:root {
  --bg: #070b10;
  --bg-soft: #0c1218;
  --panel: #101820;
  --line: #22303a;
  --line-strong: #344752;
  --text: #e6efed;
  --muted: #91a2a8;
  --dim: #63757d;
  --lime: #b9ff62;
  --cyan: #69e7da;
  --amber: #f0bd76;
  --red: #ff7c73;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(rgba(105, 231, 218, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(105, 231, 218, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  content: '';
  pointer-events: none;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }

.page-width {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 7px 10px;
  border: 1px solid var(--lime);
  border-radius: 3px;
  background: var(--bg);
  color: var(--lime);
  font-size: 0.72rem;
  transform: translateY(-150%);
  transition: transform 140ms ease;
}

.skip-link:focus { transform: translateY(0); }

.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;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 16, 0.94);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: lowercase;
}

.brand-mark {
  color: var(--lime);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
}

.brand-accent { color: var(--lime); }

.topnav {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.topnav a, .text-link {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.topnav a:hover, .topnav a:focus-visible, .text-link:hover, .text-link:focus-visible { color: var(--cyan); }

.support-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--lime);
  font-size: 0.64rem;
  font-weight: 700;
  text-decoration: none;
}

.support-link:hover, .support-link:focus-visible { border-color: var(--lime); background: rgba(185, 255, 98, 0.08); }
.support-cup { color: var(--amber); }
.external-arrow { color: var(--dim); }

.feed-wrap { padding: 30px 0 54px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}

.section-kicker {
  margin: 0;
  color: var(--lime);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.section-heading h1, .method-heading h2 {
  margin: 7px 0 0;
  color: var(--text);
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.12;
}

.section-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 3px;
  color: var(--cyan);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ranking-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(105, 231, 218, 0.12);
}

.feed-toolbar { margin: 13px 0 8px; }
.filter-caption { margin: 0; color: var(--dim); font-size: 0.66rem; }

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}

.tag-button, .story-tag {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 650;
}

.tag-button {
  padding: 4px 7px;
  letter-spacing: 0.02em;
}

.tag-button span { margin-left: 4px; color: var(--dim); font-size: 0.6rem; }
.tag-button:hover, .tag-button:focus-visible { border-color: var(--cyan); color: var(--cyan); }
.tag-button.is-active { border-color: var(--cyan); background: rgba(105, 231, 218, 0.1); color: var(--cyan); }
.tag-button.is-active span { color: var(--cyan); }

.story-list { border-top: 1px solid var(--line); }

.story-card {
  padding: 11px 0 13px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 120ms ease;
}

.story-card:hover { background: rgba(12, 18, 24, 0.8); }
.story-body { min-width: 0; }

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.45;
}

.story-meta > span[aria-hidden="true"] { color: var(--line-strong); }
.source-name { color: var(--amber); font-weight: 750; }
.story-tags { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.story-tag { padding: 0; border: 0; color: var(--cyan); font-size: inherit; }
.story-tag + .story-tag::before { margin-right: 5px; color: var(--line-strong); content: '/'; }
.story-tag:hover, .story-tag:focus-visible { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.discussion-link { color: var(--muted); font-size: inherit; font-weight: 650; text-decoration: none; }
.discussion-link:hover, .discussion-link:focus-visible { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

.story-card h3 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(1rem, 1.65vw, 1.28rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

.story-title { color: var(--text); text-decoration: none; }
.story-title:hover, .story-title:focus-visible { color: var(--lime); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.title-arrow { color: var(--dim); font-size: 0.78em; }
.story-summary { max-width: 900px; margin: 4px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.48; }
.story-bottom, .story-actions { display: inline; }

.empty-state {
  padding: 34px 16px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.empty-mark { color: var(--red); font-size: 1.4rem; }
.empty-state h3 { margin: 7px 0 3px; font-size: 0.95rem; letter-spacing: 0; }
.empty-state p { margin: 0 0 14px; color: var(--muted); font-size: 0.72rem; }
.button { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 0.66rem; font-weight: 700; }
.button-dark { background: var(--panel); color: var(--cyan); }
.button-dark:hover, .button-dark:focus-visible { border-color: var(--cyan); }

.method-wrap { padding: 44px 0 52px; border-top: 1px solid var(--line); }
.method-heading h2 { max-width: 650px; color: var(--text); }
.method-heading .section-kicker { color: var(--cyan); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 25px; border-top: 1px solid var(--line); }
.method-card { min-height: 150px; padding: 16px 18px 14px 0; border-right: 1px solid var(--line); }
.method-card + .method-card { padding-left: 18px; }
.method-card:last-child { border-right: 0; }
.method-number { display: inline-block; margin-bottom: 14px; color: var(--lime); font-size: 0.62rem; font-weight: 700; }
.method-card h3 { max-width: 280px; margin: 0 0 7px; color: var(--text); font-size: 0.8rem; letter-spacing: 0; line-height: 1.3; }
.method-card p { max-width: 320px; margin: 0; color: var(--dim); font-size: 0.68rem; line-height: 1.55; }

.footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.footer-brand { color: var(--text); }
.footer p { margin: 6px 0 0; font-size: 0.64rem; }
.footer-right { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; font-size: 0.62rem; }
.footer-right a { color: var(--cyan); font-weight: 700; text-decoration: none; }
.footer-right a:hover, .footer-right a:focus-visible { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }

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

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px 14px; padding-top: 9px; padding-bottom: 9px; }
  .topnav { order: 3; width: 100%; margin-left: 0; padding-top: 5px; border-top: 1px solid var(--line); }
  .support-link { margin-left: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-note { margin: 0; }
  .story-card h3 { font-size: 1rem; }
  .story-summary { font-size: 0.73rem; }
  .method-grid { grid-template-columns: 1fr; }
  .method-card, .method-card + .method-card { min-height: 0; padding: 15px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .method-card:last-child { border-bottom: 0; }
}

@media (max-width: 480px) {
  .page-width { width: min(100% - 22px, 1200px); }
  body { font-size: 13px; }
  .feed-wrap { padding-top: 22px; }
  .section-heading h1, .method-heading h2 { font-size: 1.35rem; }
  .story-card { padding: 10px 0 12px; }
  .story-meta { font-size: 0.59rem; }
  .story-card h3 { font-size: 0.93rem; }
  .story-summary { font-size: 0.7rem; }
  .footer { align-items: flex-start; flex-direction: column; }
  .footer-right { justify-content: flex-start; }
}

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