/* TrendBuzz — distinctive editorial dark theme
   Palette: deep charcoal + sharp orange accent + paper-cream highlights */

:root {
  --bg: #0b0b0e;
  --bg-2: #111116;
  --bg-3: #16161d;
  --surface: #1a1a22;
  --surface-2: #20202a;
  --border: #2a2a36;
  --border-2: #383846;
  --text: #f4f1e8;            /* paper cream */
  --text-muted: #9a96a8;
  --text-dim: #6c6878;
  --accent: #ff5b1f;          /* sharp orange */
  --accent-2: #ffb628;        /* warm amber */
  --accent-3: #52e0ff;        /* cold cyan */
  --accent-soft: rgba(255,91,31,0.12);
  --success: #28d17c;
  --maxw: 1320px;
  --radius: 10px;
  --radius-lg: 18px;
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(ellipse at top left, rgba(255,91,31,0.07), transparent 50%),
    radial-gradient(ellipse at top right, rgba(82,224,255,0.05), transparent 55%),
    var(--bg);
  min-height: 100vh;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== Ticker ===== */
.ticker {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: stretch;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.2);
}
.ticker-label {
  background: #000;
  color: var(--accent);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
}
.ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: flex;
  align-items: center;
}
.ticker-track .scroller {
  display: inline-flex;
  gap: 48px;
  padding-left: 100%;
  animation: tickerScroll 90s linear infinite;
}
.ticker-track .scroller span { display: inline-flex; align-items: center; gap: 8px; }
.ticker-track .scroller .dot { width: 6px; height: 6px; background: #000; border-radius: 50%; display: inline-block; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,11,14,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 38px; height: 38px;
  background: var(--accent);
  color: #000;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 18px;
  transform: rotate(-4deg);
  box-shadow: 4px 4px 0 #000;
}
.logo-text em { font-style: italic; color: var(--accent); }

.primary-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav a {
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.primary-nav a:hover { color: var(--text); background: var(--surface); }
.primary-nav a.is-active {
  color: #000;
  background: var(--accent);
  font-weight: 700;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  width: 200px;
  transition: border-color 0.18s ease, width 0.25s ease;
}
.search-form:focus-within { border-color: var(--accent); width: 280px; }
.search-form input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.search-form input::placeholder { color: var(--text-dim); }

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 28px;
  z-index: 90;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 500;
}
.mobile-menu a:hover { background: var(--surface); }

/* ===== Main ===== */
.site-main { padding-bottom: 80px; }

/* Hero */
.hero-section { padding: 36px 24px 28px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 28px;
}
.hero-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
  position: relative;
}
.hero-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.hero-media {
  display: block;
  aspect-ratio: 16/9;
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.55) 100%);
}
.hero-badge {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 2;
  background: var(--accent);
  color: #000;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-body { padding: 24px 28px 28px; }
.hero-title {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.15;
  margin: 10px 0 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-title a { background-image: linear-gradient(to bottom, transparent 92%, var(--accent) 92%); background-size: 0 100%; background-repeat: no-repeat; transition: background-size 0.4s ease; }
.hero-title a:hover { background-size: 100% 100%; }
.hero-excerpt { color: var(--text-muted); font-family: var(--font-serif); font-size: 17px; }

.hero-side { display: flex; flex-direction: column; gap: 14px; }

.list-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.list-item:hover { border-color: var(--accent); transform: translateX(2px); }
.list-thumb {
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  aspect-ratio: 1/1;
}
.list-body h4 { font-size: 15px; line-height: 1.3; margin: 0 0 6px; font-weight: 700; }

/* Meta */
.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.meta-chip {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}
.meta-stats { color: var(--text-muted); margin-top: 8px; }
.meta-stats span { display: inline-flex; align-items: center; gap: 4px; }
.meta-domain { color: var(--accent-3); }

/* ===== Stats strip ===== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 20px auto 40px;
  background: linear-gradient(135deg, rgba(255,91,31,0.08), rgba(82,224,255,0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-label { color: var(--text-muted); font-size: 13px; }
.stat-cta { align-items: flex-end; justify-content: center; }

.primary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.primary-pill:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #000; }

.ghost-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-2);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.ghost-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Main grid ===== */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
}
.main-content { min-width: 0; }

.content-section {
  margin-bottom: 56px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
  gap: 16px;
}
.section-title-group { display: flex; flex-direction: column; gap: 4px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.accent-bar {
  display: inline-block;
  width: 28px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.more-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.18s ease;
}
.more-link:hover { gap: 10px; }

/* ===== Card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.card-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }

.section-spaced { margin-top: 32px; }

.card-medium {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease;
}
.card-medium:hover { transform: translateY(-4px); border-color: var(--accent); }
.card-media {
  display: block;
  aspect-ratio: 16/10;
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.no-img-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,91,31,0.18);
}
.icon-xl { width: 64px; height: 64px; }
.icon-lg { width: 48px; height: 48px; }
.icon-sm { width: 14px; height: 14px; }
.icon { width: 16px; height: 16px; }
.play-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card-title a:hover { color: var(--accent); }

/* ===== HN grid ===== */
.hn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
}
.hn-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.18s ease;
}
.hn-item:hover { background: var(--bg-3); }
.hn-rank {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.hn-body h4 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
}
.hn-body h4 a:hover { color: var(--accent); }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.side-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 20px;
}
.side-block.accent-block { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,91,31,0.05); }
.block-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.compact-list { display: flex; flex-direction: column; gap: 4px; }
.compact-item {
  display: grid;
  grid-template-columns: 26px 48px 1fr;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 8px;
  align-items: center;
  transition: background 0.18s ease;
}
.compact-item:hover { background: var(--bg-3); }
.compact-item .rank {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
}
.compact-thumb {
  width: 48px; height: 48px;
  border-radius: 6px;
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
}
.compact-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.compact-title {
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
}
.compact-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Wikipedia list */
.wiki-list { display: flex; flex-direction: column; gap: 10px; }
.wiki-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.18s ease;
}
.wiki-item:hover { background: var(--bg-3); }
.wiki-thumb {
  width: 56px; height: 56px;
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
  border-radius: 6px;
}
.wiki-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.wiki-body strong { font-weight: 600; color: var(--text); }
.wiki-views { color: var(--text-dim); display: inline-flex; align-items: center; gap: 4px; }

