/* ---------------------------------------------------------------
   mobile.css — mobile optimisation layer.
   Loaded after each page's own <style>, so plain rules win by order.
   Desktop (>820px) is untouched.
   --------------------------------------------------------------- */

html { -webkit-text-size-adjust: 100%; }

img, svg, video { max-width: 100%; }

.nav-toggle { display: none; }

/* ---------- Mobile navigation drawer ---------- */
@media (max-width: 820px) {

  header {
    padding: 12px 18px;
    gap: 12px;
  }

  .brand img { height: 26px; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(244, 236, 217, 0.28);
    border-radius: 3px;
    color: #f1ead9;
    cursor: pointer;
  }

  .nav-toggle-bars {
    position: relative;
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: background 0.2s ease;
  }

  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease, top 0.2s ease;
  }

  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }

  body.nav-open .nav-toggle-bars { background: transparent; }
  body.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
  body.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

  header nav,
  header .nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--mobile-header-h, 64px);
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0 !important;
    padding: 6px 18px 22px;
    background: #0f2438;
    border-top: 1px solid rgba(168, 117, 47, 0.35);
    box-shadow: 0 18px 34px rgba(10, 26, 41, 0.28);
    max-height: calc(100vh - var(--mobile-header-h, 64px));
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }

  body.nav-open header nav,
  body.nav-open header .nav {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  header nav a,
  header .nav a {
    display: flex !important;
    align-items: center;
    min-height: 54px;
    margin: 0 !important;
    padding: 6px 2px !important;
    font-size: 16px !important;
    font-weight: 600;
    color: rgba(244, 236, 217, 0.92) !important;
    border-bottom: 1px solid rgba(244, 236, 217, 0.1);
  }

  header nav a::after,
  header .nav a::after { display: none; }

  header nav a.active,
  header .nav a.active { color: #f1ead9 !important; }

  .nav-optional { display: flex !important; }
  .nav-divider { display: none !important; }

  header nav a.contact-link,
  header .nav a.contact-link {
    justify-content: center;
    margin-top: 16px !important;
    padding: 15px 16px !important;
    border: 0;
    background: #c68f42;
    color: #0f2438 !important;
    font-weight: 700;
  }

  body.nav-open { overflow: hidden; }

  section[id], .card[id] { scroll-margin-top: 78px; }
}

/* ---------- Shared layout tightening ---------- */
@media (max-width: 720px) {

  h1, h2, h3 { overflow-wrap: break-word; }

  .wrap { padding-left: 20px; padding-right: 20px; }

  section { padding: 68px 0; }

  .section-lede { margin-bottom: 40px; font-size: 1rem; }

  .eyebrow,
  .proof-label { font-size: 0.74rem; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  .cta-row { gap: 12px; }
  .cta-row .btn { flex: 1 1 100%; }
}

/* ---------- Home page ---------- */
@media (max-width: 720px) {

  .hero {
    min-height: auto;
    padding-top: 128px;
    padding-bottom: 72px;
  }

  .hero h1 { line-height: 1.12; }
  .hero p.sub { font-size: 1rem; margin-top: 22px; }
  .hero .cta-row { margin-top: 34px; }

  .depth-mark { margin-top: 48px; }
  .depth-mark .num { font-size: 2.2rem; }

  .trusted-by { padding: 52px 0 44px; }
  .marquee-block { margin-bottom: 26px; }
  .marquee-row { padding: 16px 0; }

  .help-card,
  .instrument,
  .proof-item { padding: 26px 22px; }

  .help-card p,
  .instrument li,
  .proof-item p { font-size: 0.95rem; }

  .waypoint { padding: 26px 22px; }
  .waypoint h3 { font-size: 1.3rem; }
  .waypoint p { font-size: 0.95rem; }
  .waypoints { gap: 16px; }
  .route-track { padding: 24px 0 0; }
  .portrait-frame { max-width: 220px; margin-bottom: 32px; }
  .journey-layout { gap: 8px; }

  .log-entry { padding: 28px 22px; }
  .log-entry h3 { font-size: 1.25rem; }
  .entry-no.mono { flex-direction: row; align-items: baseline; gap: 12px; }
  .entry-no .entry-cat { border-top: 0; padding-top: 0; font-size: 0.68rem; }
  .cs-label { font-size: 0.72rem; }
  .tag { font-size: 0.72rem; padding: 5px 10px; }
  .entry-link,
  .proof-item a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.86rem;
  }

  .lab-card { padding: 22px 20px; }
  .lab-preview { margin-bottom: 16px; }
  .lab-grid { gap: 14px; }

  .dashboard-caption,
  .portrait-caption { font-size: 0.72rem; }

  /* Testimonials */
  .testimonial-card {
    width: 84vw;
    padding: 26px 22px;
    opacity: 0.55;
  }
  .testimonial-quote { font-size: 1rem; line-height: 1.62; }
  .testimonial-role { font-size: 0.72rem; }
  .testimonial-carousel { gap: 16px; padding-bottom: 28px; }
  .testimonial-nav { gap: 14px; }
  .testimonial-arrow { width: 48px; height: 48px; }
  .testimonial-dot {
    width: 28px;
    height: 28px;
    padding: 9px;
    background-clip: content-box;
  }

  .contact { padding-bottom: 72px; }
  footer { padding: 26px 20px; }
}

/* ---------- Resume ---------- */
@media (max-width: 720px) {

  .hero-block { padding: 40px 0 28px; }

  .summary,
  .role-block li { text-align: left; }

  .impact-item { padding: 16px 18px; gap: 14px; }
  .impact-metric { font-size: 1.35rem; }

  .role-block { padding-left: 16px; margin-bottom: 36px; }
  .role-title { font-size: 1.1rem; }
  .role-header { gap: 2px; }
  .role-tenure { white-space: normal; }

  .exec-profile { padding: 26px 22px; }
  .exec-profile p { font-size: 1.05rem; }

  .featured-item { padding: 18px 18px; }
  .featured-item a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 520px) {
  .impact-item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Insights index ---------- */
@media (max-width: 720px) {
  .hero { }
  .content { padding: 56px 20px 72px; }
  .card { padding: 26px 0; }
  .card p { font-size: 0.98rem; }
  .meta { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ---------- Article ---------- */
@media (max-width: 720px) {
  .article-hero { padding-top: 118px; }
  .article-hero h1 { hyphens: auto; }
  .article .question { font-size: 1.15rem; padding-left: 18px; }
  .article .equation { font-size: 0.82rem; overflow-x: auto; }
  .roi-card { padding: 20px 18px; }
  .end-link { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-inner { flex-direction: column; gap: 8px; }
}

/* ---------- Agent demo ---------- */
@media (max-width: 720px) {
  .page-hero { padding-top: 128px; padding-bottom: 64px; }
  .pipeline-node { padding: 16px 18px; }
  .pipeline-node .node-desc { font-size: 0.85rem; }
  .pipeline-node .node-tag,
  .status-pill { font-size: 0.7rem; }
  .flag-panel { padding: 22px 20px; }
  .flag-row { grid-template-columns: 1fr; gap: 2px; }
  .flag-row .k { font-size: 0.74rem; }
  .breadcrumb { display: inline-flex; align-items: center; min-height: 44px; }
}
