/* Self-hosted fonts (latin subset, variable axis) — served same-origin so first
   paint isn't blocked on a third-party round-trip to fonts.googleapis/gstatic.
   Files mirrored from Google Fonts; swap so text shows immediately in the fallback. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  /* swap so the font always renders once loaded; its metrics are close enough to the
     system fallback that the swap costs no measurable layout shift here. */
  font-display: swap;
  src: url("assets/fonts/inter-latin-var.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: "Space Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/spacegrotesk-latin-var.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;
}

:root {
  /* Flat, gamey palette built around a mustard-yellow ground. */
  --color-bg: #f7d671;          /* mustard ground */
  --color-bg-deep: #f3cb5c;     /* deeper mustard for bands / sticky bar */
  --color-surface: #fffdf6;     /* warm cream — cards & inputs */
  --color-surface-2: #fff7e2;   /* soft cream — secondary fills */
  --color-fg: #1c1813;          /* warm near-black ink */
  --color-muted: #5a4f37;       /* muted warm ink */
  --color-line: #1c1813;        /* bold borders are ink */
  --color-line-soft: #c9ad55;   /* hairline on mustard */

  /* Accents — punchy, used flat (no gradients). */
  --color-accent: #e2533b;      /* coral/tomato — primary action */
  --color-accent-deep: #c63f29;
  --color-accent-2: #1f7a64;    /* teal — secondary */

  --radius: 12px;
  --radius-sm: 9px;
  --radius-pill: 999px;

  /* Flat design: solid offset "hard" shadows instead of soft blurs. */
  --shadow-sm: 2px 2px 0 var(--color-line);
  --shadow: 3px 3px 0 var(--color-line);
  --shadow-lift: 6px 6px 0 var(--color-line);

  --border: 2px solid var(--color-line);
  --maxw: 1060px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--color-fg); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Display face for headings / wordmark — bold, geometric, a touch gamey. */
h1, h2, h3, .brand-name, .stat-value {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
}

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

/* Keyboard skip link — hidden until focused. */
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--color-fg);
  color: var(--color-bg);
  border-radius: var(--radius-sm);
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; outline: none; }
#main:focus { outline: none; }

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

.header {
  padding: 40px 20px 36px;
  background: var(--color-bg);
  border-bottom: var(--border);
}
.header .wrap { max-width: var(--maxw); margin: 0 auto; }

/* Brand + nav share the top row. */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* Logo sits inline with the wordmark. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  /* Source PNG is 256×256; rendered down to a chunky-but-tidy mark. */
  width: 76px;
  height: 76px;
  display: block;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  object-fit: contain;
}
.brand .brand-name {
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--color-fg);
}

/* Compact brand for secondary pages (stats) where a page title leads. */
.brand--sm .logo { width: 52px; height: 52px; }
.brand--sm .brand-name { font-size: 1.7rem; }

