:root {
  --ink: #f3f4f6;
  --ink-dim: rgba(255, 255, 255, 0.62);
  --ink-faint: rgba(255, 255, 255, 0.40);
  --bg: #08080a;
  --panel: rgba(20, 20, 22, 0.55);
  --panel-solid: rgba(18, 18, 20, 0.92);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --hot: #ff2d6f;
  --nav-h: 62px;
  --radius: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: #fff; color: #000; padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

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

/* ---------------------------------------------------------------- backdrop */

.bg-fixed {
  position: fixed; inset: var(--nav-h) 0 0 0;
  background-image: url('../img/meme.jpg');
  background-size: cover; background-position: center top;
  background-color: #111; z-index: -2;
}
.bg-scrim {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8,8,10,0.30) 0%, rgba(8,8,10,0.72) 55%, rgba(8,8,10,0.92) 100%);
}
body:not(.has-backdrop) { background-color: var(--bg); }

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

.top-nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
  min-height: var(--nav-h);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px clamp(14px, 5vw, 44px);
  background-color: rgba(12, 12, 14, 0.78);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
}

.nav-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 800; color: #fff; text-decoration: none; white-space: nowrap;
}
.nav-mark {
  width: 9px; height: 9px; border-radius: 50%; background: var(--hot);
  box-shadow: 0 0 12px var(--hot);
}
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-dim); text-decoration: none;
}
.nav-links a:hover { color: #fff; }

/* ----------------------------------------------------------------- filter */

.filter-wrapper { position: relative; }

#dropdown-toggle {
  background-color: rgba(255,255,255,0.08); border: 1px solid var(--line-strong);
  padding: 8px 16px; border-radius: 999px; font: inherit;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: #fff; cursor: pointer; display: flex; align-items: center; gap: 10px;
  transition: background 0.2s;
}
#dropdown-toggle:hover { background-color: rgba(255,255,255,0.16); }

#dropdown-menu {
  position: absolute; top: calc(100% + 12px); right: 0; width: 262px;
  background-color: rgba(16,16,18,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: 340px; overflow-y: auto; box-shadow: 0 18px 46px rgba(0,0,0,0.7);
}
#dropdown-menu[hidden] { display: none; }

.filter-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  border-radius: 9px; color: #e5e7eb;
}
.filter-option:hover { background-color: rgba(255,255,255,0.09); }
.filter-option input { accent-color: var(--hot); width: 16px; height: 16px; cursor: pointer; }

.filter-foot {
  display: flex; gap: 14px; padding: 8px 10px 4px;
  border-top: 1px solid var(--line); margin-top: 4px;
}

