/* VoicePal v2. Hero hierarchy by request (TERRA reference): action / brand / account bar, one line, the headline, a media stage with report cards.
   Signature: the sound meadow, a field of waveform strands that moves like grass, with VoicePal's own report metrics in glass on top.
   Critique: one bold moment (the stage); everything below is quiet type on a light sheet. Waived: the hero report uses labelled example values (a depiction of the product, not a claim). test-flow.css is the production pop-up CSS, copied as-is. */

:root {
  --frame: #0b2a31;
  --frame-raised: #10363e;
  --paper: #eceeec;
  --surface: #f8f9f7;
  --white: #ffffff;
  --ink: #0f2b31;
  --ink-soft: #52666a;
  --line: #d3dad7;
  --signal: #1f9e77;
  --mint: #8ff0c4;
  --on-dark: #eef6f3;
  --on-dark-soft: rgba(238, 246, 243, 0.68);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --glass-lo: rgba(6, 40, 48, 0.46);
  --glass-line: rgba(255, 255, 255, 0.2);
  --field: rgba(255, 255, 255, 0.06);
  --shade: rgba(5, 34, 42, 0.55);
  --stage-top: #0c3a43;
  --stage-bottom: #05222a;
  --stage-glow: rgba(120, 230, 180, 0.2);
  --flag: #ff8f7e;
  --meadow-far: 40, 120, 110;
  --meadow-near: 143, 240, 196;
  --meadow-glow: 120, 230, 180;
  --meadow-light: 236, 255, 246;
  --acc-1: #8ff0c4;
  --acc-2: #ffd27a;
  --acc-3: #ff8f7e;
  --acc-4: #9cc8ff;
  --acc-5: #c9b6ff;
  --acc-6: #7fe0e8;
  --tone-1: #ffc1c2;
  --tone-2: #ffbfa3;
  --tone-3: #54c6f2;
  --tone-4: #ffb7b5;
  --spot: rgba(255, 255, 255, 0.38);

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --wrap: 128rem;
  --gutter: clamp(2rem, 4vw, 4.8rem);
  --r-sheet: 2.2rem;
  --r-panel: 1.4rem;
  --r-card: 0.8rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Logo-blue theme: the logo's azure (#0a80dd) and navy (#0a1f2c) carried through the page */
:root[data-theme="blue"] {
  --frame: #0a1d2c;
  --frame-raised: #112c42;
  --paper: #eceff2;
  --surface: #f8f9fb;
  --ink: #0b2133;
  --ink-soft: #4d6072;
  --line: #d2d9e1;
  --signal: #0a80dd;
  --mint: #7cc4ff;
  --on-dark: #eef5fc;
  --on-dark-soft: rgba(238, 245, 252, 0.68);
  --glass-lo: rgba(6, 26, 46, 0.46);
  --shade: rgba(4, 18, 32, 0.55);
  --stage-top: #0e3355;
  --stage-bottom: #061626;
  --stage-glow: rgba(70, 160, 255, 0.22);
  --acc-1: #7cc4ff;
  --meadow-far: 30, 80, 140;
  --meadow-near: 124, 196, 255;
  --meadow-glow: 60, 150, 255;
  --meadow-light: 236, 246, 255;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 62.5%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 2.4rem;
}

body {
  overflow-x: clip;
  background: var(--frame);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.7rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

li {
  list-style: none;
}

/* Hidden means hidden, even for elements whose own rules set a display value */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.sheet {
  margin: 1rem;
  border-radius: var(--r-sheet);
  background: var(--paper);
  overflow: clip;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* ---------- Controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 4.2rem;
  padding: 0 1.8rem;
  border: 1px solid transparent;
  border-radius: var(--r-card);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn--ink {
  background: var(--ink);
  color: var(--paper);
}

.btn--ink:hover {
  background: var(--frame-raised);
}

.btn--mint {
  background: var(--mint);
  color: var(--frame);
}

.btn--mint:hover {
  background: var(--white);
}

.btn:active {
  transform: translateY(1px);
}

/* ---------- Top bar (action / brand / account) ---------- */

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1.6rem;
}

.topbar__start {
  justify-self: start;
}

.topbar__end {
  justify-self: end;
}

.brand-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.5rem 0.5rem 0.5rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 2.8rem;
  height: 2.8rem;
}

.menu > summary {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.6rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.5rem;
  cursor: pointer;
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary:hover {
  background: var(--frame-raised);
}

.menu__panel {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: 50%;
  width: 26rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 0 2.4rem 4.8rem -2rem var(--shade);
  transform: translateX(-50%);
}

.menu__panel a {
  display: block;
  padding: 1rem 1.2rem;
  border-radius: 0.6rem;
  font-size: 1.5rem;
}

.menu__panel a:hover {
  background: var(--paper);
}

.menu__account {
  display: none;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.account {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 4.2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  font-size: 1.45rem;
  font-weight: 600;
}

.account a {
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
}

.account a:hover {
  background: var(--paper);
}

.account span {
  color: var(--ink-soft);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-rows: auto auto auto minmax(36rem, 1fr);
  min-height: calc(100svh - 2rem);
  padding: 1.6rem 1rem 1rem;
}

.hero .topbar {
  padding: 0 0.6rem;
}

.hero__intro {
  max-width: 34ch;
  margin: clamp(3.2rem, 6vh, 6.4rem) auto 0;
  color: var(--ink-soft);
  font-size: 1.55rem;
  line-height: 1.45;
  text-align: center;
  text-wrap: balance;
}

.hero__title {
  max-width: 13.5em;
  min-width: 0;
  margin: 1.4rem auto clamp(2.8rem, 5vh, 5.2rem);
  font-size: clamp(4.2rem, 7.2vw, 9.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: break-word;
}

/* The stage: canvas meadow, captions, report */
.stage-slot {
  position: relative;
  min-height: 36rem;
}

.stage {
  position: absolute;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-panel);
  background: radial-gradient(90% 70% at 50% 100%, var(--stage-glow), transparent 70%),
    linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
  color: var(--on-dark);
}

.stage canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, var(--shade)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.55;
  pointer-events: none;
}

.stage__content {
  position: absolute;
  inset: 0;
}

.stage__caption {
  position: absolute;
  top: 50%;
  max-width: 11ch;
  font-size: clamp(1.8rem, 2vw, 2.6rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-align: center;
  transform: translateY(-50%);
}

.stage__caption--start {
  left: clamp(2.4rem, 7vw, 12rem);
}

.stage__caption--end {
  right: clamp(2.4rem, 7vw, 12rem);
}

.report {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  width: min(44rem, 100% - 3.2rem);
  transform: translate(-50%, -50%);
}

.report__card {
  display: flex;
  flex-direction: column;
  min-height: 17rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo));
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  backdrop-filter: blur(22px) saturate(130%);
}

.report__card--wide {
  grid-column: 1 / -1;
  min-height: 12rem;
}

.report__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.4rem;
}

