/* Neolung's website. The design system's tokens and the Button's cut corner
   are put in by build.mjs from apps/web/src/index.css; everything else here
   uses them. The haematoxylin and eosin colours belong to the drawing only. */
:root {
  --background: #ffffff;
  --surface-sunken: #f3efea;
  --foreground: #0c0a09;

  
  --text-secondary: #5e554b;
  --text-disabled: #a8a097;
  
  --text-placeholder: #746c62;

  
  --surface-pressed: #e8e2da;

  
  --border: #e6e0d8;
  --border-strong: #0c0a09;
  
  --input: #90897f;
  
  --surface-field: transparent;
  --surface-field-hover: transparent;
  --ring: #0c0a09;

  
  --primary: #0c0a09;
  --primary-foreground: #ffffff;
  
  --active: #2dd4bf;
  --active-foreground: #0c0a09;
  --secondary: #f3efea;
  --secondary-foreground: #0c0a09;
  --accent: #f3efea;
  --accent-foreground: #0c0a09;
  --muted: #f3efea;
  --muted-foreground: #5e554b;
  --popover: #ffffff;
  --popover-foreground: #0c0a09;
  --card: #ffffff;
  --card-foreground: #0c0a09;

  
  --destructive: #b91c1c;
  --destructive-foreground: #ffffff;
  
  --overlay: #0c0a09;
  --check-high: #b91c1c;
  --check-high-surface: #fef2f2;
  --check-medium: #92400e;
  --check-medium-surface: #fffbeb;
  --check-info: #5e554b;
  --check-info-surface: #f3efea;
  
  --status-neutral: #5e554b;
  --status-neutral-surface: #f3efea;
  --status-success: #166534;
  --status-success-surface: #ecfdf3;
  --status-warning: #92400e;
  --status-warning-surface: #fff7e0;

  --radius: 0px;
  --title: clamp(28px, 3.4vw, 40px);
  --title-line: 1.15;
}

@font-face {
  font-family: "Alcyone";
  src:
    url("/fonts/Alcyone-Medium.woff2") format("woff2"),
    url("/fonts/Alcyone-Medium.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--foreground);
  font-family: "Alcyone", system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 400;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
}

/* Hidden means hidden, whatever display a component sets. */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.top {
  position: fixed;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: var(--background);
  z-index: 3;
}

.top nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.wordmark {
  text-decoration: none;
  font-size: 20px;
  line-height: 28px;
}

.link {
  color: var(--text-secondary);
  text-decoration: none;
}

.link:hover,
.link:focus-visible {
  color: var(--foreground);
}

.eyebrow {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* ---- Act one: the name, cut out of the tissue -------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 10fr);
  grid-template-rows: 1fr auto;
  gap: 40px 80px;
  padding: 96px clamp(16px, 4vw, 48px) 24px;
}

.hero-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  padding-top: 24px;
}

/* The hero's figures, counted from the report types. */
.hero-figures {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 64px;
}

.hero-figures div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .hero-figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-figures div {
    white-space: normal;
  }
}

.hero-figures dd {
  order: -1;
  margin: 0;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.hero-figures dt {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* The hero's AI at work, beside the words: it listens, recognises the
   clinical terms in what's said, carries each to its field, then the rules
   flag what contradicts. No box: it sits on the page. */
.hero-ai {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.4vh, 24px);
  width: 100%;
  max-width: 640px;
  justify-self: end;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }
  .hero-ai {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }
  .hero-figures {
    grid-row: 2;
  }
}

@media (max-width: 560px) {
  .ai-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ai-listen {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
}

.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--destructive);
  opacity: 0.25;
  transition: opacity 300ms ease-out;
}

.hero-ai.listening .ai-dot {
  opacity: 1;
  animation: pulse 1.2s ease-in-out infinite;
}

.ai-wave {
  flex: 0 1 220px;
  min-width: 80px;
  height: 36px;
}

.ai-state {
  white-space: nowrap;
}

/* What's said: each word arrives out of focus, then sharpens. */
.ai-said {
  font-size: clamp(18px, min(1.9vw, 3vh), 27px);
  line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 6em;
}

.ai-said .w {
  display: inline;
  opacity: 0;
  filter: blur(6px);
  transition:
    opacity 260ms ease-out,
    filter 260ms ease-out;
}

.ai-said .w.in {
  opacity: 1;
  filter: none;
}

/* A term the AI recognises: a light passes over it, then it's marked. */
.ai-term {
  position: relative;
  transition:
    background-color 300ms ease-out,
    color 300ms ease-out;
}

.hero-ai.scanning .ai-term {
  background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--active) 45%, transparent) 50%, transparent 70%);
  background-size: 300% 100%;
  animation: scan 900ms ease-in-out;
}

@keyframes scan {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.ai-term.found {
  background-color: color-mix(in srgb, var(--active) 18%, transparent);
  box-shadow: inset 0 -2px 0 var(--active);
}

.hero-ai.checked .ai-term.flagged {
  background-color: var(--check-high-surface);
  box-shadow: inset 0 -2px 0 var(--check-high);
}

/* The fields the terms fill: empty slots until each term lands. */
.ai-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(6px, 1.1vh, 10px) 14px;
  background: var(--surface-sunken);
  font-size: 14px;
  line-height: 20px;
  transition: background-color 300ms ease-out;
}

.ai-field dt {
  color: var(--text-secondary);
}