/* Secondary page heading, subordinate to the brand wordmark. */
.page-title {
  margin: 26px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

/* ---------- top nav ---------- */

.topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.topnav a {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .92rem;
  color: var(--color-fg);
  border: var(--border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.topnav a:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.topnav a:active { transform: translate(1px, 1px); box-shadow: none; }
.topnav a.active {
  color: var(--color-surface);
  background: var(--color-fg);
}

.header .tagline {
  margin: 26px 0 0;
  color: var(--color-fg);
  font-size: 1.14rem;
  font-weight: 500;
  max-width: 60ch;
}
.header .updated {
  margin: 18px 0 0;
  color: var(--color-fg);
  font-size: .82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  /* Reserve the pill's height up front so the JS-injected "Updated…" text doesn't grow
     the header after first paint and shove the whole page down (layout shift / CLS). */
  min-height: 37px;
  box-sizing: border-box;
}
/* Keep it occupying space while still empty (reserves the slot); just hide it visually. */
.header .updated:empty { visibility: hidden; }

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

.controls {
  /* Not pinned: the search/filter bar scrolls away with the page on every viewport
     (desktop included), rather than sticking to the top over the job list. */
  position: static;
  background: var(--color-bg-deep);
  border-bottom: var(--border);
}
.controls .wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.search input[type="text"] {
  flex: 1 1 340px;
  min-width: 0;
  padding: 13px 18px;
  border: var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-fg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .12s ease, transform .12s ease;
}
.search input[type="text"]::placeholder { color: #998a63; }
.search input[type="text"]:focus {
  outline: none;
  box-shadow: var(--shadow);
}

.btn {
  padding: 12px 22px;
  border: var(--border);
  background: var(--color-surface);
  color: var(--color-fg);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.btn:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}
.btn:active { transform: translate(1px, 1px); box-shadow: none; }
/* Accent-filled variant; also works on <a class="btn btn-primary"> links. */
.btn-primary { display: inline-block; background: var(--color-accent); color: #fff; text-decoration: none; }
.btn-primary:hover { background: var(--color-accent-deep); color: #fff; }

.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Each row lays its filters out horizontally; wraps if the viewport is tight. */
.filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
/* `display:flex` above would otherwise override the `hidden` attribute's UA display:none. */
.filters-row[hidden] { display: none; }
/* "Expand additional filters" sits at the right end of the top row. */
/* Matches the dropdown fieldsets: same curved-rectangle box, stretched to their height. */
.more-filters-toggle {
  margin-left: auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border);
  border-radius: var(--radius);
  padding: 4px 16px 6px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-fg);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.more-filters-toggle:hover { border-color: var(--color-accent); color: var(--color-accent-deep); }
/* Toggle is mobile-only; filters always show on desktop. */
.filters-toggle { display: none; }
.filters fieldset {
  border: var(--border);
  border-radius: var(--radius);
  padding: 4px 14px 6px;
  margin: 0;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.filters legend {
  padding: 2px 8px;
  font-size: .82rem;
  color: var(--color-fg);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #fdf0be;
  border-radius: var(--radius-pill);
}
.filters select {
  border: none;
  background: transparent;
  color: var(--color-fg);
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  padding: 1px 2px 3px;
  max-width: 200px;
  cursor: pointer;
}
.filters select:focus { outline: none; }
.filters select option { background: var(--color-surface); color: var(--color-fg); }
.remote-field label {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .92rem; font-weight: 600; padding: 3px 0 5px;
  cursor: pointer;
}
.remote-field input { accent-color: var(--color-accent); width: 16px; height: 16px; }

.status {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--color-fg);
  min-height: 1.2em;
}

/* ---------- results ---------- */

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 56px;
  /* Reserve a screenful so the SEO blurb + footer below the list start off-screen at
     first paint; otherwise they sit in view while the list is empty and get shoved down
     when the jobs render in, which Lighthouse counts as layout shift (CLS). */
  min-height: 100vh;
}

/* ---------- active-filter chips ---------- */

.chips {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 14px;
  border: var(--border);
  background: var(--color-surface);
  color: var(--color-fg);
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.chip:hover { background: var(--color-accent); color: #fff; transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.chip .chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(28,24,19,.12);
  font-size: .9rem; line-height: 1;
}
.chip:hover .chip-x { background: rgba(255,255,255,.28); }

.results {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.results li {
  /* Per-discipline accent, overridden by the .dept-* class below; ink is the fallback. */
  --accent: var(--color-fg);
  position: relative;
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 22px 18px 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
/* Accent rail on the left — flat block of the discipline colour. */
.results li::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
  background: var(--accent);
  border-right: var(--border);
}
.results li:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
}
.results li:active { transform: translate(0, 0); box-shadow: var(--shadow-sm); }

/* Discipline accents — drive the rail per card. */
.results li.dept-engineering           { --accent: #3b6fe0; }
.results li.dept-art                   { --accent: #d6418f; }
.results li.dept-design                { --accent: #8a4ff0; }
.results li.dept-audio                 { --accent: #189f78; }
.results li.dept-production-leadership { --accent: #e08a1e; }
.results li.dept-qa-support            { --accent: #d8453f; }

.results li .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.results li .title {
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--color-fg);
}
.results li .title:hover { color: var(--color-accent-deep); text-decoration: underline; }
.results li .row1-right {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.results li .company {
  color: var(--color-fg);
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
}

.results li .row2 {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 13px;
  font-size: .85rem;
  color: var(--color-muted);
}
.results li .meta { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }

.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  background: var(--color-surface-2);
  color: var(--color-fg);
  border: 1.5px solid var(--color-line);
  font-weight: 700;
  white-space: nowrap;
}
.type-tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-fg);
  border: 1.5px solid var(--color-line);
  font-size: .76rem;
  font-weight: 700;
}

/* Per-discipline colour coding for the department tag (flat tints, ink text). */
.type-tag.dept-engineering          { background: #d9e4fc; }
.type-tag.dept-art                  { background: #fbdcee; }
.type-tag.dept-design               { background: #e7dcfd; }
.type-tag.dept-audio                { background: #d3f1e7; }
.type-tag.dept-production-leadership{ background: #fce8cf; }
.type-tag.dept-qa-support           { background: #fcdcda; }

/* Card badges (New / Remote). */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .02em;
  border: 1.5px solid var(--color-line);
}
.badge-new { background: #bdf0cc; color: var(--color-fg); }
.badge-remote { background: var(--color-accent); color: #fff; }
/* Posted-today badge — punchy coral, gently throbbing to catch the eye. */
.badge-today {
  background: var(--color-accent);
  color: #fff;
  animation: today-badge 1.8s ease-in-out infinite;
}
@keyframes today-badge {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}

@media (prefers-reduced-motion: reduce) {
  .badge-today { animation: none; }
}

.dot { color: #c2a85d; }

.empty {
  text-align: center;
  color: var(--color-muted);
  padding: 56px 16px;
  font-size: 1.02rem;
  background: var(--color-surface);
  border: 2px dashed var(--color-line);
  border-radius: var(--radius);
  box-shadow: none;
}
.empty::before { display: none; }
.empty:hover { transform: none; box-shadow: none; }

/* ---------- stats page ---------- */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-muted);
}
.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-top: 6px;
}
.stat-sub { font-size: .82rem; color: var(--color-muted); margin-top: 4px; }
.stat-sub .up { color: #157a45; font-weight: 800; }
.stat-sub .down { color: var(--color-accent-deep); font-weight: 800; }
.stat-sub .flat { font-weight: 700; }

.chart-card {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 16px;
  box-shadow: var(--shadow);
}
.chart-head {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.chart-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-fg);
}

/* Time-range zoom toggle — flat pill buttons. */
.range-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.range-toggle button {
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: .82rem;
  color: var(--color-fg);
  border: var(--border);
  background: var(--color-surface);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.range-toggle button:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.range-toggle button:active { transform: translate(1px, 1px); box-shadow: none; }
.range-toggle button.is-active {
  color: var(--color-surface);
  background: var(--color-fg);
}
.chart { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--color-line-soft); stroke-width: 1; }
.chart-svg .line { fill: none; stroke: var(--color-accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .point { fill: var(--color-surface); stroke: var(--color-fg); stroke-width: 2; }
.chart-svg .point:hover { fill: var(--color-accent); stroke: var(--color-fg); }
.chart-svg .point-label { fill: var(--color-fg); font-size: 13px; font-weight: 800; text-anchor: middle; }
.chart-svg .axis-label { fill: var(--color-muted); font-size: 12px; }
.chart-svg .axis-label.y { text-anchor: end; }
.chart-svg .axis-label.x { text-anchor: middle; }

/* ---------- SEO / about ---------- */

.seo {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px 8px;
  color: var(--color-muted);
  border-top: var(--border);
}
.seo h2 {
  margin: 22px 0 12px;
  color: var(--color-fg);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.seo h3 {
  margin: 24px 0 6px;
  color: var(--color-fg);
  font-size: 1.06rem;
  font-weight: 700;
}
.seo p {
  margin: 0 0 13px;
  max-width: 76ch;
  font-size: .95rem;
  line-height: 1.75;
}
.seo strong { color: var(--color-fg); font-weight: 700; }

/* ---------- About page ---------- */
.about { display: flex; flex-direction: column; gap: 46px; }
.about h2 {
  margin: 0 0 12px;
  color: var(--color-fg);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.about p {
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-fg);
}
.about p:last-child { margin-bottom: 0; }

/* Placeholder image box — swap each for an <img> when real artwork is ready. */
.about-img {
  flex: 0 0 40%;
  align-self: stretch;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  border: 2px dashed var(--color-line);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.about-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Area 1 & 3: image + text side by side. --reverse puts the image on the right. */
.about-row {
  display: flex;
  gap: 32px;
  align-items: center;
}
.about-row--reverse { flex-direction: row-reverse; }
.about-row .about-text { flex: 1 1 auto; }

/* Area 2: full-width text. */
.about-full .about-text,
.about-full p { max-width: none; }

/* Area 4: centre-aligned text. */
.about-center { text-align: center; }
.about-center p { margin-left: auto; margin-right: auto; max-width: 70ch; }

@media (max-width: 720px) {
  .about { gap: 36px; }
  /* Stack the image above the text on narrow screens, image first either way. */
  .about-row,
  .about-row--reverse { flex-direction: column; align-items: stretch; gap: 18px; }
  .about-img { flex-basis: auto; min-height: 180px; }
}

.footer {
  padding: 28px 20px 40px;
  font-size: .85rem;
  color: var(--color-muted);
  border-top: var(--border);
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
}
.footer a { color: inherit; text-decoration: underline; }
.footer a:hover { color: var(--color-accent-deep); }

/* ---------- cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 1100;
  width: min(640px, calc(100vw - 24px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 16px 20px;
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cookie-banner .cookie-text {
  flex: 1 1 280px;
  margin: 0;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--color-fg);
}
.cookie-banner .cookie-text a { color: var(--color-accent-deep); }
.cookie-banner .cookie-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}
.cookie-banner .btn { padding: 9px 18px; font-size: .9rem; }
.cookie-banner .btn-primary { background: var(--color-accent); color: #fff; }

@media (max-width: 520px) {
  .cookie-banner .cookie-actions { width: 100%; }
  .cookie-banner .cookie-actions .btn { flex: 1; }
}

@media (max-width: 720px) {
  .header { padding: 28px 18px 28px; }
  .brand .logo { width: 60px; height: 60px; }

  .filters select { max-width: 44vw; }
  .results li .row1 { flex-direction: column; gap: 3px; }

  /* Collapse filters behind a button to reclaim screen space. */
  .filters-toggle { display: inline-block; align-self: flex-start; }
  .filters { display: none; }
  .filters.open { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .results li, .topnav a, .btn, .chip, .range-toggle button { transition: none; }
  .results li:hover, .topnav a:hover, .btn:hover, .chip:hover, .range-toggle button:hover { transform: none; }
}

/* Note shown on the stats page while history is still accumulating. */
.chart-note {
  margin: 14px 2px 4px;
  padding: 12px 16px;
  font-size: .88rem;
  color: var(--color-muted);
  background: var(--color-surface-2);
  border: 2px dashed var(--color-line);
  border-radius: var(--radius-sm);
}

/* ---------- Contra (Konami) code easter egg ---------- */

.konami-banner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 0, 0, .5);
  animation: konami-pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.konami-banner .konami-arrows {
  font-size: clamp(1.2rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: .12em;
  color: #fff;
}
.konami-banner strong {
  font-size: clamp(1.8rem, 9vw, 5rem);
  font-weight: 900;
  letter-spacing: .04em;
  background: linear-gradient(90deg, #ff4d4d, #ffd24d, #4dff77, #4dd2ff, #b14dff, #ff4d4d);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: konami-rainbow 1.4s linear infinite;
}
@keyframes konami-pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes konami-rainbow {
  to { background-position: 300% 0; }
}

/* Brief screen flash + a faint shake of the whole page while the code is live. */
.konami-active::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: #fff;
  animation: konami-flash .6s ease-out forwards;
}
@keyframes konami-flash {
  from { opacity: .85; }
  to   { opacity: 0; }
}

.konami-sprites {
  position: fixed;
  inset: 0;
  z-index: 998;
  overflow: hidden;
  pointer-events: none;
}
.konami-sprites span {
  position: absolute;
  top: -10vh;
  animation-name: konami-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes konami-fall {
  from { transform: translateY(0)      rotate(0deg);   opacity: 1; }
  to   { transform: translateY(115vh)  rotate(540deg); opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
  .konami-banner { animation: none; }
  .konami-banner strong { animation: none; }
  .konami-active::before { display: none; }
  .konami-sprites { display: none; }
}