.report__top span:last-child {
  color: var(--on-dark-soft);
  font-size: 1.2rem;
}

.report__value {
  margin-top: auto;
  font-size: clamp(4rem, 4.2vw, 5.6rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}

.report__card--wide .report__value {
  font-size: clamp(2.4rem, 2.6vw, 3.2rem);
  letter-spacing: -0.03em;
}

.report__note {
  margin-top: 0.6rem;
  color: var(--on-dark-soft);
  font-size: 1.25rem;
}

.report__foot {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  color: var(--on-dark-soft);
  font-size: 1.2rem;
  text-align: center;
}

.hero.is-cinema {
  position: relative;
}

.hero.is-cinema .stage-slot {
  position: static;
}

.hero.is-cinema .stage {
  z-index: 0;
  border-radius: 0;
  clip-path: inset(var(--ct, 0) var(--cr, 0) var(--cb, 0) var(--cl, 0) round var(--crad, 0));
}

.hero.is-cinema .hero__intro,
.hero.is-cinema .hero__title {
  position: relative;
  z-index: 1;
}

.hero.is-cinema .stage__content {
  transform: translateY(var(--shift, 0));
}

.hero.is-cinema .topbar .btn--ink {
  box-shadow: 0 0 0 1px var(--glass-line);
}

/* One orchestrated load moment; content stays visible without scripting. */
.js .hero__intro,
.js .hero__title,
.js .report {
  animation: rise 0.9s var(--ease) both;
}

.js .hero__title {
  animation-delay: 0.08s;
}

.js .report {
  animation-name: rise-centre;
  animation-delay: 0.3s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.6rem);
  }
}

@keyframes rise-centre {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 2rem));
  }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(8rem, 11vw, 14rem) 0;
}

.section--rule {
  border-top: 1px solid var(--line);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 3.2rem 6rem;
  align-items: end;
  margin-bottom: clamp(4rem, 6vw, 7.2rem);
}

