/* QuillMD front page for CPT Studio.
   Design language after HorizonX "Alder & Stone" (near-white page, point-drawn 3D, hairlines, one accent),
   rebuilt for a clinical audience: real document flow, selectable text, type that follows browser zoom. */

:root {
  /* Layout idea: one left-anchored editorial column; documents (the note, sheets, codes) sit on the right;
     the dot field behind the page is the only thing that moves. */
  --canvas: #f5f5ef;   /* page ground, from the CPT Studio app */
  --paper: #ffffff;    /* sheets and cards */
  --ink: #202d29;      /* text */
  --muted: #5b665f;    /* supporting text, 5:1 on canvas */
  --forest: #183d35;   /* the one accent */
  --lime: #d8eb96;     /* highlighter only */
  --soft: #edf2e7;     /* quiet fills */
  --line: #dfe3d8;     /* hairlines */
  --dash: rgba(32, 45, 41, .45);

  --display: "Gelasio", Georgia, "Times New Roman", serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "IBM Plex Mono", "Liberation Mono", "DejaVu Sans Mono", ui-monospace, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(20px, 4.4vw, 72px);
  --max: 1320px;
  color-scheme: only light;   /* one light design: "only" asks a browser's forced dark mode to leave it alone (index.html says it too) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
svg, canvas { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--lime); color: var(--ink); }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- dot field and progress rail ---------- */
#field {
  position: fixed; left: 0; top: 0; width: 100%; height: 100vh;   /* 100vh, not 100%: on a phone it stays put while the bars slide */
  z-index: 0; pointer-events: none;
  display: none; opacity: 0; transition: opacity 1s var(--ease);
}
.immersive #field { display: block; }
.immersive.is-ready #field { opacity: 1; }
main, .top { position: relative; z-index: 1; }

.rail { display: none; }
.immersive .rail {
  display: block; position: fixed; right: 16px; top: 50%; z-index: 4;
  width: 7px; height: 150px; transform: translateY(-50%);
  background: repeating-linear-gradient(to bottom, rgba(32, 45, 41, .55) 0 1px, transparent 1px 10px);
}
.rail i {
  position: absolute; left: -6px; width: 19px; height: 2px; margin-top: -1px;
  top: calc(var(--p, 0) * 100%); background: var(--forest);
}

/* ---------- header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px);
  padding: 14px var(--gutter);
}
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(245, 245, 239, .88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .35s var(--ease);
}
.top.is-scrolled::before { opacity: 1; }

/* The logo: the Q mark, the name (both outlines, defined once in the page), then the product in plain type. */
.logo-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); min-height: 40px; }
.logo-mark { display: block; flex: none; width: 28px; height: 28px; }
.logo-name { display: block; flex: none; width: 70.5px; height: 28px; margin-left: 7px; color: var(--ink); }
.brand-sep { flex: none; width: 1px; height: 18px; margin: 0 12px; background: rgba(32, 45, 41, .25); }
.brand-product { font: 500 .9375rem/1 var(--body); letter-spacing: -.012em; white-space: nowrap; }

.nav { margin-left: auto; display: flex; gap: clamp(16px, 2.2vw, 30px); font-size: .9375rem; }
.nav a { position: relative; text-decoration: none; padding: 10px 2px; white-space: nowrap; }
.nav a::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: 6px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav a:hover::after, .nav a:focus-visible::after { transform: scaleX(1); }

