/* ==========================================================================
   PRO.CSS — the serious site. SaaS-scale type, FigJam-dot canvas, Figma
   cursors. Mobile-first throughout; same brand seeds as the desktop.
   ========================================================================== */

@import url('desktop/css/tokens.css');

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* belt-and-braces: nothing (cursors, doodles, chips) may widen the page */
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #FBF9F5;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the FigJam canvas ---------- */

.canvas-dots {
  position: fixed;
  inset: -120px 0;
  background-image: radial-gradient(circle,
    color-mix(in oklab, var(--espresso) 16%, transparent) 1.3px, transparent 1.3px);
  background-size: 26px 26px;
  pointer-events: none;
  /* negative z: behind all content, above the propagated body background.
     (The old approach — position:relative on every body child — silently
     broke the topbar's sticky and the FAB's fixed. Never again.) */
  z-index: -1;
  will-change: transform;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: color-mix(in srgb, #FBF9F5 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid color-mix(in oklab, var(--espresso) 12%, transparent);
  z-index: 100;
}

.wordmark {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

.topnav { display: none; }

/* the persistent boot CTA — the header's whole job. A power icon that gently
   pulses reads as "a device waiting to be switched on" and pulls the eye by
   motion/novelty rather than by a loud fill (which would compete with the case
   studies for attention as you scroll). */
.topbar-desktop-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  padding: 9px 15px;
}

/* the power glyph, shared by every boot CTA. All three buttons render at the
   same 15px text, so one size + one `top` nudge centres them identically. The
   nudge exists because align-items:center centres the SVG box, but text's
   optical centre sits on the cap band (lower). `top` (position:relative),
   not transform, so it never fights the pulse animation's scale. */
.ico-power { width: 20px; height: 20px; flex: none; position: relative; top: 4px; }
.btn-boot { display: inline-flex; align-items: center; gap: 8px; }

/* breathing power icon — on-brand "boot me" signal */
.topbar-desktop-cta .ico-power,
.btn-boot .ico-power { animation: power-pulse 2.6s var(--ease-out) infinite; }

@keyframes power-pulse {
  0%, 100% { opacity: .55; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), box-shadow var(--t-fast);
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--primary-600);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-600) 30%, transparent);
}
.btn-primary:hover { background: var(--primary-700); }

.btn-ghost {
  color: var(--primary-600);
  border-color: color-mix(in oklab, var(--primary-600) 35%, transparent);
  background: color-mix(in srgb, #fff 55%, transparent);
}
.btn-ghost:hover { background: var(--primary-050); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 56px 22px 40px;
  max-width: 1120px;
  margin: 0 auto;
  /* cursors + their name chips roam to the hero's edges. `clip` (never `hidden`,
     which would make the hero a scroll container) keeps a chip crossing the
     boundary from handing Safari a horizontal scroll. The clip-margin pushes the
     clip edge out ~72px so a cursor or name-chip near the edge is drawn in full
     instead of being sliced — measured max chip overhang is 57px; the page-level
     html{overflow-x:hidden} still catches anything that reaches the viewport, so
     no horizontal scroll is introduced (verified 360–1440px). */
  overflow: clip;
  overflow-clip-margin: 72px;
}

.eyebrow {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 10px;
}

.headline {
  font-size: clamp(40px, 9vw, 76px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 800;
  margin: 0 0 18px;
}

/* accent words — the one word each headline is really about */
.accent-word { color: var(--primary-600); }
h2 .accent-word { color: var(--primary-600); }

.hero-sub {
  font-size: clamp(16px, 2.2vw, 19px);
  color: color-mix(in oklab, var(--ink) 76%, white);
  max-width: 52ch;
  margin: 0 0 24px;
}

/* marker-swipe highlights on the experience line — sweep in after typing */
.hero-sub mark {
  color: inherit;
  font-weight: 700;
  padding: 0 3px;
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--warning) 38%, transparent),
    color-mix(in srgb, var(--warning) 26%, transparent));
  background-repeat: no-repeat;
  background-position: 0 62%;
  background-size: 0% 46%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size 700ms var(--ease-out);
}
body.hero-ready .hero-sub mark { background-size: 100% 46%; }
body.hero-ready .hero-sub mark:nth-of-type(1) { transition-delay: 400ms; }
body.hero-ready .hero-sub mark:nth-of-type(2) { transition-delay: 950ms; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-footnote {
  font-size: 13px;
  color: color-mix(in oklab, var(--ink) 50%, white);
  margin: 12px 0 0;
}

.hero-art {
  position: relative;
  align-self: center;
  width: min(78vw, 360px);
}

/* the portrait sits ON the canvas — no card, no frame. Multiply blends the
   illustration's baked background into the paper; the mask fades him in
   from the dots like hero art, not a headshot in a picture frame. */
.hero-art img {
  width: 100%;
  display: block;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 98%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 98%);
}