.h2 {
  min-width: 0;
  font-size: clamp(3.4rem, 4.8vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.lede {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.9rem;
  line-height: 1.5;
}

/* Patterns index */
.patterns {
  border-top: 1px solid var(--line);
}

.pattern {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr);
  gap: 1.2rem 3.2rem;
  align-items: baseline;
  padding: 3.2rem 0;
  border-bottom: 1px solid var(--line);
}

.pattern h3 {
  font-size: clamp(2.6rem, 3vw, 3.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.pattern p {
  max-width: 44ch;
  color: var(--ink-soft);
}

.pattern__route {
  justify-self: end;
  font-size: 1.45rem;
  text-align: right;
}

.pattern-visual {
  display: none;
}

.js .patterns-story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 4rem 8rem;
  align-items: start;
}

.js .pattern-visual {
  position: sticky;
  top: calc(50vh - 16rem);
  z-index: 2;
  display: block;
  padding: 2.4rem;
  border-radius: var(--r-panel);
  background: linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
  color: var(--on-dark);
}

.pattern-visual__svg {
  display: block;
  width: 100%;
  height: auto;
}

.pattern-visual__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 1.6rem;
  margin-top: 1.6rem;
}

.pattern-visual__name {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pattern-visual__flag {
  color: var(--flag);
  font-size: 1.4rem;
}

.js .patterns-story .pattern {
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-height: 44vh;
  padding: 6rem 0;
  transition: opacity 0.4s ease;
}

.js .patterns-story .pattern__route {
  justify-self: start;
  text-align: left;
}

.patterns-story.is-live .pattern:not(.is-active) {
  opacity: 0.32;
}

/* Patterns as a pinned listening room (wide screens, motion allowed): built by story.js */
#patterns.is-listening {
  padding: 0;
}

.listen {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100vh;
  overflow: hidden;
  padding: 4rem var(--gutter) 3.2rem;
  /* the top glow continues the meadow's, so the hand-off from the hero has no seam */
  background: radial-gradient(90% 30% at 50% -6%, var(--stage-glow), transparent 70%),
    radial-gradient(70% 60% at 50% 115%, var(--stage-glow), transparent 70%),
    linear-gradient(180deg, var(--stage-bottom), var(--stage-top) 60%, var(--stage-bottom));
  color: var(--on-dark);
}

.listen__intro {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
}

.listen__head {
  display: inline-block;
  transform-origin: left top;
  will-change: transform;
}

.listen__title {
  font-size: clamp(3.2rem, 3.4vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.listen__lede {
  margin-top: 1.2rem;
  color: var(--on-dark-soft);
  font-size: 1.6rem;
}

.listen__stage {
  position: relative;
  align-self: center;
  width: min(96rem, 100%, (100vh - 46rem) * 2.18);
  margin: 0 auto;
}

.listen__wave svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.listen__playhead {
  stroke: var(--on-dark);
  stroke-width: 1.5;
}

.listen__playhead-glow {
  stroke: var(--mint);
  stroke-width: 14;
  stroke-opacity: 0.14;
}

.listen__notes span {
  position: absolute;
  padding: 0.4rem 1rem;
  border-radius: 99rem;
  background: var(--flag);
  color: var(--frame);
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(0.8rem);
  transition: opacity 0.3s ease, transform 0.4s var(--ease);
}

.listen__notes span.is-below {
  transform: translate(-50%, 0) translateY(-0.8rem);
}

.listen__notes span.is-on {
  opacity: 1;
  transform: translate(-50%, -100%);
}

.listen__notes span.is-below.is-on {
  transform: translate(-50%, 0);
}

.listen__readout {
  position: absolute;
  top: -3.6rem;
  right: 0;
  color: var(--on-dark-soft);
  font-size: 1.4rem;
}

.listen__readout b {
  color: var(--flag);
  font-weight: 600;
}

.listen__copy {
  position: relative;
  width: min(var(--wrap), 100%);
  min-height: 14rem;
  margin: 0 auto;
}

.listen__item {
  position: absolute;
  inset: 0 0 auto 0;
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 1rem 6rem;
  align-items: end;
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.5s ease, transform 0.6s var(--ease);
  pointer-events: none;
}

.listen__item.is-active {
  opacity: 1;
  transform: none;
}

.listen__item h3 {
  min-width: 0;
  font-size: clamp(4.4rem, 5.4vw, 7.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  overflow-wrap: break-word;
}

.listen__item p {
  color: var(--on-dark-soft);
  font-size: 1.8rem;
}

.listen__item span {
  display: block;
  margin-top: 0.8rem;
  color: var(--mint);
  font-size: 1.5rem;
}

.listen__chapters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  width: min(var(--wrap), 100%);
  margin: 2.4rem auto 0;
}

.listen__chapters button {
  position: relative;
  padding: 1.2rem 0 0;
  border: 0;
  background: none;
  color: var(--on-dark-soft);
  font-size: 1.4rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s ease;
}

.listen__chapters button:hover,
.listen__chapters button.is-active {
  color: var(--on-dark);
}

.listen__chapters i {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  background: var(--glass-line);
}

.listen__chapters i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mint);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

/* How the test works: four steps, each with a small scene of that step */
.how__progress {
  display: none;
}

.how__track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.how-panel {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  padding: 1.2rem 1.2rem 2.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.how-panel__text {
  padding: 0 1.2rem;
}

.how-panel__num {
  display: block;
  font-size: 5.6rem;
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.how-panel h3 {
  margin-top: 1.6rem;
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.how-panel p {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 1.55rem;
}

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: clamp(20rem, 30vh, 26rem);
  overflow: hidden;
  padding: 2rem;
  border-radius: var(--r-card);
  background: linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
  color: var(--on-dark);
}

.scene__title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--on-dark-soft);
  font-size: 1.35rem;
}

.scene__rec {
  color: var(--flag);
  font-size: 0.9rem;
}

.scene__read {
  font-size: 1.85rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.js .scene__read .word {
  opacity: 0.3;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.js .scene__read .word.is-read {
  opacity: 1;
  color: var(--mint);
}

.scene__field {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  color: var(--on-dark-soft);
  font-size: 1.35rem;
}

.scene__field i,
.scene__meter i {
  position: relative;
  display: block;
  overflow: hidden;
}

.scene__field i {
  height: 3.2rem;
  border: 1px solid var(--glass-line);
  border-radius: 0.6rem;
  background: var(--field);
}

.scene__field i::after {
  content: "";
  position: absolute;
  top: calc(50% - 0.4rem);
  left: 1rem;
  width: var(--w, 50%);
  height: 0.8rem;
  border-radius: 0.4rem;
  background: var(--on-dark-soft);
  transform: scaleX(var(--p, 1));
  transform-origin: left;
}

.scene__field:nth-of-type(1) i { --w: 18%; }
.scene__field:nth-of-type(2) i { --w: 34%; }
.scene__field:nth-of-type(3) i { --w: 78%; }
.scene__field:nth-of-type(4) i { --w: 56%; }

.scene__meter {
  display: grid;
  gap: 0.6rem;
  color: var(--on-dark-soft);
  font-size: 1.35rem;
}

.scene__meter i {
  height: 0.8rem;
  border-radius: 99rem;
  background: var(--field);
}

.scene__meter i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--mint);
  transform: scaleX(var(--p, 1));
  transform-origin: left;
}

.scene__report {
  display: grid;
  gap: 0.8rem;
}

.scene__report div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--glass-line);
  border-radius: 0.6rem;
  background: var(--field);
  font-size: 1.45rem;
}

.scene__report dt {
  color: var(--on-dark-soft);
}

.scene__report dd {
  font-weight: 600;
}

.scene__download {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.8rem;
  margin-top: auto;
  padding: 1rem 1.4rem;
  border-radius: 0.6rem;
  background: var(--mint);
  color: var(--frame);
  font-size: 1.4rem;
  font-weight: 600;
}

.scene__done {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  color: var(--mint);
  font-size: 3.2rem;
  opacity: var(--p, 1);
  transform: scale(var(--p, 1));
}

/* Sideways scroll, switched on by story.js on wide screens with motion allowed */
.how.is-horizontal .how__pin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

.how.is-horizontal {
  padding-top: 0;
}

.how.is-horizontal .section__head {
  margin-bottom: 3.2rem;
}

.how.is-horizontal .how__progress {
  display: block;
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  height: 2px;
  margin: 0 auto 2.4rem;
  background: var(--line);
}

.how__progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

.how.is-horizontal .how__track {
  display: flex;
  width: max-content;
  margin: 0;
  padding-inline: max(var(--gutter), (100vw - var(--wrap)) / 2);
  gap: 2rem;
}

.how.is-horizontal .how-panel {
  width: min(56rem, 42vw);
}

.flow-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem 2.4rem;
  margin-top: 3.2rem;
  color: var(--ink-soft);
  font-size: 1.5rem;
}

/* After the test */
.after {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 4rem 8rem;
}

.after__aside {
  position: sticky;
  top: 3.2rem;
  align-self: start;
  perspective: 120rem;
}

.after__head .lede {
  margin-top: 2.4rem;
}

.feature {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1fr);
  gap: 2rem;
  padding: 2.8rem 0;
  border-top: 1px solid var(--line);
}

.feature:last-child {
  border-bottom: 1px solid var(--line);
}

.features {
  position: relative;
}

/* Room below the last row so it reaches the middle of the screen while the showcase still holds */
.js .features {
  padding-bottom: 24vh;
}

.features__spine {
  display: none;
}

.js .features__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3.2rem;
  display: block;
  width: 2px;
  background: var(--line);
}

.features__spine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--signal);
  transform: scaleY(var(--p, 0));
  transform-origin: top;
}

