/* Hallmark · genre: editorial · macrostructure: Workbench · theme: custom (aizome indigo, word-class colours) · enrichment: live demo + clipped-edge screenshot · nav: N9 · footer: Ft1
   pre-emit critique: P4 H4 E4 S5 R4 V4 */
:root {
  --ground: #e9edf1;
  --surface: #f6f8fa;
  --ink: #111a2e;
  --muted: #4f5d75;
  --rule: #c9d1dc;
  --accent: #c4162a;
  --accent-ink: #ffffff;
  --band-bg: #111a2e;
  --band-ink: #e9edf5;
  --band-muted: #a3afc5;
  --band-rule: #2a3855;
  --c-noun: #2d4c85;
  --c-verb: #0c7660;
  --c-part: #b3541a;
  --c-other: #74529f;
  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "IBM Plex Sans", "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Sans", "IBM Plex Sans", sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-md: 1.3rem;
  --text-lg: clamp(1.7rem, 2.6vw + 0.6rem, 2.5rem);
  --text-xl: clamp(2rem, 3.6vw + 0.6rem, 3.2rem);
  --text-display: clamp(2.6rem, 5.2vw + 0.6rem, 4.9rem);
  --gutter: clamp(16px, 4vw, 56px);
  --space-sm: 12px;
  --space-md: 24px;
  --space-lg: 56px;
  --space-xl: clamp(72px, 10vw, 128px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0d1424;
    --surface: #151e34;
    --ink: #e8ecf4;
    --muted: #9ba8c0;
    --rule: #25314d;
    --accent: #ff6f64;
    --accent-ink: #1a0b0c;
    --band-bg: #070b15;
    --band-ink: #e8ecf4;
    --band-muted: #9ba8c0;
    --band-rule: #202c47;
    --c-noun: #8fb1f0;
    --c-verb: #4fd1b0;
    --c-part: #f2a35e;
    --c-other: #b99cec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0d1424;
  --surface: #151e34;
  --ink: #e8ecf4;
  --muted: #9ba8c0;
  --rule: #25314d;
  --accent: #ff6f64;
  --accent-ink: #1a0b0c;
  --band-bg: #070b15;
  --band-ink: #e8ecf4;
  --band-muted: #9ba8c0;
  --band-rule: #202c47;
  --c-noun: #8fb1f0;
  --c-verb: #4fd1b0;
  --c-part: #f2a35e;
  --c-other: #b99cec;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--text-base)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, figure, pre { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-style: normal; text-wrap: balance; letter-spacing: -0.02em; overflow-wrap: anywhere; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.in { max-width: 1180px; margin: 0 auto; }
section, header, footer { padding-inline: var(--gutter); }

/* nav */
.nav { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 32px; flex-wrap: wrap; padding-block: 20px; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; text-decoration: none; }
.nav nav { display: flex; gap: 8px 28px; flex-wrap: wrap; font-size: var(--text-sm); }
.nav nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.nav nav a:hover { color: var(--ink); }

/* hero */
.hero { padding-top: clamp(28px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 88px); align-items: end; }
.hero h1 { font-size: var(--text-display); line-height: 1.04; font-weight: 800; max-width: 12ch; }
.lede { margin-top: var(--space-md); max-width: 46ch; font-size: var(--text-md); line-height: 1.5; color: var(--muted); }
.lede strong { color: var(--ink); font-weight: 500; }
.store { margin-top: 28px; }
.store-btn { display: inline-block; line-height: 0; }
.store-btn img { display: block; height: 50px; width: auto; }
.facts { margin-top: 18px; font-size: var(--text-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 22px; }
.facts span { white-space: nowrap; }

.phone-clip { justify-self: center; width: min(100%, 340px); height: clamp(420px, 56vw, 600px); overflow: hidden; border: 1px solid var(--rule); border-bottom: 0; border-radius: 38px 38px 0 0; background: var(--surface); }
.phone-clip img { display: block; width: 100%; height: auto; }

/* live line */
.live { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--rule); padding-top: 28px; padding-bottom: var(--space-xl); }
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 32px; }
.live-head p { color: var(--muted); font-size: var(--text-sm); max-width: 60ch; }
.live-head h2 { font-size: var(--text-md); font-weight: 700; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(28px, 5vw, 72px); margin-top: 28px; align-items: start; }
.line-stage { min-width: 0; }
.line { font-family: var(--font-jp); font-weight: 500; font-size: clamp(1.7rem, 4.6vw + 0.4rem, 3.4rem); line-height: 2.1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 0.08em; }
.line .w { font: inherit; color: inherit; background: none; border: 0; border-bottom: 5px solid transparent; padding: 0 0.1em; cursor: pointer; border-radius: 6px 6px 0 0; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.line .w[data-c="noun"] { --c: var(--c-noun); }
.line .w[data-c="verb"] { --c: var(--c-verb); }
.line .w[data-c="part"] { --c: var(--c-part); }
.line .w[data-c="other"] { --c: var(--c-other); }
.line.gloss-on .w { border-bottom-color: var(--c); }
.line .w:hover { background: color-mix(in oklab, var(--c) 12%, transparent); }
.line .w[aria-pressed="true"] { background: color-mix(in oklab, var(--c) 20%, transparent); }
.line .stop { align-self: flex-end; padding: 0 0.05em; }
.line rt { font-family: var(--font-body); font-size: 0.34em; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.line.furigana-off rt { display: none; }
.line.furigana-off { line-height: 1.7; }
.under { margin-top: 10px; display: grid; gap: 4px; min-height: 5.6em; }
.romaji { font-size: var(--text-md); color: var(--muted); letter-spacing: 0.01em; }
.translation { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.3; font-weight: 500; }
.under [hidden] { display: none; }

.toggles { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font: 500 var(--text-sm)/1 var(--font-body); padding: 11px 18px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.sheet { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 26px 26px 24px; min-width: 0; }
.sheet-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-word { font-family: var(--font-jp); font-size: 2.4rem; font-weight: 500; line-height: 1.2; }
.sheet-read { color: var(--muted); font-size: var(--text-md); margin-top: 2px; }
.cls { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
.cls i { width: 22px; height: 5px; border-radius: 3px; background: var(--c); display: block; }
.sheet dl { margin: 22px 0 0; display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 12px 16px; border-top: 1px solid var(--rule); padding-top: 18px; }
.sheet dt { color: var(--muted); font-size: var(--text-sm); padding-top: 3px; }
.sheet dd { margin: 0; line-height: 1.55; }
.sheet-hint { margin-top: 18px; color: var(--muted); font-size: var(--text-sm); }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--rule); border-radius: 4px; padding: 6px 10px; }
.step.last { border-color: var(--c); }
.step-form { font-family: var(--font-jp); font-size: 1.15rem; font-weight: 500; }
.step-label { color: var(--c); font-size: var(--text-sm); font-weight: 500; }
.step-how { color: var(--muted); font-size: 0.72rem; }
.steps .arrow { color: var(--muted); }

/* tour */
.tour { padding-bottom: var(--space-xl); }
.sec-head { max-width: 22ch; font-size: var(--text-xl); line-height: 1.12; font-weight: 800; }
.row { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(32px, 7vw, 112px); align-items: center; padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--rule); }
.tour .sec-head { margin-bottom: clamp(36px, 5vw, 64px); }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.row.flip figure { order: 2; }
.row figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 34px; background: var(--surface); }
.row h3 { font-size: var(--text-xl); line-height: 1.12; font-weight: 700; max-width: 14ch; }
.row p { margin-top: 18px; max-width: 42ch; font-size: var(--text-md); line-height: 1.55; color: var(--muted); }
.row .src { margin-top: 22px; font-size: var(--text-sm); color: var(--muted); }
.row .src b { font-family: var(--font-jp); font-weight: 500; color: var(--ink); }

/* video band */
.band { background: var(--band-bg); color: var(--band-ink); padding-block: var(--space-xl); }
.band-grid { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: clamp(32px, 8vw, 128px); align-items: center; }
.band video { display: block; width: 100%; height: auto; border-radius: 30px; border: 1px solid var(--band-rule); background: var(--band-bg); }
.band h2 { font-size: var(--text-xl); line-height: 1.12; font-weight: 800; max-width: 13ch; }
.band p { margin-top: 20px; max-width: 46ch; color: var(--band-muted); font-size: var(--text-md); line-height: 1.55; }
.band p a { color: var(--band-ink); }
.band .credit { font-size: var(--text-sm); }

/* packs */
.packs { padding-block: var(--space-xl); }
.packs .intro { margin-top: 20px; max-width: 54ch; color: var(--muted); font-size: var(--text-md); line-height: 1.55; }
.pack-list { list-style: none; padding: 0; margin: clamp(32px, 5vw, 56px) 0 0; border-top: 1px solid var(--ink); }
.pack { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px clamp(24px, 6vw, 96px); align-items: center; padding-block: 30px; border-bottom: 1px solid var(--rule); }
.pack .jp { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 3.4vw + 0.4rem, 3.1rem); line-height: 1.25; letter-spacing: 0; }
.pack .meta { display: grid; gap: 4px; font-size: var(--text-base); color: var(--muted); }
.pack .meta strong { color: var(--ink); font-weight: 500; }

