/* mandarinly.app: The Listening Room, paper side (docs/STYLE_GUIDE.md).
   Fonts are self-hosted subsets: Nunito (body), Noto Serif (titles),
   Noto Serif SC (only the hanzi this page uses; re-subset when adding hanzi). */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../assets/fonts/noto-serif-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Noto Serif';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(../assets/fonts/noto-serif-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../assets/fonts/noto-serif-sc-700-subset.woff2) format('woff2');
  unicode-range: U+4e00, U+4e09, U+4e0d, U+4e8c, U+4f11, U+5341, U+542c, U+559c, U+56db, U+6052, U+61c2, U+6c34, U+8336, U+9e4a;
}

/* tokens.css: The Listening Room (docs/STYLE_GUIDE.md v2.0) */
:root {
  --paper: #F6F1E7;
  --paper-raised: #FBF8F2;
  --hairline: #DDD3C2;
  --ink: #1E2A36;
  --ink-muted: #5E6A75;
  --room: #22313F;
  --room-surface: #1B2733;
  --room-line: #45576A;
  --room-text-muted: #AEBBC7;
  --deep-teal: #2C3E50;
  --terracotta: #E67E22;
  --terracotta-ink: #A4520D;
  --terracotta-hover: #EF8D35;
  --seal: #C0392B;
  --seal-ink: #F6F1E7;
  --gold: #F1C40F;
  --missed: #E8836F;
  --on-room: #F6F1E7;
  --focus: #E67E22;
  --shade: rgba(30, 42, 54, 0.14);

  --font-title: 'Quicksand', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hanzi: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px; --s-32: 128px;
  --r-card: 22px; --r-tile: 18px; --r-btn: 16px; --r-chip: 9px; --r-pill: 999px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-stamp: cubic-bezier(0.34, 1.4, 0.64, 1);
  --step--1: 0.875rem; --step-0: 1.0625rem; --step-1: 1.25rem; --step-2: 1.6rem; --step-3: clamp(2rem, 3.4vw, 2.75rem); --step-4: clamp(2.6rem, 5.6vw, 4.6rem); --step-5: clamp(3.2rem, 8vw, 6.5rem);
}

/* base.css: what the Floor already decided */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-title); font-weight: 700; line-height: 1.08; margin: 0; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
.zh { font-family: var(--font-hanzi); font-weight: 700; }
.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; transition: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.skip { position: absolute; left: var(--s-4); top: var(--s-4); z-index: 10; background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-4); border-radius: var(--r-btn); transform: translateY(-200%); }
.skip:focus-visible { transform: none; }

/* shared controls */
.btn { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: 0 var(--s-6); border-radius: var(--r-pill); font-family: var(--font-title); font-weight: 700; font-size: 1.0625rem; text-decoration: none; transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms; }
.btn--primary { background: var(--terracotta); color: var(--ink); }
.btn--primary:hover { background: var(--terracotta-hover); }
.btn--primary:active { transform: scale(0.97); }
.btn--quiet { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; padding: 0 var(--s-2); }
.btn--quiet:hover { text-decoration-thickness: 3px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.play-icon { width: 18px; height: 18px; flex: none; }

.store { display: inline-block; border-radius: 10px; transition: transform 160ms var(--ease-out); }
.store:hover { transform: translateY(-2px); }
.store:active { transform: scale(0.98); }
.store img { width: 180px; height: auto; }

/* motion: Xǐxi's 2px bob (style guide § 2) */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.7) rotate(-14deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(var(--tilt, -4deg)); } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes breathe { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }
.bob { animation: bob 3s ease-in-out infinite; }

/* one reveal, visible by default; JS adds .js-reveal only when motion is welcome */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js-reveal [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .bob { animation: none; }
}

:root { --font-title: 'Noto Serif', 'Noto Serif SC', Georgia, serif; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }

