:root {
  --paper: #f3ede3;
  --warm-tint: #f4e9dc;
  --slip: #fbf7f0;
  --ink: #2b2534;
  --muted: #8a8490;
  --plus: #bdb5bf;
  --line: #e3d9cb;
  --safe: #386fde;
  --quick: #f5b331;
  --into: #f7795d;
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: color-mix(in srgb, var(--warm-tint) calc(var(--warm, 0) * 100%), var(--paper)); color: var(--ink); }
body { font: 500 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
code { font: 500 0.88em/1 ui-monospace, "SF Mono", Menlo, monospace; }

.label, .frac, .count, .eq, .legend, .mark, nav, .button, h2, .slip-title, .slip-sub, .tag, .run ol b, .strip figcaption {
  font-family: "Unbounded", system-ui, sans-serif;
}

/* top */
.top { display: flex; align-items: center; justify-content: space-between; padding: 28px clamp(20px, 4vw, 56px); }
.mark { font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -0.01em; }
nav { display: flex; gap: 10px; align-items: center; }
.sound, .install {
  font: 600 13px/1 "Unbounded", system-ui, sans-serif; color: var(--ink); background: none;
  border: 2px solid var(--ink); border-radius: 999px; padding: 10px 16px; cursor: pointer; text-decoration: none;
}
.sound[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.install { background: var(--ink); color: var(--paper); }

/* hero: one bar of the score */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: 1fr auto;
  column-gap: 4vw; min-height: calc(100svh - 94px); padding: 2vh clamp(20px, 4vw, 56px) 40px;
}
.score { align-self: center; }
.label { font-weight: 600; font-size: 15px; color: var(--muted); letter-spacing: 0.01em; }
.frac { font-weight: 900; font-size: clamp(92px, 13.5vw, 212px); line-height: 0.86; letter-spacing: -0.035em; margin: 14px 0 18px; }
.frac.small { font-size: clamp(64px, 8vw, 120px); }
.frac em { font-style: normal; }
.count { font-weight: 700; font-size: 20px; }
[lang="ja"] { font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif; font-weight: 700; letter-spacing: 0.02em; }
.en { color: var(--muted); font-weight: 600; font-size: 0.78em; margin-left: 0.9em; }
.count .en, .legend .en { font-size: 0.72em; }
.eq { font-weight: 800; font-size: clamp(34px, 3.6vw, 52px); letter-spacing: -0.02em; margin: 6px 0 22px; line-height: 1.1; }
.eq span { color: var(--plus); margin: 0 0.04em; }
.eq i { font-style: normal; display: inline-block; }
.safe { color: var(--safe); } .quick { color: var(--quick); } .into { color: var(--into); } .ink { color: var(--ink); }
.legend { list-style: none; display: flex; gap: 28px; font-weight: 700; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend svg { width: 20px; height: 20px; fill: var(--ink); }

.pitch { max-width: 34ch; font-size: 18px; margin: 34px 0 22px; }
.actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-weight: 600; color: var(--muted); font-size: 15px; }
.button {
  display: inline-block; background: var(--ink); color: var(--paper); text-decoration: none;
  font-weight: 700; font-size: 15px; padding: 16px 24px; border-radius: 999px; transition: transform 180ms var(--pop);
}
.button:hover { transform: translateY(-2px) rotate(-1deg); }
.button.big { font-size: clamp(18px, 2.2vw, 26px); padding: 24px 38px; }

/* figures */
.figure { align-self: center; justify-self: center; width: min(100%, 600px); aspect-ratio: 1; }
.figure svg, .mini-figure svg, .strip svg { width: 100%; height: 100%; overflow: visible; display: block; }
/* a bar plays like the video: groups go mid tint → full color → pale, dots fill with ink, claps fill coral */
.seg { fill: color-mix(in srgb, var(--c) 78%, var(--paper)); }
.seg.now { fill: var(--c); }
.seg.past { fill: color-mix(in srgb, var(--c) 52%, var(--paper)); }
.seg.line { fill: none; stroke: color-mix(in srgb, var(--c) 78%, var(--paper)); stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; }
.seg.line.now { stroke: var(--c); }
.seg.line.past { stroke: color-mix(in srgb, var(--c) 52%, var(--paper)); }
.dot { fill: #fff; stroke: var(--ink); stroke-width: 2.6; transform-box: fill-box; transform-origin: center; transition: transform 90ms ease-out; }
.dot.on { fill: var(--ink); stroke: none; }
.dot.pop { transform: scale(1.45); }
.clap { fill: #fff; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.clap.on { fill: var(--into); }

.strip { grid-column: 1 / -1; display: flex; gap: 26px; align-items: flex-end; min-height: 98px; }
.strip figure { width: 64px; text-align: center; }
.strip .seg { fill: color-mix(in srgb, var(--c) 45%, var(--paper)); }
.strip .seg.line { fill: none; stroke: color-mix(in srgb, var(--c) 45%, var(--paper)); }
.strip svg { height: 64px; }
.strip figcaption { font-weight: 700; font-size: 13px; color: var(--muted); margin-top: 8px; }

/* the three groups */
.bar {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 4vw;
  padding: clamp(64px, 10vh, 120px) clamp(20px, 4vw, 56px); border-top: 2px solid var(--line);
}
.mini-figure { width: min(280px, 70%); aspect-ratio: 1; margin-top: 18px; }
h2 { font-weight: 800; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.1; letter-spacing: -0.02em; max-width: 18ch; }
.body > p { max-width: 52ch; font-size: 18px; margin: 18px 0 30px; }
.slip { background: var(--slip); border: 2px solid var(--line); border-radius: 18px; padding: 24px 26px; max-width: 680px; font-size: 15px; }
.slip-title { font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.slip-sub { font-weight: 700; font-size: 13px; color: var(--muted); margin: 18px 0 6px; }
.slip table { border-collapse: collapse; width: 100%; }
.slip td { padding: 9px 12px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.slip td:nth-child(2), .slip td:nth-child(3), .slip td:nth-child(4) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.slip td:last-child { color: #5d5763; }
.slip p + p { margin-top: 6px; }
.quote { color: #5d5763; padding-left: 14px; border-left: 3px solid var(--line); margin-bottom: 12px; }
.risk { line-height: 1.6; }
.tag { display: inline-block; font-weight: 700; font-size: 12px; color: #fff; background: var(--into); border-radius: 999px; padding: 4px 10px; margin-right: 10px; }

/* a run */
.run, .cost, .end { padding: clamp(64px, 10vh, 120px) clamp(20px, 4vw, 56px); border-top: 2px solid var(--line); }
.eq.big { font-size: clamp(38px, 6.4vw, 96px); margin: 16px 0 40px; }
.run ol { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.run li { font-size: 16px; color: #4a4450; }
.run ol b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 10px; }
.cost > p:last-child, .end p { max-width: 46ch; font-size: 18px; }
.end { text-align: center; padding-bottom: 140px; }
.end p { margin: 22px auto 0; color: var(--muted); font-weight: 600; }

footer { padding: 28px clamp(20px, 4vw, 56px) 40px; color: var(--muted); font-size: 14px; border-top: 2px solid var(--line); }


@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; row-gap: 28px; }
  .figure { width: min(100%, 440px); }
  .bar { grid-template-columns: 1fr; }
  .run ol { grid-template-columns: 1fr 1fr; }
  .slip td:last-child { display: none; }
}
@media (max-width: 520px) {
  .run ol { grid-template-columns: 1fr; }
  .legend { flex-direction: column; gap: 10px; }
  .install { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
