/* Serse marketing site. Tokens come from Serse/UI/Theme.swift (Kachika dark, D-019). */
:root {
  --canvas: #0d0d0d;
  --surface: #1c1c1e;
  --sheet: #161618;
  --ink: #f5f1ec;
  --ink-2: #b0b0b4;
  --border: #303032;
  --accent: #d9a46e;
  --accent-hover: #e6b985;
  --accent-tint: #3a2d22;
  --on-accent: #21170e;
  --chip-en: #b7d6ee;
  --chip-ett: #f4d294;
  --tag-ink: #252525;
  --tag-sub: #4a4642;
  --tag-1: #bed9b1;
  --tag-2: #f3db9a;
  --tag-3: #bed7e8;
  --tag-4: #f0b9b9;
  --tag-5: #d6c7e7;
  --tag-6: #edc39f;

  --font: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-ipa: -apple-system, "SF Pro Text", "Segoe UI", "Noto Sans", Arial, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  /* The app's spring (response 0.50, damping 0.70), sampled over 700ms. */
  --spring: linear(0, 0.078 5%, 0.252 10%, 0.452 15%, 0.638 20%, 0.79 25%, 0.902 30%, 0.976 35%, 1.02 40%, 1.04 45%, 1.046 50%, 1.034 60%, 1.017 70%, 1.005 80%, 0.999 90%, 1);

  --vh: 100vh;
  --gutter: clamp(20px, 5vw, 72px);
  --w: min(300px, 74vw);
}

@supports (height: 100svh) {
  :root { --vh: 100svh; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: #49494c var(--canvas);
  background: var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 160ms var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 28px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-dark { background: var(--on-accent); color: var(--ink); }
.btn-dark:focus-visible { outline-color: var(--on-accent); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-hover); }
  .btn-dark:hover { background: #3a2a1b; }
  .header-link:hover { color: var(--accent-hover); }
  .text-link:hover { color: var(--accent-hover); }
  .chapter-nav a:hover { color: var(--ink); }
  .site-footer a:hover { color: var(--accent); }
}

/* Hero */
.hero {
  display: grid;
  gap: clamp(40px, 8vw, 64px);
  padding: clamp(24px, 6vw, 48px) var(--gutter) clamp(56px, 10vw, 96px);
}
.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede {
  max-width: 34ch;
  margin-top: clamp(20px, 3vw, 28px);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink);
}
.hero .btn { margin-top: clamp(24px, 3.5vw, 36px); }
.note { margin-top: 14px; font-size: 1rem; color: var(--ink-2); }

.hero-figure {
  justify-self: center;
  perspective: 1200px;
  animation: phone-in 900ms var(--ease-out) both;
}
.hero-tilt { transform-style: preserve-3d; }

@keyframes phone-in {
  from { opacity: 0; translate: 0 28px; }
  to { opacity: 1; translate: 0 0; }
}

@media (min-width: 960px) {
  :root { --w: min(340px, calc((var(--vh) - 130px) / 2.21)); }
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(40px, 6vw, 96px);
    min-height: calc(var(--vh) - 80px);
    padding-top: 0;
    padding-bottom: 24px;
  }
}

/* Phone */
.phone {
  position: relative;
  width: calc(var(--w) + 20px);
  padding: 10px;
  border-radius: calc(var(--w) * 0.155);
  background: #1b1b1d;
  box-shadow: inset 0 0 0 1px #3a3a3d, 0 24px 56px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
}
.screen {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: var(--w);
  aspect-ratio: 402 / 874;
  border-radius: calc(var(--w) * 0.125);
  background: var(--canvas);
}
.screen > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.island {
  position: absolute;
  top: calc(var(--w) * 0.028);
  left: 50%;
  width: calc(var(--w) * 0.29);
  height: calc(var(--w) * 0.08);
  margin-left: calc(var(--w) * -0.145);
  border-radius: 99px;
  background: #000;
}

