/* ==============================================
   Christian Silva — Shared Styles
   Light: Rostra (serif, white, literary)
   Dark:  Swiss Editorial (sans, charcoal, grid)
   ============================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==============================================
   LIGHT THEME (default) — Rostra
   ============================================== */
:root, [data-theme="light"] {
  --ink: #111;
  --muted: #555;
  --faint: #777;
  --line: #ddd;
  --bg: #fff;
  --soft: #f7f7f3;
  --card-bg: #fff;
  --accent: #111;
  --accent-hi: #c42;
  --font-body: Georgia, "Times New Roman", serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 880px;
  color-scheme: light;
}

/* ==============================================
   DARK THEME — Swiss Editorial
   ============================================== */
[data-theme="dark"] {
  --ink: #f0f0f0;
  --muted: #999;
  --faint: #666;
  --line: #2a2a2a;
  --bg: #0a0a0a;
  --soft: #111;
  --card-bg: #111;
  --accent: #e53935;
  --accent-hi: #ff5252;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

/* ==============================================
   BASE
   ============================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .08em; }
img, svg, video, iframe { max-width: 100%; height: auto; }

/* --- Film grain overlay (dark mode only) --- */
[data-theme="dark"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==============================================
   LAYOUT
   ============================================== */
.page { width: min(100%, var(--max)); margin: 0 auto; padding: 34px 22px 70px; }

/* ==============================================
   HEADER / NAV
   ============================================== */
.top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  font-size: 14px;
  letter-spacing: .02em;
}
.mark {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.nav a, .mark { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.nav a:hover, .mark:hover { border-bottom-color: var(--ink); }

/* --- Theme toggle --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  transition: all 0.2s ease;
  line-height: 1.4;
}
.theme-toggle:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ==============================================
   HERO
   ============================================== */
.hero { padding: 76px 0 48px; border-bottom: 1px solid var(--line); }
.kicker, .num, .meta, .back {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--faint);
}
.kicker { letter-spacing: .18em; margin-bottom: 18px; }
[data-theme="dark"] .kicker { color: var(--accent); letter-spacing: .22em; }
.meta { margin-top: 34px; }
[data-theme="dark"] .meta { color: var(--muted); }
.back {
  display: inline-block;
  margin-top: 18px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* ==============================================
   TYPOGRAPHY
   ============================================== */
h1 {
  font-weight: 400;
  font-size: clamp(46px, 8vw, 96px);
  letter-spacing: -.07em;
  line-height: .92;
  margin: 0 0 24px;
  text-wrap: balance;
  font-family: var(--font-heading);
}
[data-theme="dark"] h1 {
  font-weight: 600;
  letter-spacing: -.04em;
}
h2 {
  font-weight: 400;
  font-size: clamp(28px, 5vw, 54px);
  letter-spacing: -.045em;
  line-height: 1.05;
  margin: 0 0 22px;
  text-wrap: balance;
  font-family: var(--font-heading);
}
[data-theme="dark"] h2 { font-weight: 500; letter-spacing: -.03em; }
h3 { font-weight: 400; font-size: 22px; margin: 0 0 8px; font-family: var(--font-heading); }
[data-theme="dark"] h3 { font-weight: 500; }
.dek {
  font-size: clamp(23px, 3.3vw, 36px);
  line-height: 1.16;
  letter-spacing: -.03em;
  max-width: 760px;
  margin: 0 0 20px;
  text-wrap: balance;
}
.sub, .date { font-size: 18px; color: var(--muted); max-width: 690px; }

/* ==============================================
   SECTIONS
   ============================================== */
.section { padding: 54px 0; border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 150px 1fr; gap: 34px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* ==============================================
   CARDS
   ============================================== */
.card {
  border: 1px solid var(--line);
  background: var(--card-bg);
  padding: 22px;
  min-width: 0;
}
[data-theme="dark"] .card {
  border-color: #333;
  background: var(--soft);
}
.card p, .item p { color: var(--muted); margin: 0; }
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--faint);
  margin-bottom: 8px;
}
[data-theme="dark"] .tag { color: var(--accent); }
.list { display: grid; gap: 28px; }
.item {
  display: block;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}
.item:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .08em; }
.item h2 { margin-bottom: 12px; }

/* ==============================================
   ARTICLES
   ============================================== */
.article { max-width: 760px; padding: 46px 0; border-bottom: 1px solid var(--line); }
.article p { font-size: 20px; margin: 0 0 22px; hyphens: auto; }
.article h2 { margin: 54px 0 18px; }
.article ul { font-size: 20px; margin: 0 0 28px; padding-left: 24px; }
.article li { margin: 0 0 10px; }

/* ==============================================
   PULL QUOTES
   ============================================== */
.pull {
  font-size: clamp(25px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.04em;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
  margin: 38px 0;
}
[data-theme="dark"] .pull {
  font-weight: 500;
  color: #f5f5f5;
}

/* ==============================================
   RELATED ARTICLES
   ============================================== */
.related { border-top: 1px solid var(--line); margin-top: 44px; padding-top: 28px; }
.related h2 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 16px; }
.related-list { display: grid; gap: 14px; }
.related-card {
  display: block;
  border: 1px solid var(--line);
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
}
[data-theme="dark"] .related-card { border-color: #333; background: var(--soft); }
.related-card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .08em; }
.related-card h3 { font-size: 21px; margin: 0 0 6px; }
.related-card p { font-size: 16px; color: var(--muted); margin: 0; }

/* ==============================================
   FOOTER
   ============================================== */
.footer { font-size: 13px; color: var(--faint); padding-top: 28px; }

/* ==============================================
   QUOTE (homepage)
   ============================================== */
.quote {
  font-size: 20px;
  line-height: 1.5;
  margin: 0 0 18px;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 640px) {
  .page { padding: 24px 18px 56px; }
  .top { align-items: flex-start; gap: 12px; flex-direction: column; }
  .nav { justify-content: flex-start; gap: 12px 16px; font-size: 17px; }
  .mark { font-size: 12px; letter-spacing: .14em; }
  .hero { padding: 58px 0 40px; }
  h1 { font-size: clamp(52px, 17vw, 76px); line-height: .9; letter-spacing: -.08em; }
  h2 { font-size: clamp(34px, 10vw, 48px); line-height: 1; letter-spacing: -.055em; }
  .dek { font-size: clamp(26px, 7vw, 34px); line-height: 1.12; }
  .sub, .date { font-size: 19px; line-height: 1.45; }
  .section { padding: 42px 0; }
  .split { grid-template-columns: 1fr; gap: 14px; }
  .grid { grid-template-columns: 1fr; }
  .article { padding: 38px 0; }
  .article p, .article ul { font-size: 20px; line-height: 1.58; }
  .pull { font-size: clamp(28px, 9vw, 40px); }
  .item { padding-bottom: 26px; }
  .footer { font-size: 12px; }
}
@media (max-width: 380px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .nav { font-size: 16px; gap: 10px 12px; }
  h1 { font-size: 50px; }
  h2 { font-size: 32px; }
  .dek { font-size: 24px; }
  .article p, .article ul { font-size: 19px; }
}