/* idle float — the portrait breathes instead of sitting dead on the canvas */
body.hero-ready .hero-art img { animation: art-float 7s ease-in-out infinite; }

@keyframes art-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* the doodle layer — cursors draw here, strokes fade like a shared canvas */
.doodles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  overflow: visible;   /* let strokes near the edge paint fully; the hero's
                          clip-margin is the real boundary, not this SVG's box */
}
.doodles polyline {
  fill: none;
  stroke-width: 4.5;          /* FigJam marker weight */
  stroke-linecap: round;
  stroke-linejoin: round;
}
.doodles g {
  opacity: .9;
  transition: opacity 1600ms ease;
}
.doodles g.fade { opacity: 0; }

.portrait-fallback { display: none; }
.hero-art.noimg img { display: none; }
.hero-art.noimg .portrait-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--primary-600), var(--primary-800));
  color: #fff;
  font-size: 84px;
  font-weight: 800;
  letter-spacing: -.03em;
}

/* headline selection box — a cursor "selected" these words */
.hl-select { position: relative; white-space: nowrap; }

.sel-box {
  position: absolute;
  inset: -4px -10px -8px -6px;
  border: 2px solid var(--primary-400);
  background: color-mix(in srgb, var(--primary-400) 10%, transparent);
  border-radius: 4px;
  animation: sel-blink 5.5s ease-in-out infinite;
  pointer-events: none;
}

.sel-box::after {                 /* resize handle, Figma-style */
  content: '';
  position: absolute;
  right: -5px; bottom: -5px;
  width: 8px; height: 8px;
  background: #fff;
  border: 2px solid var(--primary-400);
  border-radius: 2px;
}

@keyframes sel-blink {
  0%, 12%  { opacity: 0; }
  18%, 78% { opacity: 1; }
  88%, 100%{ opacity: 0; }
}

/* ---------- multiplayer cursors ---------- */

.cursor {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 5px rgba(46,36,28,.25));
}

.cursor svg { width: 18px; height: 18px; }

.cursor span {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 12px;
  white-space: nowrap;
}

/* cursors are JS-driven (waypoints + easing in pro.js). They hide until the
   headline finishes typing, then fade in and start moving. */
