/* ============================================================
   andvri.com — global styles
   Static page; all motion is CSS scroll-driven inside @supports and
   removed under prefers-reduced-motion.
   ============================================================ */

/* ---- Tokens ------------------------------------------------ */
:root {
  --white: #ffffff;
  --grey-1: #f5f5f7;
  --grey-2: #e8e8ed;
  --grey-3: #d2d2d7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --black: #000000;
  --panel-dark: #1c1c1e;
  --chip-dark: #2c2c2e;
  --muted-dark: #a1a1a6;
  --accent: #0d7480;
  --accent-hover: #0a5f69;
  --steel: #2f6f8f;
  --cyan: #4fa3c6;
  --slate: #3d4c55;
  --cyan-light: #8fd3ea;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --slant: 88px;
}

/* ---- Reset & base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--cyan-light); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Layout helpers --------------------------------------- */
.c { max-width: 1040px; margin: 0 auto; padding-inline: 20px; }
.center { text-align: center; }
.h2 { margin: 0; font-size: clamp(40px, 4.4vw, 64px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; }
/* section edges cut on the AVR's slant */
.cut { clip-path: polygon(0 var(--slant), 100% 0, 100% 100%, 0 100%); margin-top: calc(var(--slant) * -1); position: relative; }
.cut-r { clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 100%); margin-top: calc(var(--slant) * -1); position: relative; }
.pill { display: inline-block; background: var(--accent); color: var(--white); padding: 12px 24px; border-radius: 999px; font-size: 17px; font-weight: 500; transition: background 160ms ease, transform 160ms ease; }
.pill:hover { background: var(--accent-hover); text-decoration: none; }
.pill:active { transform: scale(0.97); }

/* ---- Header ------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--white); }
.site-header .bar { display: flex; justify-content: space-between; align-items: center; height: 52px; font-size: 13px; }
.site-header .nav-desktop { display: flex; gap: 32px; }
.site-header nav a { color: var(--ink); }
.site-header .bar-end { display: flex; align-items: center; gap: 8px; }
/* phone menu: a native disclosure, works without script */
.nav-mobile { display: none; }
.nav-mobile summary { list-style: none; cursor: pointer; padding: 6px 14px; border-radius: 999px; background: var(--grey-1); font-size: 13px; min-height: 32px; display: flex; align-items: center; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile[open] summary { background: var(--ink); color: var(--white); }
.nav-mobile nav { position: absolute; left: 0; right: 0; top: 52px; background: var(--white); display: flex; flex-direction: column; padding: 8px 20px 20px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); }
.nav-mobile nav a { font-size: 21px; font-weight: 600; padding: 12px 0; }
.site-header .contact { background: var(--accent); color: var(--white); padding: 6px 14px; border-radius: 999px; font-size: 13px; transition: opacity 200ms ease, visibility 200ms; }
/* the closing has its own email button; don't show two contact actions at once */
.site-header.at-close .contact { opacity: 0; visibility: hidden; }
.site-header .mark { display: flex; }
.site-header .mark svg { width: 40px; height: auto; }