.feature.is-active .feature__icon {
  background: var(--accent, var(--mint));
  color: var(--ink);
  transform: scale(1.08);
}



.feature__icon {
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.4s var(--ease);
  display: grid;
  place-items: center;
  width: 4.8rem;
  height: 4.8rem;
  border-radius: var(--r-card);
  background: var(--ink);
  color: var(--mint);
  font-size: 1.8rem;
}

.feature h3 {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.feature p {
  margin-top: 0.6rem;
  max-width: 52ch;
  color: var(--ink-soft);
}


/* Showcase: a live preview of whichever feature is in view */
@property --glow {
  syntax: "<color>";
  inherits: true;
  initial-value: #8ff0c4;
}

.showcase {
  display: none;
}

.js .showcase {
  --glow: var(--acc-1);
  position: relative;
  display: block;
  height: clamp(32rem, 50vh, 42rem);
  margin-top: 3.2rem;
  overflow: hidden;
  border-radius: var(--r-panel);
  background: radial-gradient(80% 70% at 85% 100%, color-mix(in srgb, var(--glow) 26%, transparent), transparent 70%),
    linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
  color: var(--on-dark);
  transform-style: preserve-3d;
  transition: --glow 0.8s ease;
}

.showcase__rings {
  position: absolute;
  z-index: 3;
  right: -6rem;
  bottom: -6rem;
  width: 26rem;
  height: 26rem;
  pointer-events: none;
}

.showcase__rings span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--glow);
  border-radius: 50%;
  opacity: 0;
}

.showcase.is-inview .showcase__rings span {
  animation: ring 4.5s ease-out infinite;
}

.showcase__rings span:nth-child(2) { animation-delay: 1.5s; }
.showcase__rings span:nth-child(3) { animation-delay: 3s; }

@keyframes ring {
  from {
    opacity: 0.55;
    transform: scale(0.2);
  }
  to {
    opacity: 0;
    transform: scale(1.6);
  }
}

.showcase__scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 2.4rem;
  /* Opaque, so the incoming scene fully covers the outgoing one */
  background: radial-gradient(80% 70% at 85% 100%, color-mix(in srgb, var(--glow) 26%, transparent), transparent 70%),
    linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
  visibility: hidden;
  clip-path: circle(0% at var(--ox, 100%) var(--oy, 50%));
}

.showcase__scene.is-active {
  z-index: 2;
  visibility: visible;
  clip-path: circle(150% at var(--ox, 100%) var(--oy, 50%));
  transition: clip-path 0.85s cubic-bezier(0.7, 0, 0.2, 1);
}

.showcase__scene.is-leaving {
  visibility: visible;
  clip-path: circle(150% at var(--ox, 100%) var(--oy, 50%));
  transition: none;
}

.showcase__scene.is-active [data-pop] {
  animation: pop 0.7s var(--ease) both;
  animation-delay: calc(0.22s + var(--d, 0) * 0.08s);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(1.4rem);
  }
}

.sc-label {
  color: var(--on-dark-soft);
  font-size: 1.35rem;
}

.sc-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.4rem;
  border-radius: 0.6rem;
  background: var(--glow);
  color: var(--frame);
  font-size: 1.4rem;
  font-weight: 600;
}

.sc-btn--wide {
  align-self: stretch;
  justify-content: center;
}

.sc-chip {
  padding: 0.4rem 1rem;
  border: 1px solid var(--glass-line);
  border-radius: 99rem;
  font-size: 1.25rem;
}

/* 1. Phonetics */
.sc-phon {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 2.4rem;
  align-items: center;
}

.sc-donut {
  position: relative;
}

.sc-donut svg {
  display: block;
  width: 100%;
  transform: rotate(-90deg);
}

.sc-donut circle {
  fill: none;
  stroke-width: 14;
}

.sc-donut__track {
  stroke: var(--field);
}

.sc-donut__seg {
  stroke: var(--c);
  stroke-dasharray: var(--len) calc(100 - var(--len));
  stroke-dashoffset: var(--off);
}

.showcase__scene.is-active .sc-donut__seg {
  animation: donut 1.1s var(--ease) both 0.35s;
}

@keyframes donut {
  from {
    stroke-dasharray: 0 100;
  }
}

.sc-donut__centre {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: var(--on-dark-soft);
  font-size: 1.15rem;
  text-align: center;
}

.sc-donut__centre b {
  color: var(--on-dark);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.sc-keys {
  display: grid;
  gap: 1rem;
  font-size: 1.45rem;
}

.sc-keys li {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sc-keys li::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  background: var(--c);
}

.sc-reading {
  margin-top: auto;
  color: var(--on-dark-soft);
  font-size: 1.5rem;
  line-height: 1.5;
}

.sc-reading mark {
  background: none;
  color: var(--on-dark);
  text-decoration: underline wavy var(--acc-3);
  text-underline-offset: 0.35em;
}

/* 2. Courses */
.sc-lesson {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: var(--field);
}

.sc-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 30%, var(--frame)));
  color: var(--frame);
  font-size: 1.3rem;
}

.sc-lesson b {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
}

.sc-lesson span {
  color: var(--on-dark-soft);
  font-size: 1.25rem;
}

.sc-bar {
  position: relative;
  display: block;
  height: 0.4rem;
  margin-top: 0.8rem;
  overflow: hidden;
  border-radius: 99rem;
  background: var(--field);
}

.sc-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glow);
  transform: scaleX(var(--v));
  transform-origin: left;
}

.showcase__scene.is-active .sc-bar::after {
  animation: grow 1.2s var(--ease) both 0.6s;
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

/* 3. Exercise */
.sc-ex {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.6rem;
  flex: 1;
  min-height: 0;
}

.sc-pose {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: var(--field);
}

.sc-pose svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 1.6rem 1rem 3.6rem;
}

.sc-pose__bones path {
  fill: none;
  stroke: var(--glow);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sc-pose__joints circle {
  fill: var(--on-dark);
}

.sc-pose__joints .sc-pose__head {
  fill: none;
  stroke: var(--glow);
  stroke-width: 3;
}

.showcase__scene.is-active .sc-pose__bones path {
  stroke-dasharray: 120;
  animation: draw 1.4s var(--ease) both 0.4s;
}

@keyframes draw {
  from {
    stroke-dashoffset: 120;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.sc-pose__scan {
  position: absolute;
  inset: 0 0 auto;
  height: 30%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--glow) 22%, transparent));
  border-bottom: 1px solid var(--glow);
}