.top { border-bottom: 1.5px solid var(--hairline); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); padding-block: var(--s-4); }
.mark { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; }
.seal { display: inline-grid; place-items: center; background: var(--seal); color: var(--seal-ink); font-family: var(--font-hanzi); font-weight: 700; border-radius: 22%; transform: rotate(var(--tilt, -4deg)); line-height: 1; }
.mark .seal { width: 32px; height: 32px; font-size: 19px; }
.nav__links { display: flex; gap: var(--s-6); align-items: center; }
.nav__links a { text-decoration: none; font-size: var(--step--1); color: var(--ink-muted); padding-block: var(--s-2); }
.nav__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.nav__links .btn { min-height: 40px; padding-inline: var(--s-5); color: var(--paper); background: var(--ink); text-decoration: none; }
.nav__links .btn:hover { background: var(--deep-teal); }
@media (max-width: 760px) { .nav__links a:not(.btn) { display: none; } }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; padding-block: clamp(40px, 7vw, 88px); }
.hero h1 span { display: block; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); line-height: 1.04; animation: settle 800ms var(--ease-out) both; }
/* The headline moves but never starts hidden, so it paints straight away. */
@keyframes settle { from { transform: translateY(14px); } to { transform: none; } }
.hero__lede { margin-top: var(--s-6); font-size: var(--step-1); color: var(--ink-muted); max-width: 32ch; animation: rise 800ms 160ms var(--ease-out) both; }
.hero__actions { margin-top: var(--s-8); display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; animation: rise 800ms 280ms var(--ease-out) both; }
.hero__note { margin-top: var(--s-4); font-size: var(--step--1); color: var(--ink-muted); animation: rise 800ms 360ms var(--ease-out) both; }

/* Hero: one word to try, on paper (concept A's listening card, cream). */
.try { position: relative; }
.try__xixi { position: absolute; width: 124px; right: 20px; top: -98px; z-index: 2; pointer-events: none; }
.listen { position: relative; background: var(--paper-raised); border: 1.5px solid var(--hairline); border-radius: var(--r-card); padding: clamp(20px, 3vw, 32px) clamp(20px, 3vw, 32px) 64px; box-shadow: 0 24px 48px -32px rgba(30, 42, 54, 0.35); }
.listen__eyebrow { font-size: var(--step--1); color: var(--terracotta-ink); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--s-2); }
.listen h2 { font-size: var(--step-2); }
.player { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--s-4); margin-block: var(--s-5) var(--s-2); }
.wave { display: flex; align-items: center; gap: 5px; height: 56px; }
.wave:first-child { justify-content: flex-end; }
.wave i { display: block; width: 4px; height: 100%; border-radius: 4px; background: var(--hairline); transform: scaleY(0.35); animation: breathe 2.6s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-delay: -0.4s; } .wave i:nth-child(3n) { animation-delay: -1.1s; } .wave i:nth-child(5n) { animation-delay: -1.7s; }
.is-playing .wave i { background: var(--terracotta); animation-duration: 0.5s; }
.play { width: 88px; height: 88px; border-radius: 50%; background: var(--terracotta); color: var(--ink); display: grid; place-items: center; position: relative; transition: transform 160ms var(--ease-out), background-color 160ms; }
.play::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--terracotta); opacity: 0; }
.is-playing .play::after { animation: ring 900ms var(--ease-out); }
@keyframes ring { from { opacity: 0.9; transform: scale(0.85); } to { opacity: 0; transform: scale(1.35); } }
.play:hover { background: var(--terracotta-hover); }
.play:active { transform: scale(0.95); }
.play svg { width: 32px; height: 32px; }
.contour { height: 40px; display: flex; justify-content: center; margin-bottom: var(--s-3); }
.contour svg { width: 140px; height: 48px; overflow: visible; }
.contour path { fill: none; stroke: var(--seal); stroke-width: 5; stroke-linecap: round; }
.contour .draw { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }
.contour.is-drawn .draw { animation: draw 700ms var(--ease-out) forwards; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.choice { display: grid; justify-items: center; gap: 2px; padding: var(--s-3) var(--s-2); border-radius: var(--r-tile); border: 1.5px solid var(--hairline); background: var(--paper); transition: transform 160ms var(--ease-out), border-color 200ms, opacity 200ms; }
.choice .zh { font-size: 2rem; line-height: 1.2; }
.choice small { font-size: var(--step--1); color: var(--ink-muted); }
.choice:hover:not(:disabled) { border-color: var(--ink-muted); transform: translateY(-2px); }
.choice:active:not(:disabled) { transform: scale(0.97); }
.choice:disabled { cursor: default; }
.choices[data-locked] .choice:disabled:not(.right):not(.wrong) { opacity: 0.45; }
.choice.right { border: 2px solid var(--seal); }
.choice.right .zh { color: var(--seal); }
.choice.wrong { border-color: var(--missed); }
.choice.wrong .zh { color: var(--ink-muted); }
.feedback { min-height: 2.75em; margin-top: var(--s-4); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3) var(--s-4); }
.feedback p { color: var(--ink-muted); }
.feedback .btn { min-height: 40px; padding-inline: var(--s-4); border: 1.5px solid var(--ink); flex: none; }
.feedback .btn[hidden] { display: none; }
/* The reward, small and second: tonight's seal stamps when you hear one right. */
/* In flow, pulled up over the card's bottom padding only, so a taller card (large text) grows downward and never covers the answers. */
.tonight { position: relative; margin: -46px 0 0 -24px; width: fit-content; z-index: 1; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-5) var(--s-3) var(--s-3); background: var(--paper-raised); border: 1.5px solid var(--hairline); border-radius: var(--r-tile); box-shadow: 0 16px 32px -20px rgba(30, 42, 54, 0.45); max-width: 270px; }
.tonight p { display: grid; font-size: var(--step--1); color: var(--ink-muted); line-height: 1.35; }
.tonight b { color: var(--ink); font-family: var(--font-title); font-size: var(--step-0); }
.tonight__seal { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 22%; border: 2px dashed var(--seal); color: var(--seal); font-size: 26px; opacity: 0.55; transform: rotate(-6deg); }
.tonight__seal.on { opacity: 1; border: 0; background: var(--seal); color: var(--seal-ink); --tilt: -6deg; animation: stamp 520ms var(--ease-stamp) both; }