/* FigJam-bright cursor identities (ink in pro.js matches) */
.c1 { top: 16%; left: 58%; }
.c1 svg path { fill: #4C82F7; }
.c1 span { background: #4C82F7; }

.c2 { top: 52%; left: 8%; }
.c2 svg path { fill: #5DBB63; }
.c2 span { background: #5DBB63; }

.c3 { top: 34%; left: 44%; }
.c3 svg path { fill: #F59E2C; }
.c3 span { background: #F59E2C; }

html.typing .cursor { opacity: 0; }
body.hero-ready .cursor { opacity: 1; transition: opacity 700ms var(--ease-out); }

/* typed headline: text occupies its final space from first paint (visibility
   hides it, layout stays) — characters reveal one by one with zero CLS */
html.typing .headline [data-type] { visibility: hidden; }
html.typing .headline [data-type].typed { visibility: visible; }
html.typing .headline .ch { visibility: hidden; }
html.typing .headline .ch.on { visibility: visible; }
html.typing .sel-box { animation: none; opacity: 0; }
html.typing body.hero-ready .sel-box { animation: sel-blink 5.5s ease-in-out infinite; }

.type-caret {
  display: inline-block;
  width: .08em;
  height: .92em;
  margin-left: 2px;
  background: var(--primary-600);
  vertical-align: -0.08em;
  animation: caret-blink 900ms steps(1) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

/* ---------- metrics band ---------- */

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: color-mix(in oklab, var(--espresso) 12%, transparent);
  border-block: 1px solid color-mix(in oklab, var(--espresso) 12%, transparent);
}

.metric {
  background: #FBF9F5;
  padding: 26px 20px;
  text-align: center;
}

.metric b {
  display: block;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--primary-600);
}

.metric span {
  font-size: 13px;
  color: color-mix(in oklab, var(--ink) 62%, white);
}

/* ---------- sections shared ---------- */

main, .leadership, .process, .side {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 22px 8px;
}

.section-kicker {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--olive);
  margin: 0 0 18px;
}

h2 {
  font-size: clamp(26px, 4.6vw, 40px);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 0 0 16px;
}

/* ---------- case studies ---------- */

/* mobile-first: cases are FULL-BLEED panels (the floating-card treatment is
   a desktop luxury — on a phone those triple margins ate the interactives) */
.case {
  padding: 30px 20px;
  margin: 0 -22px 26px;      /* bleed through main's side padding */
  background: #fff;
  border-block: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
}

.case-meta {
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in oklab, var(--ink) 52%, white);
  margin: 0 0 8px;
}

.case p { margin: 0 0 14px; }

.honest {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  font-size: 14.5px;
  margin: 18px 0;
}

.case-link {
  display: block;               /* phones: full-width, like the summary */
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  margin-top: 12px;
  /* same box as the summary button: 13px pad − 1.5px border = equal height */
  padding: 11.5px 22px;
  border-radius: 10px;
  border: 1.5px solid color-mix(in oklab, var(--primary-600) 35%, transparent);
  background: color-mix(in srgb, #fff 55%, transparent);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.65;            /* pinned — matches the summary's inherited value */
  color: var(--primary-600);
  text-decoration: none;
  transition: background var(--t-fast);
}
.case-link:hover { background: var(--primary-050); }

/* case visuals — inline SVG diagrams and video */
.case-visual {
  margin: 22px 0;
  padding: 0;
}
.case-visual svg { width: 100%; height: auto; display: block; }
.case-visual video,
.case-visual img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--espresso) 12%, transparent);
}
.case-visual figcaption {
  font-size: 12.5px;
  color: color-mix(in oklab, var(--ink) 48%, white);
  margin-top: 8px;
}
.case-visual figcaption a { color: var(--primary-600); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* phones: 2-up, like the metrics band */
  gap: 12px;
  margin: 22px 0;
}
.stat-grid .stat {
  background: var(--primary-050);
  border: 1px solid color-mix(in oklab, var(--primary-600) 14%, transparent);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
}
.stat-grid b {
  display: block;
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--primary-600);
}
.stat-grid span {
  font-size: 12.5px;
  color: color-mix(in oklab, var(--ink) 62%, white);
}

/* full case study — expands in place, so nobody is thrown onto the desktop
   mid-read */
.case-full {
  margin: 20px 0 16px;
  border-top: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
}
/* button hierarchy: expanding the story is the PRIMARY action; hopping to
   the desktop is secondary. Summary dresses as the primary button. */
.case-full { padding-top: 18px; }
.case-full summary {
  cursor: pointer;
  list-style: none;
  display: block;              /* full-width expand affordance */
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  padding: 13px 22px;
  border-radius: 10px;
  background: var(--primary-600);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  user-select: none;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-600) 30%, transparent);
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.case-full summary:hover { background: var(--primary-700); }
.case-full summary:active { transform: scale(.97); }
.case-full summary::-webkit-details-marker { display: none; }
.case-full summary::after {
  content: '＋';
  margin-left: 8px;
  font-weight: 800;
}
.case-full[open] summary::after { content: '－'; }
.case-full[open] summary { margin-bottom: 10px; }
.case-full h3 {
  font-size: 18px;
  letter-spacing: -.01em;
  margin: 26px 0 8px;
}
.case-full > p { margin: 0 0 14px; }

/* spoke list — used in the Nick.ai case ("what it became") */
.case-full ul.spokes { list-style: none; padding: 0; margin: 6px 0 14px; }
.case-full ul.spokes li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-bottom: 1px solid color-mix(in oklab, var(--espresso) 9%, transparent);
  font-size: 15.5px;
}
.case-full ul.spokes li:last-child { border-bottom: 0; }
.case-full ul.spokes li::before {
  content: '';
  position: absolute;
  left: 3px; top: 18px;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--primary-600);
  transform: rotate(45deg);
}
.case-full ul.spokes li strong { color: var(--ink); }

/* ---------- process ---------- */

.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.p-card {
  background: #fff;
  border: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
  border-radius: 14px;
  padding: 20px 22px;
}