.showcase.is-inview .is-active .sc-pose__scan {
  animation: scan 2.6s ease-in-out infinite alternate;
}

@keyframes scan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(240%);
  }
}

.sc-pose__tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  border-radius: 99rem;
  background: var(--glow);
  color: var(--frame);
  font-size: 1.2rem;
  font-weight: 600;
}

.sc-mantra {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.6rem;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: var(--field);
}

.sc-mantra__title {
  color: var(--on-dark-soft);
  font-size: 1.3rem;
}

.sc-marquee {
  overflow: hidden;
  font-size: 1.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.sc-marquee span {
  display: inline-block;
}

.showcase.is-inview .is-active .sc-marquee span {
  animation: marquee 9s linear infinite;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.sc-eq {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 4.8rem;
  margin-top: auto;
}

.sc-eq i {
  flex: 1;
  height: 100%;
  border-radius: 0.3rem;
  background: var(--glow);
  transform-origin: bottom;
  transform: scaleY(0.5);
}

.showcase.is-inview .is-active .sc-eq i {
  animation: eq 1.1s ease-in-out infinite alternate;
}

.showcase.is-inview .is-active .sc-eq i:nth-child(3n) { animation-duration: 0.8s; }
.showcase.is-inview .is-active .sc-eq i:nth-child(3n + 1) { animation-duration: 1.4s; animation-delay: -0.4s; }
.showcase.is-inview .is-active .sc-eq i:nth-child(4n) { animation-delay: -0.7s; }

@keyframes eq {
  from {
    transform: scaleY(0.15);
  }
  to {
    transform: scaleY(1);
  }
}

.sc-play {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: var(--glow);
  color: var(--frame);
  font-size: 1.2rem;
}

/* 4. Report */
.sc-doc {
  display: grid;
  gap: 1rem;
  padding: 2rem;
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2rem 4rem -2rem var(--shade);
  transform: rotate(-1.5deg);
}

.showcase__scene.is-active .sc-doc {
  animation: paper 0.9s var(--ease) both 0.25s;
}

@keyframes paper {
  from {
    opacity: 0;
    transform: translateY(4rem) rotate(4deg);
  }
}

.sc-doc b {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sc-line {
  display: block;
  width: var(--w);
  height: 0.6rem;
  border-radius: 99rem;
  background: var(--line);
}

.sc-doc__row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.35rem;
}

.sc-doc__row span:last-child {
  font-weight: 600;
}

.sc-file {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  font-size: 1.4rem;
}

.sc-file > i {
  color: var(--glow);
  font-size: 2.2rem;
}

.sc-file .sc-btn {
  margin-left: auto;
}

/* 5. Parent access */
.sc-uid {
  display: grid;
  gap: 1rem;
  color: var(--on-dark-soft);
  font-size: 1.35rem;
}

.sc-uid__digits {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.6rem;
}

.sc-uid__digits i {
  display: grid;
  place-items: center;
  height: 4.8rem;
  border: 1px solid var(--glass-line);
  border-radius: 0.6rem;
  background: var(--field);
  color: var(--on-dark);
  font-size: 2.2rem;
  font-style: normal;
  font-weight: 600;
}

.showcase__scene.is-active .sc-uid__digits i {
  animation: type 0.3s steps(1) both;
}

.sc-uid__digits i:nth-child(1) { animation-delay: 0.5s; }
.sc-uid__digits i:nth-child(2) { animation-delay: 0.62s; }
.sc-uid__digits i:nth-child(3) { animation-delay: 0.74s; }
.sc-uid__digits i:nth-child(4) { animation-delay: 0.86s; }
.sc-uid__digits i:nth-child(5) { animation-delay: 0.98s; }
.sc-uid__digits i:nth-child(6) { animation-delay: 1.1s; }
.sc-uid__digits i:nth-child(7) { animation-delay: 1.22s; }
.sc-uid__digits i:nth-child(8) { animation-delay: 1.34s; }

@keyframes type {
  from {
    color: transparent;
    border-color: var(--glow);
  }
}

.sc-ring {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-top: auto;
  font-size: 1.4rem;
}

.sc-ring svg {
  width: 6.4rem;
  flex: none;
  transform: rotate(-90deg);
}

.sc-ring circle {
  fill: none;
  stroke-width: 7;
}

.sc-ring__track {
  stroke: var(--field);
}

.sc-ring__fill {
  stroke: var(--glow);
  stroke-dasharray: 64 36;
  stroke-linecap: round;
}

.showcase__scene.is-active .sc-ring__fill {
  animation: donut 1.4s var(--ease) both 0.9s;
}

.sc-ring b {
  display: block;
  font-size: 2.4rem;
  font-weight: 600;
}

/* 6. Nearby */
.sc-map {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: var(--field);
}

.sc-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sc-map path {
  fill: none;
  stroke: var(--glass-line);
  stroke-width: 6;
}

.sc-me {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 1.4rem;
  height: 1.4rem;
  margin: -0.7rem 0 0 -0.7rem;
  border: 3px solid var(--on-dark);
  border-radius: 50%;
  background: var(--acc-4);
  box-shadow: 0 0 0 0 var(--acc-4);
}

.showcase.is-inview .is-active .sc-me {
  animation: locate 2s ease-out infinite;
}

@keyframes locate {
  to {
    box-shadow: 0 0 0 2.4rem transparent;
  }
}

.sc-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--glow);
  font-size: 2.6rem;
  transform: translate(-50%, -100%);
}

.showcase__scene.is-active .sc-pin {
  animation: drop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  animation-delay: calc(0.3s + var(--d) * 0.15s);
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translate(-50%, -260%);
  }
}

.sc-place {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--glass-line);
  border-radius: 0.6rem;
  background: var(--field);
  color: var(--on-dark-soft);
  font-size: 1.4rem;
}

.sc-place b {
  margin-right: 0.6rem;
  color: var(--on-dark);
  font-weight: 600;
}

