/* toli.mov design system — one stylesheet for every page the household sees.
   Tokens first, then base elements, then the handful of components. Dark is
   the primary look (a theatre); light resolves from the same tokens.
   Fonts: Fraunces (display), IBM Plex Sans (text), IBM Plex Mono (data). */

:root {
  color-scheme: dark light;
  /* ground and ink */
  --bg: #121317;
  --bg-2: #1a1c22;
  --bg-3: #23262e;
  --ink: #ece6d8;
  --ink-2: #a8a396;
  --line: #2a2d35;
  /* accent: projector amber */
  --accent: #f2b544;
  --accent-ink: #1a1408;
  --accent-soft: rgba(242, 181, 68, 0.14);
  /* semantic */
  --ok: #5cc38a;
  --warn: #e6a23c;
  --bad: #e5645c;
  --info: #7fa7e0;
  /* type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-data: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.4rem, 6vw, 4rem);
  /* space and shape */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2.5rem;
  --s-5: 4rem;
  --r: 12px;
  --r-pill: 999px;
  --measure: 42rem;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ee;
    --bg-2: #ffffff;
    --bg-3: #efeae0;
    --ink: #1b1a17;
    --ink-2: #6b675e;
    --line: #e3ded3;
    --accent: #b86d0a;
    --accent-ink: #ffffff;
    --accent-soft: rgba(184, 109, 10, 0.12);
    --ok: #2f8f5b;
    --warn: #b7791f;
    --bad: #c0392b;
    --info: #3d6fb5;
  }
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font-text);
  min-height: 100vh;
}
main { max-width: var(--measure); margin: 0 auto; padding: var(--s-4) var(--s-3) var(--s-5); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-4); font-variation-settings: "opsz" 144, "SOFT" 40; letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); font-variation-settings: "opsz" 48; }
h3 { font-size: var(--step-1); font-variation-settings: "opsz" 24; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code, .data { font-family: var(--font-data); font-size: 0.92em; font-variant-numeric: tabular-nums; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }

/* text roles */
.lead { font-size: var(--step-1); color: var(--ink-2); max-width: 36rem; }
.muted { color: var(--ink-2); }
.eyebrow {
  font-family: var(--font-data);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); letter-spacing: -0.01em; color: var(--ink); }
.wordmark .tld { color: var(--accent); }

/* layout */
.stack > * + * { margin-top: var(--s-2); }
.stack-lg > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid-2 { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-2) 0; }

/* components */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s-3);
}
.card.accent { border-left: 4px solid var(--accent); }
.card.ok { border-left: 4px solid var(--ok); }
.card.warn { border-left: 4px solid var(--warn); }
.card.bad { border-left: 4px solid var(--bad); }
.card.info { border-left: 4px solid var(--info); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font: 500 var(--step-0)/1 var(--font-text);
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { text-decoration: none; border-color: var(--ink-2); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover, .btn-primary:focus-visible { filter: brightness(1.06); border-color: transparent; }
.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-data);
  font-size: var(--step--1);
  color: var(--ink-2);
}
.pill::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink-2); }
.pill.is-ok { color: var(--ok); } .pill.is-ok::before { background: var(--ok); }
.pill.is-bad { color: var(--bad); } .pill.is-bad::before { background: var(--bad); }
.pill.is-warn { color: var(--warn); } .pill.is-warn::before { background: var(--warn); }
.list > li { padding: var(--s-1) 0; border-top: 1px solid var(--line); display: grid; gap: 0.15rem; }
.list > li:first-child { border-top: 0; }
.list .t { font-weight: 600; }
.list .m, .list .n { color: var(--ink-2); font-size: var(--step--1); }
.count { font-weight: 400; color: var(--ink-2); font-family: var(--font-data); font-size: var(--step-0); }
.input {
  flex: 1 1 14rem; min-width: 0;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--ink);
  font: 400 var(--step-0)/1.2 var(--font-text);
}
.input::placeholder { color: var(--ink-2); }
.results > li { grid-template-columns: 3rem 1fr; column-gap: var(--s-2); align-items: start; }
.results .poster { grid-row: span 3; width: 3rem; height: 4.5rem; border-radius: 6px; background: var(--bg-3); object-fit: cover; }
.results .btn { padding: 0.45rem 0.9rem; font-size: var(--step--1); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--s-2); }
.stats li { display: grid; gap: 0.1rem; padding: var(--s-2) var(--s-3); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.stats .n { font-family: var(--font-display); font-size: var(--step-3); font-variation-settings: "opsz" 72; line-height: 1; font-variant-numeric: tabular-nums; }
.stats .l { font-family: var(--font-data); font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
footer.site { color: var(--ink-2); font-size: var(--step--1); margin-top: var(--s-5); display: flex; gap: var(--s-2); justify-content: space-between; flex-wrap: wrap; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .pill { transition: border-color 120ms ease, filter 120ms ease; }
}