.ai-field dd {
  margin: 0;
  min-height: 24px;
  font-size: clamp(16px, 2.3vh, 18px);
  line-height: 24px;
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.ai-field.filled dd {
  opacity: 1;
}

.ai-field.filled {
  background: color-mix(in srgb, var(--active) 10%, var(--background));
}

.hero-ai.checked .ai-field.flagged {
  background: var(--check-high-surface);
}

/* A term on its way: a copy of it, carried from the sentence to its field. */
.ai-flying {
  position: fixed;
  z-index: 4;
  padding: 0 4px;
  background: var(--active);
  color: var(--active-foreground);
  font-size: 18px;
  line-height: 26px;
  white-space: nowrap;
  pointer-events: none;
}

.ai-check {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 12px 16px;
  background: var(--check-high-surface);
  font-size: 16px;
  line-height: 22px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 400ms ease-out,
    transform 400ms ease-out;
}

.ai-check .corner {
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--check-high);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.hero-ai.checked .ai-check {
  opacity: 1;
  transform: none;
}

/* Reduced motion: the finished state, still. */
.hero-ai.still .ai-said .w {
  opacity: 1;
  filter: none;
  transition: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
}

.hero-copy h1 {
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-copy > p {
  font-size: 18px;
  line-height: 28px;
  color: var(--text-secondary);
}

/* ---- The microscope ------------------------------------------------------ */
/* The stage stays on screen while the story scrolls past it. */
.scope {
  position: relative;
  height: 900vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) 340px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px 48px;
  padding: 80px clamp(16px, 4vw, 48px) 32px;
}

/* To the left: the objectives, then the caption of each step. */
.side {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 48px;
}

/* The ocular: a round field of view, the tissue inside it. */
.ocular {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: min(100%, calc(100vh - 220px));
  width: min(100%, calc(100svh - 220px));
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #fbf3f7;
  box-shadow:
    0 0 0 1px var(--border),
    inset 0 0 48px 8px rgb(60 30 60 / 0.25);
}

/* The ocular comes on stage once, with a bounce: from nothing past its
   size and back, in a second (site.js adds .entered when it's in view). */
.js .ocular:not(.entered) {
  transform: scale(0);
}

.js .ocular.entered {
  animation: ocular-in 1s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes ocular-in {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.tissue {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.tissue:active {
  cursor: grabbing;
}

.tissue:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -6px;
  border-radius: 50%;
}


/* The nosepiece: the objectives, the one in use with the teal corner. */
.turret {
  display: flex;
  gap: 8px;
}

.turret button {
  --btn-cut: 10px;
  height: 32px;
  min-width: 48px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.turret button[aria-pressed="true"] {
  --btn-edge: var(--border-strong);
  color: var(--foreground);
  --btn-gap: 2px;
  position: relative;
  isolation: isolate;

  &::before,
  &::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }
  &::before {
    inset: 0;
    z-index: -1;
    border: 1px solid var(--btn-edge, transparent);
    background-image: linear-gradient(135deg, var(--btn-edge, transparent) calc(50% + 1px), transparent 0);
    background-origin: border-box;
    background-repeat: no-repeat;
    background-size: var(--btn-cut) var(--btn-cut);
    clip-path: polygon(var(--btn-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--btn-cut));
    transition:
      background-color 150ms,
      border-color 150ms;
  }
  &::after {
    top: 0;
    left: 0;
    width: max(0px, var(--btn-cut) - var(--btn-gap) * 1.4142);
    aspect-ratio: 1;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    transition:
      width 150ms ease-out,
      background-color 150ms;
  }
  &:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]) {
    --btn-gap: 0px;
  }
  @media (prefers-reduced-motion: reduce) {
    &::before,
    &::after {
      transition: none;
    }
  }
}

.turret button[aria-pressed="true"]::after {
  background-color: var(--active);
}

.turret button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* The report, in the app's report type. */
.report {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  line-height: 20px;
}

.report-title {
  font-family: "Alcyone", system-ui, sans-serif;
  color: var(--text-secondary);
}

.report dl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report dt {
  color: var(--text-secondary);
}

.report [data-field],
.checks li,
.signed {
  transition: opacity 300ms ease-out;
}

.report [data-field]:not(.on),
.checks li:not(.on),
.signed:not(.on) {
  opacity: 0.12;
}

.report [data-field].new {
  animation: arrive 700ms ease-out;
}

@keyframes arrive {
  from {
    background: color-mix(in srgb, var(--active) 30%, transparent);
  }
}

.checks {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Alcyone", system-ui, sans-serif;
}

.checks li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* The check's marker: the Button's corner, in the check's colour. */
.corner {
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--check-medium);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.signed {
  font-family: "Alcyone", system-ui, sans-serif;
  color: var(--status-success);
}

/* What you say, as you look. */
.dictation {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  min-height: 28px;
  font-size: 18px;
  line-height: 28px;
}

.mic {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--destructive);
  opacity: 0;
  transition: opacity 200ms;
}

