/* ==========================================================
   mobile.css — mobile-first refinements
   Breakpoints:
     ≤ 960px  — tablet / large phone adjustments (existing inline rules)
     ≤ 720px  — phone layout (main mobile pass)
     ≤ 420px  — small phone (iPhone SE, etc.)
   Philosophy: preserve the editorial feel — serif display type
   stays dominant, just shrunk. Cards become full-bleed. Nav
   collapses to a hamburger drawer. Scroll-snap cards become
   vertical stack. Metric grids go single-col. All hit targets
   ≥ 44px. Generous vertical rhythm > side-by-side density.
   ========================================================== */

/* -----------------------------------------------------------
   Global: tighten gutter, stop horizontal overflow
----------------------------------------------------------- */
@media (max-width: 720px) {
  :root {
    --gutter: 20px;
  }
  html, body { overflow-x: hidden; }

  /* kill custom cursor on touch devices just in case */
  .cursor-dot, .cursor-ring { display: none !important; }

  /* universal: soften section padding so content breathes */
  section { scroll-margin-top: 64px; }
}

/* -----------------------------------------------------------
   Nav — collapse to hamburger + drawer
----------------------------------------------------------- */
@media (max-width: 860px) {
  .nav2 {
    grid-template-columns: 1fr auto !important;
    padding: 12px 20px !important;
    gap: 12px !important;
  }
  .nav2-mark { font-size: 18px; }
  .nav2-mark .dot { width: 6px; height: 6px; box-shadow: 0 0 0 2px var(--signal-dim); }

  /* hide the pill + right cluster; show hamburger button */
  .nav2-links { display: none; }
  .nav2-right .mono,
  .nav2-right #v2-clock { display: none; }

  /* reshape the search cmd into a compact icon-like button */
  .nav2-cmd kbd { display: none; }
  .nav2-right .nav2-cmd {
    padding: 8px 10px;
    font-size: 11px;
  }

  /* mobile menu button */
  .nav2-menu-btn {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: rgba(21,21,26,0.6);
    color: var(--ink);
    cursor: pointer;
    transition: border-color .2s, color .2s;
    position: relative;
  }
  .nav2-menu-btn:hover,
  .nav2-menu-btn[aria-expanded="true"] { border-color: var(--signal); color: var(--signal); }
  .nav2-menu-btn .bar {
    position: absolute; left: 11px; right: 11px; height: 1.5px;
    background: currentColor; border-radius: 1px;
    transition: transform .25s var(--ease-out, ease), opacity .25s;
  }
  .nav2-menu-btn .bar:nth-child(1) { top: 14px; }
  .nav2-menu-btn .bar:nth-child(2) { top: 19px; }
  .nav2-menu-btn .bar:nth-child(3) { top: 24px; }
  .nav2-menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .nav2-menu-btn[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav2-menu-btn[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
}
@media (min-width: 861px) { .nav2-menu-btn { display: none; } }

/* mobile drawer */
.nav2-drawer {
  position: fixed; inset: 0;
  z-index: 99;
  background: rgba(11,11,12,0.96);
  backdrop-filter: blur(24px);
  padding: 88px 28px 40px;
  display: flex; flex-direction: column;
  gap: 28px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .28s var(--ease-out, ease), transform .28s var(--ease-out, ease);
}
.nav2-drawer[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav2-drawer .drawer-nav {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
}
.nav2-drawer .drawer-nav li { border-bottom: 1px solid var(--line); }
.nav2-drawer .drawer-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 4px;
  font-family: var(--serif);
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color .2s, padding-left .25s var(--ease-out, ease);
}
.nav2-drawer .drawer-nav a .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav2-drawer .drawer-nav a:hover,
.nav2-drawer .drawer-nav a.active {
  color: var(--signal);
  padding-left: 12px;
}
.nav2-drawer .drawer-meta {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
}
.nav2-drawer .drawer-meta a { color: var(--ink-2); }
.nav2-drawer .drawer-meta a:hover { color: var(--signal); }

/* lock scroll when drawer open */
body.drawer-open { overflow: hidden; }

/* -----------------------------------------------------------
   Hero — tame the display type, stack everything
----------------------------------------------------------- */
@media (max-width: 720px) {
  .hero2 {
    padding: 88px 20px 60px;
    min-height: auto;
    align-content: start;
  }
  .hero2-inner { gap: 32px; }
  .hero2-grid-bg { background-size: 48px 48px; opacity: 0.45; }

  /* hero meta row — wrap status below index */
  .hero2-top {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }

  .hero2-title {
    font-size: clamp(58px, 15.5vw, 96px);
    line-height: 0.9;
    letter-spacing: -0.03em;
  }
  .hero2-title .line.shift { padding-left: 28px; }
  .hero2-title .line .scramble {
    display: inline-block;
    font-size: 10px;
    margin-left: 0.5em;
    padding: 3px 7px;
  }

  .hero2-bottom {
    margin-top: 24px;
    gap: 28px;
  }
  .hero2-lede { font-size: 16px; line-height: 1.55; }

  .hero2-intake { padding: 12px; }
  .hero2-intake .chip { font-size: 10px; padding: 5px 9px; }

  .hero2-cue {
    font-size: 10px;
  }
}
@media (max-width: 420px) {
  .hero2-title { font-size: 54px; }
  .hero2-title .line.shift { padding-left: 20px; }
}

/* -----------------------------------------------------------
   Chapter label + section headings
----------------------------------------------------------- */
@media (max-width: 720px) {
  .chap-label {
    font-size: 10px;
    gap: 10px !important;
    margin-bottom: 28px !important;
  }
  /* All section H2 sizes — serif display, shrink uniformly */
  .proof-head h2,
  .work2-head h2,
  .machine-head h2,
  .stack-head h2,
  .voices-head h2 {
    font-size: clamp(38px, 10vw, 56px) !important;
    line-height: 0.96;
    letter-spacing: -0.02em;
    max-width: 16ch;
  }
  .machine-head p,
  .voices-head + * p { font-size: 15px; line-height: 1.55; }
}

/* -----------------------------------------------------------
   Proof board — stack metric cards vertically, kill draggable board
----------------------------------------------------------- */
@media (max-width: 720px) {
  .proof-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 14px !important;
    margin-bottom: 32px !important;
  }
  .proof-head .hint { font-size: 10px; }

  .proof-board {
    height: auto !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: visible;
  }
  .proof-board::before, .proof-board::after { display: none !important; }

  .metric-card {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
    padding: 20px 22px !important;
    cursor: default !important;
  }
  .metric-card .v { font-size: 48px !important; }
  .metric-card .k { font-size: 10px; }
  .metric-card .sub { font-size: 12px; }
}

/* -----------------------------------------------------------
   Work (horizontal rail) — keep it horizontal, just tune
   card width + make drag friendlier
----------------------------------------------------------- */
@media (max-width: 720px) {
  .work2-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 28px !important;
  }

  .work2-track {
    gap: 16px;
    padding: 0 20px;
    scroll-padding-left: 20px;
  }
  .work2-card {
    flex: 0 0 82vw;
    max-width: 340px;
    aspect-ratio: auto;
    min-height: 480px;
    padding: 20px !important;
    gap: 12px !important;
  }
  .work2-card .title { font-size: 28px !important; }
  .work2-card .metrics .v { font-size: 28px; }
  .work2-card svg.chart { height: 72px !important; }

  .work2-nav {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start !important;
  }
  .work2-nav .arrows { align-self: flex-end; }
  .work2-nav .count { font-size: 10px; }
}

