/* AI Competition Radar — Neo-brutalist: butter-cream ground, 3px black
   outlines, hard offset shadows, chunky Archivo, bright status badges,
   zero corner radius. A deliberately single, bright visual world. */

/* Archivo (variable, self-hosted — no external dependency) */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("assets/fonts/archivo-latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #fff5db;   /* butter ground */
  --card: #ffffff;
  --ink: #12100a;     /* near-black — borders, shadows, text */
  --muted: #4a463c;

  --accent: #ff5c00;  /* orange — hero, primary */
  --live: #ffe14d;    /* yellow — in progress */
  --up: #7cf3c3;      /* mint — upcoming */
  --done: #ded9c8;    /* muted — completed */

  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --b: 3px;                       /* standard border width */
  --sh: 6px 6px 0 var(--ink);     /* standard hard shadow */
  --sh-lg: 8px 8px 0 var(--ink);
  --sh-sm: 3px 3px 0 var(--ink);

  --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --wrap: 1140px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* honor the attribute even on elements with an explicit display */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }

a { color: var(--ink); text-decoration: none; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--space-5); width: 100%; }

/* Press interaction (buttons, chips, cards) */
.press { transition: transform .09s ease, box-shadow .09s ease; }
.press:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-lg); }
.press:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .press { transition: none; }
  .press:hover, .press:active { transform: none; box-shadow: var(--sh); }
}

