/* Proportions first. Everything below is a multiple of these. */
:root {
  --phi: 1.618;
  --u: 8px;                                   /* the spacing unit */
  --gutter: clamp(16px, 4vw, 48px);           /* page side margin */
  --gap: calc(var(--u) * 3);
  --section: clamp(72px, 12vw, 168px);        /* air between sections */
  --t-1: 13px;                                /* type scale: each step is sqrt(phi) x the last */
  --t0: 16px;
  --t1: 20px;
  --t2: 26px;
  --t3: 33px;
  --t4: clamp(33px, 5vw, 54px);
  --t5: clamp(44px, 9vw, 110px);
  --ink: #0d0d0d;
  --ink-2: #6b6b6b;
  --ink-3: #767676;
  --line: #e6e6e6;
  --soft: #f5f5f5;
  --bg: #fff;
  --bar-h: 72px;                              /* player height */
  --head-h: 64px;
  --sans: "Helvetica Neue", Helvetica, "Inter", Arial, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--t0)/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
body.has-player { padding-bottom: var(--bar-h); }
a { color: inherit; text-decoration: none; }
main:focus { outline: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; line-height: 1.12; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--ink); color: #fff; }
.eq { font-weight: 500; font-variant-numeric: lining-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.label { font: 400 var(--t-1)/1.4 var(--mono); color: var(--ink-2); letter-spacing: 0; }
.mute { color: var(--ink-2); }
.wrap { padding-inline: var(--gutter); }
.link { border-bottom: 1px solid currentColor; padding-bottom: 1px; transition: opacity .15s; }
.link:hover { opacity: .55; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); height: var(--head-h); padding-inline: var(--gutter); position: relative; z-index: 5; background: var(--bg); }
.wordmark { font-weight: 500; font-size: var(--t1); letter-spacing: -.01em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: 15px; white-space: nowrap; }
.nav a { color: var(--ink-2); padding-block: 8px; transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* Hero: every equation is a button */
.hero { position: relative; height: calc(100svh - var(--head-h)); min-height: 520px; overflow: hidden; }
.hero { cursor: pointer; }
.rain { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.field { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: var(--gutter); position: relative; z-index: 1; }
.field a { color: var(--ink-2); font-size: 15px; }
.field.placed { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.stage { position: absolute; left: 50%; top: 43%; transform: translate(-50%, -50%); width: min(100% - 2 * var(--gutter), 1120px); text-align: center; pointer-events: none; z-index: 2; }
.stage > * { pointer-events: auto; }
.stage-lead { font-size: clamp(38px, 6.2vw, 88px); font-weight: 500; line-height: 1.04; letter-spacing: -.025em; text-wrap: balance; }
.stage-lead .br { display: block; }
.stage-cta { margin-top: calc(var(--u) * 3.5); display: flex; justify-content: center; }
.stage-sub { margin-top: calc(var(--u) * 1.5); color: var(--ink-2); font-size: 15px; }
.stage-idle { transition: opacity .25s; }
.stage-now { position: absolute; inset: 50% 0 auto; transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .25s; }
.is-live .stage-idle { opacity: 0; visibility: hidden; }
.is-live .stage-now { opacity: 1; visibility: visible; }
.stage-title { display: inline-block; font-size: var(--fit, var(--t5)); line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; }
.stage-what { margin: calc(var(--u) * 2) auto 0; max-width: 34em; color: var(--ink-2); font-size: var(--t0); }
.stage-actions { margin-top: calc(var(--u) * 2); display: flex; gap: calc(var(--u) * 3); justify-content: center; font-size: 15px; }
.scope { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 21%; min-height: 90px; display: block; z-index: 1; pointer-events: none; transition: bottom .28s; }
body.has-player .scope { bottom: var(--bar-h); }

/* Sections */
.section { padding: var(--section) var(--gutter) 0; }
.section:last-of-type { padding-bottom: var(--section); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--gap); margin-bottom: calc(var(--u) * 5); }
.section-head h2 { font-size: var(--t4); }
.page-head { padding: clamp(32px, 6vw, 80px) var(--gutter) calc(var(--u) * 5); }
.page-head h1 { font-size: var(--t5); letter-spacing: -.025em; line-height: 1.04; text-wrap: balance; word-break: auto-phrase; }
.page-head.tight h1 { font-size: clamp(36px, 6.2vw, 88px); }
.page-head p { margin-top: calc(var(--u) * 2.5); max-width: 38em; color: var(--ink-2); font-size: var(--t1); line-height: 1.5; }

/* Album feature: golden split */
.album-split { display: grid; grid-template-columns: 1fr 1.618fr; gap: clamp(24px, 5vw, 72px); align-items: end; }
.album-split img { width: 100%; aspect-ratio: 1; }
.album-split h2, .album-split h1 { font-size: clamp(72px, 15vw, 200px); line-height: .95; letter-spacing: -.03em; }
.album-split .lede { margin-top: calc(var(--u) * 3); font-size: var(--t1); max-width: 28em; line-height: 1.5; }
.stores { display: flex; flex-wrap: wrap; gap: 10px calc(var(--u) * 3); margin-top: calc(var(--u) * 3); font-size: 15px; }
.button { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 22px 0 18px; border-radius: 22px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500; white-space: nowrap; transition: transform .12s; }
.button:hover { transform: scale(1.03); }
.button:active { transform: scale(.98); }
.button svg { width: 14px; height: 14px; fill: currentColor; }
.button .i-pause { display: none; }
.is-playing > .i-pause, .is-playing .i-pause { display: block; }
.is-playing > .i-play, .is-playing .i-play { display: none; }

/* Wall of plots */
.plots { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(8px, 2vw, 28px); }
.plots a { display: block; }
.plots img, .plots .fig { width: 100%; aspect-ratio: 1; transition: transform .2s; }
.plots a:hover img { transform: scale(1.05); }
.plots .cap { display: block; margin-top: 8px; font-size: var(--t-1); line-height: 1.25; overflow-wrap: anywhere; }

/* Score excerpt on home */
.excerpt { display: block; border-block: 1px solid var(--line); padding-block: calc(var(--u) * 2); overflow: hidden; }
.excerpt img { width: 100%; min-width: 720px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); counter-reset: h; }
.how li { border-top: 1px solid var(--ink); padding-top: calc(var(--u) * 2); }
.how h3 { font-size: var(--t2); margin-bottom: calc(var(--u) * 1.5); line-height: 1.2; }
.how p { color: var(--ink-2); }

/* Library */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--u) * 1.5) calc(var(--u) * 3); padding: 0 var(--gutter) calc(var(--u) * 3); position: sticky; top: 0; z-index: 3; background: var(--bg); padding-top: calc(var(--u) * 1.5); }
.search { flex: 1 1 200px; max-width: 360px; height: 40px; border: 0; border-bottom: 1px solid var(--ink); background: none; font: inherit; padding: 0 2px; border-radius: 0; color: var(--ink); -webkit-appearance: none; }
.search::placeholder { color: var(--ink-3); }
.search:focus { outline: none; border-bottom-width: 2px; }
.sort { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; }
.sort button, .views button { color: var(--ink-3); padding: 6px 0; transition: color .15s; }
.sort button:hover, .views button:hover { color: var(--ink); }
.sort button.on, .views button.on { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.views { margin-left: auto; display: flex; gap: 14px; font-size: 15px; }
.rows { padding-inline: var(--gutter); }
.row { display: grid; grid-template-columns: 56px minmax(0, 2.6fr) minmax(0, 1fr) minmax(90px, 1.6fr) 48px minmax(0, .9fr) 48px; align-items: center; gap: var(--gap); padding-block: 10px; border-top: 1px solid var(--line); }
.row:hover { background: linear-gradient(90deg, transparent, var(--soft) 12%, var(--soft) 88%, transparent); }
.row.is-current .row-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.thumb { position: relative; width: 56px; height: 56px; display: block; }
.thumb img { width: 100%; height: 100%; }
.thumb i { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.82); opacity: 0; transition: opacity .12s; }
.thumb i svg { width: 16px; height: 16px; fill: var(--ink); }
.thumb:hover i, .thumb:focus-visible i, .thumb.is-playing i { opacity: 1; }
.row-title { font-size: var(--t1); font-weight: 500; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.row-n { color: var(--ink-3); font-size: var(--t-1); margin-right: 8px; font-weight: 400; }
.spark { width: 100%; height: 28px; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rows.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: clamp(16px, 2.5vw, 32px); }
.as-grid .row { display: block; border: 0; padding: 0; background: none; }
.as-grid .thumb { width: 100%; height: auto; aspect-ratio: 1; }
.as-grid .row-title { display: block; margin-top: 8px; font-size: 15px; }
.as-grid .row > :not(.thumb):not(.row-main) { display: none; }
.as-grid .row-main .mute { display: block; font-size: var(--t-1); }
.empty { padding: calc(var(--u) * 6) var(--gutter); color: var(--ink-2); }

/* Track */
.track-head { padding: clamp(24px, 4vw, 56px) var(--gutter) 0; }
.crumb { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-2); font-size: 15px; }
.track-title { font-size: var(--fit, clamp(44px, 11vw, 156px)); line-height: 1.02; letter-spacing: -.025em; margin-top: calc(var(--u) * 2); white-space: nowrap; }
.track-what { margin-top: calc(var(--u) * 2.5); max-width: 32em; font-size: var(--t1); line-height: 1.45; color: var(--ink-2); }
.track-actions { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--u) * 1.5) calc(var(--u) * 3); margin-top: calc(var(--u) * 3); font-size: 15px; }
.track-scope { width: 100%; height: clamp(120px, 20vw, 220px); display: block; margin-top: calc(var(--u) * 3); }
.track-body { display: grid; grid-template-columns: 1.618fr 1fr; gap: clamp(32px, 6vw, 96px); padding: clamp(40px, 6vw, 80px) var(--gutter) 0; align-items: start; }
.fact { border-top: 1px solid var(--ink); padding-top: calc(var(--u) * 1.5); margin-bottom: calc(var(--u) * 5); }
.fact h2 { font: 400 var(--t-1)/1.4 var(--mono); color: var(--ink-2); margin-bottom: calc(var(--u) * 1.5); letter-spacing: 0; }
.fact .formula { font-size: var(--t2); line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.fact .formula sup, .fact .formula sub { font-size: .66em; line-height: 0; }
.fact p { font-size: var(--t1); line-height: 1.5; max-width: 34em; }
.fact p.small { font-size: var(--t0); color: var(--ink-2); line-height: 1.6; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; font-size: 15px; }
.meta dt { color: var(--ink-2); }
.meta dd { margin: 0; }
.figure { position: relative; }
.figure svg { width: 100%; height: auto; }
.figure .rider { fill: var(--ink); }
.peek { display: block; margin-top: 0; overflow: hidden; }
.peek img { width: 100%; min-width: 620px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); padding: var(--section) var(--gutter) var(--section); font-size: var(--t1); font-weight: 500; }
.pager a { display: block; border-top: 1px solid var(--ink); padding-top: calc(var(--u) * 1.5); overflow-wrap: anywhere; }
.pager a span { display: block; color: var(--ink-2); font: 400 var(--t-1)/1.6 var(--mono); }
.pager a:last-child { text-align: right; }