/* Scan sweep: the dot field the app shows while it analyses a photo. */
.scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 55%;
  background: radial-gradient(circle, rgba(245, 241, 236, 0.85) 1.2px, transparent 1.7px) 0 0 / 13px 13px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 65%, transparent);
  opacity: 0;
  animation: scan-sweep 1100ms var(--ease-in-out) 200ms both;
}
@keyframes scan-sweep {
  0% { opacity: 0; transform: translateY(-60%); }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(190%); }
}

/* Drawn app chrome over the plate */
.chrome {
  position: absolute;
  inset: 0;
  color: #fff;
  font-size: calc(var(--w) * 0.04);
  font-weight: 600;
  line-height: 1.2;
}
.chrome-status {
  position: absolute;
  top: calc(var(--w) * 0.05);
  left: calc(var(--w) * 0.11);
  right: calc(var(--w) * 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(var(--w) * 0.044);
}
.chrome-battery {
  width: calc(var(--w) * 0.065);
  height: calc(var(--w) * 0.03);
  border-radius: calc(var(--w) * 0.009);
  background: #fff;
}
.chrome-pill {
  display: inline-block;
  padding: calc(var(--w) * 0.024) calc(var(--w) * 0.04);
  border-radius: 99px;
  background: rgba(32, 30, 28, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.chrome-back {
  position: absolute;
  top: calc(var(--w) * 0.14);
  left: calc(var(--w) * 0.04);
}
.chrome-back::before { content: "\2039\00a0"; }
.chrome-actions {
  position: absolute;
  left: calc(var(--w) * 0.04);
  bottom: calc(var(--w) * 0.05);
  display: flex;
  gap: calc(var(--w) * 0.02);
}
.chrome-shutter {
  position: absolute;
  right: calc(var(--w) * 0.04);
  bottom: calc(var(--w) * 0.04);
  display: grid;
  place-items: center;
  width: calc(var(--w) * 0.15);
  height: calc(var(--w) * 0.15);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 calc(var(--w) * 0.007) rgba(255, 255, 255, 0.75);
}
.chrome-shutter svg { width: 58%; height: 58%; }
.chrome-status-pill {
  position: absolute;
  left: 50%;
  bottom: calc(var(--w) * 0.2);
  display: grid;
  transform: translateX(-50%);
  padding: calc(var(--w) * 0.024) calc(var(--w) * 0.045);
  border-radius: 99px;
  background: rgba(32, 30, 28, 0.86);
  white-space: nowrap;
  text-align: center;
  animation: fade-away 320ms var(--ease-out) 3200ms both;
}
.status-busy, .status-done { grid-area: 1 / 1; }
.status-busy { animation: fade-away 180ms var(--ease-out) 1420ms both; }
.status-done { animation: fade-in 180ms var(--ease-out) 1500ms both; }

@keyframes fade-away { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Tags */
.tags { position: absolute; inset: 10px; transform-style: preserve-3d; }
.tag-spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) translateZ(26px);
}
.tag {
  display: inline-flex;
  flex-direction: column;
  padding: 0.42em 0.72em 0.46em;
  border-radius: 0.72em;
  color: var(--tag-ink);
  font-weight: 600;
  line-height: 1.18;
  white-space: nowrap;
}
.tag-spot .tag {
  font-size: calc(var(--w) * 0.04);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  animation:
    tag-pop 700ms var(--spring) calc(1000ms + var(--i) * 70ms) both,
    fade-in 180ms var(--ease-out) calc(1000ms + var(--i) * 70ms) both;
}
@keyframes tag-pop {
  from { scale: 0.84; translate: 0 calc(var(--w) * 0.03); }
  to { scale: 1; translate: 0 0; }
}
.tag-word { display: inline-flex; align-items: center; gap: 0.4em; }
.tag-sub { color: var(--tag-sub); font-size: 0.86em; }
.c1 { background: var(--tag-1); }
.c2 { background: var(--tag-2); }
.c3 { background: var(--tag-3); }
.c4 { background: var(--tag-4); }
.c5 { background: var(--tag-5); }
.c6 { background: var(--tag-6); }

.dot {
  display: inline-block;
  flex: none;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  box-shadow: 0 0 0 0.12em var(--tag-ink);
}
.dot-en { background: var(--chip-en); }
.dot-ett { background: var(--chip-ett); }

/* Marquee */
.words {
  position: relative;
  padding-block: clamp(32px, 5vw, 56px);
}
.word-rows { display: grid; gap: 14px; }
.word-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding-inline: var(--gutter);
  font-size: 1.0625rem;
}
.word-row[data-clone-host] > li[aria-hidden="true"] { display: none; }

.js .words-pause { display: inline-block; }
.words-pause {
  display: none;
  margin: 18px var(--gutter) 0;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}
.words-pause[hidden] { display: none; }
.words-pause:active { transform: scale(0.97); }

@media (prefers-reduced-motion: no-preference) {
  .js .word-rows {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  }
  .js .word-row[data-clone-host] {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 0;
    width: max-content;
    padding-inline: 0;
    animation: marquee 80s linear infinite;
  }
  .js .word-row[data-clone-host] > li { padding-right: 12px; }
  .js .word-row[data-clone-host] > li[aria-hidden="true"] { display: list-item; }
  .js .word-row-reverse[data-clone-host] {
    animation-direction: reverse;
    animation-duration: 100s;
  }
  .words.is-offscreen .word-row,
  .words.is-paused .word-row,
  .words:hover .word-row,
  .words:focus-within .word-row { animation-play-state: paused; }
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .words-pause { display: none !important; }
}

/* Story */
.story { padding: clamp(48px, 8vw, 96px) var(--gutter) 0; }
.story-title {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.chapter-nav { margin-top: 20px; }
.chapter-nav ol { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.chapter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}
.chapter-nav a[aria-current="true"] { color: var(--accent); }

.stage-col { display: none; }

.chapter {
  display: grid;
  gap: 36px;
  padding-block: clamp(56px, 10vw, 96px);
  scroll-margin-top: 16px;
}
.chapter-copy { max-width: 34rem; }
.chapter-copy h3 {
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.chapter-copy h3 + p { margin-top: 20px; }
.chapter-copy p + p { margin-top: 14px; }
.chapter-copy > p { color: var(--ink); }
.inline-phone { justify-self: center; }

@media (min-width: 960px) {
  .chapter {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(40px, 6vw, 96px);
    min-height: var(--vh);
  }
}

/* Stage mode: one sticky phone. Only with JS, room and motion allowed. */
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .sda .story-body, .io .story-body {
    --stage-w: min(320px, calc((var(--vh) - 110px) / 2.2));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: clamp(32px, 5vw, 80px);
    align-items: start;
    timeline-scope: --ch-0, --ch-1, --ch-2, --ch-3, --ch-4, --ch-5;
  }
  .sda .chapters, .io .chapters { grid-column: 1; grid-row: 1; }
  .sda .stage-col, .io .stage-col {
    grid-column: 2;
    grid-row: 1;
    display: block;
    position: sticky;
    top: calc((var(--vh) - var(--stage-w) * 2.174 - 20px) / 2);
    --w: var(--stage-w);
  }
  .sda .chapter-nav, .io .chapter-nav {
    grid-column: 3;
    grid-row: 1;
    position: sticky;
    top: calc(var(--vh) / 2 - 110px);
    margin-top: 0;
  }
  .sda .chapter-nav ol, .io .chapter-nav ol { flex-direction: column; gap: 2px; }
  .sda .chapter, .io .chapter {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: 48px;
  }
  .sda .inline-phone, .io .inline-phone {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .stage-shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Scroll-driven crossfade. Each screen is bound to its own chapter's timeline. */
  .sda #point { view-timeline: --ch-0 block; }
  .sda #learn { view-timeline: --ch-1 block; }
  .sda #hear { view-timeline: --ch-2 block; }
  .sda #practise { view-timeline: --ch-3 block; }
  .sda #talk { view-timeline: --ch-4 block; }
  .sda #private { view-timeline: --ch-5 block; }

  .sda .stage-shot {
    animation: shot-mid linear both;
    animation-range: cover 0% cover 100%;
  }
  .sda .shot-first { animation-name: shot-first; animation-timeline: --ch-0; }
  .sda .shot-learn { animation-timeline: --ch-1; }
  .sda .shot-hear { animation-timeline: --ch-2; }
  .sda .shot-practise { animation-timeline: --ch-3; }
  .sda .shot-talk { animation-timeline: --ch-4; }
  .sda .shot-last { animation-name: shot-last; animation-timeline: --ch-5; }

  /* Fallback for browsers without scroll timelines: IntersectionObserver sets .is-active. */
  .io .stage-shot {
    opacity: 0;
    transform: translateY(5%) scale(0.98);
    transition: opacity 360ms var(--ease-out), transform 480ms var(--ease-out);
  }
  .io .stage-shot.is-active { opacity: 1; transform: none; }
}

@keyframes shot-mid {
  0%, 18% { opacity: 0; transform: translateY(7%) scale(0.98); }
  32%, 68% { opacity: 1; transform: none; }
  82%, 100% { opacity: 0; transform: translateY(-7%) scale(0.98); }
}
@keyframes shot-first {
  0%, 68% { opacity: 1; transform: none; }
  82%, 100% { opacity: 0; transform: translateY(-7%) scale(0.98); }
}
@keyframes shot-last {
  0%, 18% { opacity: 0; transform: translateY(7%) scale(0.98); }
  32%, 100% { opacity: 1; transform: none; }
}

/* Small screens and no stage: each inline phone rises as it enters. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sda .inline-phone .phone {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 70%;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .inline-phone .phone {
      animation: fade-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
  }
}
@keyframes rise {
  from { opacity: 0.2; transform: translateY(40px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Learn: word panel */
.legend { display: block; }
.legend span { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; }
.legend .dot { box-shadow: none; }
.legend span + span { margin-left: 0.6em; }

.word-panel {
  margin-top: 24px;
  padding: 20px;
  border-radius: 16px;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--border);
}
.word-panel-head { display: flex; align-items: center; gap: 10px; font-size: 1.75rem; line-height: 1.1; }
.word-panel-head strong { font-weight: 800; }
.chip {
  display: inline-block;
  padding: 0.14em 0.55em 0.18em;
  border-radius: 0.5em;
  color: #111;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.chip-en { background: var(--chip-en); }
.level {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 700;
}
.word-panel-meta { margin-top: 8px; color: var(--ink-2); }
.ipa { font-family: var(--font-ipa); }
.forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 16px 0 0;
}
.forms dt { color: var(--ink-2); font-size: 0.875rem; }
.forms dd { margin: 0; font-weight: 700; }
.word-panel-example { margin-top: 16px; font-weight: 600; }
.word-panel-gloss { color: var(--ink-2); font-size: 1rem; }
.chapter-copy .word-panel p + p { margin-top: 2px; }
.chapter-copy .word-panel .word-panel-example { margin-top: 16px; }
.chapter-copy .word-panel .word-panel-meta { margin-top: 8px; }
mark {
  padding: 0 0.12em;
  border-radius: 3px;
  background: var(--accent-tint);
  color: var(--accent);
}

/* Hear: the sentence lights up as you scroll */
.chapter-copy .read-along {
  margin-top: 24px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}
.chapter-copy .read-along-gloss { margin-top: 6px; color: var(--ink-2); }
.chapter-copy .read-along-gloss + p { margin-top: 20px; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sda #hear { view-timeline: --ch-2 block; }
    .sda .read-along span {
      display: inline-block;
      animation: word-on linear both;
      animation-timeline: --ch-2;
    }
    .sda .read-along span:nth-child(1) { animation-range: cover 34% cover 37%; }
    .sda .read-along span:nth-child(2) { animation-range: cover 37% cover 40%; }
    .sda .read-along span:nth-child(3) { animation-range: cover 40% cover 43%; }
    .sda .read-along span:nth-child(4) { animation-range: cover 43% cover 46%; }
    .sda .read-along span:nth-child(5) { animation-range: cover 46% cover 49%; }
    .sda .read-along span:nth-child(6) { animation-range: cover 49% cover 52%; }
    .sda .read-along span:nth-child(7) { animation-range: cover 52% cover 55%; }
    .sda .read-along span:nth-child(8) { animation-range: cover 55% cover 58%; }
    @media (max-width: 959px) {
      .sda .story-body { timeline-scope: --ch-2; }
    }
  }
}
@keyframes word-on {
  from { opacity: 0.45; color: var(--ink); }
  to { opacity: 1; color: var(--accent); }
}

/* Practise: flip card */
.flip-scene {
  width: min(100%, 340px);
  margin-top: 24px;
  perspective: 1100px;
  transition: transform 160ms var(--ease-out);
}
.flip-scene:active { transform: scale(0.985); }

.flip {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tag-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 26px;
}
.face {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: 26px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
.face-front {
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 300px;
  text-align: center;
  background: linear-gradient(145deg, #f5d49b, #e699a4 55%, #a787c5);
}
.face-back {
  gap: 10px;
  margin-top: 16px;
  min-height: 300px;
  background: linear-gradient(145deg, #bed9b1, #bed7e8 55%, #d6c7e7);
}
.flip-word { font-size: 3rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.flip-ipa { font-size: 1.125rem; }
.flip-hint { display: none; margin-top: 10px; font-size: 0.9375rem; font-weight: 600; color: #2f2b28; }
.js .flip-hint { display: block; }
.js .face-back .flip-hint { margin-top: auto; text-align: center; }
.flip-back-head { display: flex; align-items: center; gap: 10px; }
.flip-back-word { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.level-card { background: rgba(37, 37, 37, 0.12); color: var(--tag-ink); }
.flip-meaning { font-size: 1.25rem; font-weight: 600; }
.flip-forms { display: flex; flex-wrap: wrap; gap: 6px; }
.flip-forms > span {
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.9375rem;
  font-weight: 700;
}
.flip-example {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}
.flip-example mark { background: rgba(217, 164, 110, 0.35); color: #6e4316; }
.flip-gloss { font-weight: 500; font-size: 0.9375rem; color: var(--tag-sub); }

/* With JS the two faces share one card. Without it, both faces simply stack. */

.js .flip {
  position: relative;
  aspect-ratio: 34 / 36;
  transform-style: preserve-3d;
  transition: transform 700ms var(--spring);
}
.js .face {
  position: absolute;
  inset: 0;
  margin: 0;
  min-height: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: visibility 0s linear;
}
.js .face-back { transform: rotateY(180deg); }
.js .flip[aria-pressed="true"] { transform: rotateY(180deg); }
.js .flip[aria-pressed="false"] .face-back,
.js .flip[aria-pressed="true"] .face-front {
  visibility: hidden;
  transition: visibility 0s linear 180ms;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-figure, .scan { animation: none; }
  .scan { display: none; }
  .chrome-status-pill { display: none; }
  .tag-spot .tag { animation: fade-in 240ms ease calc(var(--i) * 40ms) both; }
  .js .flip { transition: none; }
  .js .flip[aria-pressed="true"] { transform: none; }
  .js .face-back { transform: none; }
  .js .face {
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    transition: opacity 180ms ease, visibility 0s linear;
  }
  .js .flip[aria-pressed="false"] .face-back,
  .js .flip[aria-pressed="true"] .face-front {
    opacity: 0;
    transition: opacity 180ms ease, visibility 0s linear 180ms;
  }
  .flip-scene:active { transform: none; }
}

/* Private */
.chapter-copy .promise {
  margin-top: 20px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent);
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 600;
  transition: color 160ms ease;
}

/* Join */
.join {
  display: grid;
  justify-items: start;
  gap: 20px;
  margin-top: clamp(48px, 8vw, 96px);
  padding: clamp(64px, 11vw, 140px) var(--gutter);
  background: var(--accent);
  color: var(--on-accent);
}
.join h2 {
  max-width: 14ch;
  font-size: clamp(2.75rem, 7.2vw, 6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.join p { max-width: 36ch; font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.4; }
.join .btn { margin-top: 12px; }

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px var(--gutter) 36px;
  color: var(--ink-2);
  font-size: 1rem;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  transition: color 160ms ease;
}