.p-card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -.01em; }
.p-card p { margin: 0; font-size: 14.5px; color: color-mix(in oklab, var(--ink) 72%, white); }

/* ---------- side projects ---------- */

.side-row { display: grid; gap: 14px; }

.side-card {
  display: block;
  background: #fff;
  border: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
  border-radius: 14px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}

.side-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(46,36,28,.10); }
.side-card b { display: block; margin-bottom: 4px; }
.side-card span { font-size: 14px; color: color-mix(in oklab, var(--ink) 66%, white); }

/* ---------- desktop invite (framed preview + peak-interest CTA) ---------- */

.desktop-invite {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 22px 8px;
  display: grid;
  gap: 26px;
}

.di-copy h2 { margin: 0 0 12px; }
.di-copy p { margin: 0 0 20px; color: color-mix(in oklab, var(--ink) 76%, white); }

/* the window — a little OS pane the visitor can click to boot */
.di-frame {
  display: block;
  text-decoration: none;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--espresso) 16%, transparent);
  box-shadow: 0 14px 40px rgba(46, 36, 28, .14);
  background: #fff;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.di-frame:hover { transform: translateY(-3px); box-shadow: 0 20px 54px rgba(46, 36, 28, .20); }

.di-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  background: color-mix(in oklab, var(--espresso) 8%, #fff);
  border-bottom: 1px solid color-mix(in oklab, var(--espresso) 12%, transparent);
}
.di-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.di-dot.r { background: #FF5F57; }
.di-dot.y { background: #FEBC2E; }
.di-dot.g { background: #28C840; }
.di-barname {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: color-mix(in oklab, var(--ink) 55%, white);
}

/* the "screen": the desktop wallpaper art on the site's sand tone, so the
   transparent illustration reads exactly like the live desktop */
.di-screen {
  position: relative;
  display: block;
  background: #D8CBB4;                 /* the desktop's default "Sand" wallpaper */
  background-image: radial-gradient(circle,
    color-mix(in oklab, var(--espresso) 14%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 14px 14px 0;
  overflow: hidden;
}
.di-screen img {
  width: 100%;
  max-width: 460px;
  display: block;
  margin: 0 auto;
  /* trim the tall transparent illustration to a tidy screen crop */
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 42%;
}
.di-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--primary-600) 92%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-600) 34%, transparent);
  transform: translateY(4px);
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.di-frame:hover .di-hint,
.di-frame:focus-visible .di-hint { opacity: 1; transform: none; }

@media (min-width: 760px) {
  .desktop-invite {
    grid-template-columns: 1fr 1.05fr;
    align-items: center;
    gap: 40px;
    padding: 64px 34px 8px;
  }
  .di-screen img { max-width: none; }
}

/* ---------- contact ---------- */

.contact {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 22px 90px;
  text-align: center;
}

.contact-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 22px 0 26px;
}

.fineprint { font-size: 13px; color: color-mix(in oklab, var(--ink) 48%, white); }
.fineprint a { color: var(--primary-600); }

/* ---------- embedded desktop interactives (inside the accordions) -------- */

/* mobile-first: no box around the embeds — the interactive IS the content */
.embed-interactive {
  margin: 22px -20px;            /* bleed to the case edges on phones */
  overflow-x: auto;              /* wide stages scroll rather than squash */
  padding: 0 8px;
}

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* Apple-ish settle: visuals scale in a beat after their card arrives */
.reveal .case-visual { opacity: 0; transform: scale(.955); transition: opacity 700ms var(--ease-out) 180ms, transform 700ms var(--ease-out) 180ms; }
.reveal.in .case-visual { opacity: 1; transform: none; }

/* ---------- Nick.ai FAB + sheet ---------- */

.fab {
  position: fixed;
  right: 18px;
  /* lifted clear of iOS Safari's translucent bottom bar, which was slicing
     the shadow; safe-area covers home-indicator devices */
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--primary-600);
  color: #fff;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  /* tight shadow — a long throw was getting sliced by Safari's bottom bar */
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-600) 38%, transparent);
  z-index: 300;
  transition: transform var(--t-fast) var(--ease-out);
}
.fab:hover { transform: scale(1.06); }
.fab .fab-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--light-max);
  border: 2px solid #fff;
}

/* body scroll-lock while the chat modal is open (iOS-proof position trick,
   applied in pro.js which also restores the scroll position) */