/* -----------------------------------------------------------
   Machine section — stack steps + canvas, canvas smaller
----------------------------------------------------------- */
@media (max-width: 960px) {
  .machine-grid { gap: 32px; }
  .machine-canvas { order: 2; min-height: 280px; }
  .machine-steps { order: 1; }
}
@media (max-width: 720px) {
  .machine-head { margin-bottom: 32px !important; }
  .machine-steps { gap: 0 !important; }
  .machine-step { padding: 18px 0 !important; }
  .machine-step .row { font-size: 12px !important; }
  .machine-step .t { font-size: 17px !important; }
  .machine-step .d { font-size: 14px !important; line-height: 1.55; }
  .machine-canvas {
    min-height: 260px;
    padding: 16px !important;
  }
  .machine-canvas svg { max-width: 100%; }
}

/* -----------------------------------------------------------
   Stack / Operating-system rail
----------------------------------------------------------- */
@media (max-width: 720px) {
  .stack-rail,
  .stack-grid,
  .os-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .stack-card,
  .os-card {
    padding: 20px !important;
  }
  .stack-card h4,
  .os-card h4 { font-size: 18px; }
}

/* -----------------------------------------------------------
   Voices — stack list + aside, trim bubble padding
----------------------------------------------------------- */
@media (max-width: 720px) {
  .voices-head { margin-bottom: 32px !important; }
  .voices-stack { gap: 32px !important; }
  .voice-bubble { padding: 18px 20px !important; font-size: 15px; }
  .voice-bubble .meta strong { font-size: 13px; }
  .voice-bubble .meta span { font-size: 11px; }
  .voices-aside { padding-left: 0 !important; border-left: none !important; }
  .voices-logos { grid-template-columns: 1fr 1fr !important; }
  .voices-logos span { padding: 12px; font-size: 12px; }
}