.linkish {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px;
  font-size: 0.78rem;
}
.linkish:hover { color: #fff; }

/* ------------------------------------------------------------------- main */

main { flex: 1 0 auto; width: 100%; }

.feed-page {
  max-width: 560px; width: 90%; margin: 0 auto;
  padding-top: calc(var(--nav-h) + 34px); padding-bottom: 64px;
}
.page {
  max-width: 760px; width: 90%; margin: 0 auto;
  padding-top: calc(var(--nav-h) + 40px); padding-bottom: 72px;
}

.feed-head { margin-bottom: 26px; }
.feed-head h1 {
  font-size: clamp(1.35rem, 4.6vw, 1.85rem); line-height: 1.2; margin: 0 0 12px;
  font-weight: 800; letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(0,0,0,0.75);
}
.feed-sub {
  margin: 0 0 8px; font-size: 0.82rem; line-height: 1.55; color: var(--ink-dim);
  text-shadow: 0 1px 10px rgba(0,0,0,0.8);
}
.feed-sub a { color: #fff; }

.feed { display: flex; flex-direction: column; gap: 24px; }

.date-divider {
  align-self: center; margin: 6px 0 0; text-align: center;
  font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 800;
  background-color: rgba(18,18,20,0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 18px;
}

.post-container {
  background-color: var(--panel);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.36);
}
.post-container[hidden] { display: none; }

.post-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.category-tag {
  padding: 4px 12px; border-radius: 999px; font-size: 0.62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: #fff; text-decoration: none;
  white-space: nowrap;
}
a.category-tag:hover { filter: brightness(1.25); }
.timestamp { font-size: 0.68rem; color: var(--ink-faint); font-weight: 500; white-space: nowrap; }

.cat-politics    { background-color: rgba(142, 68, 173, 0.78); }
.cat-business    { background-color: rgba(39, 174, 96, 0.78); }
.cat-technology  { background-color: rgba(41, 128, 185, 0.78); }
.cat-sports      { background-color: rgba(211, 84, 0, 0.78); }
.cat-entertainment { background-color: rgba(230, 126, 34, 0.78); }
.cat-health      { background-color: rgba(22, 160, 133, 0.78); }
.cat-environment { background-color: rgba(46, 204, 113, 0.78); }
.cat-world       { background-color: rgba(26, 95, 122, 0.85); }
.cat-opinion     { background-color: rgba(192, 57, 43, 0.78); }
.cat-news        { background-color: rgba(85, 85, 85, 0.78); }

.meme-text {
  margin: 0; font-size: 0.94rem; line-height: 1.62; text-transform: uppercase;
  overflow-wrap: break-word; font-weight: 500; color: #eceef2;
}

.tldr {
  margin: 0; font-size: 0.8rem; line-height: 1.55; color: var(--ink-dim);
  border-left: 2px solid var(--hot); padding-left: 12px;
}
.tldr-label {
  display: block; font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 800; color: var(--ink-faint); margin-bottom: 3px;
}

.source-box {
  display: block; background-color: rgba(0,0,0,0.34); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 11px; padding: 12px; text-decoration: none; color: #d1d5db;
  transition: background 0.2s, border-color 0.2s;
}
.source-box:hover { background-color: rgba(255,255,255,0.08); border-color: var(--line-strong); }
.source-label {
  display: block; font-size: 0.6rem; color: var(--ink-faint); text-transform: uppercase;
  margin-bottom: 4px; letter-spacing: 0.08em; font-weight: 700;
}
.source-title { display: block; font-size: 0.78rem; line-height: 1.45; font-weight: 600; }

.post-foot {
  margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
}
.post-foot a { color: var(--ink-dim); text-decoration: none; }
.post-foot a:hover { color: #fff; text-decoration: underline; }
.ai-flag { color: var(--ink-faint); }

.empty-state, .feed-empty {
  text-align: center; font-size: 0.85rem; padding: 22px; color: var(--ink-dim);
  background: rgba(18,18,20,0.6); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 12px; margin-top: 24px;
}

/* ------------------------------------------------------------------ story */

.breadcrumb {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  color: var(--ink-faint); margin-bottom: 16px;
}
.breadcrumb a { color: var(--ink-dim); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }

.story {
  background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(20px, 4vw, 32px);
  display: flex; flex-direction: column; gap: 18px;
}
.story-headline {
  margin: 0; font-size: clamp(1.2rem, 3.6vw, 1.6rem); line-height: 1.28; font-weight: 800;
  letter-spacing: -0.01em;
}
.ai-notice {
  margin: 0; font-size: 0.78rem; line-height: 1.55; color: var(--ink-dim);
  background: rgba(255, 45, 111, 0.09); border: 1px solid rgba(255, 45, 111, 0.3);
  border-radius: 11px; padding: 12px 14px;
}
.ai-notice strong { color: #fff; }
.story-meme { font-size: 1rem; }
.story-foot { margin: 0; font-size: 0.78rem; color: var(--ink-dim); }
.story-foot a { color: #fff; }

.related { margin-top: 34px; }
.related h2 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-faint); margin: 0 0 12px;
}
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.related a {
  display: block; font-size: 0.85rem; line-height: 1.5; color: var(--ink-dim);
  text-decoration: none; border-left: 2px solid var(--line-strong); padding-left: 12px;
}
.related a:hover { color: #fff; border-left-color: var(--hot); }

/* ------------------------------------------------------------------ prose */

.prose { max-width: 68ch; }
.prose h1 {
  font-size: clamp(1.5rem, 4.6vw, 2rem); line-height: 1.2; margin: 0 0 6px;
  font-weight: 800; letter-spacing: -0.02em;
}
.prose h2 {
  font-size: 1.02rem; font-weight: 800; margin: 34px 0 10px; color: #fff;
  letter-spacing: -0.005em;
}
.prose p, .prose li { color: #cfd3da; font-size: 0.92rem; line-height: 1.72; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hot); }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: #fff; }
.prose code {
  background: rgba(255,255,255,0.09); padding: 2px 6px; border-radius: 5px;
  font-size: 0.85em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.updated { font-size: 0.72rem; color: var(--ink-faint); margin: 0 0 26px; }
.lede { font-size: 1rem !important; color: var(--ink-dim) !important; margin-bottom: 26px !important; }
.steps li { margin-bottom: 12px; }
.center-state { text-align: center; margin: 0 auto; padding-top: 40px; }

.cookie-table {
  width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 0.8rem;
  display: block; overflow-x: auto;
}
.cookie-table th, .cookie-table td {
  border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top;
  color: #cfd3da;
}
.cookie-table th {
  background: rgba(255,255,255,0.05); color: #fff; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.contact-card {
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin: 24px 0 30px;
}
.contact-label {
  font-size: 0.64rem !important; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-faint) !important; margin: 0 0 6px !important; font-weight: 800;
}
.contact-email {
  font-size: 1.15rem; font-weight: 800; color: #fff; text-decoration: underline;
  text-underline-offset: 4px; text-decoration-color: var(--hot); overflow-wrap: anywhere;
}
.contact-note { font-size: 0.78rem !important; color: var(--ink-dim) !important; margin: 14px 0 0 !important; }

.contact-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.contact-grid section { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.contact-grid h2 { margin: 0 0 8px; font-size: 0.88rem; }
.contact-grid p { font-size: 0.82rem !important; margin: 0 !important; }

.btn {
  display: inline-block; font: inherit; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 11px 20px;
  border-radius: 999px; cursor: pointer; text-decoration: none; border: 1px solid transparent;
}
.btn-solid { background: #fff; color: #000; }
.btn-solid:hover { background: #e8e8e8; }
.btn-ghost { background: transparent; color: #fff; border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); }

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

.site-footer {
  flex-shrink: 0; position: relative; z-index: 2; margin-top: 40px;
  background: rgba(8,8,10,0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 44px clamp(16px, 5vw, 44px) 30px;
  display: grid; gap: 32px;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(130px, 1fr));
}

.footer-wordmark {
  margin: 0 0 8px; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: #fff;
}
.footer-blurb { margin: 0 0 14px; font-size: 0.82rem; color: var(--ink-dim); max-width: 38ch; }
.footer-badge {
  margin: 0; font-size: 0.74rem; line-height: 1.55; color: var(--ink-dim);
  background: rgba(255, 45, 111, 0.09); border: 1px solid rgba(255, 45, 111, 0.28);
  border-radius: 11px; padding: 11px 13px; max-width: 44ch;
}

.footer-col h2 {
  margin: 0 0 12px; font-size: 0.64rem; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-faint); font-weight: 800;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a, .footer-col .linkish {
  font-size: 0.82rem; color: var(--ink-dim); text-decoration: none; text-align: left;
}
.footer-col a:hover, .footer-col .linkish:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.footer-base {
  max-width: 1080px; margin: 0 auto; padding: 20px clamp(16px, 5vw, 44px) 34px;
  border-top: 1px solid var(--line);
}
.footer-base p { margin: 0 0 8px; font-size: 0.72rem; line-height: 1.6; color: var(--ink-faint); }
.footer-base a { color: var(--ink-dim); }
.footer-base .credit { font-style: italic; }

/* ---------------------------------------------------------------- consent */

.consent-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 150;
  width: min(680px, calc(100% - 24px));
  background: rgba(14,14,16,0.97);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 20px 54px rgba(0,0,0,0.72);
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.consent-bar[hidden] { display: none; }
.consent-copy { flex: 1 1 300px; }
.consent-copy p { margin: 0 0 6px; font-size: 0.8rem; line-height: 1.55; color: var(--ink-dim); }
.consent-copy strong { color: #fff; }
.consent-links { font-size: 0.74rem !important; }
.consent-links a { color: var(--ink-dim); }
.consent-actions { display: flex; gap: 10px; flex: 0 0 auto; }

/* ----------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --nav-h: 104px; }
  .top-nav { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .nav-title { justify-content: center; }
  .nav-links { justify-content: center; flex-wrap: wrap; gap: 14px; }
  .filter-wrapper { width: 100%; }
  #dropdown-toggle { width: 100%; justify-content: space-between; }
  #dropdown-menu { width: 100%; right: auto; left: 0; }
  .bg-fixed { background-size: 100% auto; background-repeat: repeat; background-position: top center; }
  .consent-bar { bottom: 0; border-radius: 16px 16px 0 0; width: 100%; }
  .consent-actions { width: 100%; }
  .consent-actions .btn { flex: 1; text-align: center; }
}

@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .post-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
}

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

@media print {
  .top-nav, .consent-bar, .bg-fixed, .bg-scrim, .filter-wrapper { display: none !important; }
  body { background: #fff; color: #000; }
  .prose p, .prose li, .prose h1, .prose h2 { color: #000; }
}
