:root {
  --bg: #11141a;
  --surface: #171b23;
  --surface-2: #1f2430;
  --surface-3: #2a3142;
  --text: #f2f4f8;
  --text-dim: #9ca5b6;
  --text-muted: #6a7485;
  --accent: #ff4d6d;
  --accent-2: #ff9a3c;
  --accent-3: #6b8aff;
  --border: rgba(255, 255, 255, 0.08);
  --max-width: 960px;
  --max-width-wide: 1100px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 20, 26, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand { display: flex; align-items: baseline; gap: 10px; border: none; }
.brand:hover { color: var(--text); border: none; }
.brand-mark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand-dot { color: var(--accent); }
.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.primary-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  border: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface-2);
  border: none;
}

.locale-switcher { position: relative; }
.locale-toggle {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600; color: var(--text-dim);
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.locale-toggle:hover { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.locale-toggle::-webkit-details-marker { display: none; }
.locale-chevron { transition: transform 0.2s; }
.locale-switcher[open] .locale-chevron { transform: rotate(180deg); }
.locale-current { white-space: nowrap; }

.locale-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 170px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 64px -20px rgba(0, 0, 0, 0.6);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 60;
}
.locale-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 0.92rem; font-weight: 500; color: var(--text-dim);
  padding: 9px 12px; border-radius: 10px; border: none;
  transition: background 0.12s, color 0.12s;
}
.locale-option:hover { background: var(--surface-2); color: var(--text); border: none; }
.locale-option.active { color: var(--accent); background: rgba(255, 77, 109, 0.08); font-weight: 700; }
.locale-option .locale-code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.75rem; color: var(--text-muted); }
.locale-option.active .locale-code { color: var(--accent); opacity: 0.7; }

main { padding: 48px 0 80px; }

/* Hero for latest issue */
.hero {
  margin: 40px 0 64px;
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge-cadence { color: var(--accent); border-color: rgba(255, 77, 109, 0.4); }
.badge-latest {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.25);
}

.hero-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.02;
  margin: 0 0 22px;
  letter-spacing: -0.025em;
  max-width: 900px;
}

.hero-deck {
  font-size: 1.45rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 28px;
  max-width: 720px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  border: none;
}
.btn:hover { transform: translateY(-1px); border: none; }
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover { background: #fff; color: var(--bg); box-shadow: 0 8px 24px rgba(242, 244, 248, 0.12); }
.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* TL;DR card */
.tldr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin: 0 0 44px;
  position: relative;
  overflow: hidden;
}
.tldr::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.tldr-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.tldr p { margin: 0; font-size: 1.1rem; line-height: 1.6; }

/* Article body */
.article-body {
  color: #d9dde7;
  font-size: 1.05rem;
}
.article-body h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 52px 0 18px;
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}
.article-body p { margin: 0 0 20px; }
.article-body a { color: var(--accent); border-bottom: 1px solid rgba(255, 77, 109, 0.3); }
.article-body a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.article-body ul, .article-body ol { margin: 0 0 20px 20px; padding-left: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  margin: 28px 0;
  padding: 0 24px;
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
  font-style: italic;
}
.article-body code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--surface-2);
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

/* Sources */
.article-sources {
  margin-top: 64px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.article-sources h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 22px;
}
.source-list { list-style: none; padding: 0; margin: 0; }
.source-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.source-item:last-child { border-bottom: none; }
.source-rank {
  flex: 0 0 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}
.source-content { flex: 1; }
.source-title {
  font-weight: 600;
  font-size: 1rem;
  display: block;
  margin-bottom: 4px;
  border: none;
}
.source-title:hover { color: var(--accent); }
.source-meta { font-size: 0.8rem; color: var(--text-muted); }

.archive-link { margin-top: 48px; }
.archive-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
}
.archive-link a:hover { border-color: var(--text-muted); }

/* Archive page */
.archive-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.archive-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 900;
  margin: 0 0 8px;
}
.archive-subtitle { color: var(--text-dim); margin: 0; }

.issue-grid {
  display: grid;
  gap: 20px;
}
.issue-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.issue-card:hover {
  background: var(--surface-2);
  border-color: var(--surface-3);
  transform: translateY(-2px);
}
.issue-card:hover .issue-title { color: var(--accent); }
.issue-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
  border: none;
  transition: color 0.12s;
}
.issue-deck { color: var(--text-dim); margin: 0 0 16px; font-size: 0.98rem; line-height: 1.55; }
.issue-meta { display: flex; align-items: center; gap: 14px; font-size: 0.82rem; color: var(--text-muted); flex-wrap: wrap; }
.issue-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); }
.issue-arrow { margin-left: auto; color: var(--text-muted); font-size: 1.1rem; }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: 16px;
}
.empty-state h2 { margin: 0 0 8px; font-size: 1.4rem; color: var(--text); }
.empty-state p { margin: 0; }

/* Not found / empty */
.not-found { padding: 80px 0; text-align: center; }
.not-found h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 5rem;
  font-weight: 900;
  margin: 0 0 12px;
  color: var(--accent);
}
.not-found p { color: var(--text-dim); margin: 0 0 16px; }
.not-found a { color: var(--text); font-weight: 600; }
.not-found a:hover { color: var(--accent); }

/* Prose / about */
.prose { max-width: 720px; }
.prose h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 900;
  margin: 0 0 16px;
}
.prose p { color: var(--text-dim); margin: 0 0 18px; font-size: 1.05rem; }
.prose strong { color: var(--text); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); border: none; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .brand-tagline { display: none; }
  .primary-nav { order: 3; width: 100%; justify-content: center; }
  .locale-menu { right: auto; left: 0; }
  .hero-title { font-size: 2.6rem; max-width: none; }
  .hero-deck { font-size: 1.1rem; }
  .sources { padding: 24px; }
  .issue-card { padding: 22px; }
  .archive-title { font-size: 2rem; }
}