/* -----------------------------------------------------------
   Contact section + contact page
----------------------------------------------------------- */
@media (max-width: 720px) {
  .contact2 { padding: 60px 20px !important; }
  .contact2-inner { gap: 40px !important; }
  .contact2 h2 { font-size: clamp(56px, 14vw, 82px) !important; line-height: 0.92; }

  .contact-page { padding: 60px 20px 40px !important; }
  .contact-page-inner { gap: 40px !important; }
  .form2 .row { padding: 14px 0 !important; }
  .form2 .row .k { font-size: 10px; }
  .form2 .row input,
  .form2 .row textarea,
  .form2 .row select { font-size: 16px !important; /* prevent iOS zoom */ }
}

/* -----------------------------------------------------------
   CTA band
----------------------------------------------------------- */
@media (max-width: 720px) {
  .cta-band { padding: 80px 20px !important; }
  .cta-band h3 { font-size: clamp(44px, 11vw, 60px) !important; line-height: 0.95; }
  .cta-band p { font-size: 15px; margin-bottom: 24px; }
  .cta-band .btn-row { flex-direction: column; gap: 10px; width: 100%; }
  .cta-band .btn-row .btn-solid,
  .cta-band .btn-row .btn-ghost {
    width: 100%; justify-content: center;
    padding: 16px 20px;
  }
}

/* -----------------------------------------------------------
   Footer
----------------------------------------------------------- */
@media (max-width: 720px) {
  .footer2 { padding: 60px 20px 32px !important; }
  .footer2-inner {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }
  .footer2 h5 { margin-bottom: 12px; }
  .footer2 ul { gap: 8px !important; }
  .footer2-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    font-size: 10px;
  }
}

/* -----------------------------------------------------------
   Page headers (Work / About / Contact / Case) — tame the
   huge display type
----------------------------------------------------------- */
@media (max-width: 720px) {
  .page-head {
    padding: 108px 20px 56px !important;
  }
  .page-head h1 {
    font-size: clamp(56px, 15vw, 88px) !important;
    line-height: 0.92;
    letter-spacing: -0.025em;
  }
  .page-head .lede { font-size: 16px; line-height: 1.55; }
  .page-head .meta-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    padding-top: 20px !important;
  }
  .page-head .meta-grid .v { font-size: 14px; }
}

/* -----------------------------------------------------------
   Work list rows
----------------------------------------------------------- */
@media (max-width: 720px) {
  .work-list2 { padding: 56px 20px !important; }
  .work-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 24px 0 !important;
  }
  .work-row-title { font-size: 32px !important; line-height: 1.08; }
  .work-row .n { font-size: 10px; }
  .work-row-arr { display: none; }
}

/* -----------------------------------------------------------
   About page
----------------------------------------------------------- */
@media (max-width: 720px) {
  .about-grid { padding: 60px 20px !important; }
  .about-grid-inner { gap: 36px !important; }
  .about-portrait { position: static !important; }
  .about-portrait .overlay-card {
    position: static !important;
    margin-top: 16px;
    width: auto !important;
  }
  .about-body h2 {
    font-size: clamp(36px, 9vw, 54px) !important;
    line-height: 0.98;
    margin-top: 28px !important;
  }
  .about-body p { font-size: 15px; line-height: 1.6; }
}

/* -----------------------------------------------------------
   Case-study pages
----------------------------------------------------------- */
@media (max-width: 720px) {
  .case-hero { padding: 108px 20px 40px !important; }
  .case-hero-title,
  .case-hero h1 {
    font-size: clamp(48px, 13vw, 72px) !important;
    line-height: 0.94;
    letter-spacing: -0.025em;
  }
  .case-hero .lede { font-size: 16px; }

  .case-stats {
    padding: 40px 20px !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
  .case-stat .v { font-size: 40px !important; line-height: 1; }
  .case-stat .k { font-size: 10px; }

  .case-body { padding: 48px 20px !important; }
  .case-body-inner { gap: 32px !important; }
  .case-body .sidebar { position: static !important; }
  .case-body .sidebar .grp { font-size: 13px; }
  .case-body .article h2 { font-size: 28px !important; line-height: 1.15; }
  .case-body .article p { font-size: 15px; line-height: 1.6; }
  .case-body .article .pull {
    font-size: 20px !important;
    line-height: 1.3 !important;
    padding: 20px 0 !important;
  }

  .case-nav {
    padding: 40px 20px 72px !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .case-nav a { padding: 22px !important; }
  .case-nav a .title { font-size: 18px !important; }
}

/* -----------------------------------------------------------
   Touch-friendly hit targets everywhere
----------------------------------------------------------- */
@media (max-width: 720px) {
  .nav2-links a,
  .btn-solid,
  .btn-ghost,
  .nav2-cmd,
  .work2-nav .arrows button {
    min-height: 44px;
  }
  /* disable hover lift on touch (feels sticky) */
  .work2-card:hover,
  .btn-solid:hover,
  .stack-card:hover {
    transform: none !important;
  }
}

/* -----------------------------------------------------------
   Reduce motion on mobile by default (performance)
----------------------------------------------------------- */
@media (max-width: 720px) {
  .hero2-field { display: none; }  /* kills mousemove gradient */
}

