:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232322;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #8f8d86;
  --hair: #2c2c2a;
  --border: rgba(255, 255, 255, 0.12);
  --accent: #3987e5;
  --fam-1: #3987e5;
  --fam-2: #d95926;
  --fam-3: #199e70;
  --fam-4: #c98500;
  --fam-5: #d55181;
  --fam-6: #2fa02f;
  --fam-7: #9085e9;
  --fam-8: #e66767;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 800px; margin: 0 auto; padding-inline: 16px; }

.skip {
  position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--page);
  padding: 8px 12px; border-radius: 6px; z-index: 10;
}
.skip:focus { left: 8px; }

a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero */
.hero { padding-block: 56px 28px; border-bottom: 1px solid var(--hair); margin-bottom: 28px; }
.eyebrow {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
h1 {
  font-family: "Bebas Neue", system-ui, sans-serif; font-weight: 400;
  font-size: clamp(48px, 10vw, 84px); line-height: 0.95; margin: 6px 0 0; text-wrap: balance;
}
.lede { font-size: 16px; color: var(--ink-2); max-width: 58ch; margin: 14px 0 0; }
.privacy {
  display: inline-block; margin: 16px 0 0; font-size: 13px; color: var(--ink-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
}

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); margin-bottom: 24px; }
.tabs button {
  font: 700 14px "Manrope", sans-serif; color: var(--muted); background: none; border: none;
  padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.panel { display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.panel[hidden] { display: none; }
.panel-intro { margin: 0; color: var(--ink-2); max-width: 60ch; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }

.seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px;
  background: var(--surface);
}
.seg button {
  font: 600 13px "Manrope", sans-serif; border: none; background: transparent; color: var(--ink-2);
  padding: 8px 14px; border-radius: 7px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }

.field-label {
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 8px;
}
textarea {
  width: 100%; resize: vertical; font-family: "IBM Plex Mono", monospace; font-size: 15px;
  line-height: 1.7; background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
textarea::placeholder { color: var(--muted); }

.status { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--muted); margin: 0; min-height: 14px; }

/* Card */
.card-frame {
  display: flex; justify-content: center; background: var(--surface-2); border-radius: 16px;
  padding: 20px; border: 1px solid var(--hair);
}
.card {
  background: #141414; color: #f4f3f0; border-radius: 14px; overflow: hidden; width: 100%;
  max-width: 420px; aspect-ratio: 4 / 5; display: flex; flex-direction: column;
  font-family: "IBM Plex Mono", monospace; border: 1px solid rgba(255, 255, 255, 0.06);
}
.card.theme-light { background: #faf9f6; color: #141414; }
.card.ratio-square { aspect-ratio: 1 / 1; }
.card.ratio-story { aspect-ratio: 9 / 16; }
.card.ratio-wide { aspect-ratio: 16 / 9; max-width: 640px; }
/* Light card: use the darker-on-light family palette */
.card.theme-light {
  --fam-1: #2a78d6; --fam-2: #eb6834; --fam-3: #1baf7a; --fam-4: #b87a00;
  --fam-5: #c63f73; --fam-6: #008300; --fam-7: #4a3aa7; --fam-8: #e34948;
}

.card-inner { flex: 1; display: flex; flex-direction: column; padding: 26px 24px 20px; min-height: 0; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-brand { font-family: "Bebas Neue", sans-serif; font-size: 20px; letter-spacing: 0.03em; opacity: 0.92; }
.card-mode { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.55; }

.card-lyrics {
  flex: 1; overflow: auto; margin-top: 16px; font-size: 16px; line-height: 1.85;
  display: flex; flex-direction: column; justify-content: center; min-height: 0;
}
.card-lyrics .lyrics-inner { width: 100%; white-space: pre-wrap; word-break: break-word; }
.card-lyrics .fam { border-radius: 3px; padding: 0 1px; }
.card-lyrics .fam.tight { font-weight: 600; }
.card-lyrics .fam.slant { font-style: italic; opacity: 0.82; }
.card-lyrics .fam .badge { font-size: 9px; vertical-align: super; opacity: 0.85; margin-right: 1px; font-weight: 700; }
.card-lyrics .fam-other { border-bottom: 2px dotted var(--muted); }

.card-legend {
  display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(127, 127, 127, 0.25); font-size: 10px;
}
.legend-chip { display: flex; align-items: center; gap: 5px; opacity: 0.85; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }

.card-caption { margin-top: 14px; font-size: 11px; opacity: 0.7; display: flex; justify-content: space-between; gap: 8px; }
.card-caption input {
  background: transparent; border: none; outline: none; color: inherit;
  font-family: "IBM Plex Mono", monospace; font-size: 11px; width: 100%;
}
.card-caption input::placeholder { color: inherit; opacity: 0.45; }
.card-caption span { font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.card-caption .handle { text-align: right; margin-left: auto; }

select.ctl {
  font: 600 13px "Manrope", sans-serif; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
button.primary {
  font: 700 14px "Manrope", sans-serif; background: var(--ink); color: var(--page); border: none;
  border-radius: 9px; padding: 11px 18px; cursor: pointer;
}
button.primary:disabled { opacity: 0.5; cursor: default; }
button.ghost {
  font: 600 13px "Manrope", sans-serif; color: var(--ink-2); background: transparent;
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 14px; cursor: pointer;
}

details.note { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--hair); padding-top: 16px; }
details.note summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.note p { line-height: 1.6; margin: 10px 0 0; max-width: 70ch; }
code { font-family: "IBM Plex Mono", monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* Vocab Lab */
.vocab-inputs { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.vocab-results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.stat-card h3 {
  margin: 0 0 12px; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; }
.stat-grid dt { font-size: 12px; color: var(--muted); }
.stat-grid dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.top-words { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.top-words li { display: grid; grid-template-columns: 7.5em 1fr 2.5em; align-items: center; gap: 8px; font-size: 13px; }
.top-words .bar { height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
.top-words .n { text-align: right; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.long-words { font-size: 13px; color: var(--ink-2); margin: 14px 0 0; }
.empty { color: var(--muted); font-size: 14px; }

/* Roadmap + footer */
.roadmap { margin-top: 48px; }
.roadmap h2 { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 32px; margin: 0; }
.muted { color: var(--muted); margin: 4px 0 0; }
.roadmap-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; font-size: 14px; }
.tag {
  display: inline-block; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-right: 8px; border: 1px solid var(--border);
}
.tag.live { color: #5fd3a0; border-color: rgba(95, 211, 160, 0.4); }
.tag.soon { color: var(--muted); }
.foot { padding-block: 40px 56px; color: var(--muted); font-size: 13px; }

@media (max-width: 620px) {
  .vocab-inputs { grid-template-columns: 1fr; }
  .hero { padding-block: 36px 20px; }
  .card-frame { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