/* On this day */
.onthisday-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.onthisday-list li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.onthisday-list li:last-child { border-bottom: none; padding-bottom: 0; }
.year {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-2);
  font-size: 14px;
}
.event-text { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

/* Topic cloud */
.topic-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-pill {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.18s ease;
}
.topic-pill:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ===== Category Hero ===== */
.category-hero {
  background:
    linear-gradient(135deg, rgba(255,91,31,0.16), transparent 60%),
    var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.category-hero::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 300px; height: 300px;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.2;
}
.category-hero-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
}
.cat-icon {
  width: 96px; height: 96px;
  background: var(--accent);
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #000;
  box-shadow: 8px 8px 0 #000;
}
.category-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  margin: 4px 0 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.category-hero p { color: var(--text-muted); max-width: 60ch; font-family: var(--font-serif); font-size: 18px; }
.cat-stats {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.cat-stats strong { color: var(--accent); }

/* Tabs */
.tab-bar {
  display: flex;
  gap: 6px;
  margin: 24px 0 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 12px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== Story page ===== */
.story-page {
  max-width: 880px;
  padding-top: 36px;
  padding-bottom: 48px;
}
.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}
.breadcrumb a:hover { color: var(--accent); }
.bc-current { color: var(--text); }

.story-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  margin: 12px 0 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.story-head .big-stat {
  font-size: 14px;
  color: var(--text);
  background: var(--bg-3);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.story-media {
  width: 100%;
  aspect-ratio: 16/9;
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-lg);
  margin: 28px 0;
  border: 1px solid var(--border);
}
.story-body {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--text);
  padding-bottom: 28px;
}
.story-link-body { color: var(--text-muted); }

.story-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 48px;
}
.related-section { margin-top: 48px; }
.related-section .section-title { margin-bottom: 20px; }

/* ===== Search ===== */
.search-hero {
  padding-top: 56px;
  padding-bottom: 24px;
}
.search-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin: 8px 0 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.accent-text { color: var(--accent); }
.search-form-big {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 12px 18px;
  max-width: 600px;
}
.search-form-big:focus-within { border-color: var(--accent); }
.search-form-big input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  outline: none;
}
.search-form-big button {
  background: var(--accent);
  color: #000;
  border: 0;
  padding: 8px 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.result-meta { color: var(--text-muted); font-size: 14px; margin: 20px 0; font-family: var(--font-mono); }
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-2);
  padding: 48px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { color: var(--text-muted); margin: 0; }
.suggested-topics { margin: 40px 0; }
.suggested-topics h3 { font-size: 16px; color: var(--text-muted); margin-bottom: 14px; font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; }