.menu-btn {
  display: none; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px; margin-left: auto;
  border: 1px solid rgba(32, 45, 41, .32); border-radius: 8px; background: transparent;
  font: 500 .9375rem/1 var(--body); cursor: pointer;
}
.menu-icon { position: relative; width: 16px; height: 12px; }
.menu-icon::before, .menu-icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.menu-icon::before { top: 2px; }
.menu-icon::after { top: 8.5px; }
.top.is-open .menu-icon::before { top: 5px; transform: rotate(45deg); }
.top.is-open .menu-icon::after { top: 5px; transform: rotate(-45deg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border: 1px solid var(--forest); border-radius: 10px;
  background: var(--forest); color: #fff;
  font: 500 1rem/1 var(--body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
}
.btn:hover { background: #0f2c26; box-shadow: 0 14px 30px -14px rgba(24, 61, 53, .6); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--forest); }
.btn-ghost:hover { background: var(--soft); box-shadow: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9375rem; border-radius: 8px; }
.btn-lg { min-height: 58px; padding: 0 34px; font-size: 1.0625rem; }

/* ---------- shared pieces ---------- */
.tag.soon { margin-left: .5em; vertical-align: middle; color: var(--forest); border-color: var(--forest); }
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font: 500 .6875rem/1.35 var(--body); letter-spacing: 0; color: var(--muted); white-space: nowrap;
}

.note-lines { font: 400 .84375rem/1.8 var(--mono); color: var(--ink); }
.note-lines .k { color: var(--muted); }
mark.found {
  background: var(--lime); color: var(--ink); padding: .14em 0;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.open {
  text-decoration: underline dashed; text-decoration-thickness: 1px;
  text-underline-offset: .32em; text-decoration-color: var(--ink);
}
.code { font: 500 1.0625rem/1.2 var(--mono); color: var(--forest); white-space: nowrap; }

.how h2, .get h2, .spec h2, .dict h2 {
  font: 400 clamp(2rem, 3.5vw, 3.25rem)/1.04 var(--display);
  letter-spacing: -.022em; text-wrap: balance;
}

/* ---------- 1. hero ---------- */
.hero { position: relative; }
.hero-pin {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(28px, 4vw, 72px);
  width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: clamp(108px, 16vh, 156px) var(--gutter) clamp(56px, 9vh, 104px);
}
.hero h1 {
  font: 400 clamp(2.75rem, 5.5vw, 5.75rem)/.98 var(--display);
  letter-spacing: -.026em; text-wrap: balance; max-width: 9.8em;
}
.lede { margin-top: clamp(20px, 3.2vh, 34px); max-width: 30em; font-size: clamp(1.0625rem, 1.25vw, 1.25rem); line-height: 1.5; }
.hero-actions { margin-top: clamp(24px, 4vh, 40px); display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-foot { flex-basis: 100%; font-size: .875rem; line-height: 1.4; color: var(--muted); }

.hero-note { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; justify-self: end; width: 100%; max-width: 720px; }
.sheet-wrap { position: relative; }
html:not(.immersive) .sheet-wrap::before,
html:not(.immersive) .sheet-wrap::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  border: 1px dotted rgba(32, 45, 41, .4); border-radius: 6px;
}
html:not(.immersive) .sheet-wrap::before { transform: translate(13px, -12px); }
html:not(.immersive) .sheet-wrap::after { transform: translate(26px, -24px); opacity: .55; }
.sheet {
  position: relative; z-index: 1;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 18px 24px 26px;
  box-shadow: 0 40px 90px -44px rgba(13, 40, 28, .32), 0 1px 2px rgba(13, 40, 28, .05);
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 13px; margin-bottom: 15px; border-bottom: 1px solid var(--line);
  font: 500 .8125rem/1.2 var(--body);
}
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; }
.chip {
  display: grid; gap: 4px; align-content: start; padding: 12px 14px 13px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--forest);
  font: 400 .8125rem/1.4 var(--body);
  box-shadow: 0 20px 44px -28px rgba(13, 40, 28, .38);
}
.chip-label { font: 500 .6875rem/1.3 var(--body); color: var(--muted); }
.chip-code { font: 500 1.5rem/1.1 var(--mono); color: var(--forest); letter-spacing: -.02em; }
.chip-q { font: 400 1.125rem/1.22 var(--display); letter-spacing: -.005em; }
.chip-text { color: var(--muted); }
.chip-open { border: 1px dashed var(--dash); background: rgba(245, 245, 239, .7); box-shadow: none; }
.tether { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; display: none; }
.tether path { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tether .t-found { stroke: var(--forest); }
.tether .t-open { stroke: var(--ink); stroke-dasharray: 3 3; opacity: .75; }
.tether circle { fill: var(--forest); }
.tether circle.t-open-dot { fill: var(--canvas); stroke: var(--ink); stroke-width: 1; }

@media (min-width: 1240px) {
  .hero-note { grid-template-columns: minmax(0, 1fr) 232px; column-gap: 30px; align-items: start; }
  .notes { position: relative; grid-template-columns: minmax(0, 1fr); align-self: stretch; }
  .notes.is-placed .chip { position: absolute; left: 0; right: 0; }
  .notes.is-placed ~ .tether { display: block; }
}

/* immersive mode: the hero is pinned while the note turns into points */
.note-track { display: contents; }
.immersive:not(.is-narrow) .hero { height: 270vh; }
.immersive:not(.is-narrow) .hero-pin { position: sticky; top: 0; height: 100vh; padding-block: 84px 36px; }
.immersive:not(.is-narrow) .hero-copy {
  opacity: calc(1 - var(--fade, 0));
  transform: translate3d(0, calc(var(--fade, 0) * -34px), 0);
}
/* narrower windows: the copy scrolls away and only the note is pinned */
.immersive.is-narrow .hero-pin { display: block; padding-bottom: 0; }
.immersive.is-narrow .note-track { display: block; margin-top: 52px; }
.immersive.is-narrow .note-track::after { content: ""; display: block; height: 175vh; }   /* room for the note to stay pinned */
.immersive.is-narrow .hero-note { position: sticky; top: 92px; max-width: 640px; margin-inline: auto; }
.immersive.is-narrow .hero.is-away .hero-note { visibility: hidden; }
.immersive .hero-note .sheet,
.immersive .hero-note .notes,
.immersive .hero-note .tether { opacity: calc(1 - var(--melt, 0)); }
.immersive:not(.is-narrow) .hero.is-away .hero-pin { visibility: hidden; }
.scroll-hint { display: none; }
.immersive:not(.is-narrow) .scroll-hint {
  display: flex; align-items: center; gap: 12px;
  position: absolute; left: var(--gutter); bottom: 30px;
  font-size: .8125rem; color: var(--muted);
  opacity: calc(1 - var(--fade, 0));
}
.scroll-hint i { width: 1px; height: 30px; background: linear-gradient(var(--forest), var(--forest)) 0 0 / 1px 12px no-repeat, rgba(32, 45, 41, .25); animation: hint 2.4s var(--ease) infinite; }
@keyframes hint { 0% { background-position: 0 -12px; } 70%, 100% { background-position: 0 30px; } }
/* a soft halo keeps text clear where the dot field passes behind it */
.immersive .problem, .immersive .how-grid, .immersive .trust-main, .immersive .dict-grid, .immersive .close .wrap { text-shadow: 0 0 14px var(--canvas), 0 0 5px var(--canvas), 0 0 2px var(--canvas); }
.immersive .btn { text-shadow: none; }

/* ---------- 2. the problem ---------- */
.problem { padding: clamp(88px, 16vh, 190px) 0 clamp(72px, 12vh, 140px); }
.immersive:not(.is-narrow) .problem { min-height: 100vh; display: flex; align-items: center; padding-block: 16vh; }
.immersive:not(.is-narrow) .statement { max-width: 11.8em; font-size: clamp(2.25rem, 4.25vw, 4.2rem); }
.immersive:not(.is-narrow) .roles { max-width: 700px; gap: 28px; }
.immersive:not(.is-narrow) .roles p { font-size: 1.125rem; }
.statement {
  font: 400 clamp(2.25rem, 4.7vw, 4.6rem)/1.03 var(--display);
  letter-spacing: -.024em; max-width: 12.5em;
}
.statement span { display: block; }
.statement span + span { margin-top: .1em; }
.roles {
  margin-top: clamp(40px, 8vh, 88px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px);
  max-width: 940px;
}
.roles li { border-top: 1px solid var(--ink); padding-top: 14px; }
.roles h3 { font: 500 .875rem/1.35 var(--body); color: var(--muted); }
.roles p { margin-top: 8px; font: 400 1.25rem/1.3 var(--display); letter-spacing: -.005em; }

/* ---------- 3. how it works ---------- */
.how { padding: clamp(72px, 12vh, 140px) 0; }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.how-intro { margin-top: 16px; max-width: 27em; font-size: 1.125rem; }
.steps { margin-top: clamp(28px, 5vh, 56px); display: grid; gap: clamp(40px, 7vh, 72px); }
.step { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); column-gap: clamp(12px, 1.6vw, 22px); row-gap: 10px; align-content: start; }
.step-n { grid-row: 1 / span 3; font: 400 2.75rem/.95 var(--display); color: var(--forest); font-variant-numeric: lining-nums; }
.step h3 {
  grid-column: 2;
  font: 400 clamp(1.5rem, 2.3vw, 2.125rem)/1.12 var(--display);
  letter-spacing: -.016em; max-width: 15em; text-wrap: balance;
}
.step > p { grid-column: 2; max-width: 29em; }
.step > .specimen { grid-column: 2; margin-top: 14px; }

.specimen {
  width: 100%; max-width: 450px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 18px 18px;
  box-shadow: 0 34px 70px -46px rgba(13, 40, 28, .42);
  font-size: .9375rem;
}
.spec-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
  font: 500 .8125rem/1.2 var(--body);
}
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.file-icon {
  width: 30px; height: 38px; border: 1px solid var(--ink); border-radius: 3px;
  background:
    linear-gradient(var(--ink), var(--ink)) 6px 11px / 16px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 6px 17px / 16px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 6px 23px / 10px 1px no-repeat;
}
.file-name { font-weight: 500; }
.file-state { font: 500 .75rem/1 var(--body); color: var(--forest); padding: 7px 10px; border-radius: 999px; background: var(--soft); }
.code-row, .summary li { display: grid; grid-template-columns: 6.4rem minmax(0, 1fr); align-items: baseline; gap: 12px; }
.code-text { line-height: 1.35; }
.quote { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font: 400 .8125rem/1.75 var(--mono); }
.question { font: 400 1.3125rem/1.22 var(--display); letter-spacing: -.008em; }
.answers { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.answer {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(32, 45, 41, .4); background: transparent;
  font: 500 .875rem/1 var(--body); cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.answer:hover { border-color: var(--forest); background: var(--soft); }
.answer[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.answer-note { margin-top: 12px; font-size: .8125rem; color: var(--muted); }
.summary { display: grid; gap: 10px; }
.summary li[hidden] { display: none; }
.done-row, .pdf-row { display: flex; align-items: center; gap: 10px; }
.done-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.pdf-row { margin-top: 10px; }
.check { position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--forest); }
.check::after {
  content: ""; position: absolute; left: 6px; top: 5.5px; width: 8px; height: 5px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(-45deg);
}
.pdf-icon { flex: none; width: 20px; height: 24px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 2px; font: 500 .4375rem/1 var(--mono); }

.stage { display: none; }
.immersive:not(.is-narrow) .how { padding-block: 0; }
.immersive:not(.is-narrow) .how-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 96px);
  grid-template-areas: "title stage" "steps stage";
}
.immersive:not(.is-narrow) .how-head { grid-area: title; padding-top: 14vh; }
.immersive:not(.is-narrow) .steps { grid-area: steps; margin-top: 0; gap: 0; }
.immersive:not(.is-narrow) .step { min-height: 78vh; align-content: center; opacity: .38; transition: opacity .5s var(--ease); }
.immersive:not(.is-narrow) .step.is-active { opacity: 1; }
.immersive:not(.is-narrow) .step:first-child { min-height: 56vh; }
.immersive:not(.is-narrow) .stage { grid-area: stage; display: block; position: sticky; top: 0; height: 100vh; align-self: start; }
.immersive.is-narrow .stage { display: block; position: relative; height: 52vh; margin-top: 3vh; }
.immersive.is-narrow .stage-slot { display: none; }