/* Score */
.score-eq { margin: calc(var(--u) * 4) var(--gutter); border-top: 1px solid var(--ink); padding-top: calc(var(--u) * 1.5); max-width: 56em; }
.score-eq h2 { font: 400 var(--t-1)/1.4 var(--mono); color: var(--ink-2); letter-spacing: 0; margin-bottom: calc(var(--u) * 1); }
.score-eq .formula { font-size: var(--t3); line-height: 1.3; font-weight: 500; margin-bottom: calc(var(--u) * 3); overflow-wrap: anywhere; }
.score-eq .formula sup, .score-eq .formula sub, .list-eq sup, .list-eq sub { font-size: .66em; line-height: 0; }
.score-eq .decides { font-size: var(--t1); line-height: 1.5; max-width: 34em; }
.list-eq { display: block; margin-top: 6px; font-size: 15px; color: var(--ink-2); font-weight: 400; overflow-wrap: anywhere; }
.score-note { max-width: 40em; color: var(--ink-2); padding-inline: var(--gutter); }
.dl .mute:hover { color: var(--ink); }
.dl { display: flex; flex-wrap: wrap; gap: 8px calc(var(--u) * 3); padding: calc(var(--u) * 2.5) var(--gutter) calc(var(--u) * 5); font-size: 15px; align-items: center; }
.follow { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; color: var(--ink-2); }
.follow input { accent-color: var(--ink); margin: 0; }
.sheet { overflow-x: auto; padding: 0 var(--gutter) var(--section); -webkit-overflow-scrolling: touch; }
.sheet-in { min-width: 760px; max-width: 1480px; margin-inline: auto; }
.sheet h2 { font: 400 var(--t-1)/1.4 var(--mono); color: var(--ink-2); padding: calc(var(--u) * 3) 0 calc(var(--u) * .5); border-top: 1px solid var(--line); margin-top: calc(var(--u) * 2); letter-spacing: 0; }
.line { position: relative; margin: 0; cursor: pointer; }
.line img { width: 100%; height: auto; display: block; }
.line .tint { position: absolute; top: 0; bottom: 0; background: rgba(13,13,13,.045); pointer-events: none; display: none; }
.line .head { position: absolute; top: 4%; bottom: 0; width: 1.5px; background: var(--ink); pointer-events: none; display: none; }
.line .head::before { content: ""; position: absolute; left: 50%; top: -3px; width: var(--dot, 11px); height: var(--dot, 11px); border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.line.now .head, .line.now .tint { display: block; }
.line .silent { color: var(--ink-3); padding: calc(var(--u) * 2) 0; font-size: var(--t-1); font-family: var(--mono); }
.score-list { padding-inline: var(--gutter); }
.score-item { display: grid; grid-template-columns: minmax(150px, 1fr) 2.618fr; gap: var(--gap); padding-block: calc(var(--u) * 3); border-top: 1px solid var(--line); align-items: center; }
.score-item .row-title { display: block; }
.score-item .stat { display: block; color: var(--ink-2); font: 400 var(--t-1)/1.5 var(--mono); margin-top: 6px; }
.score-thumb { overflow: hidden; display: block; max-height: 180px; }
.score-thumb img { width: 100%; min-width: 560px; height: auto; object-position: left top; }

/* Albums */
.albums { display: grid; gap: var(--section); padding: 0 var(--gutter) var(--section); }
.next-album { border-top: 1px solid var(--ink); padding-top: calc(var(--u) * 2); }
.next-album h2 { font-size: var(--t4); }
.next-album p { margin-top: calc(var(--u) * 1.5); color: var(--ink-2); max-width: 34em; }
.album-meta { padding: calc(var(--u) * 6) var(--gutter) 0; display: grid; grid-template-columns: 1.618fr 1fr; gap: clamp(32px, 6vw, 96px); }
.album-meta p { font-size: var(--t1); line-height: 1.5; max-width: 34em; }

/* Prose pages */
.prose { padding: 0 var(--gutter) var(--section); max-width: calc(44em + 2 * var(--gutter)); }
.prose h2 { font-size: var(--t2); margin: calc(var(--u) * 7) 0 calc(var(--u) * 2); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { margin-bottom: calc(var(--u) * 2); color: #2a2a2a; }
.prose ul { list-style: disc; padding-left: 1.2em; }
.prose a { border-bottom: 1px solid currentColor; }
.prose .big { font-size: var(--t2); line-height: 1.4; color: var(--ink); font-weight: 400; }
.steps { counter-reset: s; margin-top: calc(var(--u) * 3); }
.steps li { display: grid; grid-template-columns: 40px 1fr; margin-bottom: calc(var(--u) * 3); }
.steps li::before { counter-increment: s; content: counter(s); font-family: var(--mono); color: var(--ink-3); font-size: var(--t-1); padding-top: 4px; }
.steps b { font-weight: 500; display: block; }
.faq dt { font-weight: 500; margin-top: calc(var(--u) * 3); }
.faq dd { margin: calc(var(--u) * 1) 0 0; color: #2a2a2a; }
.updated { color: var(--ink-3); font-size: var(--t-1); font-family: var(--mono); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: calc(var(--u) * 6) var(--gutter) calc(var(--u) * 5); display: grid; grid-template-columns: 1.618fr 1fr 1fr; gap: var(--gap); font-size: 15px; }
.site-foot .say { font-size: var(--t2); font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.site-foot .credit { margin-top: calc(var(--u) * 2); font: 400 var(--t-1)/1.7 var(--mono); color: var(--ink-2); }
.site-foot ul a { color: var(--ink-2); display: inline-block; padding-block: 3px; }
.site-foot ul a:hover { color: var(--ink); }

/* Player */
.player { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h); z-index: 10; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); display: grid; grid-template-columns: auto minmax(120px, 280px) minmax(0, 1fr) auto; align-items: center; gap: calc(var(--u) * 3); padding-inline: var(--gutter); transform: translateY(100%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s; backdrop-filter: blur(8px); }
.player.on { transform: none; visibility: visible; transition-delay: 0s; }
.ctl { display: flex; align-items: center; gap: 4px; }
.ctl button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; transition: background .12s; }
.ctl button:hover { background: var(--soft); }
.ctl svg { width: 16px; height: 16px; fill: var(--ink); }
.ctl .main { background: var(--ink); width: 44px; height: 44px; }
.ctl .main:hover { background: var(--ink); transform: scale(1.05); }
.ctl .main svg { fill: #fff; }
.ctl .main .i-pause { display: none; }
.player.playing .main .i-pause { display: block; }
.player.playing .main .i-play { display: none; }
.now { min-width: 0; }
.now a { display: block; font-weight: 500; font-size: var(--t1); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.now span { display: block; font-size: var(--t-1); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seek { width: 100%; height: 44px; display: block; cursor: pointer; touch-action: none; }
.time { font: 400 var(--t-1)/1 var(--mono); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.load-state { opacity: .55; }

@media (max-width: 900px) {
  .row { grid-template-columns: 56px minmax(0, 1fr) 44px; }
  .row > .c-style, .row > .c-spark, .row > .c-bpm, .row > .c-key { display: none; }
  .plots { grid-template-columns: repeat(5, 1fr); }
  .how { grid-template-columns: 1fr; }
  .track-body, .album-meta { grid-template-columns: 1fr; }
  .figure { max-width: 420px; }
  .site-foot { grid-template-columns: 1fr 1fr; }
  .site-foot > :first-child { grid-column: 1 / -1; }
  .score-item { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --bar-h: 112px; --head-h: 56px; }
  .nav { gap: 12px; font-size: 14px; }
  .wordmark { font-size: 17px; }
  .album-split { grid-template-columns: 1fr; }
  .plots { grid-template-columns: repeat(4, 1fr); }
  .plots .cap { display: none; }
  .player { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 60px 44px; gap: 0 12px; }
  .now { grid-column: 1; grid-row: 1; }
  .ctl { grid-column: 2; grid-row: 1; }
  .seek-wrap { grid-column: 1 / -1; grid-row: 2; margin-top: -6px; }
  .player .time { display: none; }
  .section-head { flex-wrap: wrap; }
  .pager { font-size: var(--t0); }
  .views { margin-left: 0; }
  .track-title { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-head, .site-foot, .player, .dl, .tools, .score-note, .pager { display: none !important; }
  body { padding: 0 !important; }
  .sheet { overflow: visible; padding: 0; }
  .sheet-in { min-width: 0; max-width: none; }
  .line, .sheet h2 { break-inside: avoid; }
}