body.chat-open {
  position: fixed;
  left: 0; right: 0;
  overflow: hidden;
}

.chat-sheet {
  position: fixed;
  right: 0; bottom: 0; left: 0;
  top: 0;                       /* phones: FULL-SCREEN modal — header pinned,
                                   keyboard squeezes the log, not the header */
  height: auto;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 -14px 50px rgba(46,36,28,.25);
  z-index: 310;
  display: flex;
  flex-direction: column;
  transform: translateY(calc(100% + 30px));
  /* display gate: an offscreen-transformed fixed element still counts toward
     scrollable overflow (phantom page bottom) — so the sheet only exists in
     layout while open. JS mounts it a frame early so the slide still animates. */
  display: none;
  transition: transform 320ms var(--ease-out);
}
.chat-sheet.mounted { display: flex; }
.chat-sheet.open { transform: none; }

.chat-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
  font-size: 14px;
}
.chat-head span { color: color-mix(in oklab, var(--ink) 55%, white); font-size: 12.5px; }
.chat-close { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--ink); font-size: 15px; }

.chat-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.chat-msg.user { margin-left: auto; background: var(--primary-600); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant { background: var(--primary-050); border-bottom-left-radius: 4px; }
.chat-msg.typing::after { content: '…'; }

.chat-form { display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent); }
/* 16px is load-bearing: iOS Safari force-zooms the page when a focused
   input is under 16px — that zoom was the mobile horizontal scroll */
.chat-input { flex: 1; border: 1.5px solid color-mix(in oklab, var(--espresso) 18%, transparent); border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 16px; }
.chat-input:focus { outline: 2px solid var(--primary-400); border-color: transparent; }
.chat-send { border: 0; border-radius: 10px; background: var(--primary-600); color: #fff; font-weight: 700; padding: 0 18px; cursor: pointer; }

/* ---------- ≥760px ---------- */

@media (min-width: 760px) {
  .topbar { padding: 14px 34px; }
  .topnav { display: flex; gap: 22px; margin-left: 26px; }
  .topnav a { color: color-mix(in oklab, var(--ink) 72%, white); text-decoration: none; font-size: 14.5px; font-weight: 600; }
  .topnav a:hover { color: var(--primary-600); }

  .hero {
    flex-direction: row;
    align-items: center;
    gap: 48px;
    padding: 96px 34px 72px;
  }
  .hero-copy { flex: 1.25; }
  .hero-art { flex: 1; align-self: auto; width: auto; max-width: 400px; }

  .metrics { grid-template-columns: repeat(4, 1fr); }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .side-row { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }

  /* desktop: the floating-card treatment returns */
  .case {
    padding: 42px 46px;
    margin: 0 0 34px;
    border: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
    border-radius: 16px;
    box-shadow: 0 10px 34px rgba(46,36,28,.07);
  }
  .embed-interactive {
    margin: 22px 0;
    border: 1px solid color-mix(in oklab, var(--espresso) 10%, transparent);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
  }
  .case-full summary { display: inline-block; width: auto; text-align: left; }
  .case-link { display: inline-block; width: auto; text-align: left; }

  /* Nick.ai card: primary + ghost sit side by side while the story's closed */
  #nick-ai .case-full:not([open]) {
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
    border-top: 0;
    padding-top: 0;
  }
  #nick-ai .case-full:not([open]) + .case-link { vertical-align: middle; margin-top: 0; }

  .chat-sheet {
    top: auto;
    left: auto;
    right: 22px;
    bottom: 88px;
    width: 400px;
    height: min(72dvh, 560px);
    border-radius: 18px;
  }
}

/* ---------- reduced motion ---------- */

/* touch/no-hover: the boot hint can't wait for a hover that never comes */
@media (hover: none) {
  .di-hint { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor, .sel-box { animation: none; }
  .sel-box { opacity: 1; }
  .canvas-dots { transform: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .topbar-desktop-cta .ico-power,
  .btn-boot .ico-power { animation: none; opacity: 1; transform: none; }
  .di-hint { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- case decks (30-second rule: title = hook, deck = the plain-
   language what/how/role line beneath it) ---------- */

.case-deck {
  /* a standfirst, not a caption: heavier than body, quieter than the h2 —
     it must WIN the first read (it carries the 30-second what/how/role) */
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.5;
  color: color-mix(in oklab, var(--ink) 88%, white);
  margin: -6px 0 20px;
  max-width: 58ch;
}