.dictation.live .mic {
  opacity: 1;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

/* The captions, one at a time, in the same place at the foot of the side. */
.captions {
  margin-top: auto;
  display: grid;
  list-style: none;
  padding: 0;
}

.captions li {
  grid-area: 1 / 1;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 400ms ease-out,
    transform 400ms ease-out;
}

.captions li.on {
  opacity: 1;
  transform: none;
}

.caption {
  font-size: 20px;
  line-height: 28px;
}

.hint {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* ---- Why Neolung exists: one column, read as an article --------------- */
.maker {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(0, 1fr);
  gap: 48px 96px;
  padding: 144px clamp(16px, 4vw, 48px) 48px;
}

.story {
  grid-column: 1;
  grid-row: 1;
}

/* Beside the article: her interstitial report, as she dictates it, and
   what it asks to look at; held in view while the column is read. */
.ild {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 120px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 460px;
}

.ild-said {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface-sunken);
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  line-height: 22px;
}

.ild-said .mic {
  align-self: flex-start;
  margin-top: 6px;
}

.ild-said.live .mic {
  opacity: 1;
  animation: pulse 1.2s ease-in-out infinite;
}

.ild-label {
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* What it asks to look at: each marked with the corner, lit in turn once
   the dictation is typed. */
.ild-looks {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.ild-looks li {
  position: relative;
  padding-left: 16px;
  transition: opacity 300ms ease-out;
  transition-delay: calc(var(--i) * 90ms);
}

.ild-looks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  background: var(--active);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ild.waiting .ild-looks li,
.ild.waiting .ild-every {
  opacity: 0.15;
}

.ild-every {
  margin-top: 8px;
  color: var(--text-secondary);
  transition: opacity 400ms ease-out 1.4s;
}

.ild-every strong {
  font-weight: inherit;
  color: var(--foreground);
}

.story {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
  font-size: 18px;
  line-height: 30px;
}

.story h2 {
  margin-top: 8px;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.story-lede {
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* The quote, pulled out of the column, her portrait beside it. */
.pull {
  margin: 40px 0;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px 32px;
  align-items: start;
}

.pull .portrait {
  grid-row: 1 / span 2;
}

.pull blockquote {
  margin: 0;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.2;
}

.pull figcaption {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
}

.pull .name {
  display: block;
  color: var(--foreground);
}

/* Her portrait, its corner cut as the Button's is, the triangle in teal. */
.portrait {
  --btn-cut: 18px;
  position: relative;
  display: block;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  clip-path: polygon(var(--btn-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--btn-cut));
}

.portrait::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--btn-cut) - 4px);
  height: calc(var(--btn-cut) - 4px);
  background: var(--active);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* Her career as one running line, the years in the report's type. */
.journey {
  list-style: none;
  padding: 0;
  display: block;
  font-size: 16px;
  line-height: 28px;
  color: var(--text-secondary);
}

.journey li {
  display: inline;
}

.journey li + li::before {
  content: " · " / "";
  color: var(--text-disabled);
}

.journey .when {
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  color: var(--active);
}

.journey .where {
  color: var(--foreground);
}

/* ---- Second opinions: asking and giving, one at a time ----------------- */
.opinions {
  margin-top: 144px;
  padding: 120px clamp(16px, 4vw, 48px);
  background: var(--surface-sunken);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.opinions-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
}

.opinions-head h2 {
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.opinions-head > p:last-child {
  max-width: 720px;
  font-size: 20px;
  line-height: 30px;
  color: var(--text-secondary);
}

.op-switch {
  display: flex;
  gap: 8px;
}

/* Without scripts both sides show, one after the other: no tabs to press. */
html:not(.js) .op-switch {
  display: none;
}

.op-switch button {
  --btn-cut: 12px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.op-switch button[aria-selected="true"] {
  --btn-edge: var(--border-strong);
  color: var(--foreground);
  --btn-gap: 2px;
  position: relative;
  isolation: isolate;

  &::before,
  &::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }
  &::before {
    inset: 0;
    z-index: -1;
    border: 1px solid var(--btn-edge, transparent);
    background-image: linear-gradient(135deg, var(--btn-edge, transparent) calc(50% + 1px), transparent 0);
    background-origin: border-box;
    background-repeat: no-repeat;
    background-size: var(--btn-cut) var(--btn-cut);
    clip-path: polygon(var(--btn-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--btn-cut));
    transition:
      background-color 150ms,
      border-color 150ms;
  }
  &::after {
    top: 0;
    left: 0;
    width: max(0px, var(--btn-cut) - var(--btn-gap) * 1.4142);
    aspect-ratio: 1;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    transition:
      width 150ms ease-out,
      background-color 150ms;
  }
  &:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]) {
    --btn-gap: 0px;
  }
  @media (prefers-reduced-motion: reduce) {
    &::before,
    &::after {
      transition: none;
    }
  }
}

.op-switch button[aria-selected="true"]::before {
  background-color: var(--background);
}

.op-switch button[aria-selected="true"]::after {
  background-color: var(--active);
}

.op-switch button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.op-panel {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: 48px 96px;
  align-items: start;
}

/* The steps, joined by a line down their numbers. */
.op-steps {
  list-style: none;
  padding: 0;
  counter-reset: op;
  display: flex;
  flex-direction: column;
}

.op-steps li {
  position: relative;
  counter-increment: op;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 40px 64px;
}

.op-steps li::before {
  content: counter(op, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--background);
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  color: var(--foreground);
}

.op-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  border-left: 2px solid var(--background);
}

.op-steps li > p:not(.op-step-title) {
  max-width: 600px;
  color: var(--text-secondary);
}

.op-step-title {
  font-size: 24px;
  line-height: 32px;
  padding-top: 4px;
}

/* With scripts, each step lights in turn as the panel opens or scrolls in. */
.js .op-panel:not(.played) .op-steps li {
  opacity: 0.25;
}

.js .op-steps li {
  transition: opacity 400ms ease-out;
}

.js .op-panel.played .op-steps li:nth-child(2) {
  transition-delay: 250ms;
}

.js .op-panel.played .op-steps li:nth-child(3) {
  transition-delay: 500ms;
}

.js .op-panel.played .op-steps li:nth-child(4) {
  transition-delay: 750ms;
}

.js .op-panel.played .op-steps li::before {
  background: var(--foreground);
  color: var(--background);
  transition: background-color 300ms ease-out, color 300ms ease-out;
}

.op-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.op-chips span {
  padding: 4px 12px;
  background: var(--background);
  font-size: 14px;
  line-height: 22px;
}

.op-aside {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--background);
}

