/* ============================================================
   Your Name — Investigative Journalism
   Static, CDN-friendly stylesheet. No build step.
   ============================================================ */

/* ---- Red & white, warm and smooth. Light is the default; the
   [data-theme="dark"] block swaps every token for a warm dark red-tinted
   palette (no harsh pure black). Components only ever read variables, so
   the toggle is just an attribute flip — light on code, smooth on eyes. */
:root {
  --bg: #fff6f4;
  --bg-2: #ffffff;
  --ink: #2b1517;
  --ink-dim: #967076;
  --line: #f0d6da;
  --accent: #e63946;
  --money: #0a8f4d;
  --header-bg: rgba(255, 251, 250, 0.8);
  --box-from: #ffffff;
  --box-to: #fff3f2;
  --grad: linear-gradient(160deg, #ffffff 0%, #fff0ee 45%, #ffe3e4 100%);
  --shadow: 0 18px 50px -24px rgba(198, 40, 53, 0.3);
  --max: 1200px;
  --radius: 16px;
  font-synthesis: none;
}
:root[data-theme="dark"] {
  --bg: #1b0d0f;
  --bg-2: #251316;
  --ink: #fdf2f2;
  --ink-dim: #c9a0a5;
  --line: #402227;
  --accent: #ff4f5f;
  --money: #6ee7b7;
  --header-bg: rgba(24, 11, 13, 0.75);
  --box-from: #251316;
  --box-to: #1c0d0f;
  --grad: linear-gradient(160deg, #1f0e10 0%, #150a0b 55%, #241014 100%);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
}

/* Smooth theme cross-fade on the big surfaces (kept off elements that
   animate transform/opacity so nothing fights the reveal/shake). */
html, body, .site-header, .site-nav, .chip, .tier, .synd-card,
.syndication, .ad-box, .newsletter, .site-footer, .developments,
.article-meta, .share-bar a, .share-bar button, .theme-toggle, .hamburger {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--grad);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Georgia", "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4, .brand-name, .site-nav, .kicker, .ad-label, .hero-eyebrow {
  font-family: "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent);
  color: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px clamp(16px, 4vw, 48px);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; min-width: 0; }
@media (max-width: 600px) {
  /* keep the full THINK40 YEARS AHEAD on phones, just tighter */
  .brand-name { font-size: 16px; letter-spacing: 1px; }
  .brand-tag {
    font-size: 10px;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
body { overflow-x: clip; }             /* backstop: nothing may push the page sideways */
.brand-40 { color: var(--accent); }
.brand-name { font-weight: 800; letter-spacing: 2px; font-size: 18px; }
.brand-tag { color: var(--ink-dim); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.site-nav { display: flex; gap: 22px; font-size: 14px; letter-spacing: .3px; }
.site-nav a { text-decoration: none; color: var(--ink-dim); transition: color .2s; }
.site-nav a:hover { color: var(--ink); }
.nav-cta {
  color: var(--ink) !important; border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- Responsive header nav ----------
   The ☰ hamburger + dropdown work at EVERY size. On desktop (>760px) the
   header additionally fills with hotlinks to the articles themselves —
   the whole strip becomes navigation. */
.title-links {
  display: none; /* mobile: hidden, the dropdown carries the links */
}
@media (min-width: 761px) {
  /* hamburger stays available at every size; desktop adds the title strip */
  .title-links {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 18px;
    margin: 0 14px;
    min-width: 0;
    font-family: "Helvetica Neue", Arial, sans-serif;
  }
  .title-links a {
    /* fat newspaper-style lettering: heavy, larger, high contrast */
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  .title-links a::before {
    content: "◆";
    font-size: 7px;
    vertical-align: 2px;
    margin-right: 7px;
    color: var(--t-accent, var(--accent));
  }
  .title-links a:hover { color: var(--t-accent, var(--accent)); border-bottom-color: var(--t-accent, var(--accent)); }
  .title-links .tl-cta {
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 13px;
  }
  .title-links .tl-cta::before { content: none; }
  .title-links .tl-cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.hamburger:hover { border-color: var(--accent); }

.site-nav {
  /* dropdown panel anchored under the header, right side */
  position: absolute;
  top: calc(100% + 10px);
  right: clamp(12px, 4vw, 48px);
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.site-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
.site-nav a { padding: 12px 14px; border-radius: 10px; font-size: 15px; }
.site-nav a:hover { background: rgba(230, 57, 70, 0.12); color: var(--ink); }
.nav-cta { text-align: center; margin-top: 4px; }
.site-nav .nav-divider {
  border-top: 1px solid var(--line);
  margin: 8px 4px 6px;
  padding: 8px 10px 0;
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.site-nav .nav-article { font-size: 13.5px; color: var(--ink-dim); }
.site-nav .nav-article:hover { color: var(--ink); }

/* ---------- Theme toggle (light / dark) ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); }
/* show the icon of the mode you'd switch TO */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  .site-nav, .hamburger span { transition: none; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(60px, 12vw, 140px) clamp(16px, 4vw, 48px) clamp(40px, 8vw, 90px); }
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero-eyebrow { color: var(--accent); letter-spacing: 3px; text-transform: uppercase; font-size: 13px; margin: 0 0 18px; }
.hero-title { font-size: clamp(38px, 7vw, 80px); line-height: 1.02; margin: 0 0 22px; letter-spacing: -1px; }
.hero-sub { color: var(--ink-dim); font-size: clamp(17px, 2.4vw, 22px); max-width: 640px; margin: 0 0 30px; }
.hero-scroll { color: var(--ink); text-decoration: none; font-family: Arial, sans-serif; font-size: 14px; letter-spacing: 1px; opacity: .8; }
.hero-scroll:hover { opacity: 1; }

/* ---------- Stories grid ---------- */
.stories { max-width: var(--max); margin: 0 auto; padding: 30px clamp(16px, 4vw, 48px) 80px; }
.stories-head h2 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 6px; }
.stories-head p { color: var(--ink-dim); margin: 0 0 34px; font-family: Arial, sans-serif; font-size: 15px; }

.grid {
  display: grid;
  /* Fluid adaptation (DevTips-style, but with CSS Grid): boxes reflow at
     every width instead of jumping at fixed breakpoints. auto-fit packs as
     many columns as fit; the container cap (--max) keeps it to a clean 3-up
     on desktop, 2-up on tablet, 1-up on phone — no awkward in-between gaps.
     min(100%, 340px) stops overflow on screens narrower than 340px. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(16px, 2vw, 26px);
}

/* The boxes */
.box {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, var(--box-from), var(--box-to));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
  padding: 0;
  /* start slightly hidden, lifted into view on reveal */
  opacity: 0;
  transform: translateY(40px) scale(.98);
  transition: opacity .6s ease, transform .6s ease, box-shadow .3s ease, border-color .3s ease;
  will-change: transform, opacity;
}
.box::before {
  /* accent strip + faint hero glow */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(420px 200px at 80% -10%, var(--box-accent, var(--accent)) 0%, transparent 60%);
  opacity: .16;
  transition: opacity .3s ease;
}
.box:hover { border-color: var(--box-accent, var(--accent)); box-shadow: var(--shadow); transform: translateY(-4px) scale(1); }
.box:hover::before { opacity: .3; }

/* Revealed state (added by IntersectionObserver) */
.box.revealed { opacity: 1; transform: translateY(0) scale(1); }

/* The shake — triggered with .shake class, runs once */
@keyframes box-shake {
  0%   { transform: translateY(0) rotate(0); }
  15%  { transform: translateY(-2px) rotate(-1.2deg); }
  30%  { transform: translateX(3px) rotate(1.2deg); }
  45%  { transform: translateX(-3px) rotate(-1deg); }
  60%  { transform: translateX(2px) rotate(.8deg); }
  75%  { transform: translateX(-1px) rotate(-.4deg); }
  100% { transform: translateY(0) rotate(0); }
}
.box.shake { animation: box-shake .6s cubic-bezier(.36,.07,.19,.97) both; }

.box-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; padding: 22px; }
.box-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: auto; }
.kicker {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--box-accent, var(--accent)); font-weight: 700;
}
.box-num { font-family: Arial, sans-serif; font-size: 12px; color: var(--ink-dim); }
.box-badge {
  font-family: Arial, sans-serif; font-size: 10px; letter-spacing: 1px;
  background: var(--box-accent, var(--accent)); color: #fff;
  padding: 3px 7px; border-radius: 4px; font-weight: 800;
}
.box-title { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.15; margin: 18px 0 8px; }
.box-dek { color: var(--ink-dim); font-size: 15px; margin: 0; }

/* The excerpt that the shake "reveals" */
.box-excerpt {
  max-height: 0; opacity: 0; overflow: hidden;
  font-family: Arial, sans-serif; font-size: 14px; color: var(--ink-dim);
  border-top: 1px solid var(--line); margin-top: 14px;
  transition: max-height .5s ease, opacity .4s ease, padding-top .4s ease;
}
.box.revealed .box-excerpt { max-height: 160px; opacity: 1; padding-top: 14px; }

.box-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; font-family: Arial, sans-serif; font-size: 12px; color: var(--ink-dim); }
.box-read { color: var(--box-accent, var(--accent)); font-weight: 700; }

/* ---------- Topics ---------- */
.topics { max-width: var(--max); margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px); }
.topics h2 { font-size: clamp(24px, 3.5vw, 34px); margin: 0 0 6px; }
.section-sub { color: var(--ink-dim); font-family: Arial, sans-serif; margin: 0 0 24px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  font-family: Arial, sans-serif; font-size: 14px;
  border: 1px solid var(--line); background: var(--bg-2);
  padding: 10px 16px; border-radius: 999px; color: var(--ink);
  text-decoration: none; transition: all .2s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.chip .count { color: var(--ink-dim); margin-left: 6px; }

/* ---------- Syndication ---------- */
.syndication { max-width: var(--max); margin: 60px auto; padding: clamp(28px, 4vw, 48px); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.synd-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; }
@media (max-width: 820px) { .synd-grid { grid-template-columns: 1fr; } }
.synd-copy h2 { font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 14px; }
.synd-copy p { color: var(--ink-dim); }
.synd-points { list-style: none; padding: 0; margin: 20px 0 28px; font-family: Arial, sans-serif; font-size: 15px; }
.synd-points li { padding: 6px 0; }
.synd-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.synd-card h3 { margin: 0 0 14px; font-size: 16px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dim); }
.synd-list { list-style: none; padding: 0; margin: 0; font-family: Arial, sans-serif; }
.synd-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.synd-list li:last-child { border-bottom: 0; }
.synd-list .price { color: var(--money); font-weight: 700; white-space: nowrap; }
.synd-list a { text-decoration: none; }
.synd-list a:hover .title { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; font-family: Arial, sans-serif; font-weight: 700; text-decoration: none; padding: 13px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-size: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }

/* ---------- Ad slot ---------- */
.ad-slot { max-width: var(--max); margin: 30px auto; padding: 0 clamp(16px, 4vw, 48px); text-align: center; }
.ad-label { display: block; font-family: Arial, sans-serif; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 8px; }
.ad-box { border: 1px dashed var(--line); border-radius: 12px; padding: 26px; color: var(--ink-dim); font-family: Arial, sans-serif; font-size: 14px; }
.ad-box a { color: var(--accent); }

/* ---------- Newsletter ---------- */
.newsletter { background: linear-gradient(180deg, transparent, var(--box-to)); border-top: 1px solid var(--line); margin-top: 50px; padding: clamp(50px, 8vw, 90px) clamp(16px, 4vw, 48px); }
.news-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.newsletter h2 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 10px; }
.newsletter p { color: var(--ink-dim); }
.news-form { display: flex; gap: 10px; justify-content: center; margin: 26px 0 10px; flex-wrap: wrap; }
.news-form input { font-family: Arial, sans-serif; font-size: 16px; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); min-width: 280px; }
.news-form input:focus { outline: 2px solid var(--accent); }
.news-note { color: var(--money); font-family: Arial, sans-serif; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; text-align: left; }
@media (max-width: 700px) { .tiers { grid-template-columns: 1fr; } }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 22px; background: var(--bg-2); font-family: Arial, sans-serif; }
.tier-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier h4 { margin: 0 0 6px; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dim); }
.tier .price { font-size: 30px; font-family: Georgia, serif; color: var(--ink); margin: 0 0 8px; }
.tier .price span { font-size: 14px; color: var(--ink-dim); }
.tier p:last-child { color: var(--ink-dim); margin: 0; font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px clamp(16px, 4vw, 48px); text-align: center; color: var(--ink-dim); font-family: Arial, sans-serif; font-size: 13px; }
.footer-links a { color: var(--ink-dim); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .box { opacity: 1; transform: none; transition: none; }
  .box.shake { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Article page styles (used by /articles/*.html)
   ============================================================ */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 24px) 80px; }
.article-back { font-family: Arial, sans-serif; font-size: 14px; color: var(--ink-dim); text-decoration: none; }
.article-back:hover { color: var(--ink); }
.article-kicker { font-family: Arial, sans-serif; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin: 30px 0 10px; font-weight: 700; }
.article-title { font-size: clamp(32px, 5.5vw, 56px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -.5px; }
.article-dek { font-size: clamp(18px, 2.5vw, 24px); color: var(--ink-dim); margin: 0 0 24px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-family: Arial, sans-serif; font-size: 14px; color: var(--ink-dim); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.article-meta .updated { background: var(--accent); color: #fff; padding: 3px 9px; border-radius: 4px; font-weight: 700; font-size: 11px; letter-spacing: 1px; }
.article-hero { width: 100%; height: auto; border-radius: 12px; margin: 28px 0; border: 1px solid var(--line); }
.article-body { font-size: 19px; line-height: 1.75; }
.article-body p { margin: 0 0 22px; }
.article-body h2 { font-family: "Helvetica Neue", Arial, sans-serif; font-size: 26px; margin: 40px 0 14px; }
.article-body blockquote { border-left: 3px solid var(--accent); margin: 28px 0; padding: 6px 0 6px 22px; color: var(--ink-dim); font-style: italic; font-size: 22px; }

.share-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 36px 0; }
.share-bar a, .share-bar button { font-family: Arial, sans-serif; font-size: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); padding: 10px 16px; border-radius: 999px; text-decoration: none; cursor: pointer; }
.share-bar a:hover, .share-bar button:hover { border-color: var(--accent); }

/* Developments / Part 2 timeline */
.developments { margin: 50px 0; border: 1px solid var(--line); border-radius: 12px; padding: 26px; background: var(--bg-2); }
.developments h2 { margin: 0 0 6px; font-size: 24px; }
.developments .sub { color: var(--ink-dim); font-family: Arial, sans-serif; font-size: 14px; margin: 0 0 20px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 24px 32px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-2); }
.timeline .t-date { font-family: Arial, sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dim); }
.timeline .t-title { font-size: 18px; margin: 4px 0 6px; font-family: "Helvetica Neue", Arial, sans-serif; }
.timeline .t-body { color: var(--ink-dim); font-size: 16px; }

.synd-banner { margin: 40px 0; padding: 24px; border: 1px solid var(--accent); border-radius: 12px; background: linear-gradient(135deg, rgba(230,57,70,.12), transparent); font-family: Arial, sans-serif; }
.synd-banner h3 { margin: 0 0 6px; }
.synd-banner p { color: var(--ink-dim); margin: 0 0 14px; }