/* Seals section: the seal book sits beside the heading. */
.seals__intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; margin-bottom: var(--s-16); }
.seals__intro .sec-head { margin-bottom: 0; }
.js-reveal .book[data-reveal]:not(.in) .st { animation-play-state: paused; }
@media (max-width: 900px) {
  .seals__intro { grid-template-columns: minmax(0, 1fr); }
  .try { margin-top: 84px; }
  .try__xixi { width: 100px; top: -80px; right: 12px; }
  .tonight { margin-left: 12px; }
}
@media (max-width: 480px) {
  .play { width: 72px; height: 72px; }
  .choice .zh { font-size: 1.7rem; }
}

.book { margin-inline: 0; position: relative; background: var(--paper-raised); border: 1.5px solid var(--hairline); border-radius: var(--r-card); padding: clamp(20px, 3vw, 36px); }
.book__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s-5); gap: var(--s-4); }
.book__head h2 { font-size: var(--step-2); white-space: nowrap; }
.book__head { flex-wrap: wrap; }
.book__head p { color: var(--ink-muted); font-size: var(--step--1); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(6px, 1vw, 10px); }
.week .dow { font-size: var(--step--1); color: var(--ink-muted); text-align: center; padding-bottom: var(--s-1); }
.day { aspect-ratio: 1; border-radius: 22%; border: 1.5px dashed var(--hairline); display: grid; place-items: center; position: relative; }
.day.blank { border-color: transparent; }
.day .num { font-size: var(--step--1); color: var(--ink-muted); }
.day.today { border: 2px solid var(--terracotta); }
.day.today .num { color: var(--terracotta-ink); font-weight: 600; }
.st { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 22%; background: var(--seal); color: var(--seal-ink); font-size: clamp(16px, 2.2vw, 26px); transform: rotate(var(--tilt)); animation: stamp 480ms var(--ease-stamp) both; }
.st.rest { background: var(--paper); color: var(--ink-muted); border: 1.5px solid var(--hairline); }
.book__x { position: absolute; width: 150px; right: -36px; bottom: -58px; }
.book__foot { margin-top: var(--s-5); display: flex; gap: var(--s-6); flex-wrap: wrap; font-size: var(--step--1); color: var(--ink-muted); }
.book__foot b { font-family: var(--font-title); font-size: var(--step-2); color: var(--ink); display: block; line-height: 1.1; }

section { padding-block: clamp(72px, 10vw, 128px); }
.sec-head { display: grid; gap: var(--s-4); max-width: 36rem; margin-bottom: var(--s-12); }
.sec-head h2 { font-size: var(--step-3); }
.sec-head p { color: var(--ink-muted); font-size: var(--step-1); }

.ledger { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s-5); padding-block: var(--s-6); border-top: 1.5px solid var(--hairline); }
.steps li:last-child { border-bottom: 1.5px solid var(--hairline); }
.steps .zh { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 22%; background: var(--seal); color: var(--seal-ink); font-size: 1.7rem; line-height: 1; transform: rotate(-4deg); }
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--ink-muted); margin-top: var(--s-2); }