.op-aside-head {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.op-aside .haves {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 18px;
  line-height: 26px;
}

/* ---- The AI: on the dark, what it does beside what you do -------------- */
.ai {
  padding: 144px clamp(16px, 4vw, 48px);
  background: var(--foreground);
  color: var(--background);
  --text-on-dark: color-mix(in srgb, var(--background) 62%, transparent);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px 96px;
}

.ai .eyebrow,
.ai-terms {
  color: var(--text-on-dark);
}

.ai-head {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.ai h2 {
  font-size: clamp(40px, 6vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.sides,
.pairs li {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}

.sides p:first-child {
  padding-left: 56px;
}

.sides p:last-child {
  padding-left: 32px;
}

.sides p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-on-dark);
}

.sides .icon {
  width: 24px;
  height: 24px;
  color: var(--background);
}

.pairs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 64px;
  list-style: none;
  padding: 0;
  counter-reset: pair;
}

.pairs li {
  counter-increment: pair;
}

/* Each row is a hand-over: numbered, the AI's part, then the teal corner
   travels across to yours, which lights up when it arrives. */
.pairs .does {
  position: relative;
  padding-left: 56px;
  font-size: 18px;
  line-height: 28px;
  color: var(--text-on-dark);
}

.pairs .does::before {
  content: counter(pair, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 4px;
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  line-height: 20px;
  color: var(--active);
}

.pairs .you {
  position: relative;
  padding-left: 32px;
  font-size: 26px;
  line-height: 34px;
}

.pairs .you::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 14px;
  height: 14px;
  background: var(--active);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.js .pairs .you {
  opacity: 0.25;
  transition: opacity 500ms ease-out 700ms;
}

.js .pairs .you::before {
  opacity: 0;
  transform: translateX(-160px);
  transition:
    transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms,
    opacity 300ms ease-out 200ms;
}

.js .pairs li.seen .you,
.js .pairs li.seen .you::before {
  opacity: 1;
  transform: none;
}

.pairs .who {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ai-terms {
  grid-column: 1 / -1;
  margin-top: 48px;
  max-width: 560px;
}

/* ---- The worked case: one case, step by step, inside the app ---------- */
.demo {
  grid-column: 1 / -1;
  position: relative;
  height: 640vh;
  margin-top: 96px;
}

.demo-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.demo-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  padding: 96px 0 32px;
}

/* Who does each step, one at a time, in the same place. */
.demo-steps {
  display: grid;
  list-style: none;
  padding: 0;
}

.demo-steps li {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 22px;
  line-height: 30px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 400ms ease-out,
    transform 400ms ease-out;
}

.demo-steps li.on {
  opacity: 1;
  transform: none;
}

.demo-who {
  font-size: 14px;
  line-height: 20px;
  color: var(--active);
}

/* The case screen, drawn with the app's tokens. */
.window {
  height: min(640px, calc(100vh - 160px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 32px 96px rgb(0 0 0 / 0.5);
  font-size: 14px;
  line-height: 20px;
}

.w-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.w-signed,
.window[data-step="5"] .w-draft {
  display: none;
}

.window[data-step="5"] .w-signed {
  display: inline;
  color: var(--status-success);
}

.w-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px 32px;
  padding: 24px;
}

.w-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  transition: opacity 300ms ease-out;
}

.w-label {
  color: var(--text-secondary);
}

.w-said {
  grid-column: 1 / -1;
  grid-row: 1;
}

.w-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  line-height: 24px;
  min-height: 24px;
}

.w-text .mic {
  flex: none;
  align-self: center;
}

.w-text.live .mic {
  opacity: 1;
  animation: pulse 1.2s ease-in-out infinite;
}

.w-again {
  display: none;
}

.window[data-step="4"] .w-again {
  display: flex;
}

.window[data-step="4"] .w-said > .w-text:not(.w-again) {
  display: none;
}

.w-fields {
  grid-column: 1;
  grid-row: 2;
}

.w-fields dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 16px;
  overflow: hidden;
}

.w-field {
  display: contents;
}

.w-field dt,
.w-field dd {
  margin: 0;
  padding: 2px 8px;
  transition:
    opacity 300ms ease-out,
    background-color 300ms ease-out;
  transition-delay: calc(var(--i) * 40ms);
}

.w-field dt {
  color: var(--text-secondary);
}

/* Empty until the AI fills them. */
.window[data-step="0"] .w-field dd {
  opacity: 0;
}

/* The rules point at what they check. */
.window[data-step="3"] .w-field.flagged > * {
  background: var(--check-medium-surface);
}

.w-field .was {
  color: var(--text-secondary);
}

.w-field .now,
.window[data-step="4"] .w-field .was,
.window[data-step="5"] .w-field .was {
  display: none;
}

.window[data-step="4"] .w-field .now,
.window[data-step="5"] .w-field .now {
  display: inline;
  animation: arrive 700ms ease-out;
}

/* The right-hand side: the photo, then the checks, one at a time. */
.w-photo,
.w-checks {
  grid-column: 2;
  grid-row: 2;
}

