/* KanaGO! — quiet white pages, ink type, the illustrated mascot and real app screens. */
:root {
  color-scheme: light;
  --ink: #232127; --ink-soft: #4a4750; --muted: #6c6872; --faint: #d8d5dc;
  --line: #ece8e4; --soft: #f7f5f2; --paper: #fff; --glyph: #f2f1f4;
  --accent: #f23a7c; --accent-deep: #cc2462;
  --accent-ink: #c2255b; --accent-soft: #ffe4ed; --star: #ffc83d;
  /* The app's level palette (KG in Theme.swift). Fills carry bold white text; *-ink is for text on white. */
  --candy: #ff6f9c; --ink-deep: #111014;
  --sky: #1a8cf0; --sky-ink: #1271c2; --sky-soft: #e3f1fe;
  --mint: #12a865; --mint-ink: #0c7a4c; --mint-soft: #ddf5e9;
  --grape: #9b6bff; --grape-ink: #6b46d9; --grape-soft: #f1ebff;
  --sun: #ffc83d; --sun-soft: #fff4d6;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --jp: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --duration-quick: 150ms; --duration-fast: 250ms; --duration-medium: 350ms; --duration-slow: 400ms;
  --duration-very-slow: 500ms; --duration-stagger: 40ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);
  --stage-bg: var(--paper); --stage-fg: var(--ink); --stage-muted: var(--muted);
  --stage-border: var(--line); --stage-surface: var(--soft);
  --stage-accent: var(--accent); --stage-on-accent: #fff;
  --p16-dur: var(--duration-fast); --p16-ease: var(--ease-smooth-out);
  --p16-text-muted: var(--stage-muted); --p16-text-active: var(--stage-fg);
  --p16-bar-bg: var(--stage-surface); --p16-pill-bg: var(--stage-bg);
  --p21-expand-dur: 250ms; --p21-collapse-dur: 250ms; --p21-chevron-dur: 250ms;
  --p21-ease: var(--ease-smooth-out); --blur-small: 2px;
  --p18-dur: var(--duration-very-slow); --p18-distance: 12px;
  --p18-stagger: var(--duration-stagger); --p18-blur: 3px;
  --p18-ease: var(--ease-smooth-out); --p18-exit-dur: 200ms;
  --digit-dur: 500ms; --digit-distance: 8px; --digit-stagger: 70ms;
  --digit-blur: 2px; --digit-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
  --digit-dir-x: 0; --digit-dir-y: 1;
  --nav: 64px;
  --gutter: clamp(16px,4vw,48px); --max: 1120px;
}
* { box-sizing: border-box; }
::selection { background: var(--accent-soft); color: var(--ink); }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--body); letter-spacing: -.01em; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 8px; }
.wrap { width: min(var(--max),100% - 2 * var(--gutter)); margin-inline: auto; }
.jp { font-family: var(--jp); color: inherit; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 12px; z-index: 50; background: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.skip:focus { left: 12px; }
h1,h2,h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; margin: 0; }
h2 { font-size: clamp(32px,4.4vw,56px); text-wrap: balance; }
p { margin: 0; }
.lede { font-size: clamp(17px,1.6vw,19px); color: var(--ink-soft); max-width: 32em; }
.kicker { display: inline-flex; gap: 12px; align-items: baseline; font: 600 13px/1.4 var(--body); color: var(--accent-ink); margin-bottom: 18px; }
.kicker .jp { color: var(--muted); opacity: .55; font-weight: 500; }
.note { font: 500 12px/1.6 var(--body); color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 26px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 16px/1.2 var(--display); text-decoration: none; transition: transform var(--duration-quick, 150ms) ease; }
.btn:hover { transform: translateY(-1px); }
/* Official-style App Store badge */
.store-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 8px 20px 8px 15px; border-radius: 13px; background: #000; color: #fff; text-decoration: none; border: 1px solid #a6a6a6; transition: transform var(--duration-quick, 150ms) ease; }
.store-badge .apple { width: 27px; height: 27px; fill: currentColor; flex: none; margin-top: -3px; }
.store-badge span { display: grid; line-height: 1; text-align: left; }
.store-badge small { font: 500 11px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; letter-spacing: .01em; }
.store-badge b { font: 600 22px/1.1 -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif; letter-spacing: -.02em; }
a.store-badge[href]:hover { transform: translateY(-2px); }
.store-badge[aria-disabled="true"] { cursor: default; }
.store-badge-sm { min-height: 38px; padding: 4px 12px 4px 10px; border-radius: 9px; gap: 6px; }
.store-badge-sm .apple { width: 19px; height: 19px; margin-top: -2px; }
.store-badge-sm small { font-size: 8.5px; }
.store-badge-sm b { font-size: 15px; }
.card { background: var(--soft); border-radius: 20px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 30; height: var(--nav); display: flex; align-items: center; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid transparent; transition: border-color var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
body[data-page="home"] .nav { position: fixed; inset: 0 0 auto; }
.nav.solid { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 70px; height: auto; }
.brand .brand-icon { width: 32px; border-radius: 8px; }
.nav .brand { gap: 8px; }
.nav .brand img { width: 52px; }
.nav .brand .brand-icon { width: 28px; }
.nav-badge { margin-left: auto; }
.lang { position: relative; display: inline-flex; align-items: center; padding: 3px; border-radius: 999px; background: var(--p16-bar-bg); }
.lang .p16-tab { position: relative; z-index: 1; border: 0; background: transparent; color: var(--p16-text-muted); font: 600 12px/1 var(--body); padding: 8px 10px; border-radius: 999px; cursor: pointer; transition: color var(--p16-dur) var(--p16-ease); }
.lang .p16-tab[aria-pressed="true"], .lang .p16-tab:hover { color: var(--p16-text-active); }
.p16-indicator { position: absolute; top: 3px; left: 0; height: 28px; width: 0; background: var(--p16-pill-bg); border-radius: 999px; box-shadow: 0 1px 3px rgba(22,21,26,.12); transform: translateX(0); transition: transform var(--p16-dur) var(--p16-ease), width var(--p16-dur) var(--p16-ease); will-change: transform, width; z-index: 0; pointer-events: none; }
.no-js .p16-indicator { display: none; }
.no-js .lang .p16-tab[aria-pressed="true"] { background: var(--p16-pill-bg); }

/* Phone: black glass, screenshot, real iPhone frame on top */
.phone { position: relative; width: 100%; aspect-ratio: 1406 / 2822; }
.phone::before { content: ""; position: absolute; inset: 1.88% 3.84%; border-radius: 26% / 12.9%; background: #000; box-shadow: 0 30px 40px rgba(22,21,26,.14); }
/* 18pro.svg as drawn: titanium, black bezel and Dynamic Island. Its screen hole (100,100 → 1306,2722
   of 1406 × 2822) is exactly one 1206 × 2622 iPhone 17/18 Pro screenshot, so shots sit 1:1 under it
   and their status bar lines up with the island. */
.phone::after { content: ""; position: absolute; inset: 0; z-index: 2; background: url(/assets/iphone-frame.svg?v=3) center / 100% 100% no-repeat; pointer-events: none; }
/* The frame's bezel draws the screen's real corner. This radius (130 of 1206 × 2622) only has to tuck the
   screenshot's corners under the bezel: anything from 82 to 176 stays hidden on all four corners. */
.screens { position: absolute; left: 7.112%; top: 3.544%; width: 85.775%; height: 92.913%; border-radius: 10.78% / 4.96%; overflow: hidden; background: #000; isolation: isolate; }
.screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.js .screen { visibility: hidden; }
.js .screen.is-visible[data-ready] { visibility: visible; }
.js .screen { opacity: 0; }
.js .screen.is-current { opacity: 1; z-index: 1; }
.js .screen.is-incoming { z-index: 2; transition: opacity var(--duration-fast) var(--ease-smooth-out); }
.js .screen.is-incoming.is-revealed { opacity: 1; }

/* ---------- The film: one pinned stage driven by scroll ---------- */
.film { position: relative; height: calc((var(--steps) + 1) * 100svh); --t: 0; --intro: 0; --slide: 0; --sway: 0deg; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.glyphs { position: absolute; inset: 0; pointer-events: none; }
.glyph { position: absolute; left: 50%; top: 52%; translate: -50% -50%; font: 700 min(66svh,62vw)/1 var(--jp); color: var(--glyph); white-space: nowrap; opacity: 0; scale: .86; transition: opacity var(--duration-very-slow, 500ms) var(--ease-in-out, ease-in-out), scale var(--duration-slow, 400ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.glyph:last-child { font-size: min(44svh,40vw); }
.glyph.is-active { opacity: 1; scale: 1; }
.glyph:nth-child(1), .glyph:nth-child(6) { color: #fdedf3; }
.glyph:nth-child(2), .glyph:nth-child(7) { color: #eaf4fe; }
.glyph:nth-child(3) { color: #e8f7ef; }
.glyph:nth-child(4) { color: #fff6de; }
.glyph:nth-child(5) { color: #f3eeff; }

.intro { position: absolute; inset: calc(var(--nav) + 7svh) var(--gutter) auto; text-align: center; display: grid; justify-items: center; opacity: var(--fade, 1); transform: translateY(calc(var(--intro) * -12svh)) scale(calc(1 - var(--intro) * .06)); will-change: transform, opacity; }
.intro h1 { font-size: clamp(42px, min(7.4vw, 11svh), 108px); line-height: .98; letter-spacing: -.055em; }
.intro h1 .jp { color: var(--accent); letter-spacing: 0; }
.intro-lede { margin-top: clamp(14px,2.4svh,24px); max-width: 30em; font-size: clamp(16px,1.6vw,20px); color: var(--ink-soft); text-wrap: balance; }
.intro-cta { display: grid; justify-items: center; gap: 12px; margin-top: clamp(18px,3.4svh,32px); }

.device { --h: min(76svh, 700px); --dx: min(24vw, 330px); position: absolute; left: 50%; top: calc(50% + var(--nav) / 2); height: var(--h); aspect-ratio: 1406 / 2822; transform: translate(-50%,-50%) translate(calc(var(--slide) * var(--dx)), calc((1 - var(--intro)) * 60svh)) scale(calc(.9 + var(--intro) * .1)); will-change: transform; }
.device .phone { height: 100%; width: auto; }

.buddy { position: absolute; left: -40%; bottom: 3%; width: 64%; aspect-ratio: 1127 / 1061; rotate: var(--sway); transform-origin: 50% 100%; z-index: 2; }
.buddy .pet { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; opacity: 0; scale: .7; transition: opacity var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), scale var(--duration-slow, 400ms) var(--ease-bounce, cubic-bezier(0.34, 1.36, 0.64, 1)); filter: drop-shadow(0 10px 10px rgba(22,21,26,.1)); }
.buddy[data-mood="hello"] [data-m="hello"], .buddy[data-mood="wow"] [data-m="wow"], .buddy[data-mood="happy"] [data-m="happy"], .buddy[data-mood="meh"] [data-m="meh"] { opacity: 1; scale: 1; }
.buddy::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -6%; height: 8%; border-radius: 50%; background: rgba(22,21,26,.08); filter: blur(4px); z-index: -1; }

.chapters { list-style: none; margin: 0; padding: 0; position: absolute; left: max(var(--gutter), (100vw - var(--max)) / 2); top: calc(50% + var(--nav) / 2); width: min(440px, 38vw); }
.chapter { --reveal-start: var(--p18-exit-dur); position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); visibility: hidden; transition: visibility 0s linear var(--p18-exit-dur); pointer-events: none; }
.chapter.is-active { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.ch-n { display: flex; gap: 12px; font: 600 13px/1 var(--body); color: var(--muted); margin-bottom: 22px; }
.ch-n span:first-child { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.chapter h2 { font-size: clamp(40px,4.8vw,66px); line-height: 1; }
.ch-p { margin-top: 22px; font-size: clamp(16px,1.5vw,19px); color: var(--ink-soft); max-width: 26em; }
.ch-stats { display: flex; gap: 36px; margin: 32px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.ch-stats div { display: grid; gap: 4px; }
.ch-stats dt { font: 700 30px/1 var(--display); letter-spacing: -.04em; }
.ch-stats dd { margin: 0; font-size: 13px; color: var(--muted); }

.rail { position: absolute; right: var(--gutter); top: 50%; translate: 0 -50%; display: grid; gap: 10px; opacity: 0; transition: opacity var(--duration-slow) var(--ease-smooth-out); }
.rail i { width: 3px; height: 22px; border-radius: 2px; background: var(--line); transition: background var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), height var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.rail i.on { background: var(--ink); }
.rail i.now { height: 40px; background: var(--accent); }
.film.in-chapters .rail { opacity: 1; }

/* ---------- Kana-chan: moods slide past the center as you scroll ---------- */
.moods-film { position: relative; height: calc(var(--steps) * 70svh + 100svh); }
.moods-film .stage { display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; padding: calc(var(--nav) + 6svh) var(--gutter) 6svh; text-align: center; }
.moods-head h2 { font-size: clamp(32px,4.4vw,56px); }
.mood-track { position: relative; width: 100%; min-height: 0; }
.mood-track img { --size: min(34svh, 300px, 52vw); position: absolute; left: 50%; top: 50%; width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2); object-fit: contain; will-change: transform, opacity; filter: drop-shadow(0 14px 14px rgba(22,21,26,.08)); }
.mood-captions { list-style: none; margin: 0; padding: 0; position: relative; width: min(440px,100%); height: 92px; }
.mood-captions li { position: absolute; inset: 0; display: grid; align-content: start; gap: 4px; opacity: 0; transform: translateY(18px); transition: opacity var(--duration-medium, 350ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), transform var(--duration-slow, 400ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.mood-captions li.is-past { transform: translateY(-18px); }
.mood-captions li.is-active { opacity: 1; transform: none; }
.mood-captions .jp { font-size: 13px; color: var(--muted); }
.mood-captions b { font: 700 26px/1.15 var(--display); letter-spacing: -.03em; }
.mood-captions li > span:last-child { color: var(--ink-soft); font-size: 15px; }
.mood-dots { display: flex; gap: 8px; margin-top: 18px; }
.mood-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); transition: background var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), width var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.mood-dots i.on { width: 20px; border-radius: 3px; background: var(--accent); }

/* ---------- Plain blocks ---------- */
.block { padding: clamp(80px,12vw,160px) 0; }
/* ---------- Widgets: the clock runs with the scroll and the widgets react ---------- */
.w-film { position: relative; height: calc(var(--steps) * 70svh + 100svh); }
.w-film .stage { display: grid; align-items: center; padding-top: var(--nav); }
.w-grid { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: clamp(36px,6vw,96px); align-items: center; }
.w-copy h2 { margin-bottom: 20px; }
.clock { margin-top: clamp(24px,4svh,44px); padding-top: 22px; border-top: 1px solid var(--line); }
.clock-time { position: relative; height: 1em; font: 700 clamp(44px,5.4vw,72px)/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock-time span, .clock-caps li { position: absolute; left: 0; top: 0; opacity: 0; transform: translateY(14px); transition: opacity var(--duration-medium, 350ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), transform var(--duration-slow, 400ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.clock-time span.is-past, .clock-caps li.is-past { transform: translateY(-14px); }
.clock-time span.is-active, .clock-caps li.is-active { opacity: 1; transform: none; }
.clock-caps { list-style: none; margin: 14px 0 0; padding: 0; position: relative; height: 1.6em; color: var(--ink-soft); font-size: clamp(15px,1.4vw,17px); }
.clock-caps li { white-space: nowrap; }

/* Home Screen: everything scales with --s, the side of a small widget. */
.homescreen { text-align: left; --s: clamp(136px, 13.5vw, 180px); --g: calc(var(--s) * .13); display: grid; grid-template-columns: repeat(2, var(--s)); gap: var(--g); padding: calc(var(--g) * 1.3); border-radius: calc(var(--s) * .28); background: radial-gradient(120% 80% at 0% 0%, #fbe7ef 0%, transparent 60%), radial-gradient(120% 90% at 100% 100%, #e6e3f3 0%, transparent 60%), #f3f1f6; }
.wx { position: relative; isolation: isolate; overflow: hidden; width: var(--s); height: var(--s); border-radius: calc(var(--s) * .14); padding: calc(var(--s) * .1); color: var(--wx-ink); box-shadow: 0 1px 1px rgba(22,21,26,.04), 0 12px 28px -8px rgba(22,21,26,.22); font-family: var(--display); }
.wx-md { grid-column: 1 / -1; width: auto; }
.homescreen { --wx-ink: #fff; --wx-soft: rgba(255,255,255,.94); --wx-flame: #fff; --wx-dot: rgba(255,255,255,.26); --wx-dot-on: #fff; --wx-check: #ff4f8b; }
.homescreen[data-state="late"] { --wx-check: #d61f5c; }
.homescreen[data-state="last"] { --wx-flame: #ffb199; --wx-check: #8f0f2a; }
.homescreen[data-state="done"] { --wx-ink: #3b2412; --wx-soft: rgba(59,36,18,.82); --wx-flame: #ff8a00; --wx-dot: rgba(59,36,18,.12); --wx-dot-on: #ff9500; --wx-check: #fff; }

/* One background per state, crossfaded. */
.wx-bg { position: absolute; inset: 0; z-index: -2; opacity: 0; transition: opacity var(--duration-very-slow, 500ms) var(--ease-in-out, ease-in-out); }
.wx-bg[data-s="ready"] { background: radial-gradient(90% 70% at 15% 0%, rgba(255,255,255,.22), transparent 60%), linear-gradient(155deg, #ff5f97, #f23a7c 60%, #d92a6b); }
.wx-bg[data-s="late"] { background: radial-gradient(90% 70% at 15% 0%, rgba(255,255,255,.16), transparent 60%), linear-gradient(155deg, #f2476a, #cf1f55 60%, #a3124a); }
.wx-bg[data-s="last"] { background: radial-gradient(70% 70% at 88% 95%, rgba(255,92,51,.55), transparent 65%), linear-gradient(160deg, #9a1230, #4a0818 60%, #24040b); }
.wx-bg[data-s="done"] { background: radial-gradient(80% 70% at 85% 90%, rgba(255,196,64,.55), transparent 65%), linear-gradient(160deg, #fffaf0, #ffeec2 60%, #ffdd8a); }
.homescreen[data-state="ready"] .wx-bg[data-s="ready"], .homescreen[data-state="late"] .wx-bg[data-s="late"],
.homescreen[data-state="last"] .wx-bg[data-s="last"], .homescreen[data-state="done"] .wx-bg[data-s="done"] { opacity: 1; }

.wx-top { display: flex; align-items: center; gap: calc(var(--s) * .03); }
.wx .flame { width: calc(var(--s) * .15); height: calc(var(--s) * .15); fill: var(--wx-flame); flex: none; transition: fill var(--duration-slow, 400ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.wx-fire { position: relative; display: inline-flex; flex: none; }
.wx-alert { position: absolute; right: -32%; bottom: -12%; display: grid; place-items: center; width: calc(var(--s) * .085); aspect-ratio: 1; border-radius: 50%; background: #fff; color: var(--wx-check); font: 900 calc(var(--s) * .064)/1 var(--display); font-style: normal; opacity: 0; scale: .4; transition: opacity var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), scale var(--duration-slow, 400ms) var(--ease-bounce, cubic-bezier(0.34, 1.36, 0.64, 1)); }
.homescreen[data-state="late"] .wx-alert, .homescreen[data-state="last"] .wx-alert { opacity: 1; scale: 1; }
.homescreen[data-state="late"] .wx-fire, .homescreen[data-state="last"] .wx-fire { margin-right: calc(var(--s) * .07); }
.wx-n { position: relative; display: inline-grid; font: 800 calc(var(--s) * .26)/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.wx-n span { grid-area: 1 / 1; transition: opacity var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), transform var(--duration-slow, 400ms) var(--ease-bounce, cubic-bezier(0.34, 1.36, 0.64, 1)); }
.wx-n .n-after { opacity: 0; transform: translateY(40%); }
.homescreen[data-state="done"] .wx-n .n-before { opacity: 0; transform: translateY(-40%); }
.homescreen[data-state="done"] .wx-n .n-after { opacity: 1; transform: none; }
.wx-msg { position: relative; margin-top: calc(var(--s) * .04); height: 2.3em; max-width: 64%; font: 700 calc(var(--s) * .088)/1.15 var(--display); color: var(--wx-soft); }
.wx-msg span { position: absolute; inset: 0; opacity: 0; transition: opacity var(--duration-medium, 350ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.homescreen[data-state="ready"] .wx-msg [data-s="ready"], .homescreen[data-state="late"] .wx-msg [data-s="late"],
.homescreen[data-state="last"] .wx-msg [data-s="last"], .homescreen[data-state="done"] .wx-msg [data-s="done"] { opacity: 1; }

/* Kana-chan bleeds off the corner, like a sticker on the glass. */
.wx-pet { position: absolute; z-index: -1; right: calc(var(--s) * -.06); bottom: calc(var(--s) * -.03); width: calc(var(--s) * .64); height: calc(var(--s) * .58); object-fit: contain; object-position: 100% 100%; rotate: -4deg; opacity: 0; scale: .85; transform-origin: 80% 100%; transition: opacity var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), scale var(--duration-slow, 400ms) var(--ease-bounce, cubic-bezier(0.34, 1.36, 0.64, 1)); filter: drop-shadow(0 8px 12px rgba(0,0,0,.18)); }
.homescreen[data-state="ready"] .wx-pet[data-s="ready"], .homescreen[data-state="late"] .wx-pet[data-s="late"],
.homescreen[data-state="last"] .wx-pet[data-s="last"], .homescreen[data-state="done"] .wx-pet[data-s="done"] { opacity: 1; scale: 1; }
/* On the darkest state she gets an ember glow behind her, never an outline. */
.wx-pet[data-s="last"] { filter: drop-shadow(0 0 calc(var(--s) * .08) rgba(255,110,70,.7)); }

/* Poses with a prop on the left (party hat, pencil) sit a bit further right to clear the text. */
.wx-sm .wx-pet[data-s="done"], .wx-sm .wx-pet[data-s="ready"] { right: calc(var(--s) * -.13); }
.wx-md .wx-col { height: 100%; display: flex; flex-direction: column; width: 62%; }
.wx-md .wx-msg { max-width: none; height: 1.2em; }
.wx-md .wx-pet { width: calc(var(--s) * .84); height: calc(var(--s) * .76); right: calc(var(--s) * -.02); bottom: calc(var(--s) * -.05); }
.wx-pill { position: absolute; z-index: 1; top: calc(var(--s) * .1); right: calc(var(--s) * .1); padding: calc(var(--s) * .028) calc(var(--s) * .06); border-radius: 99px; background: rgba(255,255,255,.22); color: var(--wx-ink); font: 700 calc(var(--s) * .062)/1 var(--display); white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.homescreen[data-state="done"] .wx-pill { background: rgba(59,36,18,.08); }
.wx-week, .wx-dots { display: grid; grid-template-columns: repeat(7, 1fr); justify-items: center; }
.wx-week { margin-top: auto; font: 700 calc(var(--s) * .052)/1 var(--display); color: var(--wx-soft); }
.wx-dots { margin-top: calc(var(--s) * .035); }
.wx-dots i { position: relative; width: calc(var(--s) * .105); aspect-ratio: 1; border-radius: 50%; background: var(--wx-dot); transition: background var(--duration-slow, 400ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)), box-shadow var(--duration-slow, 400ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.wx-dots i.part { background: color-mix(in srgb, var(--wx-dot-on) 55%, transparent); }
.wx-dots i.done, .homescreen[data-state="done"] .wx-dots i.today { background: var(--wx-dot-on); }
.wx-dots i.done::after, .homescreen[data-state="done"] .wx-dots i.today::after { content: ""; position: absolute; inset: 28% 24% 34%; border: solid var(--wx-check); border-width: 0 0 2px 2px; rotate: -45deg; transition: border-color var(--duration-slow) var(--ease-smooth-out); }
.wx-dots i.today { box-shadow: 0 0 0 1.5px var(--wx-ink); }

/* Word of the day: quiet paper, big ink. */
.wx-word { --wx-ink: var(--ink); display: flex; flex-direction: column; background: linear-gradient(160deg, #fff, #f7f4ef); color: var(--ink); }
.wx-label { font: 700 calc(var(--s) * .06)/1.25 var(--display); color: #6c6872; max-width: 66%; }
.wx-level { position: absolute; top: calc(var(--s) * .1); right: calc(var(--s) * .1); padding: calc(var(--s) * .02) calc(var(--s) * .045); border-radius: 99px; background: var(--ink); color: #fff; font: 800 calc(var(--s) * .055)/1 var(--display); }
.wx-word b { margin-top: auto; font: 700 calc(var(--s) * .25)/1.05 var(--jp); letter-spacing: -.02em; }
.wx-reading { margin-top: calc(var(--s) * .03); font: 600 calc(var(--s) * .068)/1.2 var(--display); color: #6c6872; }
.wx-mean { font: 700 calc(var(--s) * .09)/1.2 var(--display); }
.wx-mark { position: absolute; z-index: -1; right: calc(var(--s) * -.12); bottom: calc(var(--s) * -.2); font: 700 calc(var(--s) * .8)/1 var(--jp); color: rgba(22,21,26,.04); }

/* ---------- Shared pieces from the app: Hugeicons, Pill, level colors ---------- */
.hi-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hi { display: block; flex: none; width: 20px; height: 20px; }
.pill { --pill: var(--accent); --pill-on: #fff; display: inline-flex; flex: none; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--pill); color: var(--pill-on); font: 600 12px/1 var(--display); letter-spacing: 0; white-space: nowrap; }
.pill .hi { width: 13px; height: 13px; }
.pill-grape, .pill[data-level="N2"] { --pill: var(--grape); }
.pill[data-level="N4"] { --pill: var(--sky); }
.pill[data-level="N3"] { --pill: var(--mint); }
.pill[data-level="N1"] { --pill: var(--ink); }
.pill[data-level="Survival"] { --pill: var(--sun); --pill-on: var(--ink); }

/* ---------- Voices: cream like the app, sticker cards, chunky play buttons ---------- */
.voices { --voice: var(--accent); --voice-deep: var(--accent-deep); --voice-ink: var(--accent-ink); --voice-soft: var(--accent-soft);
  position: relative; padding: clamp(88px,11vw,150px) 0; background: var(--soft); }
.voices[data-voice="kasane"] { --voice: var(--grape); --voice-deep: #7a4fe0; --voice-ink: var(--grape-ink); --voice-soft: var(--grape-soft); }
.voices-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); gap: clamp(36px,6vw,96px); align-items: center; }
.voices-copy h2 { margin-bottom: 20px; }
.voice-pick { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; max-width: 470px; margin-top: clamp(26px,4svh,40px); }
.voice-card { position: relative; display: grid; justify-items: start; gap: 4px; min-height: 172px; padding: 16px 16px 18px; border: 0; border-radius: 26px; background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 8px 28px rgba(35,33,39,.07); transition: transform var(--duration-medium) var(--ease-bounce), box-shadow var(--duration-fast) var(--ease-smooth-out); }
.voice-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--voice); opacity: 0; transition: opacity var(--duration-fast) var(--ease-smooth-out); pointer-events: none; }
.voice-card:hover { box-shadow: 0 14px 34px rgba(35,33,39,.1); }
.voice-card:active { transform: scale(.96); }
.voice-card[aria-checked="true"]::after { opacity: 1; }
.voice-pet { display: block; width: 76px; height: 64px; margin: 0 0 8px -4px; }
.voice-pet img { width: 100%; height: 100%; object-fit: contain; object-position: 0 100%; transform-origin: 30% 100%; transform: translateY(calc(var(--level, 0) * -4px)) scale(calc(1 + var(--level, 0) * .07)); filter: grayscale(.15); transition: filter var(--duration-fast) var(--ease-smooth-out); }
.voice-card[aria-checked="true"] .voice-pet img { filter: none; }
.voice-name { display: flex; align-items: center; gap: 8px; }
.voice-name b { font: 700 22px/1.1 var(--display); letter-spacing: -.03em; }
.voice-card small { font-size: 13px; color: var(--muted); }
.voice-card[data-voice="kasane"] .pill { --pill: var(--grape); }
.voice-check { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--voice); color: #fff; opacity: 0; scale: .4; transition: opacity var(--duration-fast) var(--ease-smooth-out), scale var(--duration-slow) var(--ease-bounce); }
.voice-check .hi { width: 16px; height: 16px; }
.voice-card[aria-checked="true"] .voice-check { opacity: 1; scale: 1; }
.voice-wave { position: absolute; right: 18px; bottom: 20px; display: flex; align-items: center; gap: 3px; height: 22px; opacity: 0; transition: opacity var(--duration-fast) var(--ease-smooth-out); }
.voice-wave i { display: block; width: 4px; height: 100%; border-radius: 2px; background: var(--voice); transform: scaleY(var(--b, .2)); }
.voice-card.is-speaking .voice-wave { opacity: 1; }
.voices-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; text-align: left; font: 600 14px/1.4 var(--display); color: var(--ink-soft); }
.voices-note .hi { width: 22px; height: 22px; color: var(--voice); }

.phrases-head { display: flex; align-items: center; gap: 8px; margin: 0 0 14px 6px; font: 600 13px/1.4 var(--display); color: var(--muted); }
.phrases-head .hi { width: 18px; height: 18px; }
.phrases { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.phrase { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 16px; width: 100%; padding: 14px 20px 14px 14px; border: 0; border-radius: 26px; background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 8px 28px rgba(35,33,39,.07); transition: transform var(--duration-medium) var(--ease-bounce), box-shadow var(--duration-fast) var(--ease-smooth-out); }
.phrase::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--voice); opacity: 0; transition: opacity var(--duration-fast) var(--ease-smooth-out); pointer-events: none; }
.phrase:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(35,33,39,.1); }
.phrase:active { transform: scale(.98); }
.phrase.is-playing::after { opacity: 1; }
/* The app's chunky candy button: a solid lip underneath that the button presses into. */
.chunky-play { position: relative; display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 5px; border-radius: 50%; background: var(--voice); color: #fff; box-shadow: 0 5px 0 var(--voice-deep); transition: transform var(--duration-quick) var(--ease-smooth-out), box-shadow var(--duration-quick) var(--ease-smooth-out), background-color var(--duration-fast) var(--ease-smooth-out); }
.phrase:active .chunky-play { transform: translateY(5px); box-shadow: 0 0 0 var(--voice-deep); }
.chunky-play .hi { position: absolute; width: 24px; height: 24px; transition: opacity var(--duration-quick) ease, scale var(--duration-fast) var(--ease-bounce); }
.chunky-play .i-pause, .phrase.is-playing .chunky-play .i-play { opacity: 0; scale: .5; }
.phrase.is-playing .chunky-play .i-pause { opacity: 1; scale: 1; }
.phrase-body { display: grid; gap: 4px; min-width: 0; }
.phrase-jp { font: 700 clamp(19px,1.8vw,22px)/1.35 var(--jp); padding-top: .32em; }
.phrase-jp rt { font-size: .44em; font-weight: 600; color: var(--muted); }
.phrase-ro { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 600 13px/1.3 var(--display); color: var(--voice-ink); }
.phrase-ro .pill { height: 20px; padding: 0 8px; font-size: 11px; }
.phrase-tr { font-size: 14px; line-height: 1.4; color: var(--muted); text-wrap: pretty; }

/* Karaoke text: chunks light up as they're spoken, like the app's LyricTiming. */
.kc { transition: color var(--duration-quick) var(--ease-smooth-out); }
.phrase.is-playing .kc { color: #bdb8c2; }
.phrase.is-playing .kc.is-sung, .phrase.is-playing .kc.is-sung rt { color: var(--voice-ink); }

/* ---------- Songs: same white page, the phone on the left, the Sing tab's rows below ---------- */
.songs { position: relative; padding: clamp(88px,11vw,150px) 0 clamp(64px,8vw,104px); }
.songs-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(36px,6vw,96px); align-items: center; }
.songs-show { --song-phone-width: clamp(260px, 26vw, 330px); position: relative; display: grid; justify-items: center; padding-left: calc(var(--song-phone-width) * .4); }
.phone-song { width: var(--song-phone-width); }
.screen-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Anchor her to the phone's lower-left corner, with the tour buddy's proportions.
   The reserved gutter centers the whole composition and keeps her inside narrow screens. */
.songs-pet { position: absolute; z-index: 3; left: -40%; bottom: 3%; width: 64%; height: auto; filter: drop-shadow(0 10px 10px rgba(22,21,26,.1)); }
.songs-copy h2 { margin-bottom: 20px; }
.song-points { list-style: none; margin: clamp(24px,4svh,36px) 0 0; padding: 0; display: grid; gap: 18px; max-width: 30em; }
.song-points li { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 14px; }
.song-points b { display: block; font: 700 17px/1.3 var(--display); letter-spacing: -.02em; }
.song-points small { display: block; margin-top: 2px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.point-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); }
.point-icon .hi { width: 22px; height: 22px; }
.point-mint { background: var(--mint-soft); color: var(--mint-ink); }
.point-sky { background: var(--sky-soft); color: var(--sky-ink); }

/* The song shelf: the Sing tab's rows, drifting in opposite directions, paused off screen. */
.shelf { margin-top: clamp(64px,9vw,112px); }
.shelf-title { width: min(var(--max),100% - 2 * var(--gutter)); margin: 0 auto 18px; font: 600 13px/1.4 var(--display); color: var(--muted); }
.shelf-viewport { display: flex; overflow: hidden; padding-block: 10px 22px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.shelf-viewport + .shelf-viewport { margin-top: -8px; }
.shelf-row { flex: none; display: flex; gap: 14px; margin: 0; padding: 0 14px 0 0; list-style: none; animation: shelf 80s linear infinite; animation-play-state: paused; }
.shelf-reverse .shelf-row { animation-direction: reverse; animation-duration: 72s; }
.shelf.is-running .shelf-row { animation-play-state: running; }
.shelf-viewport:hover .shelf-row { animation-play-state: paused; }
@keyframes shelf { to { transform: translateX(-100%); } }
.shelf-row li { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 22px; background: var(--paper); box-shadow: 0 8px 22px rgba(35,33,39,.08); white-space: nowrap; }
.shelf-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: var(--candy); }
.shelf-icon .hi { width: 22px; height: 22px; }
.shelf-text { display: grid; gap: 2px; }
.shelf-row b { font: 700 15px/1.2 var(--display); color: var(--ink); }
.shelf-row b.jp { font-family: var(--jp); }
.shelf-row small { font: 600 12px/1.2 var(--display); color: var(--muted); }
.shelf-row small.jp { font-family: var(--jp); }
.no-js .shelf-viewport { overflow-x: auto; }
.promise-line { font: 700 clamp(30px,4.6vw,64px)/1.12 var(--display); letter-spacing: -.045em; max-width: 18em; text-wrap: balance; }
.promise-line .word { color: var(--faint); transition: color var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
.promise-line .word.lit { color: var(--ink); }

.faq-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: clamp(32px,6vw,80px); align-items: start; }
.faq-lede { margin-top: 14px; color: var(--ink-soft); }
.faq-lede a, .faq a { color: var(--ink); text-underline-offset: 4px; }
.faq .p21-item { border-bottom: 1px solid var(--stage-border); }
.faq .p21-item:first-child { border-top: 1px solid var(--stage-border); }
.p21-head { appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; border: 0; background: transparent; color: var(--stage-fg); text-align: left; list-style: none; cursor: pointer; padding: 22px 0; font: 600 17px/1.4 var(--display); letter-spacing: -.02em; }
.faq summary::-webkit-details-marker { display: none; }
.p21-chevron { position: relative; flex: none; display: inline-flex; width: 22px; height: 22px; border-radius: 50%; color: var(--stage-on-accent); background: var(--accent); transition: background-color var(--p21-chevron-dur) var(--p21-ease), color var(--p21-chevron-dur) var(--p21-ease); }
.p21-chevron svg { position: absolute; inset: 4px; display: block; width: 14px; height: 14px; transform-origin: center; transition: transform var(--p21-chevron-dur) var(--p21-ease), opacity var(--p21-chevron-dur) var(--p21-ease); }
.p21-chevron path { vector-effect: non-scaling-stroke; }
.faq-icon-plus { opacity: 1; transform: rotate(0); }
.faq-icon-close { opacity: 0; transform: rotate(-45deg); }
.p21-item[data-open="true"] .p21-chevron, .no-js .p21-item[open] .p21-chevron { color: var(--stage-on-accent); background: var(--accent-deep); }
.p21-item[data-open="true"] .faq-icon-plus, .no-js .p21-item[open] .faq-icon-plus { opacity: 0; transform: rotate(45deg); }
.p21-item[data-open="true"] .faq-icon-close, .no-js .p21-item[open] .faq-icon-close { opacity: 1; transform: rotate(0); }
.p21-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--p21-collapse-dur) var(--p21-ease); }
.p21-item[data-open="true"] .p21-panel { grid-template-rows: 1fr; transition: grid-template-rows var(--p21-expand-dur) var(--p21-ease); }
.p21-panel-inner { min-height: 0; overflow: hidden; opacity: 0; filter: blur(var(--blur-small)); transition: opacity var(--p21-collapse-dur) var(--p21-ease), filter var(--p21-collapse-dur) var(--p21-ease); }
.p21-item[data-open="true"] .p21-panel-inner { opacity: 1; filter: blur(0); transition: opacity var(--p21-expand-dur) var(--p21-ease), filter var(--p21-expand-dur) var(--p21-ease); }
.faq .p21-panel-inner p { padding: 0 32px 24px 0; color: var(--ink-soft); font-size: 15px; }
.no-js .p21-panel { grid-template-rows: 1fr; }
.no-js .p21-panel-inner { opacity: 1; filter: none; }

.final { position: relative; isolation: isolate; overflow-x: clip; padding: clamp(60px,10vw,140px) 0 clamp(80px,12vw,160px); text-align: center; --rise: 0; }
.final::before { content: ""; position: absolute; z-index: -1; left: 50%; top: clamp(20px,5vw,80px); width: min(720px,120vw); aspect-ratio: 1.6; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(242,58,124,.12), rgba(155,107,255,.06) 60%, transparent); pointer-events: none; }
.final .wrap { display: grid; justify-items: center; }
.final-pet { width: clamp(140px,16vw,200px); height: auto; margin-bottom: 28px; transform: translateY(calc((1 - var(--rise)) * 60px)) rotate(calc((1 - var(--rise)) * -10deg)); opacity: calc(.2 + var(--rise) * .8); }
.final h2 { font-size: clamp(40px,6vw,80px); line-height: 1; margin-bottom: 36px; }
.final .note { margin-top: 14px; }

footer { border-top: 1px solid var(--line); color: var(--muted); padding: 36px 0 44px; font-size: 13px; }
footer .wrap { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px 48px; align-items: start; }
.footer-identity { display: grid; justify-items: start; gap: 12px; }
.footer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; }
footer nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
footer a { color: var(--ink-soft); text-decoration: none; font-weight: 500; transition: color var(--duration-fast, 250ms) var(--ease-smooth-out, cubic-bezier(0.22, 1, 0.36, 1)); }
footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
footer .brand img { width: 60px; }
footer .brand .brand-icon { width: 28px; }
footer small { display: block; max-width: 37em; font-size: 11px; line-height: 1.6; }
footer .github-star { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 44px; padding: 10px 16px; border-radius: 999px; background: var(--ink); font: 600 13px/1.4 var(--body); }
footer .github-star svg { width: 20px; height: 20px; flex: none; }
footer .github-star span { color: #fff; }
footer .github-star:hover { text-decoration: none; }
footer .github-star:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.github-star .github-count { display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.3); font-variant-numeric: tabular-nums; }
footer .github-star .github-star-mark { color: var(--star); }
.github-number { display: inline-grid; position: relative; min-width: 2ch; text-align: center; }
.github-number > * { grid-area: 1 / 1; justify-self: center; }
.github-number-fallback { pointer-events: none; }
.github-count[hidden] { display: none; }

@keyframes t-digit-pop-in {
  0% { transform: translate(calc(var(--digit-distance) * var(--digit-dir-x)), calc(var(--digit-distance) * var(--digit-dir-y))); opacity: 0; filter: blur(var(--digit-blur)); }
  100% { transform: translate(0, 0); opacity: 1; filter: blur(0); }
}
.t-digit-group { display: inline-flex; align-items: baseline; }
.t-digit { display: inline-block; will-change: transform, opacity, filter; }
.t-digit-group.is-animating .t-digit { animation: t-digit-pop-in var(--digit-dur) var(--digit-ease) both; }
.t-digit-group.is-animating .t-digit[data-stagger="1"] { animation-delay: var(--digit-stagger); }
.t-digit-group.is-animating .t-digit[data-stagger="2"] { animation-delay: calc(var(--digit-stagger) * 2); }
.t-digit-group.is-animating .t-digit[data-same] { animation: none; }

/* Reveals run both ways: in when entering, out when leaving. */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s ease, transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* Texts reveal remix: staggered entrance, quiet fade on exit. */
.js .p18-line { opacity: 0; transform: translateY(var(--p18-distance)); filter: blur(var(--p18-blur)); transition: opacity var(--p18-dur) var(--p18-ease), transform var(--p18-dur) var(--p18-ease), filter var(--p18-dur) var(--p18-ease); transition-delay: calc(var(--reveal-start, 0ms) + var(--p18-stagger) * var(--line-index, 0)); will-change: transform, opacity, filter; }
.js .p18-text.is-shown .p18-line { opacity: 1; transform: translateY(0); filter: blur(0); }
.js .p18-text.is-hiding .p18-line { opacity: 0; transform: translateY(0); filter: blur(0); transition: opacity var(--p18-exit-dur) ease, transform 0s linear, filter 0s linear; transition-delay: 0s; }

/* Legal and help */
.page-hero { padding: 72px 0 40px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(38px,5vw,60px); }
.page-hero p { margin-top: 12px; color: var(--muted); }
.doc { padding: 40px 0 96px; }
.doc .wrap { max-width: 720px; }
.doc h2 { font-size: 24px; letter-spacing: -.03em; margin: 40px 0 12px; }
.doc p,.doc li { color: var(--ink-soft); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 20px; margin: 12px 0; }
.doc li + li { margin-top: 8px; }
.doc a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.doc .card { padding: 26px; margin-top: 16px; }
.not-found { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.not-found main { padding: 48px 0; }
.not-found .wordmark { width: 150px; height: auto; margin: 0 auto 30px; }
.not-found .nf-pet { width: 180px; height: auto; margin: 0 auto 8px; }
.not-found h1 { font-size: clamp(32px,5vw,52px); }
.not-found .lede { margin: 18px auto 28px; }

/* No JavaScript: drop the pinned stage, show everything in order. */
.no-js .film, .no-js .moods-film, .no-js .w-film { height: auto; }
.no-js .stage { position: relative; height: auto; overflow: visible; padding: calc(var(--nav) + 40px) var(--gutter) 60px; }
.no-js .intro, .no-js .chapters, .no-js .chapter, .no-js .device { position: static; transform: none; opacity: 1; visibility: visible; width: auto; margin: 0 auto 40px; }
.no-js .device { height: 70svh; }
.no-js .screen + .screen, .no-js .glyphs, .no-js .rail, .no-js .buddy, .no-js .mood-track, .no-js .mood-dots { display: none; }
.no-js .mood-captions { height: auto; display: grid; gap: 20px; }
.no-js .mood-captions li { position: static; opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 899px) {
  /* A moving backdrop blur repaints the entire header on mobile. */
  .nav { background: rgba(255,255,255,.97); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-badge { display: none; }
  .lang { margin-left: auto; }
  .intro { inset-block-start: calc(var(--nav) + 5svh); }
  .intro h1 { font-size: clamp(38px, min(11vw, 7svh), 64px); }
  .device { --h: min(50svh, 100vw); top: calc(var(--nav) + 2svh); transform: translateX(-50%) translateY(calc((1 - var(--intro)) * 48svh)) scale(calc(.9 + var(--intro) * .1)); transform-origin: 50% 0; }
  /* Keep the same corner overlap as desktop, with enough space for the whole sticker. */
  .glyph { top: calc(var(--nav) + 27svh); font-size: min(52svh, 92vw); }
  .glyph:last-child { font-size: min(30svh, 52vw); }
  .chapters { left: var(--gutter); right: var(--gutter); width: auto; top: calc(var(--nav) + 2svh + min(50svh, 100vw) + 22px); bottom: 0; }
  .chapter { text-align: center; transform: none; }
  .ch-n { justify-content: center; margin-bottom: 10px; font-size: 12px; }
  .chapter h2 { font-size: clamp(28px,8vw,40px); }
  .chapter h2 br { display: none; }
  .ch-p { margin: 10px auto 0; font-size: 15px; line-height: 1.5; max-width: 30em; }
  .ch-stats { justify-content: center; gap: 28px; margin-top: 16px; padding-top: 14px; }
  .ch-stats dt { font-size: 22px; }
  .ch-stats dd { font-size: 12px; }
  .rail { display: none; }
  .faq-grid { grid-template-columns: minmax(0,1fr); }
  .w-film .stage { align-items: start; padding-top: calc(var(--nav) + 4svh); }
  .w-grid { grid-template-columns: minmax(0,1fr); gap: clamp(18px,3svh,32px); justify-items: center; text-align: center; }
  .w-copy h2 { margin-bottom: 12px; font-size: clamp(28px,8vw,40px); }
  .w-copy h2 br { display: none; }
  .w-copy .lede { margin-inline: auto; font-size: 15px; line-height: 1.5; }
  .clock { margin-top: 14px; padding-top: 12px; }
  .clock-time { font-size: clamp(32px,9vw,44px); }
  .clock-time span, .clock-caps li { right: 0; }
  .clock-caps { margin-top: 8px; font-size: 14px; }
  .homescreen { --s: min(156px, calc((100vw - 2 * var(--gutter)) / 2.47)); }
  .voices-grid, .songs-grid { grid-template-columns: minmax(0,1fr); gap: 40px; }
  .voices-copy, .songs-copy { text-align: center; }
  .voices-copy h2 br, .songs-copy h2 br { display: none; }
  .voices-copy .lede, .songs-copy .lede { margin-inline: auto; font-size: 16px; line-height: 1.55; }
  .voice-pick { margin-inline: auto; text-align: left; }
  .songs-copy .ch-stats { justify-content: center; }
  .phrase { gap: 12px; padding: 12px 16px 12px 12px; }
  .chunky-play { width: 46px; height: 46px; }
  .chunky-play .hi { width: 21px; height: 21px; }
  .songs-show { --song-phone-width: min(62vw, 270px); order: 2; }
  .song-points { margin-inline: auto; text-align: left; }
  footer .wrap { grid-template-columns: minmax(0,1fr); }
  .footer-actions { align-items: flex-start; }
}
/* Tall tablets: a bigger phone so the stage doesn't end halfway down. */
@media (max-width: 899px) and (min-height: 960px) {
  .device { --h: min(58svh, 100vw); top: calc(var(--nav) + 4svh); }
  .glyph { top: calc(var(--nav) + 33svh); }
  .chapters { top: calc(var(--nav) + 4svh + min(58svh, 100vw) + 32px); }
  .chapter h2 { font-size: clamp(28px,6vw,48px); }
}
@media (max-width: 899px) and (max-height: 720px) {
  .w-copy .lede { display: none; }
  .ch-stats { display: none; }
  .intro-lede { display: none; }
}
@media (max-width: 480px) {
  .nav .brand img { width: 46px; }
  .nav .brand .brand-icon { width: 26px; }
  .p21-head { font-size: 16px; }
  .voice-card { min-height: 0; padding: 14px; }
  .voice-pet { width: 60px; height: 50px; }
  .voice-name b { font-size: 19px; }
  .phrase-jp { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .glyph, .chapter, .buddy .pet, .mood-captions li, .js .reveal, .promise-line .word, .rail i, .mood-dots i,
  .clock-time span, .clock-caps li, .wx-bg, .wx-msg span, .wx-pet, .wx-n span, .wx-dots i, .wx-alert { transition: none; }
  .screen + .screen { transform: none; }
  .buddy { rotate: none; }
  .p16-indicator, .lang .p16-tab, .p21-panel, .p21-panel-inner, .p21-chevron, .p21-chevron svg,
  .js .p18-line, .js .screen.is-incoming { transition: none !important; transition-delay: 0s !important; }
  .js .p18-line, .p21-panel-inner { transform: none !important; filter: none !important; }
  .t-digit-group .t-digit { animation: none !important; }
  .voice-card, .voice-check, .voice-pet img, .phrase, .chunky-play, .chunky-play .hi, .kc { transition: none !important; }
  .voice-pet img { transform: none !important; }
  .shelf-row { animation: none !important; }
  .shelf-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; padding-inline: var(--gutter); }
  .shelf-row[aria-hidden="true"] { display: none; }
}