/* Free and Plus: two plan cards (from concept A), no prices. */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.plan { border-radius: var(--r-card); padding: clamp(var(--s-6), 4vw, var(--s-8)); border: 1.5px solid var(--hairline); background: var(--paper-raised); display: grid; align-content: start; gap: var(--s-5); }
.plan--plus { background: var(--room); color: var(--on-room); border-color: var(--room); }
.plan h3 { font-size: var(--step-2); }
.plan__note { color: var(--ink-muted); margin-top: calc(var(--s-3) * -1); }
.plan--plus .plan__note, .plan__fine { color: var(--room-text-muted); }
.plan__fine { font-size: var(--step--1); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.plan li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s-3); }
.plan li svg { width: 22px; height: 22px; margin-top: 3px; }
.plan li path { fill: none; stroke: var(--terracotta-ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.plan--plus li path { stroke: var(--gold); }
.plan .btn { justify-self: start; margin-top: var(--s-2); }
#plus { border-bottom: 1.5px solid var(--hairline); }
@media (max-width: 760px) { .plans { grid-template-columns: minmax(0, 1fr); } }

.seals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-6); }
.medal { display: grid; justify-items: center; text-align: center; gap: var(--s-3); }
.medal .ring { width: clamp(84px, 11vw, 128px); aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--seal); display: grid; place-items: center; transition: transform 300ms var(--ease-out); }
.medal .ring span { width: 82%; height: 82%; border-radius: 50%; background: var(--seal); color: var(--seal-ink); display: grid; place-items: center; font-family: var(--font-hanzi); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1; }
.medal .ring small { display: block; font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; margin-top: 2px; }
.medal:hover .ring { transform: rotate(-8deg) scale(1.04); }
.medal h3 { font-size: var(--step-0); }
.medal p { font-size: var(--step--1); color: var(--ink-muted); }
.js-reveal .seals[data-reveal] { opacity: 1; transform: none; }
.js-reveal .seals[data-reveal] .ring { opacity: 0; }
.js-reveal .seals[data-reveal].in .ring { animation: stamp 560ms var(--ease-stamp) forwards; }
.seals .medal:nth-child(2) .ring { animation-delay: 120ms; } .seals .medal:nth-child(3) .ring { animation-delay: 240ms; } .seals .medal:nth-child(4) .ring { animation-delay: 360ms; } .seals .medal:nth-child(5) .ring { animation-delay: 480ms; }

.meet { background: var(--paper-raised); }
.meet__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.stagebox { position: relative; aspect-ratio: 1; max-width: 420px; width: 100%; justify-self: center; }
.stagebox img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); transform: translateY(6px); }
.stagebox img.on { opacity: 1; transform: none; }
.moods { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.mood { min-height: 44px; padding: 0 var(--s-5); border-radius: var(--r-pill); border: 1.5px solid var(--hairline); background: var(--paper); font-weight: 600; transition: background-color 160ms, border-color 160ms, transform 160ms var(--ease-out); }
.mood:hover { border-color: var(--ink-muted); }
.mood:active { transform: scale(0.97); }
.mood[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.meet blockquote { margin: var(--s-6) 0 0; font-family: var(--font-title); font-size: var(--step-1); min-height: 2.8em; }

.faq details { border-bottom: 1.5px solid var(--hairline); max-width: 760px; }
.faq summary { list-style: none; cursor: pointer; padding: var(--s-5) 0; font-family: var(--font-title); font-weight: 700; font-size: var(--step-1); display: flex; justify-content: space-between; gap: var(--s-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--seal); transition: transform 200ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--seal); }
.faq details p { padding-bottom: var(--s-5); color: var(--ink-muted); }

.foot { border-top: 1.5px solid var(--hairline); padding-block: var(--s-16) var(--s-8); }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s-8); }
.foot h2 { font-size: var(--step-4); max-width: 12ch; }
.foot__base { margin-top: var(--s-12); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-4); font-size: var(--step--1); color: var(--ink-muted); }
.foot__base nav { display: flex; gap: var(--s-6); }
.foot__base a { text-decoration: none; padding-block: var(--s-2); }
.foot__base a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 900px) {
  .hero, .ledger, .meet__grid { grid-template-columns: minmax(0, 1fr); }
    .book__x { width: 84px; right: -4px; bottom: -72px; }
  .book { margin-bottom: var(--s-12); }
  .seals { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--s-10); }
}
@media (max-width: 480px) {
  .seals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Real app screens in a generic phone: a plain rounded body, no notch,
   camera, buttons or status bar, so it reads as any Android phone or iPhone. */
.phone { width: 100%; max-width: 300px; aspect-ratio: 1096 / 2278; padding: 8px; border-radius: 30px; background: var(--ink); box-shadow: 0 24px 48px -24px rgba(30, 42, 54, 0.45); }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 22px; background: var(--paper); }
.ledger__phone { justify-self: center; width: 100%; max-width: 300px; position: sticky; top: var(--s-8); }