/* make a pack */
.make { padding-bottom: var(--space-xl); }
.make-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.make h2 { font-size: var(--text-xl); line-height: 1.12; font-weight: 800; max-width: 14ch; }
.make p { margin-top: 20px; max-width: 46ch; color: var(--muted); font-size: var(--text-md); line-height: 1.55; }
.give { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.give code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; min-width: 0; flex: 1 1 260px; }
.make figure { min-width: 0; }
.make pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 22px 24px; font: 400 0.84rem/1.7 ui-monospace, "SF Mono", Menlo, "Hiragino Sans", monospace; }
.make figcaption { margin-top: 12px; font-size: var(--text-sm); color: var(--muted); }
.k { color: var(--c-noun); } .s { color: var(--c-verb); } .n { color: var(--c-part); }

/* private */
.private { border-top: 1px solid var(--ink); padding-block: var(--space-xl); }
.private-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.private h2 { font-size: var(--text-display); line-height: 1.05; font-weight: 800; }
.private h2 span { display: block; }
.private p { color: var(--muted); font-size: var(--text-md); line-height: 1.55; max-width: 40ch; }
.private p + p { margin-top: 16px; font-size: var(--text-base); }

/* footer */
.foot { border-top: 1px solid var(--rule); padding-block: 36px 48px; }
.foot-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px 40px; align-items: baseline; }
.foot .tag { color: var(--muted); font-size: var(--text-sm); }
.foot nav { display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: var(--text-sm); }
.foot nav a { text-decoration: none; color: var(--muted); white-space: nowrap; }
.foot nav a:hover { color: var(--ink); }
.foot .credit { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; max-width: 80ch; line-height: 1.6; }

@media (max-width: 860px) {
  .hero-grid, .live-grid, .make-grid, .private-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: none; }
  .row, .row.flip { grid-template-columns: minmax(0, 1fr); }
  .row figure, .row.flip figure { order: 0; max-width: 300px; }
  .band-grid { grid-template-columns: minmax(0, 1fr); }
  .band figure { max-width: 300px; }
  .pack { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .phone-clip { height: 420px; width: min(100%, 300px); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
