/*
 * Louder — landing page.
 *
 * Direction: broadcast console. The subject's world is level metering, so the
 * accent is not a single colour but a SCALE — the green/amber/red zones of a VU
 * meter. --mid and --hot are lifted from Roo Run's sun and heart colours, which
 * ties the portal to the game without borrowing its pixel-art style.
 *
 * No webfonts: a heavy system grotesque at extreme scale against wide-tracked
 * monospace labels is the studio-equipment vernacular, and it costs zero
 * network requests.
 */

:root {
  --ink: #0f0e0d;
  --panel: #1a1817;
  --edge: #2a2624;
  --paper: #f2ede4;
  --quiet: #6e6862;

  /* The VU scale. */
  --lo: #7fb069;
  --mid: #e8b44a;
  --hot: #e2593a;

  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --gut: clamp(1.25rem, 5vw, 3rem);
  --maxw: 62rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:focus-visible {
  outline: 2px solid var(--mid);
  outline-offset: 3px;
}

/* ── top bar ───────────────────────────────────────────────────────────── */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gut);
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.bar__mark { color: var(--paper); }

.bar__readout {
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
  transition: color 120ms linear;
}

.bar__readout[data-live="on"] { color: var(--lo); }
.bar__readout[data-live="hot"] { color: var(--hot); }

/* ── hero ──────────────────────────────────────────────────────────────── */

.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 5.5rem) var(--gut) clamp(2rem, 6vw, 3.5rem);
}

/* The wordmark: six letters as six meter segments. */
.mark {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0.02em;
  margin: 0;
  font-size: clamp(3.5rem, 17vw, 11rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.mark__seg {
  color: var(--quiet);
  opacity: 0.45;
  transition: color 90ms linear, opacity 90ms linear, transform 90ms ease-out;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.mark__seg[data-on="1"] {
  opacity: 1;
  transform: translateY(-0.012em) scaleY(1.03);
}

.mark__seg[data-on="1"][data-zone="lo"]  { color: var(--lo); }
.mark__seg[data-on="1"][data-zone="mid"] { color: var(--mid); }
.mark__seg[data-on="1"][data-zone="hot"] { color: var(--hot); }

/* ── level bar ─────────────────────────────────────────────────────────── */

.level { margin-top: clamp(1rem, 3vw, 1.75rem); }

.level__track {
  position: relative;
  height: 10px;
  background: var(--panel);
  border: 1px solid var(--edge);
  overflow: hidden;
}

/*
 * The gradient spans the FULL track and the fill is clipped to the current
 * level. Animating `width` instead would rescale the gradient with the bar, so
 * a quiet reading would show the whole green-to-red ramp squeezed into a few
 * pixels — the bar would claim you were peaking while you whispered.
 */
.level__fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--lo) 0%, var(--lo) 48%, var(--mid) 72%, var(--hot) 100%);
  clip-path: inset(0 calc(100% - var(--lvl, 0%)) 0 0);
  transition: clip-path 70ms linear;
}

/* Peak hold — a real marker at the loudest recent reading, not decoration. */
.level__peak {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--paper);
  opacity: 0;
  transition: left 90ms linear, opacity 400ms linear;
}

.level__peak[data-on="1"] { opacity: 0.9; }

.level__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ── copy + actions ────────────────────────────────────────────────────── */

.lede {
  max-width: 20ch;
  margin: clamp(1.75rem, 5vw, 2.75rem) 0 0;
  font-size: clamp(1.5rem, 5.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 4vw, 2rem);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* thumb target */
  padding: 0 1.4rem;
  border: 1px solid var(--paper);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn--solid {
  background: var(--paper);
  color: var(--ink);
}

.btn--ghost[data-state="live"] {
  border-color: var(--lo);
  color: var(--lo);
}

.btn--ghost[data-state="off"] {
  border-color: var(--edge);
  color: var(--quiet);
  cursor: default;
}

@media (hover: hover) {
  .btn--ghost:hover { background: var(--paper); color: var(--ink); }
  .btn--solid:hover { background: var(--mid); border-color: var(--mid); }
  /* Live and disabled states report status; hover must not overwrite them. */
  .btn--ghost[data-state="live"]:hover { background: transparent; color: var(--lo); }
  .btn--ghost[data-state="off"]:hover { background: transparent; color: var(--quiet); }
}

.note {
  max-width: 46ch;
  margin: clamp(1.25rem, 3vw, 1.75rem) 0 0;
  color: var(--quiet);
  font-size: 0.875rem;
  line-height: 1.5;
}

.note[data-tone="warn"] { color: var(--mid); }

/* ── games ─────────────────────────────────────────────────────────────── */

.games {
  display: grid;
  gap: 1px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut) clamp(3rem, 8vw, 5rem);
}

.card {
  padding: clamp(1.5rem, 5vw, 2.25rem) 0;
  border-top: 1px solid var(--edge);
}

.card__kicker {
  margin: 0;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.card__title {
  margin: 0.5rem 0 0;
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.card__body {
  max-width: 48ch;
  margin: 0.75rem 0 0;
  color: var(--paper);
  opacity: 0.72;
  font-size: 1rem;
}

.card__go {
  display: inline-block;
  margin-top: 1.1rem;
  color: var(--mid);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.card__go:hover { text-decoration: underline; }

.card__go--muted {
  color: var(--quiet);
  cursor: default;
}

.card--soon .card__title { color: var(--quiet); }

@media (min-width: 46rem) {
  .games { grid-template-columns: 1fr 1fr; gap: 0 3rem; }
}

/* ── footer ────────────────────────────────────────────────────────────── */

.foot {
  padding: 1.5rem var(--gut) 2.5rem;
  border-top: 1px solid var(--edge);
  color: var(--quiet);
  font-size: 0.8125rem;
}

.foot p { margin: 0; }
.foot__mono {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── reduced motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .mark__seg[data-on="1"] { transform: none; }
}
