/* HS Archive — Modern Dark (cinema). System font stack rather than a webfont
   CDN: the privacy policy claims minimal third parties, and this costs nothing
   in latency. */

:root {
  /* surfaces — never pure black, it smears on OLED */
  --bg:        #0b0b0f;
  --surface-1: #131318;
  --surface-2: #1a1a21;
  --surface-3: #22222b;

  --line:      #24242e;
  --line-2:    #32323f;
  --line-3:    #43434f;

  /* text — all pairs checked at 4.5:1+ on --surface-1 */
  --fg:        #f4f4f7;
  --fg-2:      #c9c9d3;
  --dim:       #9d9dab;
  /* 4.54:1 on --surface-3, the worst case. The previous #74748a failed AA at
     4.06:1 and it carries the footer legal text. */
  --dimmer:    #88889c;

  /* amber, deliberately not Kick green — a borrowed brand colour reads as
     affiliation, which contradicts the disclaimer */
  --accent:     #ffb020;
  --accent-hi:  #ffc247;
  --accent-dim: #7d5410;
  --accent-bg:  rgba(255, 176, 32, .1);

  --warn: #e8894a;
  --good: #6ec77a;

  --r-sm: 6px;
  --r:    9px;
  --r-lg: 13px;

  /* density 7/10 */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 22px; --s6: 30px; --s7: 44px; --s8: 64px;

  --max: 1200px;

  /* expo.out — the cinema-style easing */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --fast: 140ms;
  --med:  240ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        system-ui, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

/* one focus treatment everywhere, never removed */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--accent); color: #14140a; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s5); }
.hide { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- header ---------- */

header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(11, 11, 15, .86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.hrow { display: flex; align-items: center; gap: var(--s4); height: 60px; }

.logo {
  display: flex; align-items: center; gap: 7px;
  font-size: 16.5px; font-weight: 700; letter-spacing: -.025em;
  white-space: nowrap;
}
.logo span { color: var(--accent); }
.logo svg { width: 17px; height: 17px; flex-shrink: 0; }

.chan {
  font-size: 12.5px; color: var(--dim); letter-spacing: .01em;
  padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 99px;
  white-space: nowrap;
}

nav.main { display: flex; gap: var(--s1); margin-left: var(--s2); }
nav.main a {
  font-size: 13.5px; color: var(--dim); padding: 6px 11px;
  border-radius: var(--r-sm); transition: color var(--fast), background var(--fast);
}
nav.main a:hover { color: var(--fg); background: var(--surface-2); }
nav.main a[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }

.spacer { flex: 1; }
.hstat { font-size: 12.5px; color: var(--dimmer); white-space: nowrap; }
.hstat b { color: var(--fg-2); font-weight: 600; }

/* ---------- controls ---------- */

.controls {
  display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center;
  padding: var(--s5) 0 var(--s4);
}
.controls input, .controls select {
  background: var(--surface-1); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 9px 12px; font: inherit; font-size: 13.5px;
  min-height: 40px;
  transition: border-color var(--fast), background var(--fast);
}
.controls input { flex: 1 1 200px; min-width: 0; }
.controls input::placeholder { color: var(--dimmer); }
.controls input:hover, .controls select:hover { border-color: var(--line-3); }
.controls input:focus, .controls select:focus {
  outline: none; border-color: var(--accent-dim); background: var(--surface-2);
}
.controls select { cursor: pointer; }
.count { font-size: 12.5px; color: var(--dimmer); margin-left: auto; }

/* ---------- grid ---------- */

.grid {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  padding-bottom: var(--s8);
}

.card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform var(--med) var(--ease),
              border-color var(--med) var(--ease),
              background var(--med) var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-3);
  background: var(--surface-2);
}
.card:active { transform: translateY(-1px) scale(.99); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;      /* reserves space, keeps CLS at 0 */
  background: var(--surface-3);
  overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 500ms var(--ease);
}
.card:hover .thumb img { transform: scale(1.045); }

.thumb::after {          /* keeps the duration chip legible on bright frames */
  content: ""; position: absolute; inset: 50% 0 0 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .55));
  pointer-events: none;
}