/* slots: empty boxes in the layout that the 3D object is pinned to, so it travels with the page */
.slot { display: none; pointer-events: none; }
.immersive .problem .wrap, .immersive .trust .wrap, .immersive .close .wrap { position: relative; }
.immersive:not(.is-narrow) #slotProblem,
.immersive:not(.is-narrow) #slotTrust,
.immersive:not(.is-narrow) #slotClose { display: block; position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); }
.immersive:not(.is-narrow) #slotProblem { width: 41%; height: 66vh; }
.immersive:not(.is-narrow) #slotTrust { width: 41%; height: 84vh; }
.immersive:not(.is-narrow) #slotClose { width: 41%; height: 78vh; }
.immersive:not(.is-narrow) #slotStack { display: block; position: absolute; left: 0; right: 0; top: 10vh; height: 48vh; }
.immersive.is-narrow #slotProblem { display: block; height: 46vh; margin-bottom: 3vh; }
.immersive.is-narrow #slotTrust { display: block; height: 62vh; margin-bottom: 4vh; }
.immersive.is-narrow #slotStack { display: block; position: absolute; inset: 0; }
.immersive.dict-cols #slotDict { display: block; position: absolute; left: 0; right: 0; top: 11vh; bottom: 7vh; }
.immersive:not(.dict-cols) #slotDict { display: block; position: absolute; inset: 0; }
.stage-slot { position: absolute; left: 0; right: 0; bottom: 5vh; display: grid; justify-items: end; }
.stage-slot .specimen {
  grid-area: 1 / 1; align-self: end;
  opacity: 0; visibility: hidden; transform: translate3d(0, 16px, 0);
  transition: opacity .4s var(--ease), transform .6s var(--ease), visibility 0s linear .4s;
}
.stage-slot .specimen.is-on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .5s var(--ease) .1s, transform .7s var(--ease) .1s, visibility 0s;
}