/* After the test as a self-assembling dashboard (wide screens, motion allowed): built by story.js */
#after.is-assembling {
  padding: 0;
}

.assembly {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(60% 50% at 50% 55%, var(--stage-glow), transparent 70%),
    linear-gradient(180deg, var(--stage-bottom), var(--stage-top) 55%, var(--stage-bottom));
  color: var(--on-dark);
}

.assembly__title {
  position: absolute;
  top: 4rem;
  left: var(--gutter);
  z-index: 3;
  font-size: clamp(3.2rem, 3.4vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.assembly__frame {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  perspective: 2400px;
  will-change: transform;
}

.assembly__grid {
  position: relative;
  transform-origin: 50% 60%;
  transform-style: preserve-3d;
}

.assembly__tile {
  position: absolute;
  width: 520px;
  height: 420px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-panel);
  background: radial-gradient(80% 70% at 85% 100%, color-mix(in srgb, var(--glow) 24%, transparent), transparent 70%),
    linear-gradient(180deg, var(--stage-top), var(--stage-bottom));
  box-shadow: 0 3rem 6rem -3rem var(--shade);
  transition: filter 0.5s ease, border-color 0.5s ease;
  will-change: transform, opacity;
}

.assembly__tile.is-dim {
  filter: brightness(0.3) saturate(0.5);
}

/* A dark fade behind the caption column so the text never sits on a busy tile */
.assembly::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, var(--stage-bottom) 0%, color-mix(in srgb, var(--stage-bottom) 92%, transparent) 30%, transparent 52%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.assembly.is-touring::after {
  opacity: 1;
}

.assembly__tile .showcase__scene {
  position: absolute;
  inset: 0;
  visibility: visible;
  clip-path: none;
  background: none;
}

.assembly.is-touring .assembly__tile:not(.is-dim) {
  border-color: var(--glow);
}

/* Looping details run on the tile in focus */
.assembly .is-active .sc-pose__scan {
  animation: scan 2.6s ease-in-out infinite alternate;
}

.assembly .is-active .sc-marquee span {
  animation: marquee 9s linear infinite;
}

.assembly .is-active .sc-eq i {
  animation: eq 1.1s ease-in-out infinite alternate;
}

.assembly .is-active .sc-eq i:nth-child(3n) { animation-duration: 0.8s; }
.assembly .is-active .sc-eq i:nth-child(3n + 1) { animation-duration: 1.4s; animation-delay: -0.4s; }

.assembly .is-active .sc-me {
  animation: locate 2s ease-out infinite;
}

.assembly__captions {
  position: absolute;
  top: 50%;
  left: var(--gutter);
  z-index: 3;
  width: min(34rem, 30vw);
  transform: translateY(-50%);
}

.assembly__caption {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(-50%) translateX(-2rem);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.6s var(--ease);
  pointer-events: none;
}

.assembly__caption.is-active {
  opacity: 1;
  transform: translateY(-50%);
}

.assembly__caption .feature__icon {
  margin-bottom: 2.4rem;
  background: var(--accent);
  color: var(--ink);
}

.assembly__caption h3 {
  font-size: clamp(3.2rem, 3.4vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.assembly__caption p {
  margin-top: 1.6rem;
  color: var(--on-dark-soft);
  font-size: 1.8rem;
}

/* The finale line sits centred on the page, between the title and the dashboard */
.assembly__caption--finale {
  left: calc(50vw - var(--gutter));
  width: 90vw;
  max-width: 90rem;
  text-align: center;
}

.assembly__caption--finale,
.assembly__caption--finale.is-active {
  top: calc(13rem - 50vh);
}

.assembly__caption--finale {
  transform: translate(-50%, -50%) translateY(1.6rem);
}

.assembly__caption--finale.is-active {
  transform: translate(-50%, -50%);
}

.assembly__caption--finale h3 {
  color: var(--mint);
  font-size: clamp(2rem, 1.8vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.assembly__dots {
  position: absolute;
  bottom: 3.2rem;
  left: 50%;
  z-index: 3;
  display: flex;
  gap: 0.8rem;
  transform: translateX(-50%);
}

.assembly__dots i {
  width: 2.4rem;
  height: 0.3rem;
  border-radius: 99rem;
  background: var(--glass-line);
  transition: background-color 0.3s ease, width 0.3s ease;
}

.assembly__dots i.is-active {
  width: 4.8rem;
  background: var(--mint);
}

/* The dashboard on narrow screens: caption on top, focused tile below */
.assembly.is-narrow .assembly__title {
  top: 2.4rem;
  font-size: 2.6rem;
}

.assembly.is-narrow::after {
  background: linear-gradient(180deg, var(--stage-bottom) 0%, color-mix(in srgb, var(--stage-bottom) 92%, transparent) 30%, transparent 44%);
}

.assembly.is-narrow .assembly__captions {
  top: 7.6rem;
  right: var(--gutter);
  width: auto;
  transform: none;
}

.assembly.is-narrow .assembly__caption {
  transform: translateY(1.2rem);
}

.assembly.is-narrow .assembly__caption.is-active {
  transform: none;
}

.assembly.is-narrow .assembly__caption .feature__icon {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.2rem;
  font-size: 1.6rem;
}

.assembly.is-narrow .assembly__caption h3 {
  font-size: 2.8rem;
}

.assembly.is-narrow .assembly__caption p {
  margin-top: 0.8rem;
  font-size: 1.5rem;
}

.assembly.is-narrow .assembly__caption--finale,
.assembly.is-narrow .assembly__caption--finale.is-active {
  top: 0;
  left: 0;
  width: 100%;
  text-align: left;
  transform: none;
}

/* Team: four strips; on wide screens the one in focus opens into a portrait */
.crew {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}

.crew__member {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-panel);
  background: var(--tone);
  color: var(--ink);
}

.crew__photo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  aspect-ratio: 4 / 5;
  padding: 2.4rem 2.4rem 0;
}

.crew__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
}

.crew__member--round .crew__photo {
  align-items: center;
  padding-bottom: 2.4rem;
}

.crew__member--round .crew__photo img {
  object-position: center;
}

.crew__info {
  padding: 0 2.4rem 2.4rem;
}

.crew__name {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.crew__role {
  margin-top: 0.4rem;
  font-size: 1.5rem;
  font-weight: 500;
}

.crew__bio {
  margin-top: 0.6rem;
  font-size: 1.5rem;
}

.crew__wave,
.crew__tab,
.crew__progress {
  display: none;
}

/* Live (wide screens, scripting on): an expanding-strip spotlight */
.team-section.is-pinned {
  padding-top: 0;
  padding-bottom: 0;
}

.team-section.is-pinned .team-pin {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 6rem 0;
}

.team-section.is-pinned .section__head {
  margin-bottom: 4rem;
}

.crew.is-live {
  display: flex;
  height: clamp(42rem, 60vh, 58rem);
}

.crew.is-live .crew__member {
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
  transition: flex-grow 0.8s var(--ease);
}

.crew.is-live .crew__member.is-active {
  flex-grow: 3.4;
  cursor: default;
}

.crew.is-live .crew__member::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(36rem circle at var(--mx, 50%) var(--my, 30%), var(--spot), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.crew.is-live .crew__member:hover::after {
  opacity: 1;
}

.crew.is-live .crew__photo {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(100%, 38rem);
  height: 86%;
  aspect-ratio: auto;
  padding: 0;
}

.crew.is-live .crew__member--round .crew__photo {
  height: 70%;
  padding: 0 1.6rem 3.2rem;
}

.crew.is-live .crew__info {
  position: absolute;
  top: 3.2rem;
  left: 3.2rem;
  width: min(30rem, 100% - 6.4rem);
  padding: 0;
  opacity: 0;
  transform: translateY(1.6rem);
  transition: opacity 0.3s ease, transform 0.5s var(--ease);
  pointer-events: none;
}

.crew.is-live .crew__member.is-active .crew__info {
  opacity: 1;
  transform: none;
  transition-delay: 0.35s;
}

.crew.is-live .crew__name {
  font-size: clamp(3.4rem, 3.6vw, 5.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.crew.is-live .crew__role {
  margin-top: 1.4rem;
  font-size: 1.7rem;
}

.crew.is-live .crew__bio {
  max-width: 26ch;
  font-size: 1.6rem;
}

.crew.is-live .crew__wave {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 4.4rem;
  margin-top: 2.4rem;
}

.crew__wave i {
  width: 0.4rem;
  height: calc(var(--h) * 100%);
  border-radius: 99rem;
  background: var(--ink);
  transform: scaleY(0.4);
  transform-origin: center;
}

.crew.is-live.is-inview .is-active .crew__wave i {
  animation: talk 0.9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.07s);
}

@keyframes talk {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1);
  }
}

.crew.is-live .crew__tab {
  position: absolute;
  top: 2.4rem;
  left: 1.8rem;
  display: block;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transform: rotate(180deg);
  writing-mode: vertical-rl;
  transition: opacity 0.3s ease;
}

.crew.is-live .crew__member.is-active .crew__tab {
  opacity: 0;
}

.crew.is-live + .crew__progress {
  display: block;
  height: 2px;
  margin-top: 2.4rem;
  background: var(--line);
}

.crew__progress span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* Schemes */
.schemes {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 3.2rem 6rem;
  align-items: center;
}

.logos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.logo-tile {
  display: grid;
  place-items: center;
  height: 12rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--white);
}

.logo-tile img {
  width: 100%;
  height: 8rem;
  object-fit: contain;
}

.split-word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  vertical-align: top;
}

.split-word > span {
  display: inline-block;
}

/* ---------- Contact and footer (on the frame) ---------- */

.contact {
  padding: clamp(8rem, 10vw, 12rem) 0;
  color: var(--on-dark);
}

.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 4rem 8rem;
  align-items: start;
}

