@import url('ui.css');

/* stems.fm — shared design system.
   Monochrome interface; every bit of colour on the page comes from the music itself. */

/* Dark: the music as light on black. Light: a white-walled gallery, the music as ink on paper. */
:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #ecebe6;
  --ink: 236, 235, 230;
  --dim: rgba(var(--ink), 0.56);
  --faint: rgba(var(--ink), 0.26);
  --line: rgba(var(--ink), 0.12);
  --hair: rgba(var(--ink), 0.07);
  --tint: 255, 255, 255;
  --panel: rgba(0, 0, 0, 0.72);
  --plate: #040404;
  --frame: #050505;
  --sans: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --col: 720px;
  --wide: 1120px;
  --gutter: clamp(20px, 4vw, 48px);
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f2f1ec;
  --fg: #151515;
  --ink: 21, 21, 21;
  --dim: rgba(var(--ink), 0.62);
  --faint: rgba(var(--ink), 0.36);
  --line: rgba(var(--ink), 0.14);
  --hair: rgba(var(--ink), 0.09);
  --tint: 21, 21, 21;
  --panel: rgba(242, 241, 236, 0.9);
  --plate: #ebeae4;
  --frame: #000;
}
html, body { transition: background-color 0.4s ease, color 0.4s ease; }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--fg); scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg, canvas { display: block; }

/* ── navigation ── */
.nav {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  background: linear-gradient(var(--bg) 40%, transparent);
}
.mark { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: 0.02em; }
.mark svg { width: 22px; height: 22px; }
.nav ul { list-style: none; display: flex; gap: 4px; align-items: center; }
.nav ul a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--dim);
  border-radius: 999px;
  transition: color 0.2s;
}
.nav ul a:hover, .nav ul a[aria-current='page'] { color: var(--fg); }
.nav .connect {
  margin-left: 10px;
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  transition: border-color 0.2s;
}
.nav .connect:hover { border-color: var(--faint); }

/* ── type ── */
.statement {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.015em;
}
.statement.dim { color: var(--dim); }
/* Explanations: plain sentences, easy to read at length. Short labels use .caps or .kicker. */
.facts {
  font-size: 17px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 38em;
}
.caps { font-family: var(--mono); font-size: 11px; line-height: 1.8; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.facts p + p { margin-top: 1.4em; }
.facts a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.facts a:hover { text-decoration-color: var(--fg); }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.body { font-size: 16px; line-height: 1.65; color: var(--dim); max-width: 34em; }
.body strong { color: var(--fg); font-weight: 500; }

/* ── layout ── */
.page { padding-top: 120px; }
.section { padding: clamp(96px, 16vh, 180px) var(--gutter); }
.section.tight { padding-top: 48px; padding-bottom: 48px; }
.col { max-width: var(--col); margin: 0 auto; }
.wide { max-width: var(--wide); margin: 0 auto; }
.stack > * + * { margin-top: 28px; }
.rule { height: 1px; background: var(--line); border: 0; }

/* ── artwork with caption ── */
.piece { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.piece .frame { width: 100%; aspect-ratio: 1; background: var(--frame); outline: 1px solid var(--hair); }
.piece .frame img, .piece .frame svg { width: 100%; height: 100%; }
.caption { text-align: center; font-size: 13px; line-height: 1.45; }
.caption b { display: block; font-weight: 500; }
.caption span { color: var(--dim); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: clamp(32px, 8vw, 140px); align-items: start; }
.pair .arrow { align-self: center; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 190px); gap: 28px; overflow-x: auto; padding: 8px var(--gutter) 24px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.row.center { justify-content: center; }

/* ── numbers ── */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.numbers > div { padding: 22px 0 0; }
.numbers > div + div { padding-left: 24px; border-left: 1px solid var(--hair); }
.numbers .n { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.numbers .l { margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* ── buttons ── */
/* One primary action per place (.solid); the rest are soft, filled pills rather than outlines.
   Sizes: default, .lg for a page's main call to action, .sm inside cards and toolbars. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--fg);
  background: rgba(var(--tint), 0.08);
  border: 1px solid transparent;
  transition: background 0.2s, opacity 0.2s;
}
.button:hover { background: rgba(var(--tint), 0.14); }
.button.solid { background: var(--fg); color: var(--bg); }
.button.solid:hover { opacity: 0.86; }
.button.lg { height: 52px; padding: 0 30px; font-size: 15px; }
.button.sm { height: 34px; padding: 0 15px; font-size: 13px; }

.theme {
  width: 30px; height: 30px; margin-left: 6px; border-radius: 50%;
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}
.theme:hover { border-color: var(--faint); }
.theme span { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--fg); background: linear-gradient(90deg, var(--fg) 50%, transparent 50%); }
.button:disabled, .button:disabled:hover { opacity: 0.35; cursor: default; background: rgba(var(--tint), 0.08); }
.button.solid:disabled { background: var(--fg); }

/* ── footer ── */
.footer {
  padding: 88px var(--gutter) 40px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  color: var(--dim);
}
.footer ul { list-style: none; }
.footer a:hover { color: var(--fg); }
/* Pages with the radio leave room under the footer, so the player never sits on top of the links. */
.has-radio .footer { padding-bottom: 190px; }

.prototype-note {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
}

/* ── reveal on scroll ── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .nav ul li.optional { display: none; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .numbers > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