.inside { background: var(--paper-raised); border-block: 1.5px solid var(--hairline); }
.screens { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.screens li { display: grid; justify-items: center; text-align: center; gap: var(--s-2); }
.screens .phone { margin-bottom: var(--s-4); }
.screens h3 { font-size: var(--step-1); }
.screens p { color: var(--ink-muted); font-size: var(--step--1); max-width: 24ch; }
.js-reveal .screens[data-reveal] { opacity: 1; transform: none; }
.js-reveal .screens[data-reveal] li { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js-reveal .screens[data-reveal].in li { opacity: 1; transform: none; }
.screens li:nth-child(2) { transition-delay: 100ms; } .screens li:nth-child(3) { transition-delay: 200ms; } .screens li:nth-child(4) { transition-delay: 300ms; }

.foot__button { font: inherit; color: inherit; padding-block: var(--s-2); }
.foot__button:hover { color: var(--ink); text-decoration: underline; }
.foot__base nav { flex-wrap: wrap; column-gap: var(--s-6); row-gap: var(--s-2); }
.hero__note, .book__head p { color: var(--ink-muted); }

@media (max-width: 1000px) {
  .screens { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s-12); }
}
@media (max-width: 900px) {
  .ledger__phone { position: static; }
}
/* Phones: the four screens become a swipeable row instead of a long stack. */
@media (max-width: 640px) {
  .screens { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--s-6); margin-inline: calc(var(--gutter) * -1); padding: var(--s-2) var(--gutter) var(--s-4); scrollbar-width: thin; }
  .screens li { flex: 0 0 min(68vw, 260px); scroll-snap-align: center; }
}