.contact .lede {
  margin-top: 2.4rem;
  color: var(--on-dark-soft);
}

.field {
  display: grid;
  gap: 0.8rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--on-dark-soft);
  font-size: 1.45rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: var(--field);
  color: var(--on-dark);
  font-size: 1.6rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.field textarea {
  min-height: 14rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--on-dark-soft);
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--mint);
  outline-color: var(--mint);
}

/* Contact as a conversation: one question at a time beside a live voice line */
.contact__intro .lede {
  min-height: 3em;
}

.signal {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 12rem;
  overflow: hidden;
  margin-top: 4rem;
}

.signal i {
  flex: 1;
  height: calc(var(--h, 0.12) * 100%);
  min-height: 0.4rem;
  border-radius: 99rem;
  background: var(--mint);
  opacity: 0.35;
  transition: height 0.35s var(--ease), opacity 0.35s ease, background-color 0.35s ease;
}

.signal i.is-new {
  background: var(--on-dark);
  opacity: 1;
}

.signal i.is-word {
  opacity: 0.9;
}

.signal.is-inview.is-idle i {
  animation: breathe 2.4s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -0.09s);
}

@keyframes breathe {
  to {
    transform: scaleY(1.2);
  }
}

.signal.is-sent i {
  background: var(--mint);
  opacity: 1;
}

.talk {
  display: grid;
  gap: 2.4rem;
  align-content: start;
}

.talk__progress,
.talk__status,
.talk__hint,
.talk [data-back],
.talk [data-next] {
  display: none;
}

.talk__step {
  display: grid;
  gap: 2rem;
  min-width: 0;
  border: 0;
}