.w-slide {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.w-suggest strong {
  font-weight: inherit;
  color: var(--foreground);
}

.w-describe,
.w-suggest {
  color: var(--text-secondary);
}

.w-findings {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.w-findings li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 8px 12px;
  transition: opacity 300ms ease-out;
}

.w-findings .medium {
  background: var(--check-medium-surface);
}

.w-findings .high {
  background: var(--check-high-surface);
}

.w-findings .medium .corner {
  background: var(--check-medium);
}

.w-findings .high .corner {
  background: var(--check-high);
}

.w-findings .source {
  color: var(--text-secondary);
}

.w-clear {
  display: none;
  color: var(--status-success);
}

.window[data-step="4"] .w-findings {
  display: none;
}

.window[data-step="4"] .w-clear {
  display: block;
}

/* Signed: the report, in place of everything else. */
.w-report {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  background: var(--background);
}

.w-report pre {
  margin: 0;
  overflow: hidden;
  white-space: pre-wrap;
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  line-height: 22px;
}

/* A panel shows at its own steps; the fields stay, faint, while others work. */
.w-panel:not(.now) {
  opacity: 0;
  pointer-events: none;
}

.w-fields:not(.now),
.w-said:not(.now) {
  opacity: 0.35;
}

.window[data-step="5"] .w-fields,
.window[data-step="5"] .w-said {
  opacity: 0;
}

/* ---- For pathologists, for hospitals: one section, two audiences ------ */
.for {
  padding: 144px clamp(16px, 4vw, 48px) 48px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* The choice of audience stays at hand while its acts go past. */
.switch {
  position: sticky;
  top: 72px;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 12px 0;
  background: var(--background);
}

.switch button {
  --btn-cut: 12px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.switch button[aria-selected="true"] {
  --btn-edge: var(--border-strong);
  color: var(--foreground);
  --btn-gap: 2px;
  position: relative;
  isolation: isolate;

  &::before,
  &::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }
  &::before {
    inset: 0;
    z-index: -1;
    border: 1px solid var(--btn-edge, transparent);
    background-image: linear-gradient(135deg, var(--btn-edge, transparent) calc(50% + 1px), transparent 0);
    background-origin: border-box;
    background-repeat: no-repeat;
    background-size: var(--btn-cut) var(--btn-cut);
    clip-path: polygon(var(--btn-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--btn-cut));
    transition:
      background-color 150ms,
      border-color 150ms;
  }
  &::after {
    top: 0;
    left: 0;
    width: max(0px, var(--btn-cut) - var(--btn-gap) * 1.4142);
    aspect-ratio: 1;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    transition:
      width 150ms ease-out,
      background-color 150ms;
  }
  &:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]) {
    --btn-gap: 0px;
  }
  @media (prefers-reduced-motion: reduce) {
    &::before,
    &::after {
      transition: none;
    }
  }
}

.switch button[aria-selected="true"]::after {
  background-color: var(--active);
}

.switch button:focus-visible,
.ex-list button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.audience {
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.aud-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 980px;
}

.aud-head h3 {
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.aud-head > p:last-child {
  max-width: 720px;
  font-size: 20px;
  line-height: 30px;
  color: var(--text-secondary);
}

h4 {
  font-size: 20px;
  line-height: 28px;
}

.icon {
  width: 32px;
  height: 32px;
  color: var(--foreground);
}

.pillars {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
}

.pillars li {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pillars .icon {
  margin-bottom: 8px;
}

.pillars p {
  color: var(--text-secondary);
}

/* Each part: what it is on the left, the thing itself on the right. */
.part {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px 96px;
  align-items: start;
}

.part > :not(.part-head) {
  grid-column: 2;
}

/* A part whose thing needs the whole width: the head above it. */
.part-wide {
  grid-template-columns: minmax(0, 1fr);
}

.part-wide > :not(.part-head) {
  grid-column: 1;
}

.part-wide .part-head {
  max-width: 640px;
}

.part-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Beside a tall thing (screens, explorers), the part's words stay in view. */
.part:not(.part-wide) > .part-head {
  position: sticky;
  top: 160px;
}

.part-head h4 {
  font-size: 26px;
  line-height: 34px;
}

.part-head p {
  color: var(--text-secondary);
}

/* An explorer: questions or report types on the left, one answer at a time. */
.explorer {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.ex-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ex-list button {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ex-list button:hover {
  color: var(--foreground);
}

/* The one open: on the sunken surface, the Button's corner in teal. */
.ex-list button[aria-selected="true"] {
  background: var(--surface-sunken);
  color: var(--foreground);
}

.ex-list button[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  background: var(--active);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ex-sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.ex-panel {
  grid-column: 2;
  grid-row: 1 / span 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ex-panel h5 {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
}

.ex-panel ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 20px;
  font-size: 18px;
  line-height: 28px;
}

.ex-panel .icon {
  width: 40px;
  height: 40px;
}

/* The report types: chips across, then the one chosen, its dictation typed
   as you choose it and its sections drawn by how much each asks for. */
.explorer-types {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 40px;
}

.ex-chips {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.ex-chips button {
  padding: 8px 14px;
}

.rt-panel {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px 64px;
  align-items: start;
}

.rt-about,
.rt-live {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rt-live {
  gap: 32px;
}

.rt-facts {
  display: flex;
  gap: 48px;
}

.rt-facts div {
  display: flex;
  flex-direction: column;
}

.rt-facts dd {
  order: -1;
  margin: 0;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.rt-facts dt,
.rt-label,
.rt-note,
.rt-count {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.rt-dictation {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  background: var(--surface-sunken);
}

.rt-said {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 15px;
  line-height: 24px;
}

/* The whole dictation holds its place while it's typed over it, and wraps
   within its box. */
.rt-text {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rt-ghost,
.rt-typed {
  grid-area: 1 / 1;
}

.rt-ghost {
  visibility: hidden;
}

.rt-said .mic {
  align-self: flex-start;
  margin-top: 7px;
}

.rt-said.live .mic {
  opacity: 1;
  animation: pulse 1.2s ease-in-out infinite;
}

.rt-sections {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 16px;
}

.rt-sections li {
  display: contents;
}

/* Each bar grows to its section's share of the fields when the type opens. */
.rt-bar {
  height: 10px;
  width: calc(var(--share) * 100%);
  background: var(--active);
  transform-origin: left;
}

.js .rt-panel .rt-bar {
  transform: scaleX(0);
}

.js .rt-panel.played .rt-bar {
  transform: none;
  transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i) * 80ms);
}

/* Beside the laboratory system: Neolung on the left, the laboratory system
   on the right, unchanged; a signed report travels across once in view. */
.alongside .part-head {
  max-width: 760px;
}

.alongside .part-head h4 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  margin-top: 16px;
}

.flow-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--surface-sunken);
}

/* The Button's corner: the body cut, the teal triangle beside it. */
.flow-neolung {
  --btn-cut: 20px;
  background: transparent;
  color: var(--background);
  --btn-gap: 2px;
  position: relative;
  isolation: isolate;

  &::before,
  &::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }
  &::before {
    inset: 0;
    z-index: -1;
    border: 1px solid var(--btn-edge, transparent);
    background-image: linear-gradient(135deg, var(--btn-edge, transparent) calc(50% + 1px), transparent 0);
    background-origin: border-box;
    background-repeat: no-repeat;
    background-size: var(--btn-cut) var(--btn-cut);
    clip-path: polygon(var(--btn-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--btn-cut));
    transition:
      background-color 150ms,
      border-color 150ms;
  }
  &::after {
    top: 0;
    left: 0;
    width: max(0px, var(--btn-cut) - var(--btn-gap) * 1.4142);
    aspect-ratio: 1;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    transition:
      width 150ms ease-out,
      background-color 150ms;
  }
  &:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]) {
    --btn-gap: 0px;
  }
  @media (prefers-reduced-motion: reduce) {
    &::before,
    &::after {
      transition: none;
    }
  }
}

.flow-neolung::before {
  background-color: var(--foreground);
}

.flow-neolung::after {
  background-color: var(--active);
}

.flow-name {
  display: flex;
  flex-direction: column;
  font-size: 20px;
  line-height: 28px;
}

.flow-name span {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.flow-neolung .flow-name span {
  color: color-mix(in srgb, var(--background) 62%, transparent);
}

/* A report, drawn as lines of text. */
.flow-doc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--background);
  min-height: 132px;
}

.flow-line {
  display: block;
  height: 6px;
  width: 100%;
  background: var(--border);
}

.flow-line.short {
  width: 60%;
}

.flow-signed {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--status-success);
  background: var(--status-success-surface);
}