/* ---------- 4. what you get ---------- */
.get { padding: clamp(88px, 15vh, 180px) 0 clamp(56px, 9vh, 110px); }
.get-list {
  margin-top: clamp(32px, 6vh, 64px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px);
}
.get-list li { padding: 22px 0 30px; border-top: 1px solid var(--ink); }
.get-list h3 { font: 400 clamp(1.375rem, 2vw, 1.75rem)/1.15 var(--display); letter-spacing: -.014em; }
.get-list p { margin-top: 8px; max-width: 31em; }

/* ---------- 5. specialties ---------- */
.spec { padding: clamp(56px, 9vh, 110px) 0 clamp(88px, 15vh, 180px); }
.spec-intro { display: grid; gap: 14px; }
.spec-intro p { font-size: 1.125rem; max-width: 30em; }
.spec-row {
  margin-top: clamp(28px, 5vh, 56px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .58fr); gap: 16px; align-items: stretch;
}
.spec-card {
  min-width: 0; display: flex; flex-direction: column; gap: 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px 18px;
  box-shadow: 0 34px 70px -48px rgba(13, 40, 28, .36);
}
.spec-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.spec-card h3 { font: 400 1.375rem/1.1 var(--display); letter-spacing: -.012em; }
.spec-card .note-lines { font-size: .8125rem; }
.spec-out { margin-top: auto; display: grid; gap: 8px; }
.mini { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 8px; font-size: .875rem; line-height: 1.35; }
.mini .code { font-size: .9375rem; }
.mini-found { border: 1px solid var(--forest); }
.mini-open { border: 1px dashed var(--dash); }
.ask { font: 500 .75rem/1.3 var(--body); color: var(--muted); }
.spec-more { justify-content: flex-end; background: transparent; border: 1px dashed var(--dash); box-shadow: none; }
.spec-more h3 { font-size: 1.25rem; line-height: 1.2; }