/* ===== Content pages (about, contact) ===== */
.content-page {
  padding-top: 60px;
  padding-bottom: 80px;
  max-width: 980px;
}
.content-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.5vw, 56px);
  margin: 8px 0 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.content-page .lede {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text-muted);
  margin: 0 0 32px;
  line-height: 1.5;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
}
.about-text h3 {
  margin-top: 36px;
  font-size: 22px;
  letter-spacing: -0.01em;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}
.about-text p, .about-text ol { color: var(--text-muted); font-family: var(--font-serif); font-size: 17px; }
.about-text ol li { margin-bottom: 8px; }
.about-side { display: flex; flex-direction: column; gap: 16px; }
.side-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
.side-stat .big {
  font-family: var(--font-mono);
  font-size: 42px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.side-stat span:last-child { color: var(--text-muted); font-size: 14px; }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 640px;
}
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.04em; }
.contact-form input,
.contact-form textarea,
.contact-form select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus { border-color: var(--accent); }
.contact-form button { align-self: flex-start; }
.success-note { color: var(--success); font-size: 14px; margin: 4px 0 0; }

/* 404 */
.notfound {
  padding-top: 80px;
  padding-bottom: 80px;
  max-width: 720px;
  text-align: left;
}
.notfound h1 { font-size: clamp(36px, 5vw, 56px); margin: 12px 0 16px; font-weight: 800; letter-spacing: -0.02em; }
.notfound p { color: var(--text-muted); font-family: var(--font-serif); font-size: 18px; margin-bottom: 24px; }

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(180deg, var(--bg) 0%, #050507 100%);
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr;
  gap: 36px;
  align-items: start;
}
.foot-col h4 { margin: 0 0 16px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text); font-family: var(--font-mono); }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col ul a { color: var(--text-muted); font-size: 14px; transition: color 0.18s ease; }
.foot-col ul a:hover { color: var(--accent); }
.foot-brand .logo { margin-bottom: 12px; }
.foot-brand p { color: var(--text-muted); font-size: 14px; line-height: 1.6; max-width: 320px; }
.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all 0.18s ease;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.foot-newsletter p { color: var(--text-muted); font-size: 14px; margin: 0 0 14px; }
.newsletter-form { display: flex; gap: 6px; flex-wrap: wrap; }
.newsletter-form input {
  flex: 1;
  min-width: 140px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button {
  background: var(--accent);
  color: #000;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.nf-ok { width: 100%; color: var(--success); font-size: 13px; margin-top: 6px; }

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.tech-badge { color: var(--text-muted); }

/* ===== Reveal animation ===== */
.card,
.card-medium,
.hn-item,
.list-item,
.compact-item,
.wiki-item {
  opacity: 0;
  transform: translateY(12px);
  animation: tbReveal 0.5s cubic-bezier(0.2,0.7,0.2,1) forwards;
}
@keyframes tbReveal {
  to { opacity: 1; transform: translateY(0); }
}
.card-grid > *:nth-child(1)  { animation-delay: 0.02s; }
.card-grid > *:nth-child(2)  { animation-delay: 0.06s; }
.card-grid > *:nth-child(3)  { animation-delay: 0.10s; }
.card-grid > *:nth-child(4)  { animation-delay: 0.14s; }
.card-grid > *:nth-child(5)  { animation-delay: 0.18s; }
.card-grid > *:nth-child(6)  { animation-delay: 0.22s; }
.card-grid > *:nth-child(7)  { animation-delay: 0.26s; }
.card-grid > *:nth-child(8)  { animation-delay: 0.30s; }
.card-grid > *:nth-child(9)  { animation-delay: 0.34s; }
.card-grid > *:nth-child(n+10) { animation-delay: 0.38s; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
  .stats-strip { grid-template-columns: repeat(4, 1fr); }
  .stat-cta { grid-column: 1 / -1; align-items: flex-start; }
}
@media (max-width: 900px) {
  .primary-nav { display: none; }
  .search-form { display: none; }
  .menu-toggle { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .card-grid, .card-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hn-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .category-hero-inner { grid-template-columns: 1fr; gap: 16px; }
  .cat-icon { width: 64px; height: 64px; box-shadow: 5px 5px 0 #000; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .card-grid, .card-grid.grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-inner { grid-template-columns: 1fr auto; gap: 12px; }
  .hero-section { padding: 24px 16px; }
  .list-item { grid-template-columns: 72px 1fr; }
}