.flow-arrived {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.flow-arrived .flow-line {
  background: var(--active);
}

/* The way across: a dashed line, the report riding it, its label beneath. */
.flow-path {
  position: relative;
  height: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-path::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  border-top: 2px dashed var(--border-strong);
}

.flow-path::after {
  content: "";
  position: absolute;
  right: 4px;
  top: calc(50% - 6px);
  width: 10px;
  height: 12px;
  background: var(--border-strong);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.flow-card {
  position: absolute;
  left: 8px;
  top: calc(50% - 22px);
  width: 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  background: var(--background);
  box-shadow: 0 2px 12px rgb(12 10 9 / 0.15);
}

.flow-card .flow-line {
  height: 4px;
  background: var(--active);
}

.flow-label {
  position: absolute;
  top: calc(50% + 32px);
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* Once in view: the card travels across, then the report lands on the right. */
.js .alongside:not(.played) .flow-arrived {
  opacity: 0;
}

.js .alongside:not(.played) .flow-card {
  opacity: 0;
}

.js .alongside.played .flow-card {
  animation: carry 1600ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

.js .alongside.played .flow-arrived {
  animation: land 500ms ease-out 1500ms both;
}

@keyframes carry {
  0% {
    opacity: 0;
    left: 8px;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    left: calc(100% - 64px);
  }
}

@keyframes land {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* What you don't need, and what you have: crossed and ticked by the corner. */
.nots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 96px;
  margin-top: 24px;
}

.nots-head {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.nots ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 20px;
  line-height: 28px;
}

.nots ul:not(.haves) li {
  color: var(--text-secondary);
  text-decoration: line-through;
  text-decoration-color: var(--border-strong);
}

.haves li {
  position: relative;
  padding-left: 24px;
}

.haves li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 10px;
  height: 10px;
  background: var(--active);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* The app's real screens, framed lightly: they are pictures of a page. */
.screen {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 1px 2px rgb(12 10 9 / 0.06), 0 12px 40px rgb(12 10 9 / 0.1);
}

.screen figcaption {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.screens {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Checks as the app shows them, not to open: the small biopsy's block. */
.flags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flags li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  background: var(--check-medium-surface);
  font-size: 18px;
  line-height: 28px;
}

.flags .corner {
  background: var(--check-medium);
}

.flags .high {
  background: var(--check-high-surface);
}

.flags .high .corner {
  background: var(--check-high);
}

/* Warnings that open on their guidelines, coloured as the app colours them. */
.warnings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warnings details.medium {
  background: var(--check-medium-surface);
}

.warnings details.high {
  background: var(--check-high-surface);
}

.warnings summary {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 28px;
}

.warnings summary::-webkit-details-marker {
  display: none;
}

.warnings summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.warnings .medium .corner {
  background: var(--check-medium);
}

.warnings .high .corner {
  background: var(--check-high);
}

.w-kind {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.warnings ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px 38px;
}

.warnings li {
  display: flex;
  flex-direction: column;
}

.warnings a {
  color: var(--foreground);
  text-decoration: none;
}

.warnings a:hover {
  color: var(--text-secondary);
}

.warnings li span {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* A sequence: numbered in teal, left to right. */
.sequence {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}

/* Five steps fit on one line. */
.sequence-long {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.sequence li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sequence li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  line-height: 20px;
  color: var(--active);
}

.sequence strong {
  font-weight: inherit;
  font-size: 20px;
  line-height: 28px;
}

.sequence span:not(.icon) {
  color: var(--text-secondary);
}

/* With scripts on, items arrive as they scroll into view. */
.js .pairs li,
.js .pillars li,
.js .sequence li {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 600ms ease-out,
    transform 600ms ease-out;
}

.js .pairs li.seen,
.js .pillars li.seen,
.js .sequence li.seen {
  opacity: 1;
  transform: none;
}

h3 {
  font-size: 20px;
  line-height: 28px;
}

.close {
  padding: 144px clamp(16px, 4vw, 48px) 96px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.close h2 {
  max-width: 720px;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

/* ---- Questions we're asked ----------------------------------------------- */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px 96px;
  padding: 144px clamp(16px, 4vw, 48px) 0;
}

.faq h2 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq summary {
  position: relative;
  display: flex;
  padding: 16px 16px 16px 40px;
  list-style: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 28px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* The corner turns from closed to open, as the Button's closes on hover. */
.faq summary::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 25px;
  width: 10px;
  height: 10px;
  background: var(--active);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transition: transform 200ms ease-out;
}

.faq details[open] summary::before {
  transform: rotate(-90deg);
}

.faq summary:hover,
.faq details[open] summary {
  background: var(--surface-sunken);
}

.faq summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.faq details p {
  padding: 8px 16px 24px 40px;
  max-width: 720px;
  color: var(--text-secondary);
}

.faq details a {
  color: var(--foreground);
  text-underline-offset: 3px;
}

/* The Button, as the app draws it: ink with the teal corner; outline. */
.button {
  --btn-cut: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  color: var(--primary-foreground);
  text-decoration: none;
  white-space: nowrap;
  --btn-gap: 2px;
  position: relative;
  isolation: isolate;

  &::before,
  &::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }
  &::before {
    inset: 0;
    z-index: -1;
    border: 1px solid var(--btn-edge, transparent);
    background-image: linear-gradient(135deg, var(--btn-edge, transparent) calc(50% + 1px), transparent 0);
    background-origin: border-box;
    background-repeat: no-repeat;
    background-size: var(--btn-cut) var(--btn-cut);
    clip-path: polygon(var(--btn-cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--btn-cut));
    transition:
      background-color 150ms,
      border-color 150ms;
  }
  &::after {
    top: 0;
    left: 0;
    width: max(0px, var(--btn-cut) - var(--btn-gap) * 1.4142);
    aspect-ratio: 1;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    transition:
      width 150ms ease-out,
      background-color 150ms;
  }
  &:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]) {
    --btn-gap: 0px;
  }
  @media (prefers-reduced-motion: reduce) {
    &::before,
    &::after {
      transition: none;
    }
  }
}

.button::before {
  background-color: var(--primary);
}

.button:hover::before {
  background-color: color-mix(in srgb, var(--primary) 90%, transparent);
}

.button::after {
  background-color: var(--active);
}

.button-outline {
  --btn-edge: var(--border);
  color: var(--foreground);
}

.button-outline::before {
  background-color: var(--background);
}

.button-outline:hover::before {
  background-color: var(--accent);
}

.button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.note {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* ---- The footer: where to go next, the name, the small print ---------- */
.bottom {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding: 96px clamp(16px, 4vw, 48px) 32px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.foot-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px 96px;
}

.foot-claim {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.foot-claim > p {
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.2;
  max-width: 480px;
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.foot-cols ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.foot-head {
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.foot-cols a {
  text-decoration: none;
}

.foot-cols a:hover,
.foot-cols a:focus-visible {
  color: var(--text-secondary);
}

.foot-cols span {
  color: var(--text-secondary);
}

/* The name, as large as the page is wide, cut by the bottom edge. */
.foot-word {
  margin: 0 0 -0.34em;
  font-size: clamp(80px, 22vw, 380px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  user-select: none;
}

.foot-legal a {
  color: inherit;
  text-decoration: none;
}

.foot-legal a:hover,
.foot-legal a:focus-visible {
  color: var(--foreground);
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

/* ---- The pages beside the home page: a document, its contents beside it -- */
.doc {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 760px);
  gap: 48px 96px;
  padding: 136px clamp(16px, 4vw, 48px) 120px;
}

.doc-head {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
}

.doc-head h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.doc-lead {
  font-size: 20px;
  line-height: 30px;
  color: var(--text-secondary);
}

.doc-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 760px;
  padding: 16px;
  background: var(--check-medium-surface);
}

.doc-notice strong {
  font-weight: inherit;
}

.doc-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 20px;
}

.doc-toc p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.doc-toc ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-toc a {
  color: var(--text-secondary);
  text-decoration: none;
}

.doc-toc a:hover,
.doc-toc a:focus-visible {
  color: var(--foreground);
}

.doc-body {
  min-width: 0;
  font-size: 16px;
  line-height: 26px;
}

.doc-body > * + * {
  margin-top: 16px;
}

.doc-body h2 {
  margin-top: 64px;
  font-size: 28px;
  line-height: 36px;
  scroll-margin-top: 96px;
}

.doc-body h2:first-child {
  margin-top: 0;
}

.doc-body h3 {
  margin-top: 40px;
  font-size: 20px;
  line-height: 28px;
  scroll-margin-top: 96px;
}

.doc-body h4 {
  margin-top: 24px;
  font-size: 16px;
  line-height: 24px;
}

.doc-body ul,
.doc-body ol {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-body strong {
  font-weight: 600;
}

/* In running text a link is underlined, so it isn't told by colour alone. */
.doc-body a,
.doc-lead a {
  color: inherit;
  text-underline-offset: 3px;
}

.doc-body blockquote {
  margin: 24px 0;
  padding: 16px 16px 16px 20px;
  background: var(--check-medium-surface);
}

.doc-body code {
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  font-size: 14px;
  padding: 1px 4px;
  background: var(--surface-sunken);
}

.doc-body hr {
  display: none;
}

/* Tables: rows told apart by the sunken surface, not by lines. */
.doc-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

.doc-body th,
.doc-body td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  font-weight: inherit;
  color: var(--text-secondary);
}

.doc-body tbody tr:nth-child(odd) {
  background: var(--surface-sunken);
}

.trust section + section {
  margin-top: 64px;
}

.trust-measures {
  list-style: none;
  padding: 0 !important;
  gap: 16px !important;
}

.trust-measures li {
  display: flex;
  flex-direction: column;
}

.trust-measures span {
  color: var(--text-secondary);
}

/* A narrower screen: the report under the dictation. */
@media (max-width: 1180px) {
  .stage {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 16px 32px;
  }
  .ocular {
    width: max(160px, min(100%, calc(100vh - 420px)));
    width: max(160px, min(100%, calc(100svh - 420px)));
  }
  .report {
    grid-column: 2;
    grid-row: 3;
  }
  .report-title {
    display: none;
  }
  .report dl {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 8px 24px;
  }
}

@media (max-width: 1100px) {
  .top nav .section-link {
    display: none;
  }
  /* The interstitial panel goes under the article, not squeezed beside it. */
  .maker {
    grid-template-columns: minmax(0, 1fr);
  }
  .ild {
    grid-column: 1;
    grid-row: 2;
    position: static;
    max-width: 760px;
  }
}

@media (max-width: 860px) {
  .foot-top,
  .doc {
    grid-template-columns: 1fr;
  }
  .doc-toc {
    position: static;
    max-height: none;
  }
  .demo-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 88px 0 16px;
  }
  .demo-steps li {
    font-size: 18px;
    line-height: 26px;
  }
  .window {
    height: 100%;
  }
  .w-body {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    padding: 16px;
  }
  .w-panel:not(.now),
  .w-fields:not(.now),
  .w-said:not(.now) {
    display: none;
  }
  .w-fields dl {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  /* On a phone, one thing at a time: the fields once said, then only the two the rules point at. */
  .window[data-step="1"] .w-said,
  .window[data-step="3"] .w-field:not(.flagged) {
    display: none;
  }
  .w-said,
  .w-fields,
  .w-photo,
  .w-checks,
  .w-report {
    grid-column: 1;
    grid-row: auto;
  }
  .ai {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .sides {
    display: none;
  }
  .pairs li {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pairs .who {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    display: block;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-on-dark);
  }
  .maker {
    grid-template-columns: minmax(0, 1fr);
  }
  .ild {
    grid-column: 1;
    grid-row: 2;
    position: static;
  }
  .pull {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px 20px;
  }
  .pull .portrait {
    grid-row: 1;
  }
  .pull figcaption {
    grid-column: 1 / -1;
  }
  .maker {
    padding-top: 96px;
  }
  .hero {
    padding-top: 104px;
  }
  .for {
    padding-top: 96px;
  }
  .switch {
    top: 64px;
  }
  .switch button {
    font-size: 16px;
    padding: 0 14px;
  }
  .audience {
    gap: 72px;
  }
  .pillars,
  .part,
  .explorer,
  .rt-panel,
  .faq,
  .nots,
  .op-panel {
    grid-template-columns: minmax(0, 1fr);
  }
  .part:not(.part-wide) > .part-head {
    position: static;
  }
  .op-aside {
    position: static;
  }
  .op-switch button {
    font-size: 16px;
    padding: 0 14px;
  }
  .flow {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow-path {
    min-height: 96px;
  }
  .flow-path::before {
    left: 50%;
    right: auto;
    top: 8px;
    bottom: 8px;
    border-top: 0;
    border-left: 2px dashed var(--border-strong);
  }
  .flow-path::after {
    right: auto;
    left: calc(50% - 5px);
    top: auto;
    bottom: 2px;
    width: 12px;
    height: 10px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
  }
  .flow-card {
    display: none;
  }
  .flow-label {
    top: auto;
    left: calc(50% + 16px);
  }
  .part > :not(.part-head),
  .ex-panel {
    grid-column: 1;
    grid-row: auto;
  }
  /* On a narrow screen the choices scroll sideways, the answer below. */
  .ex-list {
    flex-direction: row;
    overflow-x: auto;
    margin: 0 calc(-1 * clamp(16px, 4vw, 48px));
    padding: 0 clamp(16px, 4vw, 48px);
  }
  .ex-list button {
    flex: none;
    max-width: 240px;
  }
  .ex-chips {
    flex-wrap: nowrap;
  }
  .pairs .does,
  .pairs .you {
    padding-left: 40px;
  }
  .pairs .you {
    font-size: 20px;
    line-height: 28px;
  }
  .pairs .you::before {
    display: none;
  }
}

/* A phone: the ocular, the caption, what you say, then the report, short. */
@media (max-width: 760px) {
  .top nav .link {
    display: none;
  }
  .foot-cols {
    grid-template-columns: 1fr 1fr;
  }
  .stage {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: repeat(4, auto);
    align-content: start;
    gap: 12px 16px;
    padding-top: 80px;
    padding-bottom: 16px;
  }
  .side {
    display: contents;
  }
  .turret {
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
  }
  .ocular {
    grid-column: 1;
    grid-row: 1;
    /* As large as fits with what follows it on the stage (the caption, the
       dictation, the report): about 480px of a phone's height. */
    width: max(120px, min(100%, 40vh, calc(100vh - 540px)));
    width: max(120px, min(100%, 40svh, calc(100svh - 540px)));
  }
  .captions {
    grid-column: 1 / span 2;
    grid-row: 2;
    margin: 0;
  }
  .caption {
    font-size: 16px;
    line-height: 24px;
  }
  .hint {
    display: none;
  }
  .dictation {
    grid-column: 1 / span 2;
    grid-row: 3;
    justify-self: start;
    font-size: 16px;
    line-height: 24px;
  }
  .report {
    grid-column: 1 / span 2;
    grid-row: 4;
    align-self: start;
    gap: 8px;
  }
  .report dl {
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
  }
  .report dt {
    display: none;
  }
}

/* A short phone: the report shows its checks and signature, not its fields. */
@media (max-width: 760px) and (max-height: 700px) {
  .report dl {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .ocular:not(.entered) {
    transform: none;
  }
  .js .ocular.entered {
    animation: none;
  }
  .report [data-field],
  .checks li,
  .signed,
  .mic,
  .captions li,
  .js .pairs li,
  .js .pairs .you,
  .js .pairs .you::before,
  .js .pillars li,
  .js .sequence li,
  .js .rt-panel .rt-bar {
    transition: none;
    animation: none !important;
  }
}