/* ---------- 6. trust ---------- */
.trust { padding: clamp(88px, 16vh, 190px) 0 clamp(56px, 9vh, 110px); }
.immersive:not(.is-narrow) .trust { min-height: 100vh; display: flex; align-items: center; }
.trust h2 {
  font: 400 clamp(2.25rem, 4.5vw, 4.4rem)/1.02 var(--display);
  letter-spacing: -.025em; text-wrap: balance; max-width: 10.5em;
}
.trust-list { margin-top: clamp(28px, 5vh, 52px); max-width: 33em; }
.trust-list li { padding: 20px 0 22px; border-top: 1px solid var(--ink); }
.trust-list h3 { font: 400 1.5rem/1.15 var(--display); letter-spacing: -.012em; }
.trust-list p { margin-top: 6px; }
.immersive:not(.is-narrow) .trust-main, .immersive:not(.is-narrow) .close .wrap > :not(.slot) { max-width: min(640px, 50vw); }

/* ---------- 7. Dictation Studio ---------- */
.dict { padding: clamp(72px, 12vh, 140px) 0; }
.dict-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.dict-intro { margin-top: 16px; max-width: 27em; font-size: 1.125rem; }
.dict-stage { display: none; }
/* two columns: the steps scroll on the left while the sound wave is written into a note on the right */
.immersive.dict-cols .dict { padding-block: 0; }
.immersive.dict-cols .dict-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(24px, 5vw, 96px);
  grid-template-areas: "title stage" "steps stage";
}
.immersive.dict-cols .dict-head { grid-area: title; padding-top: 14vh; }
.immersive.dict-cols .dict-steps { grid-area: steps; margin-top: 0; gap: 0; }
.immersive.dict-cols .dict-steps .step { min-height: 82vh; align-content: center; opacity: .38; transition: opacity .5s var(--ease); }
.immersive.dict-cols .dict-steps .step.is-active { opacity: 1; }
.immersive.dict-cols .dict-steps .step:first-child { min-height: 60vh; }
.immersive.dict-cols .dict-steps .step:last-child { min-height: 100vh; }   /* the stage stays pinned until the last step is centred */
.immersive.dict-cols .dict-stage { grid-area: stage; display: block; position: sticky; top: 0; height: 100vh; align-self: start; }
/* one column: the stage sits between the heading and the steps */
.immersive:not(.dict-cols) .dict-stage { display: block; position: relative; height: 64vh; margin-top: 3vh; }