/* ---------- Hero ---------- */
.hero { padding: var(--space-7) 0 var(--space-6); }
.eyebrow {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
  padding: 6px 12px;
  margin: 0 0 var(--space-4);
}
.hero-block {
  border: var(--b) solid var(--ink);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--sh);
  padding: var(--space-5) var(--space-5) var(--space-6);
}
.hero-block h1 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.0;
  font-size: clamp(32px, 6.5vw, 64px);
  text-wrap: balance;
}
.hero-block h1 a { color: #fff; box-shadow: inset 0 -6px 0 rgba(0,0,0,.28); }
.hero-sub { margin: var(--space-4) 0 var(--space-6); font-size: 16px; font-weight: 500; color: var(--muted); max-width: 60ch; }

/* Stat row — four chunky boxes */
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.stat {
  border: var(--b) solid var(--ink);
  background: var(--card);
  box-shadow: var(--sh-sm);
  padding: var(--space-4);
}
.stat:nth-child(2) { background: var(--live); }
.stat:nth-child(3) { background: var(--up); }
.stat:nth-child(1) { background: var(--accent); }
.stat:nth-child(1) .stat-num, .stat:nth-child(1) .stat-label { color: #fff; }
.stat-num { display: block; font-weight: 900; font-size: clamp(30px, 5vw, 44px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; margin-top: var(--space-2); }

/* ---------- Controls ---------- */
.controls { padding: var(--space-6) 0 var(--space-4); display: grid; gap: var(--space-5); }
.controls-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.section-label { margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; font-size: 14px; }

/* Collapsible filter body + toggle */
.filter-body { display: grid; gap: var(--space-5); }
.btn-caret { font-size: 13px; line-height: 1; transition: transform .12s ease; }
#filter-toggle[aria-expanded="false"] .btn-caret { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .btn-caret { transition: none; } }
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; margin-left: 2px;
  background: var(--accent); color: #fff; border: 2px solid var(--ink);
  font-weight: 900; font-size: 11px; line-height: 1;
}

/* Status + audience chip groups */
.segs { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-8); }
.segblock { display: flex; flex-direction: column; gap: 8px; }
.seg-label { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.seg { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.seg-opt {
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  background: var(--card);
  color: var(--ink);
  border: var(--b) solid var(--ink);
  box-shadow: var(--sh-sm);
  padding: 8px 16px;
  cursor: pointer;
}
.seg-opt.is-active { background: var(--ink); color: var(--paper); }

/* Fields */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-4); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.input {
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: var(--b) solid var(--ink);
  border-radius: 0;
  padding: 10px 12px;
  width: 100%;
  appearance: none;
}
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 12px) center;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  padding-right: 40px;
  cursor: pointer;
}
.input::placeholder { color: #8a8577; font-weight: 500; }

.controls-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
input[type="search"].input { flex: 1 1 280px; min-width: 200px; }

/* Chunky checkbox */
.check { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 800; font-size: 13px; cursor: pointer; user-select: none; text-transform: uppercase; letter-spacing: .04em; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 22px; height: 22px; border: var(--b) solid var(--ink); background: var(--card); display: inline-block; position: relative; }
.check input:checked + .box { background: var(--accent); }
.check input:checked + .box::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid var(--ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.check input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Reset button */
.btn {
  font-family: var(--font);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border: var(--b) solid var(--ink);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--sh-sm);
  cursor: pointer;
}
.btn .btn-x { font-size: 16px; line-height: 1; }

/* ---------- Results head ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-5) 0 var(--space-5); }
.count { margin: 0; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.count b { color: var(--accent); font-weight: 900; }
.count .muted-note { color: var(--muted); font-weight: 700; }
.refreshed { margin: 0; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-5); margin-bottom: var(--space-8); }
.card {
  background: var(--card);
  border: var(--b) solid var(--ink);
  box-shadow: var(--sh);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.card[data-status="completed"] { background: #f1eddd; }
.card.is-soon { box-shadow: 6px 6px 0 var(--accent), 6px 6px 0 1.5px var(--ink); }
.card { transition: transform .09s ease, box-shadow .09s ease; }
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--sh-lg); }
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; box-shadow: var(--sh); }
}

.card-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.badge {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 11px;
  padding: 3px 9px;
  border: 2px solid var(--ink);
  color: var(--ink);
}
.badge.b-upcoming { background: var(--up); }
.badge.b-in-progress { background: var(--live); }
.badge.b-completed { background: var(--done); }
.badge.b-soon { background: var(--accent); color: #fff; }

.card-title { margin: 2px 0 0; }
.card-title a { font-weight: 900; font-size: 20px; line-height: 1.08; letter-spacing: -.01em; color: var(--ink); }
.card[data-status="completed"] .card-title a { color: var(--muted); }
.card-title a:hover { box-shadow: inset 0 -3px 0 var(--accent); }

.summary { margin: 0; font-weight: 500; color: var(--muted); font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; padding: 2px 7px; border: 2px solid var(--ink); background: var(--card); }
.tag-accent { background: var(--accent); color: #fff; border-color: var(--ink); }

/* Meta — bold-key list */
.meta { margin-top: auto; border-top: var(--b) solid var(--ink); padding-top: var(--space-2); }
.meta-row { display: grid; grid-template-columns: 80px 1fr; gap: var(--space-3); padding: 6px 0; border-bottom: 1.5px solid rgba(18,16,10,.14); }
.meta-row:last-child { border-bottom: 0; }
.meta-row .k { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; padding-top: 2px; }
.meta-row .v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-row .v.caveat { color: #c0430a; }
.meta-row .v .prize-num { font-weight: 900; }

.empty { text-align: center; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: var(--space-8) 0; }

/* ---------- Footer ---------- */
.poster { background: var(--ink); color: var(--paper); margin-top: var(--space-8); padding: var(--space-8) 0 var(--space-7); }
.poster-statement { margin: 0 0 var(--space-6); font-weight: 900; letter-spacing: -.02em; line-height: .96; font-size: clamp(38px, 8vw, 92px); }
.poster-statement em { font-style: normal; color: var(--accent); }
.poster-note { max-width: 70ch; margin: 0; font-weight: 500; font-size: 14px; color: #cfc9b6; }
.poster .src { margin: var(--space-4) 0 0; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: #cfc9b6; }
.poster .src code { text-transform: none; letter-spacing: 0; background: rgba(255,255,255,.14); padding: 1px 6px; }
.poster a { color: var(--paper); box-shadow: inset 0 -2px 0 var(--accent); }
.poster a:hover { box-shadow: inset 0 -6px 0 var(--accent); }

@media (max-width: 760px) {
  .statrow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}