.talk__q {
  margin-bottom: 0.4rem;
  padding: 0;
  font-size: clamp(2.2rem, 2.4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.talk__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.btn--line {
  border-color: var(--glass-line);
  background: transparent;
  color: var(--on-dark);
}

.btn--line:hover {
  border-color: var(--on-dark);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.talk__done {
  display: grid;
  justify-items: start;
  gap: 1.2rem;
}

.talk__done[hidden] {
  display: none;
}

.talk__done i {
  color: var(--mint);
  font-size: 4rem;
}

.talk__done h3 {
  font-size: clamp(2.6rem, 3vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.talk__done p {
  color: var(--on-dark-soft);
}

.talk__error {
  color: var(--flag);
  font-size: 1.5rem;
}

/* Stepped mode, switched on by v2.js */
.talk.is-steps {
  min-height: 42rem;
  padding: clamp(2.4rem, 3vw, 4rem);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-panel);
  background: var(--field);
}

.talk.is-steps .talk__progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.talk__progress span {
  height: 0.4rem;
  border-radius: 99rem;
  background: var(--glass-line);
  transition: background-color 0.4s ease;
}

.talk__progress span.is-done {
  background: var(--mint);
}

.talk.is-steps .talk__status {
  display: block;
  margin-top: -1.2rem;
  color: var(--on-dark-soft);
  font-size: 1.35rem;
}

.talk.is-steps .talk__step[hidden] {
  display: none;
}

.talk.is-steps .talk__step.is-entering {
  animation: step-in 0.55s var(--ease) both;
}

.talk.is-steps .talk__step.is-entering-back {
  animation: step-back 0.55s var(--ease) both;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(3.2rem);
  }
}

@keyframes step-back {
  from {
    opacity: 0;
    transform: translateX(-3.2rem);
  }
}

.talk.is-steps .talk__nav {
  margin-top: auto;
}

.talk.is-steps [data-next] {
  display: inline-flex;
}

.talk.is-steps [data-back] {
  display: inline-flex;
}

.talk.is-steps [data-back][hidden],
.talk.is-steps [data-next][hidden],
.talk.is-steps [data-send][hidden] {
  display: none;
}

.talk.is-steps .talk__hint {
  display: block;
  margin-top: -1.2rem;
  color: var(--on-dark-soft);
  font-size: 1.3rem;
}

.field.is-shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  20%, 60% { transform: translateX(-0.6rem); }
  40%, 80% { transform: translateX(0.6rem); }
}

.talk.is-sent .talk__progress,
.talk.is-sent .talk__status,
.talk.is-sent .talk__step,
.talk.is-sent .talk__nav,
.talk.is-sent .talk__hint {
  display: none;
}

.talk.is-sent .talk__done {
  align-content: center;
  min-height: 100%;
  animation: step-in 0.6s var(--ease) both;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem 4rem;
  padding: 3.2rem 0 4rem;
  border-top: 1px solid var(--glass-line);
  color: var(--on-dark-soft);
  font-size: 1.45rem;
}

.footer .brand {
  color: var(--on-dark);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.8rem;
}

.footer__links a:hover {
  color: var(--on-dark);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .section__head,
  .after,
  .schemes,
  .contact__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .after__aside {
    display: contents;
  }

  .js .showcase {
    position: sticky;
    top: 1rem;
    z-index: 3;
    height: 30rem;
    margin-top: 0;
  }

  .js .features .feature {
    padding: 4.8rem 0;
  }

  .how__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .js .features__spine {
    display: none;
  }

  .crew {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Three people in two columns: the last one takes the full row, photo beside the words */
  .crew:not(.is-live) .crew__member:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
    align-items: end;
  }

  .crew:not(.is-live) .crew__member:last-child:nth-child(odd) .crew__photo {
    aspect-ratio: 4 / 5;
    height: auto;
  }

  .crew:not(.is-live) .crew__member:last-child:nth-child(odd) .crew__info {
    align-self: center;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar__end {
    display: none;
  }

  .menu__account {
    display: block;
  }

  .menu__panel {
    left: auto;
    right: 0;
    transform: none;
  }

  .stage__caption {
    display: none;
  }

  .pattern {
    grid-template-columns: minmax(0, 1fr);
  }

  .pattern__route {
    justify-self: start;
    text-align: left;
  }

  .js .patterns-story {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .js .pattern-visual {
    top: 1rem;
    padding: 1.6rem;
  }

  .js .pattern-visual .pattern-visual__svg {
    max-height: 12rem;
  }

  .js .patterns-story .pattern {
    min-height: 40vh;
    padding: 4rem 0;
  }
}

@media (max-width: 600px) {
  .sheet {
    margin: 0.6rem;
    border-radius: 1.6rem;
  }

  .hero {
    padding: 1rem 0.6rem 0.6rem;
  }

  .report__card {
    min-height: 14rem;
    padding: 1.2rem;
  }

  .how__track {
    grid-template-columns: minmax(0, 1fr);
  }

  .logos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal {
    height: 8rem;
    margin-top: 2.4rem;
  }

  .talk.is-steps {
    min-height: 38rem;
  }

  .crew {
    gap: 1.2rem;
  }

  .crew__photo {
    padding: 1.2rem 1.2rem 0;
  }

  .crew__member--round .crew__photo {
    padding-bottom: 1.2rem;
  }

  .crew__info {
    padding: 0 1.4rem 1.6rem;
  }

  .crew__name {
    font-size: 1.7rem;
  }

  /* Showcase scenes, compacted for a phone-width panel */
  .js .showcase {
    height: 32rem;
  }

  .showcase__scene {
    gap: 1rem;
    padding: 1.8rem;
  }

  .sc-phon {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.6rem;
    margin-block: auto;
  }

  .sc-keys {
    gap: 0.6rem;
    font-size: 1.3rem;
    white-space: nowrap;
  }

  .sc-reading,
  .sc-doc .sc-line:last-child,
  .showcase__scene[data-scene="1"] .sc-btn {
    display: none;
  }

  .sc-lesson {
    grid-template-columns: 5.6rem minmax(0, 1fr);
    padding: 0.8rem;
  }

  .sc-lesson b {
    font-size: 1.35rem;
  }

  .sc-marquee {
    font-size: 1.4rem;
  }

  .sc-mantra {
    padding: 1.2rem;
  }

  .sc-doc {
    gap: 0.6rem;
    padding: 1.4rem;
  }

  .sc-doc b {
    font-size: 1.4rem;
  }

  .sc-uid__digits {
    gap: 0.4rem;
  }

  .sc-uid__digits i {
    height: 4rem;
    font-size: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .showcase__scene,
  .showcase__scene.is-active,
  .js .showcase {
    transition: none;
  }

  .showcase *,
  .showcase *::after,
  .assembly *,
  .assembly *::after {
    animation: none !important;
  }

  .js .hero__intro,
  .js .hero__title,
  .js .report {
    animation: none;
  }

  .btn,
  .field input,
  .field textarea,
  .feature__icon,
  .signal i,
  .crew__member,
  .crew__info,
  .js .patterns-story .pattern,
  .js .scene__read .word {
    transition: none;
  }
}