.rec-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.rec-mic { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.rec-wave { width: 100%; height: 32px; }
.rec-wave path { fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sign-row, .status-row { display: flex; align-items: center; gap: 10px; }
.export-row {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted);
}
.file-chip { padding: 6px 10px; border: 1px solid rgba(32, 45, 41, .4); border-radius: 6px; font: 500 .75rem/1 var(--mono); color: var(--ink); }
.spec-cap { margin-bottom: 9px; font: 500 .75rem/1.3 var(--body); color: var(--muted); }
.status-row + .spec-cap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.status-text { font-weight: 500; }
.status-link { margin-left: auto; padding: 6px 10px; border: 1px solid rgba(32, 45, 41, .4); border-radius: 6px; font: 500 .75rem/1 var(--body); }

/* ---------- phones: pinned scenes ----------
   On a phone the dots are drawn over the page instead of behind it, and each object keeps to its own stage.
   "How it works" and "Dictation Studio" pin that stage under the header: the object stays on top while the
   steps scroll up beneath it and slip out of sight behind it. site.js sets the sizes. */
.immersive.is-phone #field { z-index: 2; }
.immersive.is-phone .pinned { display: block; padding-bottom: 5vh; }
.immersive.is-phone .pinned > .stage,
.immersive.is-phone .pinned > .dict-stage {
  display: block; position: sticky; top: var(--pin, 68px); z-index: 2; height: var(--stage-h, 44vh);
  margin: 3vh calc(-1 * var(--gutter)) 0; background: var(--canvas);
}
.immersive.is-phone .pinned > .stage::after,
.immersive.is-phone .pinned > .dict-stage::after {     /* the steps fade as they go under the stage */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 34px; pointer-events: none;
  background: linear-gradient(var(--canvas), rgba(245, 245, 239, 0));
}
.immersive.is-phone .pinned > .steps { position: relative; z-index: 1; margin-top: 22px; gap: 0; }
.immersive.is-phone .pinned > .steps > .step { padding-bottom: 22vh; }                 /* room for the object to change before the next step */
.immersive.is-phone .pinned > .dict-steps > .step:first-child { padding-bottom: 40vh; }   /* the note is written in this stretch */
.immersive.is-phone .pinned > .steps > .step:last-child { padding-bottom: 6vh; }
.immersive.is-phone .pinned .specimen { box-shadow: 0 12px 26px -20px rgba(13, 40, 28, .45); }   /* a short shadow: nothing shows below a card that has gone under the stage */

/* phones: smaller pieces around the scenes */
.immersive.is-phone .hero-note { top: 80px; }
.immersive.is-phone .rail { right: 5px; width: 5px; height: 96px; }
.immersive.is-phone .rail i { left: -3px; width: 11px; }
.hero-note.chips-row .notes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hero-note.chips-row .chip { padding: 10px 11px 11px; }
.hero-note.chips-row .chip-code { font-size: 1.25rem; }
.hero-note.chips-row .chip-q { font-size: 1rem; }

/* ---------- 8. close ---------- */
.close { padding: clamp(72px, 12vh, 150px) 0 clamp(72px, 13vh, 150px); }
.immersive:not(.is-narrow) .close { min-height: 88vh; display: flex; align-items: center; }
.close h2 {
  font: 400 clamp(2.5rem, 5.4vw, 5.25rem)/1 var(--display);
  letter-spacing: -.028em; text-wrap: balance; max-width: 9em;
}
.paths { margin-top: clamp(28px, 5vh, 52px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.paths li { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 16px; border-top: 1px solid var(--ink); }
.paths h3 { font: 400 1.5rem/1.15 var(--display); letter-spacing: -.012em; }
.paths p { flex: 1; max-width: 26em; }
.paths .btn { margin-top: 10px; }
.demo-status { margin-top: 16px; min-height: 1.4em; font-size: .875rem; color: var(--muted); }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 2; background: var(--canvas); border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: .875rem; color: var(--muted); }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 48px; }
.foot-logo { display: inline-flex; align-items: center; }
.foot-logo .logo-mark { width: 24px; height: 24px; }
.foot-logo .logo-name { width: 60.4px; height: 24px; margin-left: 6px; }
.foot-brand p { margin-top: 10px; }
.foot a { color: var(--ink); text-underline-offset: .22em; }
.foot-notes { display: grid; gap: 4px; max-width: 36em; }

/* ---------- loading intro ----------
   Shown on every page load (see the script in <head>, and site.js for its timing). The logo sits in the middle
   while the highlighter under it fills with the page's real loading; then the logo glides to its place in the
   header, the screen clears, and the page's own entrance plays. If site.js never runs, the timer in <head> and
   the one on .intro clear the screen after 7 seconds. */
.intro { display: none; }
.is-intro .intro, .intro-out .intro {
  display: block; position: fixed; left: 0; top: 0; width: 100%; height: 100vh; z-index: 100;
  animation: intro-failsafe .2s linear 6.9s forwards;
}
.intro-out .intro { pointer-events: none; }        /* the page is back: nothing may stand in front of its buttons */
/* the end state sits on two keyframes, so it holds however the browser rounds the last instant */
@keyframes intro-failsafe { 50%, 100% { visibility: hidden; opacity: 0; } }
.intro-bg { position: absolute; inset: 0; background: var(--canvas); transition: opacity .7s var(--ease); }
.intro-brand {
  /* it carries the header logo's own class as well, so it has the same parts at every width */
  position: absolute; left: 50%; top: 46%; white-space: nowrap;
  transform: translate(-50%, -50%) scale(var(--intro-scale, 1.7)); transition: transform .85s var(--ease);
  animation: arrive .45s var(--ease) .6s both;      /* the plain logo, if the scan has not drawn it by then */
}
.intro-scan { position: absolute; left: 0; top: 0; pointer-events: none; display: none; }
.intro.is-scanning .intro-scan { display: block; }
.intro.is-scanning .intro-brand { visibility: hidden; }        /* the canvas draws the same logo while it is scanned */
.intro-line {
  position: absolute; left: 50%; top: calc(46% + 56px); width: min(230px, 54vw); height: 15px; transform: translateX(-50%);
  transition: opacity .3s var(--ease); animation: arrive .5s var(--ease) .1s both;
}
.intro-line::after {     /* a line of text, as dots */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle, var(--ink) 1.1px, rgba(32, 45, 41, 0) 1.5px) 0 50% / 6px 6px repeat-x; opacity: .62;
}
.intro-line i {          /* the highlighter: how much of the page has loaded (site.js sets each step and its time) */
  position: absolute; inset: 0; background: var(--lime); transform-origin: 0 50%;
  transform: scaleX(var(--load, .06)); transition: transform var(--load-t, .55s) linear;
}
.intro-out .intro-bg { opacity: 0; }
.intro-out .intro-line { opacity: 0; }
.is-intro .top .brand, .intro-out .top .brand { visibility: hidden; }     /* the flying logo lands here */
@media (max-width: 560px) { .intro-brand { --intro-scale: 1.5; } }