/* ---- Hero -------------------------------------------------- */
.zoom-pin { display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding-block: 72px; }
.hero-name { margin: 0; font-size: 21px; font-weight: 600; }
.hero-title { margin: 8px 0 0; font-size: clamp(56px, 8vw, 112px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.hero-role { margin: 16px 0 0; font-size: clamp(19px, 1.8vw, 26px); color: var(--muted); }
.hero-actions { display: flex; gap: 20px; justify-content: center; align-items: center; margin-top: 28px; flex-wrap: wrap; font-size: 17px; }
.zmark { width: min(560px, 80vw); height: auto; overflow: visible; }
.zlate { margin: 64px 0 0; font-size: clamp(24px, 2.6vw, 36px); font-weight: 600; letter-spacing: -0.02em; }
.s { animation: avr-build 1000ms cubic-bezier(.2,.7,.2,1) both; }
.s1 { --dx: -40px; --dy: 90px; animation-delay: 150ms; }
.s2 { --dx: -60px; --dy: 0px; animation-delay: 450ms; }
.s3 { --dx: -40px; --dy: -90px; animation-delay: 250ms; }
.s4 { --dx: 40px; --dy: 90px; animation-delay: 350ms; }
.s5 { --dx: 60px; --dy: -60px; animation-delay: 550ms; }
.s6 { --dx: 40px; --dy: 90px; animation-delay: 650ms; }
@keyframes avr-build { from { opacity: 0; transform: translate(var(--dx), var(--dy)); } to { opacity: 1; transform: none; } }

/* ---- Statement --------------------------------------------- */
.statement { padding-block: 160px 240px; }
.statement p { margin: 0; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; max-width: 900px; }
.statement .end { color: var(--accent); }

/* ---- In short (bento) -------------------------------------- */
.highlights { background: var(--grey-1); padding-block: 220px; }
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 220px; gap: 16px; margin-top: 48px; }
.tile { background: var(--white); border-radius: 28px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.tile p { margin: 0; }
.t-big { grid-column: span 3; grid-row: span 2; }
.t-wide { grid-column: span 3; }
.t-sm { grid-column: span 2; }
.tile.dark { background: var(--ink); color: var(--grey-1); }
.tile.teal { background: var(--accent); color: var(--white); }
.tile .label { font-size: 17px; color: var(--muted); }
.tile .num-xl { font-size: clamp(120px, 14vw, 200px); font-weight: 700; letter-spacing: -0.06em; line-height: 0.85; }
.tile .num { font-size: 56px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.tile .val { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }

/* ---- Ask my CV --------------------------------------------- */
.ask { background: var(--black); color: var(--grey-1); padding-block: 220px 180px; overflow: hidden; }
.ask h2 { margin: 0; font-size: clamp(48px, 6vw, 88px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.ask .lead { margin: 20px auto 0; font-size: clamp(19px, 1.8vw, 24px); color: var(--muted-dark); max-width: 34ch; }
.convo { margin-top: 80px; max-width: 920px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: var(--chip-dark); color: var(--grey-1); border: 0; padding: 10px 16px; font: inherit; font-size: 15px; border-radius: 999px; cursor: pointer; min-height: 44px; transition: background 160ms ease; }
.chip:hover { background: #3a3a3c; }
.chip[aria-pressed="true"] { background: var(--grey-1); color: var(--ink); }
/* once a conversation starts, suggestions shrink to one scrollable row */
.chips { min-height: 44px; }
.convo.started .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
.convo.started .chips::-webkit-scrollbar { display: none; }
.convo.started .chip { flex: 0 0 auto; }
/* the transcript keeps a stable size and scrolls on its own, so the section never jumps */
.transcript { margin-top: 48px; height: clamp(300px, 46vh, 480px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a3a3c transparent; padding-right: 8px; display: flex; flex-direction: column;
  /* older turns fade out at the top edge instead of being cut */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 56px); mask-image: linear-gradient(to bottom, transparent 0, #000 56px); }
.transcript:focus-visible { outline-offset: 6px; }
.turn { padding-top: 28px; animation: turn-in 260ms ease both; display: flex; flex-direction: column; }
.turn:first-child { margin-top: auto; }
/* the visitor's message sits on the right; the assistant's answer stays on the left */
.t-q { margin: 0; align-self: flex-end; max-width: min(75%, 560px); background: var(--panel-dark); color: var(--grey-1); padding: 10px 16px; border-radius: 18px 18px 4px 18px; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.t-a { margin: 10px 0 0; font-size: clamp(22px, 2.1vw, 28px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.35; }
.turn-intro .t-a { color: var(--muted-dark); }
.t-src { margin: 12px 0 0; font-size: 14px; color: var(--cyan-light); animation: turn-in 260ms ease both; }
.t-a.typing::after { content: ''; display: inline-block; width: 2px; height: 0.95em; margin-left: 4px; vertical-align: -0.1em; background: var(--cyan-light); animation: caret 900ms steps(1) infinite; }
.dots { display: inline-flex; gap: 6px; padding: 10px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-light); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 150ms; }
.dots i:nth-child(3) { animation-delay: 300ms; }
@keyframes turn-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.ask-form { display: flex; gap: 10px; margin-top: 32px; position: relative; align-items: center; }
.ask-form .count { position: absolute; right: 140px; font-size: 13px; color: var(--muted-dark); }
.ask-form button:disabled { opacity: .45; cursor: default; }
.convo-foot { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; min-height: 56px; }
.convo-foot .principles { margin: 0; }
.reset { background: none; border: 0; color: var(--cyan-light); font: inherit; font-size: 15px; cursor: pointer; padding: 8px 4px; }
.reset:hover { text-decoration: underline; }
.preview-note { margin: 8px 0 0; font-size: 13px; color: #8e8e93; text-align: center; }
.preview-note a { color: inherit; text-decoration: underline; }
/* error and limit notes: quieter than an answer, with actions underneath */
.t-a.t-note { color: var(--muted-dark); font-size: clamp(19px, 1.8vw, 22px); }
.t-actions { margin: 14px 0 0; display: flex; gap: 20px; align-items: center; font-size: 15px; }
.t-actions a { color: var(--cyan-light); }
.retry { background: var(--grey-1); color: var(--ink); border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 15px; cursor: pointer; min-height: 40px; }
.ask-form input { flex: 1; background: var(--panel-dark); color: var(--grey-1); border: 0; border-radius: 999px; padding: 0 24px; height: 60px; font: inherit; font-size: 18px; min-width: 0; }
.ask-form input::placeholder { color: var(--muted-dark); }
/* iOS Safari: drop its inset shadow and keep ≥16px so focusing doesn't zoom the page */
.ask-form input, .ask-form button { -webkit-appearance: none; appearance: none; }
.ask-form input { font-size: max(16px, 18px); }
.ask-form button { height: 60px; padding: 0 28px; border-radius: 999px; border: 0; background: var(--accent); color: var(--white); font: inherit; font-size: 17px; font-weight: 500; cursor: pointer; }
.ask-form button:hover { background: var(--accent-hover); }
.principles { margin: 20px 0 0; font-size: 15px; color: var(--muted-dark); text-align: center; }

/* ---- Ten years, one stack ---------------------------------- */
.stack-pin { padding-block: 160px; }
.cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 4vw, 72px); align-items: end; }
.cols .lead { margin: 24px 0 0; font-size: 19px; line-height: 1.5; max-width: 34ch; color: var(--muted); }
.pile { display: flex; flex-direction: column-reverse; gap: 6px; list-style: none; margin: 0; padding: 0; }
.layer { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 22px 24px; align-items: baseline; border-radius: 20px; }
.layer h3, .step h3 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.layer p, .step p { margin: 6px 0 0; font-size: 16px; line-height: 1.45; }
.y1 { background: var(--grey-1); } .y2 { background: var(--grey-2); } .y3 { background: var(--grey-3); }
.y4 { background: var(--steel); color: var(--white); } .y5 { background: var(--ink); color: var(--grey-1); }

/* ---- Experience -------------------------------------------- */
.experience { background: var(--grey-1); padding-block: 220px 200px; }
.experience-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.rows { display: flex; flex-direction: column; gap: 8px; margin-top: 40px; }
.xrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) minmax(0, 1fr); gap: 24px; background: var(--white); padding: 26px 28px; align-items: baseline; border-radius: 20px; }
.xrow h3 { margin: 0; font-size: 19px; font-weight: 600; }
.xrow .org { display: block; font-weight: 400; color: var(--muted); }
.xrow p { margin: 0; font-size: 16px; line-height: 1.5; }
.xrow .years { font-size: 16px; color: var(--muted); }
.xrow .years.now { color: var(--accent); font-weight: 600; }

/* ---- Selected work ----------------------------------------- */
.work { padding-block: 160px; }
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.wtile { border-radius: 28px; padding: 56px 40px 48px; min-height: 560px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; background: var(--grey-1); }
.wtile h3 { margin: 0; font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.wtile p { margin: 0; font-size: 21px; color: var(--muted); }
.wtile .more { font-size: 17px; color: var(--accent); }
.wtile.dark { background: var(--black); color: var(--grey-1); }
.wtile.dark p { color: var(--muted-dark); }
.wtile.dark .more { color: var(--cyan-light); }
.wtile.teal { background: var(--accent); color: var(--white); }
.wtile.teal p, .wtile.teal .more { color: var(--white); }
.art { width: 100%; max-width: 420px; height: auto; margin-top: auto; overflow: visible; }
.art text { font-family: var(--font); }

/* ---- Approach ---------------------------------------------- */
.approach { background: var(--grey-1); padding-block: 220px 240px; }
.approach .top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-bottom: 48px; }
.approach .top p { margin: 0; font-size: 19px; line-height: 1.5; max-width: 40ch; color: var(--muted); }
.stairs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; list-style: none; margin: 0; padding: 0; }
.step { padding: 24px 20px; display: flex; flex-direction: column; border-radius: 20px; }
.k1 { height: 200px; background: var(--white); } .k2 { height: 260px; background: var(--grey-2); } .k3 { height: 320px; background: var(--grey-3); }
.k4 { height: 380px; background: var(--steel); color: var(--white); } .k5 { height: 440px; background: var(--ink); color: var(--grey-1); }

/* ---- Closing ----------------------------------------------- */
.site-footer { background: var(--black); color: var(--grey-1); overflow: hidden; padding-top: 220px; }
.site-footer h2 { margin: 0; font-size: clamp(40px, 5vw, 72px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; }
.site-footer .actions { display: flex; gap: 24px; justify-content: center; align-items: center; margin-top: 32px; flex-wrap: wrap; font-size: 17px; }
.site-footer .actions a:not(.pill) { color: var(--cyan-light); }
.site-footer .legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted-dark); margin-top: 96px; }
/* Cropped by the footer's bottom edge through a negative margin (not a transform, which
   would leave an empty band above it). Capped so very wide screens don't get a wall. */
.site-footer .langs a { color: var(--muted-dark); }
.site-footer .langs a:hover, .site-footer .langs a[aria-current="page"] { color: var(--grey-1); }
.giant { width: min(100%, 1600px); height: auto; display: block; margin: 64px auto -11%; overflow: visible; }
@media (min-width: 1600px) { .giant { margin-bottom: -176px; } }

/* ---- Simple pages (writing, 404) --------------------------- */
.page { min-height: 70vh; padding-block: 160px; }
.page h1 { margin: 0; font-size: clamp(48px, 6vw, 88px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.page p { margin: 24px 0 0; font-size: 21px; color: var(--muted); max-width: 40ch; }

/* ---- Scroll-driven motion ---------------------------------- */
@supports (animation-timeline: view()) {
  /* hero: the mark grows as you scroll */
  .zoom { height: 220vh; view-timeline-name: --z; }
  .zoom-pin { position: sticky; top: 0; height: 100vh; padding-block: 0; }
  .zmark { animation: avr-grow linear both; animation-timeline: --z; animation-range: contain 0% contain 100%; }
  /* it recedes into a watermark as it grows, so the closing line reads cleanly over it */
  @keyframes avr-grow { from { transform: scale(.62); opacity: 1; } 60% { opacity: 1; } to { transform: scale(1.9); opacity: .1; } }
  .ztext { animation: fade-up-out linear both; animation-timeline: --z; animation-range: contain 0% contain 35%; }
  @keyframes fade-up-out { to { opacity: 0; transform: translateY(-40px); } }
  .zlate { opacity: 0; animation: fade-in linear both; animation-timeline: --z; animation-range: contain 70% contain 95%; }
  @keyframes fade-in { to { opacity: 1; } }

  /* statement lights up phrase by phrase */
  .w { opacity: .18; animation: light linear both; animation-timeline: view(); }
  .w1 { animation-range: cover 20% cover 30%; } .w2 { animation-range: cover 28% cover 38%; } .w3 { animation-range: cover 36% cover 46%; }
  .w4 { animation-range: cover 44% cover 54%; } .w5 { animation-range: cover 52% cover 62%; }
  @keyframes light { to { opacity: 1; } }

  /* tiles and the conversation rise in */
  .tile, .wtile, .convo { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  @keyframes rise { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }

  /* experience rows enter along the slant */
  .xrow { animation: slant-in linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  @keyframes slant-in { from { opacity: 0; transform: translate(-64px, 28px); } to { opacity: 1; transform: none; } }

  /* stack: the one pinned section */
  .stackstage { height: 240vh; view-timeline-name: --stk; }
  .stack-pin { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: 0; }
  .layer { animation: drop linear both; animation-timeline: --stk; }
  .y1 { animation-range: contain 0% contain 16%; } .y2 { animation-range: contain 16% contain 32%; } .y3 { animation-range: contain 32% contain 48%; }
  .y4 { animation-range: contain 48% contain 64%; } .y5 { animation-range: contain 64% contain 82%; }
  @keyframes drop { from { opacity: 0; transform: translateY(-60px); } to { opacity: 1; transform: none; } }

  /* approach steps climb in */
  .step { animation: climb linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
  .k2 { animation-range: entry 10% cover 45%; } .k3 { animation-range: entry 20% cover 50%; }
  .k4 { animation-range: entry 30% cover 55%; } .k5 { animation-range: entry 40% cover 60%; }
  @keyframes climb { from { opacity: 0; transform: translate(-40px, 60px); } to { opacity: 1; transform: none; } }

  /* work drawings perform their case once */
  .in, .ln, .pg, .tag { animation-timeline: view(); animation-fill-mode: both; animation-timing-function: linear; }
  .in { animation-name: feed; transform-box: fill-box; }
  .in1 { animation-range: entry 30% cover 40%; } .in2 { animation-range: entry 40% cover 45%; } .in3 { animation-range: entry 50% cover 50%; }
  @keyframes feed { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
  .ln { animation-name: type; transform-box: fill-box; transform-origin: left center; }
  .l1 { animation-range: entry 30% cover 38%; } .l2 { animation-range: entry 40% cover 42%; }
  .l3 { animation-range: entry 50% cover 46%; } .l4 { animation-range: entry 60% cover 50%; }
  @keyframes type { from { transform: scaleX(0); } to { transform: none; } }
  .pg { animation-name: route; }
  .p-1 { animation-range: entry 30% cover 45%; } .p-2 { animation-range: entry 40% cover 50%; } .p-3 { animation-range: entry 50% cover 55%; }
  @keyframes route { from { transform: translateX(-80px); opacity: 0; } to { transform: translateX(70px); opacity: 1; } }
  .tag { animation-name: pull; }
  .t-1 { animation-range: entry 30% cover 40%; } .t-2 { animation-range: entry 40% cover 45%; } .t-3 { animation-range: entry 50% cover 50%; }
  @keyframes pull { from { transform: translateX(-90px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* closing: the giant mark reassembles */
  /* the mark is cropped by the page end (~75% of it is ever visible), so finish early */
  .f { animation: join linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
  .f1 { --ax: -120px; --ay: 140px; } .f2 { --ax: -160px; --ay: 0px; } .f3 { --ax: -60px; --ay: -140px; }
  .f4 { --ax: 60px; --ay: 140px; } .f5 { --ax: 160px; --ay: -100px; } .f6 { --ax: 120px; --ay: 160px; }
  @keyframes join { from { transform: translate(var(--ax), var(--ay)); opacity: 0; } to { transform: none; opacity: 1; } }
}
/* without scroll timelines the routed pages simply sit in their lanes */
@supports not (animation-timeline: view()) { .pg { transform: translateX(70px); } }

/* ---- Phone ------------------------------------------------- */
@media (max-width: 820px) {
  .site-header .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .bento { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .t-big, .t-wide { grid-column: span 2; grid-row: auto; }
  .t-sm { grid-column: span 2; }
  .tile { min-height: 180px; padding: 24px; }
  /* on phones every tile takes the full width: half-width tiles left words stacked one per line */
  .tile .val { font-size: 21px; }
  .work-grid, .cols, .stairs { grid-template-columns: 1fr; }
  .xrow, .layer { grid-template-columns: 1fr; gap: 6px; }
  .k1, .k2, .k3, .k4, .k5 { height: auto; }
  .wtile { min-height: 0; }
  .ask-form { flex-direction: column; align-items: stretch; }
  .ask-form .count { position: static; align-self: flex-end; }
  /* leave room for Safari's floating bottom toolbar when the form is scrolled into view */
  .ask-form { scroll-margin-bottom: 140px; }
  .ask-form input { flex: none; height: 56px; }
  .ask-form button { height: 52px; }
  /* phones: no reserved void; the transcript grows with the conversation, then scrolls.
     svh ignores the iOS keyboard and toolbars, so the cap doesn't jump while typing. */
  .ask { padding-block: 200px 96px; }
  .convo { margin-top: 48px; }
  .transcript { height: auto; max-height: 55svh; margin-top: 32px; }
  .preview-note { margin-bottom: 0; }
  .t-q { max-width: 85%; }
  /* five layers don't fit one phone screen: no pin, no drop */
  .stackstage { height: auto !important; }
  .stack-pin { position: static !important; height: auto !important; padding-block: 120px !important; }
  .layer { animation: none !important; }
}

/* ---- Reduced motion ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .turn, .t-src { animation: none; }
  .dots i { animation: none; opacity: .6; }
  .s, .zmark, .ztext, .zlate, .w, .tile, .wtile, .convo, .xrow, .layer, .step, .f, .in, .ln, .tag {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  .pg { animation: none !important; opacity: 1 !important; transform: translateX(70px) !important; }
  .zoom, .stackstage { height: auto !important; }
  .zoom-pin, .stack-pin { position: static !important; height: auto !important; padding-block: 120px !important; }
}