.dur, .pill-score {
  position: absolute; z-index: 1;
  font-size: 11.5px; font-weight: 600;
  border-radius: var(--r-sm);
  background: rgba(6, 6, 9, .8);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.dur { right: 7px; bottom: 7px; padding: 3px 7px; color: #fff; letter-spacing: .01em; }
.pill-score {
  left: 7px; top: 7px; padding: 3px 8px;
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 700; color: var(--fg);
}
.pill-score svg { width: 11px; height: 11px; color: var(--accent); }
.pill-score.unrated { font-weight: 500; color: var(--dim); font-size: 11.5px; }

.cbody { padding: var(--s3) var(--s3) var(--s4); }
.ctitle {
  font-size: 13.5px; font-weight: 600; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 37px; margin-bottom: 6px;
  letter-spacing: -.005em;
}
.cmeta {
  font-size: 12px; color: var(--dim);
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
}
.cmeta .sep { color: var(--line-3); }
.ctags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.tag {
  font-size: 11px; color: var(--dim); letter-spacing: .01em;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 2px 7px;
}
.tag.expired { color: var(--warn); border-color: #4a2c1c; background: rgba(232, 137, 74, .07); }

/* Entrance runs once, on first paint only. The .intro class is removed as soon
   as the wave finishes, so re-sorting never replays it. */
@media (prefers-reduced-motion: no-preference) {
  .grid.intro .card { animation: rise 420ms var(--ease) both; }
  .grid.intro .card:nth-child(1)  { animation-delay: 0ms }
  .grid.intro .card:nth-child(2)  { animation-delay: 35ms }
  .grid.intro .card:nth-child(3)  { animation-delay: 70ms }
  .grid.intro .card:nth-child(4)  { animation-delay: 105ms }
  .grid.intro .card:nth-child(5)  { animation-delay: 140ms }
  .grid.intro .card:nth-child(6)  { animation-delay: 175ms }
  .grid.intro .card:nth-child(7)  { animation-delay: 200ms }
  .grid.intro .card:nth-child(8)  { animation-delay: 220ms }
  .grid.intro .card:nth-child(n+9) { animation-delay: 240ms }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---------- detail ---------- */

.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--dim); font-size: 13.5px;
  padding: var(--s5) var(--s2) var(--s2) 0;
  transition: color var(--fast);
}
.back:hover { color: var(--fg); }
.back svg { width: 14px; height: 14px; }

.detail { padding-bottom: var(--s8); }

.dhead { display: flex; gap: var(--s5); flex-wrap: wrap; padding: var(--s1) 0 var(--s6); }
.dthumb {
  width: 320px; flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.dthumb img { width: 100%; height: 100%; object-fit: cover; }
.dinfo { flex: 1 1 280px; min-width: 0; }
.dinfo h1 {
  font-size: 25px; font-weight: 650; letter-spacing: -.022em;
  line-height: 1.24; word-break: break-word;
}
.dsub { color: var(--dim); font-size: 13.5px; margin-top: 8px; line-height: 1.65; }

.dbig { display: flex; align-items: baseline; gap: 9px; margin-top: var(--s4); }
.dbig .num {
  font-size: 42px; font-weight: 700; letter-spacing: -.035em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.dbig .den { font-size: 15px; color: var(--dimmer); }
.dbig .votes { font-size: 12.5px; color: var(--dim); }

.kicklink {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--s4); font-size: 13px; font-weight: 500;
  color: var(--accent); border: 1px solid var(--accent-dim);
  padding: 8px 14px; border-radius: var(--r);
  min-height: 40px;
  transition: background var(--fast), border-color var(--fast);
}
.kicklink:hover { background: var(--accent-bg); border-color: var(--accent); }
.kicklink svg { width: 13px; height: 13px; }

.expired-note {
  margin-top: var(--s4); font-size: 13px; color: var(--warn);
  background: rgba(232, 137, 74, .07); border: 1px solid #4a2c1c;
  border-radius: var(--r); padding: 10px 13px; line-height: 1.55;
}

/* ---------- panels ---------- */

.panel {
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s5);
  margin-bottom: var(--s4);
}
.panel h2 {
  font-size: 14px; font-weight: 600; letter-spacing: -.005em;
  margin-bottom: var(--s4);
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
}
.panel h2 .c { color: var(--dimmer); font-weight: 400; font-size: 13px; }

/* rating dial */
.dial { display: flex; gap: 5px; }
.dial button {
  flex: 1; min-width: 0; min-height: 44px;
  background: var(--surface-2); color: var(--fg-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background var(--fast), border-color var(--fast),
              color var(--fast), transform var(--fast) var(--ease);
}
.dial button:hover { border-color: var(--accent-dim); color: var(--fg); background: var(--surface-3); }
.dial button:active { transform: scale(.96); }
.dial button.on {
  background: var(--accent); border-color: var(--accent);
  color: #14140a; font-weight: 700;
}
.yours { font-size: 12.5px; color: var(--dim); margin-top: var(--s3); }

/* distribution */
.dist { display: flex; align-items: flex-end; gap: 4px; height: 68px; }
.dist .bar {
  flex: 1; background: var(--line-2); border-radius: 3px 3px 0 0;
  min-height: 3px; transition: height var(--med) var(--ease), background var(--fast);
}
.dist .bar.hi { background: var(--accent-dim); }
.dist .bar:hover { background: var(--accent); }
.distx {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--dimmer); margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

/* forms */
.form { display: flex; flex-direction: column; gap: var(--s2); }
.form label { font-size: 12.5px; color: var(--dim); }
.form textarea, .form input {
  background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; font: inherit; font-size: 13.5px; width: 100%;
  min-height: 42px;
  transition: border-color var(--fast), background var(--fast);
}
.form input::placeholder, .form textarea::placeholder { color: var(--dimmer); }
.form textarea { min-height: 80px; resize: vertical; }
.form textarea:focus, .form input:focus {
  outline: none; border-color: var(--accent-dim); background: var(--surface-3);
}
.frow { display: flex; gap: var(--s2); flex-wrap: wrap; }
.frow input { flex: 1 1 120px; }

.btn {
  background: var(--accent); color: #14140a;
  border-radius: var(--r-sm); padding: 11px 18px;
  font-weight: 650; font-size: 13.5px; min-height: 44px;
  align-self: flex-start;
  transition: background var(--fast), transform var(--fast) var(--ease);
}
.btn:hover { background: var(--accent-hi); }
.btn:active { transform: scale(.97); }
.btn.ghost {
  background: none; color: var(--dim);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover { color: var(--fg); background: var(--surface-2); }

.fhint { font-size: 12px; color: var(--dimmer); line-height: 1.5; }

/* timeline */
.ev {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
.ev:last-child { border-bottom: none; }
.ev .t {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  font-size: 12.5px; color: var(--accent); flex-shrink: 0;
  min-width: 62px; padding-top: 2px; font-variant-numeric: tabular-nums;
}
.ev .txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.ev .by { font-size: 11.5px; color: var(--dimmer); margin-top: 3px; }
.ev .vote {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--dim); font-size: 12px; font-weight: 600;
  padding: 6px 9px; min-height: 32px;
  font-variant-numeric: tabular-nums;
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.ev .vote:hover { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-bg); }
.ev .vote:active { transform: scale(.95); }
.ev .vote svg { width: 9px; height: 9px; }

/* recap */
.sline {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: 7px 0; font-size: 13.5px; line-height: 1.55;
}
.sline .t {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  font-size: 12.5px; color: var(--accent);
  flex-shrink: 0; min-width: 62px; padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.smore {
  font-size: 12px; color: var(--dimmer);
  border-top: 1px solid var(--line); margin-top: var(--s3); padding-top: var(--s3);
}

.empty {
  color: var(--dimmer); font-size: 13.5px; line-height: 1.6;
  padding: var(--s3) 0;
}
.empty-lg {
  text-align: center; padding: var(--s8) var(--s4);
  color: var(--dim);
}
.empty-lg strong { display: block; color: var(--fg); font-size: 15px; margin-bottom: 6px; font-weight: 600; }
.empty-lg p { font-size: 13.5px; color: var(--dimmer); }

/* ---------- gates ---------- */

/* The show/hide half of this lives inline in index.html so the gate survives
   a missing or stale stylesheet. Only the sizing is here. */
body.locked #lock, body.agecheck #age { min-height: 100dvh; padding: var(--s5); }

.lockbox, .agebox {
  width: 100%; max-width: 370px; text-align: center;
  background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s7) var(--s6);
  animation: rise 380ms var(--ease) both;
}
.locklogo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 19px; font-weight: 700; letter-spacing: -.025em;
}
.locklogo span { color: var(--accent); }
.locklogo svg { width: 19px; height: 19px; color: var(--accent); }
.lockbox p, .agebox p {
  color: var(--dim); font-size: 13px; line-height: 1.6;
  margin: var(--s2) 0 var(--s5);
}
.agebox h2 { font-size: 17px; font-weight: 600; margin-bottom: var(--s2); }
.lockbox input {
  width: 100%; background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 11px 13px; font: inherit; font-size: 14px; text-align: center;
  min-height: 44px;
}
.lockbox input:focus { outline: none; border-color: var(--accent-dim); background: var(--surface-3); }
.lockbox button, .agerow button {
  border-radius: var(--r-sm); padding: 11px 0;
  font-size: 13.5px; font-weight: 650; min-height: 44px;
  transition: background var(--fast), transform var(--fast) var(--ease);
}
.lockbox > button { width: 100%; margin-top: var(--s2); background: var(--accent); color: #14140a; }
.lockbox > button:hover { background: var(--accent-hi); }
.lockbox > button:active { transform: scale(.98); }
.agerow { display: flex; gap: var(--s2); }
.agerow button { flex: 1; }
#ageYes { background: var(--accent); color: #14140a; }
#ageYes:hover { background: var(--accent-hi); }
#ageNo { color: var(--dim); border: 1px solid var(--line-2); }
#ageNo:hover { color: var(--fg); background: var(--surface-2); }
#lockErr { color: var(--warn); font-size: 12.5px; min-height: 18px; margin-top: var(--s3); }

/* ---------- banner ---------- */

.banner {
  background: var(--surface-1); border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--r); padding: var(--s3) var(--s4);
  font-size: 12.5px; color: var(--dim); line-height: 1.6;
  margin-top: var(--s5);
}
.banner b { color: var(--fg-2); font-weight: 600; }

/* ---------- static pages ---------- */

.page { max-width: 680px; padding: var(--s2) 0 var(--s8); }
.page h1 { font-size: 26px; font-weight: 650; letter-spacing: -.025em; margin-bottom: 6px; }
.page .lead { color: var(--dim); font-size: 14px; margin-bottom: var(--s6); }
.page h2 {
  font-size: 15px; font-weight: 600; margin: var(--s6) 0 var(--s3);
  padding-top: var(--s5); border-top: 1px solid var(--line);
}
.page h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.page p, .page li { font-size: 14.5px; line-height: 1.75; color: var(--fg-2); }
.page p { margin-bottom: var(--s3); }
.page ul { margin: 0 0 var(--s3) 20px; }
.page li { margin-bottom: 5px; }
.page a { color: var(--accent); }
.page a:hover { text-decoration: underline; }
.page code {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  font-size: 12.5px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px 6px;
  word-break: break-word;
}
.page .callout {
  background: var(--surface-1); border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--r); padding: var(--s4);
  margin: var(--s4) 0; font-size: 13.5px; color: var(--dim); line-height: 1.7;
}
.page .callout b { color: var(--fg-2); font-weight: 600; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding: var(--s5) 0 var(--s7); margin-top: var(--s5); }
.footnav { display: flex; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s3); }
.footnav a {
  font-size: 13px; color: var(--dim); min-height: 24px;
  transition: color var(--fast);
}
.footnav a:hover { color: var(--fg); }
.note { font-size: 12px; color: var(--dimmer); line-height: 1.65; max-width: 720px; }
.note a { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .dthumb { width: 100%; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 var(--s4); }
  .hrow { height: 54px; gap: var(--s3); }
  nav.main { display: none; }
  .chan { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); }
  .ctitle { font-size: 13px; min-height: 35px; }
  .dinfo h1 { font-size: 21px; }
  .dbig .num { font-size: 36px; }
  .panel { padding: var(--s4); }
  .page h1 { font-size: 22px; }
  .dial { gap: 3px; }
  .dial button { font-size: 12.5px; }
  .ev .t, .sline .t { min-width: 54px; font-size: 11.5px; }
  .footnav { gap: var(--s4); }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}

/* Touch input needs 44x44; a mouse doesn't. Matched on both pointer type and
   viewport width — pointer:coarse is the correct signal but isn't honoured by
   every emulator, and phone-width is the case that actually matters here. */
@media (pointer: coarse), (max-width: 640px) {
  .ev .vote { min-height: 44px; min-width: 44px; justify-content: center; }
  .kicklink { min-height: 44px; }
  .form input, .form textarea { min-height: 44px; }
  .logo { padding: 6px 0; }
  .footnav a { min-height: 44px; display: flex; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