/* Cookie banner shown by js/site.js on every page. */
.cookie-banner {
    box-sizing: border-box;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 440px;
    margin-left: auto;
    padding: 20px;
    background: #FBF8F2;
    color: #1E2A36;
    border: 1px solid #DDD3C2;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(30, 42, 54, 0.18);
    font-family: 'Nunito', system-ui, sans-serif;
    /* Short screens (a phone held sideways): never taller than the window;
       the banner scrolls inside instead. */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cookie-banner:focus {
    outline: none;
}

.cookie-banner:focus-visible {
    outline: 3px solid #E67E22;
    outline-offset: 3px;
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner__title {
    margin: 0 0 6px;
    font-size: 18px;
    color: #1E2A36;
}

.cookie-banner__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #3D4A56;
}

.cookie-banner__text a {
    color: #A4520D;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

/* Accept and Reject carry equal weight on purpose (UK PECR guidance). */
.cookie-banner__button {
    box-sizing: border-box;
    min-height: 44px;
    padding: 6px 16px;
    font: 700 16px/1.15 'Quicksand', 'Nunito', system-ui, sans-serif;
    color: #1E2A36;
    background: #F6F1E7;
    border: 1.5px solid #1E2A36;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cookie-banner__button:hover {
    background: #EDE5D6;
}

.cookie-banner__button:focus-visible {
    outline: 3px solid #E67E22;
    outline-offset: 3px;
}

.cookie-banner [hidden] {
    display: none;
}

.cookie-banner__manage {
    display: block;
    margin: 12px auto 0;
    padding: 6px 8px;
    font-size: 15px;
    color: #A4520D;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner__manage:focus-visible,
.cookie-switch:focus-visible {
    outline: 3px solid #E67E22;
    outline-offset: 3px;
}

/* Functional (always on) and Analytics (optional) rows. */
.cookie-banner__choices {
    margin-top: 14px;
    border-top: 1px solid #DDD3C2;
}

.cookie-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #DDD3C2;
}

.cookie-choice__name {
    display: block;
    margin: 0;
    font-weight: 700;
    font-size: 15px;
}

.cookie-choice__text {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: #3D4A56;
}

.cookie-choice__fixed {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    color: #5E6A75;
}

/* A plain switch: off is an outlined track, on is ink. */
.cookie-switch {
    flex: none;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 48px;
    height: 28px;
    margin: 0;
    border: 1.5px solid #1E2A36;
    border-radius: 999px;
    background: #F6F1E7;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cookie-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #1E2A36;
    transition: transform 0.15s ease;
}

.cookie-switch:checked {
    background: #1E2A36;
}

.cookie-switch:checked::after {
    background: #F6F1E7;
    transform: translateX(20px);
}

/* Wide screens: a slim bar along the bottom, so the page stays visible.
   Managing choices goes back to the compact card. */
@media (min-width: 900px) {
    .cookie-banner:not(.is-managing) {
        max-width: 1080px;
        margin-inline: auto;
        padding: 14px 24px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 32px;
        align-items: center;
    }
    .cookie-banner:not(.is-managing) .cookie-banner__title,
    .cookie-banner:not(.is-managing) .cookie-banner__text {
        grid-column: 1;
    }
    .cookie-banner:not(.is-managing) .cookie-banner__actions {
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
        grid-template-columns: repeat(2, minmax(150px, auto));
    }
    .cookie-banner:not(.is-managing) .cookie-banner__manage {
        grid-column: 2;
        grid-row: 2;
        margin-top: 2px;
        padding-block: 2px;
    }
    .cookie-banner:not(.is-managing) .cookie-banner__title {
        grid-row: 1;
        align-self: end;
    }
    .cookie-banner:not(.is-managing) .cookie-banner__text {
        grid-row: 2;
    }
}

/* Privacy and Terms: a long read on paper, one measure wide. */
.foot--compact { padding-block: var(--s-8); }
.foot--compact .foot__base { margin-top: 0; align-items: center; }
.foot__base a[aria-current="page"] { color: var(--ink); }
.doc { padding-block: var(--s-16) var(--s-20); }
.doc__body { max-width: calc(70ch + var(--gutter) * 2); }
.doc h1 { font-size: var(--step-4); margin-bottom: var(--s-3); }
.doc .last-updated { color: var(--ink-muted); font-size: var(--step--1); margin-bottom: var(--s-10); }
.doc h2 { font-size: var(--step-2); margin: var(--s-12) 0 var(--s-4); scroll-margin-top: var(--s-6); }
.doc p, .doc ul { margin: 0 0 var(--s-4); }
.doc ul { padding-left: 1.25em; }
.doc li { margin-bottom: var(--s-2); }
.doc li::marker { color: var(--seal); }
.doc a, .link-button { color: var(--terracotta-ink); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.doc a:hover, .link-button:hover { text-decoration-thickness: 2px; }
.doc .summary { background: var(--paper-raised); border: 1.5px solid var(--hairline); border-radius: var(--r-card); padding: var(--s-6) clamp(var(--s-5), 4vw, var(--s-8)) var(--s-2); margin-bottom: var(--s-8); }
.doc .summary h2 { margin-top: 0; font-size: var(--step-1); }

/* 404: Xǐxi looked everywhere. */
.lost { padding-block: var(--s-16) var(--s-24); }
.lost__inner { display: grid; justify-items: center; text-align: center; gap: var(--s-4); }
.lost__xixi { width: 180px; height: auto; }
.lost__code { font-family: var(--font-title); font-weight: 700; color: var(--seal); letter-spacing: 0.2em; font-size: var(--step--1); }
.lost h1 { font-size: var(--step-4); max-width: 14ch; }
.lost__text { color: var(--ink-muted); max-width: 44ch; }
.lost__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s-4); margin-top: var(--s-4); }

/* Narrow phones: keep the logo and "Get the app" on one line. */
.nav__links .btn { white-space: nowrap; }
@media (max-width: 360px) {
  .nav { gap: var(--s-3); }
  .mark { gap: var(--s-2); font-size: 1.15rem; }
  .nav__links .btn { padding-inline: var(--s-4); }
}

/* Support: jump links at the top of the page. */
.toc { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.doc .toc a { color: var(--ink); text-decoration: none; font-size: var(--step--1); padding: var(--s-2) var(--s-4); border: 1.5px solid var(--hairline); border-radius: var(--r-pill); background: var(--paper-raised); overflow-wrap: normal; }
.doc .toc a:hover { border-color: var(--ink); }
