/* EyeRoll HQ — design system. Source of truth: /design.md. */

@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrainsmono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrainsmono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrainsmono-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* dark — native */
  --bg: oklch(.18 .02 285);
  --surface: oklch(.24 .025 285);
  --border: oklch(.30 .025 285);
  --ink: oklch(.95 .01 285);
  --muted: oklch(.68 .025 285);
  --accent: oklch(.68 .19 300);
  /* text/icons placed ON the accent fill always use --bg, not --ink — see design.md Components */
  --accent-ink: oklch(.18 .02 285);

  --radius-plate: 6px;
  --radius-control: 8px;
  --radius-card: 10px;
  --radius-pill: 999px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;

  --transition: 150ms ease-out;

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Literata", serif;
  --font-mono: "JetBrains Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: oklch(.95 .01 285);
    --surface: oklch(.99 .006 285);
    --border: oklch(.86 .015 285);
    --ink: oklch(.24 .02 285);
    --muted: oklch(.50 .03 285);
    --accent: oklch(.55 .20 300);
    --accent-ink: oklch(.95 .01 285);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ===== type scale ===== */

.display { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 5vw, 44px); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1, .h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4vw, 30px); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h2, .h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.2; margin: 0; }
p, .body { font-family: var(--font-body); font-weight: 400; font-size: 16px; line-height: 1.6; margin: 0; }
.small { font-family: var(--font-body); font-weight: 400; font-size: 13px; line-height: 1.5; }
.label { font-family: var(--font-mono); font-weight: 500; font-size: 11px; line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; }

/* ===== layout ===== */

.container { max-width: 1040px; margin: 0 auto; padding: 0 var(--space-2); }
.prose-container { max-width: 720px; margin: 0 auto; padding: 0 var(--space-2); }

.stack > * + * { margin-top: var(--space-2); }

/* ===== top bar ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.topbar-logo { height: 24px; width: auto; color: var(--ink); }
.topbar-logo:hover { opacity: 0.85; }

.topbar-right { display: flex; align-items: center; gap: var(--space-1); }
.auth-email { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== login modal ===== */

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: oklch(0 0 0 / 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
}
.login-modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
}
.login-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}
@media (prefers-reduced-motion: no-preference) {
  .login-modal { animation: fade-in 150ms ease-out; }
}

/* ===== category tag rail ===== */

.tag-rail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-2) 0;
}

.tag {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.tag:hover { border-color: var(--muted); color: var(--ink); }
.tag[aria-current="page"], .tag.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ===== buttons / controls ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-plate);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn-cue {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-cue:hover { opacity: 0.92; }
.btn-cue:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-bordered {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-bordered:hover { border-color: var(--muted); }

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  padding: 10px 14px;
}
.btn-quiet:hover { color: var(--ink); }

/* ===== form fields ===== */

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  transition: border-color var(--transition);
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--muted); }

/* ===== cards ===== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-2);
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-2);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.result-card p { flex: 1; }
.copy-btn {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.result-card:hover .copy-btn,
.copy-btn:focus-visible {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.copy-btn.is-copied {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ===== sort / filter group ===== */

.sort-group {
  display: inline-flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 3px;
}
.sort-btn {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.sort-btn:hover:not(.is-active) { color: var(--ink); }
.sort-btn.is-active { background: var(--bg); color: var(--ink); }
/* deliberately not accent-filled: the tag rail above already carries this page's one
   violet element (the active category), and design.md forbids a second per viewport */

/* ===== rating control ===== */

.rating { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.rating button {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--border);
  font-size: 16px;
  line-height: 1;
}
.rating button.is-filled { color: var(--ink); }
.rating button:hover ~ button { color: var(--border); }
.rating button:disabled { cursor: default; }
.rating.rating-locked button:hover { color: var(--border); }
.rating-meta {
  flex-basis: 100%;
  text-align: right;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== countdown / mono chip ===== */

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-plate);
  padding: 6px 10px;
}

/* ===== ad slot ===== */

.ad-slot {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-4) 0;
}
@media (min-width: 720px) { .ad-slot { min-height: 300px; } }
.ad-slot::before {
  content: "ADVERTISEMENT";
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ===== email capture ===== */

.email-capture {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-2);
}
.email-capture .field { flex: 1; min-width: 220px; }
.email-capture h2 { margin-bottom: 4px; }
.email-capture p { color: var(--muted); margin-bottom: var(--space-1); }

/* ===== consent banner ===== */

.consent-banner {
  position: fixed;
  left: var(--space-2);
  right: var(--space-2);
  bottom: var(--space-2);
  z-index: 50;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  box-shadow: 0 4px 24px oklch(0 0 0 / 0.25);
}
@media (prefers-reduced-motion: no-preference) {
  .consent-banner { animation: fade-in 180ms ease-out; }
}
.consent-banner p { flex: 1 1 320px; color: var(--muted); }
.consent-banner .actions { display: flex; gap: var(--space-1); }
.consent-banner[hidden] { display: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fade-up 180ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: fade-in 180ms ease-out; }
}

/* ===== footer ===== */

footer.site-footer {
  border-top: 1px solid var(--border);
  margin-top: var(--space-12);
  padding: var(--space-4) 0;
}
footer.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
footer.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2); }
footer.site-footer a { color: var(--muted); text-decoration: none; font-size: 13px; }
footer.site-footer a:hover { color: var(--ink); }

/* ===== loading state ===== */

.loading-line {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.loading-line .bar {
  flex: 1;
  height: 2px;
  background: var(--border);
  overflow: hidden;
  border-radius: 2px;
}
.loading-line .bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  animation: loading-sweep 900ms ease-in-out infinite;
}
@keyframes loading-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
  .loading-line .bar::after { animation: none; opacity: 0.6; width: 100%; transform: none; }
}