/* ---------- one page-load sequence: copy rises, then the note and its two margin notes arrive ---------- */
@keyframes rise { from { opacity: 0; transform: translate3d(0, 22px, 0); } }
@keyframes arrive { from { opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.js .hero h1 { animation: rise .9s var(--ease) both; }
.js .hero .lede { animation: rise .9s var(--ease) .12s both; }
.js .hero .hero-actions { animation: rise .9s var(--ease) .22s both; }
.js .sheet-wrap { animation: arrive .9s var(--ease) .18s both; }
.js .chip-found { animation: arrive .7s var(--ease) .75s both; }
.js .chip-open { animation: arrive .7s var(--ease) .95s both; }
.js .tether .t-found { stroke-dasharray: 1; animation: draw .6s var(--ease) .55s both; }
.js .tether circle, .js .tether .t-open { animation: arrive .5s var(--ease) .9s both; }
.is-intro .hero h1, .is-intro .hero .lede, .is-intro .hero .hero-actions, .is-intro .sheet-wrap,
.is-intro .chip-found, .is-intro .chip-open, .is-intro .tether .t-found, .is-intro .tether circle, .is-intro .tether .t-open { animation-play-state: paused; }

/* ---------- a short note when the 3D scroll is off, and why ---------- */
.mode-note {
  position: fixed; left: 16px; bottom: 16px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  max-width: min(440px, calc(100vw - 32px)); padding: 10px 12px 10px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 40px -22px rgba(13, 40, 28, .4);
  font-size: .8125rem; line-height: 1.4;
}
.mode-note[hidden] { display: none; }
.mode-note p { flex: 1 1 200px; }
.mode-btn, .mode-x { min-height: 32px; padding: 0 12px; border-radius: 8px; font: 500 .8125rem/1 var(--body); cursor: pointer; }
.mode-btn { border: 1px solid var(--forest); background: var(--forest); color: #fff; }
.mode-btn[hidden] { display: none; }
.mode-x { border: 1px solid var(--line); background: transparent; color: var(--muted); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .spec-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959.98px) {
  .nav a:not(.nav-dict) { display: none; }   /* four links no longer fit: the second product keeps its link */
  .hero-pin { grid-template-columns: minmax(0, 1fr); gap: 44px; padding-top: 116px; }
  .hero-note { justify-self: start; max-width: 600px; }
  /* a section link lands with its heading clear of the fixed header (68px tall, 71px while the nav link
     shows): where a section's own top padding is shorter than 84px, the difference is kept as scroll margin */
  .how, .dict, .close { scroll-margin-top: max(0px, 84px - clamp(72px, 12vh, 140px)); }
  .spec { scroll-margin-top: max(0px, 84px - clamp(56px, 9vh, 110px)); }
}
@media (max-width: 820px) {
  .get-list { grid-template-columns: minmax(0, 1fr); }
  .paths { grid-template-columns: minmax(0, 1fr); }
  .roles { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .roles li { padding: 14px 0 18px; }
}
@media (max-width: 700px) {
  .spec-row { grid-template-columns: minmax(0, 1fr); }
  .spec-more { min-height: 96px; }
}
@media (max-width: 560px) {
  /* the section links move behind a Menu button */
  .top { justify-content: space-between; gap: 10px; }
  .nav { display: none; }
  .js .menu-btn { display: inline-flex; }
  .js .top.is-open .nav {
    display: flex; flex-direction: column; gap: 0; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    padding: 0 var(--gutter) 12px; background: var(--canvas); border-bottom: 1px solid var(--line);
    box-shadow: 0 26px 40px -30px rgba(13, 40, 28, .4); font-size: 1.0625rem;
  }
  .js .top.is-open::before { opacity: 1; background: var(--canvas); }
  .top.is-open .nav a, .top.is-open .nav a:not(.nav-dict) { display: flex; align-items: center; min-height: 50px; padding: 0 2px; border-top: 1px solid var(--line); }
  .top.is-open .nav a::after { display: none; }
  html:not(.immersive) .sheet-wrap::before { transform: translate(7px, -8px); }
  html:not(.immersive) .sheet-wrap::after { transform: translate(14px, -16px); }
  .sheet-head, .spec-head, .spec-card header { flex-wrap: wrap; }
  .notes { grid-template-columns: minmax(0, 1fr); }
  .sheet { padding: 16px 16px 20px; }
  .step { grid-template-columns: 1.9rem minmax(0, 1fr); }
  .step-n { font-size: 2.25rem; }
  .code-row, .summary li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mini { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 520px) {     /* up to here the full logo, a worded Menu button and the main button do not fit side by side */
  .brand-sep, .brand-product { display: none; }
  .menu-btn { padding: 0 11px; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* the icon alone; the word stays for screen readers */
}
@media (max-width: 345px) {
  .logo-name { display: none; }                  /* the mark alone */
  .top .brand { min-width: 40px; }               /* still a fair target for a finger */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
