/* The Daily Parallax — newspaper stylesheet */
:root {
  --paper:   #F3EDDF;
  --paper-2: #EAE2D0;
  --paper-3: #DFD4BC;
  --ink:     #1A1712;
  --ink-2:   #2B261D;
  --ink-3:   #423A2C;
  --ink-soft:#5A5140;
  --ink-mute:#8A8069;
  --rule:    #1A1712;
  --rule-soft:#C9BE9F;
  --accent:  oklch(0.52 0.13 45);
  --accent-2:oklch(0.42 0.13 45);
  --accent-ink: oklch(0.35 0.10 45);
  --sage:    oklch(0.50 0.08 155);
  --claret:  oklch(0.48 0.13 25);
  --font-serif: "Playfair Display", "Source Serif 4", Georgia, serif;
  --font-body:  "Source Serif 4", Georgia, serif;
  --font-ui:    "Inter Tight", system-ui, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* paper texture */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(26,23,18,0.025), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(26,23,18,0.03), transparent 40%);
  mix-blend-mode: multiply;
}
.grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.35; mix-blend-mode: multiply;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 32px 40px 120px; position: relative; z-index: 1; }

/* Top ribbon */
.ribbon {
  display: flex; align-items: center; gap: 18px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 14px;
}
.ribbon .sep { width: 3px; height: 3px; background: var(--ink-mute); border-radius: 50%; }
.ribbon .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.ribbon .live {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--claret);
}
.ribbon .live .dot {
  width: 7px; height: 7px; background: var(--claret); border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--claret) 25%, transparent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.refresh-btn {
  font: inherit; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--rule); color: var(--ink);
  padding: 5px 12px; cursor: pointer; border-radius: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.refresh-btn:hover { background: var(--ink); color: var(--paper); }
.refresh-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Masthead */
.masthead {
  text-align: center;
  padding: 10px 0 18px;
  border-bottom: 3px double var(--rule);
  margin-bottom: 8px;
  position: relative;
}
.masthead-ornament {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute);
}
.masthead-ornament.left  { left: 0;  }
.masthead-ornament.right { right: 0; }
.masthead-ornament .star { font-size: 14px; color: var(--accent); }

.nameplate {
  font-family: var(--font-serif);
  font-size: 104px;
  line-height: 0.95;
  letter-spacing: -0.028em;
  font-weight: 900;
  color: var(--ink);
  margin: 0;
}
.nameplate em { font-style: italic; color: var(--accent-ink); font-weight: 500; }
.nameplate-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 10px;
}

.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}

/* Section nav */
.sections {
  display: flex; gap: 0; align-items: center; justify-content: center;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-btn {
  font: inherit; font-family: var(--font-ui);
  background: transparent; border: 0; cursor: pointer;
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 18px;
  border-right: 1px solid var(--rule-soft);
  transition: color 120ms ease;
}
.section-btn:last-child { border-right: 0; }
.section-btn:hover { color: var(--accent-ink); }
.section-btn.active { color: var(--accent-ink); font-weight: 600; }
.section-btn.active::before { content: "◆ "; font-size: 9px; color: var(--accent); }

/* Above-the-fold: hero + right column */
.fold {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 36px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 36px;
}

/* Hero story */
.hero-story { display: flex; flex-direction: column; }
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-ink);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.hero-kicker .rule { flex: 1; height: 1px; background: var(--rule); }
.hero-headline {
  font-family: var(--font-serif);
  font-size: 68px;
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 14px;
  text-wrap: balance;
}
.hero-dek {
  font-family: var(--font-serif);
  font-size: 22px; line-height: 1.38;
  color: var(--ink-2);
  font-style: italic;
  margin: 0 0 18px;
  text-wrap: pretty;
}
.hero-byline {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex; gap: 12px;
}
.hero-byline b { color: var(--ink); font-weight: 600; }

/* Moving photograph frame */
.photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--ink);
  border: 8px solid var(--ink);
  outline: 1px solid var(--rule);
  box-shadow: 0 8px 24px -12px rgba(0,0,0,0.4);
  cursor: pointer;
  isolation: isolate;
}
.photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.45) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 3px);
  z-index: 3;
}
.photo::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%);
  z-index: 4;
  animation: scan 6s linear infinite;
}
@keyframes scan { 0% { transform: translateX(-100%);} 50%, 100% { transform: translateX(200%);} }

.photo-caption {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--ink-soft); margin-top: 10px; text-transform: uppercase;
  display: flex; align-items: baseline; gap: 10px;
}
.photo-caption .mov {
  color: var(--accent-ink); display: inline-flex; align-items: center; gap: 5px;
}
.photo-caption .mov .blink {
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

.hero-lede {
  font-family: var(--font-body); font-size: 18px; line-height: 1.62;
  color: var(--ink);
  margin-top: 24px;
  column-count: 2; column-gap: 28px; column-rule: 1px solid var(--rule-soft);
  text-wrap: pretty;
}
.hero-lede p { margin: 0 0 14px; }
.hero-lede p:first-of-type::first-letter {
  font-family: var(--font-serif); font-size: 72px; font-weight: 800;
  float: left; line-height: 0.85; padding: 5px 10px 0 0; color: var(--accent-ink);
}

/* right column */
.sidebar-col { display: flex; flex-direction: column; gap: 26px; }
.sidebar-col .side-headline {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink); border-bottom: 2px solid var(--rule);
  padding-bottom: 8px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.side-story { padding-bottom: 18px; border-bottom: 1px dotted var(--rule-soft); }
.side-story:last-child { border-bottom: 0; }
.side-story h3 {
  font-family: var(--font-serif); font-size: 22px; line-height: 1.15;
  letter-spacing: -0.01em; font-weight: 700; margin: 0 0 8px;
  cursor: pointer; text-wrap: balance;
}
.side-story h3:hover { color: var(--accent-ink); }
.side-story p { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 8px; }
.side-story .mini-meta {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  color: var(--ink-mute); text-transform: uppercase;
}

/* Below-the-fold grid */
.below-fold-label {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink);
  margin-bottom: 24px;
}
.below-fold-label::before,
.below-fold-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.story-card { cursor: pointer; display: flex; flex-direction: column; }
.story-card .photo { aspect-ratio: 4/3; border-width: 6px; margin-bottom: 12px; }
.story-card .kicker {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 6px;
}
.story-card h3 {
  font-family: var(--font-serif); font-size: 26px; line-height: 1.12;
  letter-spacing: -0.01em; font-weight: 700; margin: 0 0 10px; text-wrap: balance;
}
.story-card:hover h3 { color: var(--accent-ink); }
.story-card p { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 10px; }
.story-card .meta {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-mute); text-transform: uppercase; margin-top: auto;
}

/* smaller brief items */
.briefs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding-bottom: 28px; border-bottom: 1px solid var(--rule); margin-bottom: 36px;
}
.brief { cursor: pointer; }
.brief .num {
  font-family: var(--font-serif); font-style: italic; font-size: 38px;
  color: var(--accent); line-height: 1; font-weight: 500;
}
.brief h4 {
  font-family: var(--font-serif); font-size: 17px; line-height: 1.22;
  font-weight: 700; margin: 8px 0 6px; letter-spacing: -0.005em;
}
.brief:hover h4 { color: var(--accent-ink); }
.brief p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

/* Reader drawer */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(26,23,18,0.45); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity 200ms ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(720px, 92vw);
  background: var(--paper);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.2,0.7,0.2,1);
  overflow-y: auto;
  box-shadow: -20px 0 60px -20px rgba(0,0,0,0.3);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  position: sticky; top: 0; z-index: 2;
  background: color-mix(in oklab, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  padding: 14px 32px; display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.drawer-close {
  margin-left: auto;
  background: transparent; border: 1px solid var(--rule); color: var(--ink);
  width: 30px; height: 30px; cursor: pointer;
  display: grid; place-items: center;
}
.drawer-close:hover { background: var(--ink); color: var(--paper); }
.drawer-body { padding: 40px 56px 80px; }
.drawer-body h1 {
  font-family: var(--font-serif); font-size: 46px; line-height: 1.05;
  letter-spacing: -0.02em; font-weight: 800; margin: 14px 0 16px; text-wrap: balance;
}
.drawer-body .dek {
  font-family: var(--font-serif); font-style: italic; font-size: 19px;
  line-height: 1.5; color: var(--ink-2); margin: 0 0 24px;
}
.drawer-body .byline {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 28px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.drawer-body .byline b { color: var(--ink); }
.drawer-body article p {
  font-family: var(--font-body); font-size: 17.5px; line-height: 1.72;
  margin: 0 0 18px; text-wrap: pretty;
}
.drawer-body article p:first-of-type::first-letter {
  font-family: var(--font-serif); font-size: 62px; font-weight: 800;
  float: left; line-height: 0.88; padding: 6px 10px 0 0; color: var(--accent-ink);
}
.pullquote {
  margin: 30px 0; padding: 22px 28px;
  border-top: 2px solid var(--rule); border-bottom: 2px solid var(--rule);
  font-family: var(--font-serif); font-style: italic; font-size: 24px; line-height: 1.4;
  color: var(--ink); text-align: center;
}

/* Skeleton loader */
.skeleton { position: relative; overflow: hidden; background: var(--paper-2); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } 0% { transform: translateX(-100%); } }

/* Status notice */
.status-notice {
  padding: 10px 14px; margin-bottom: 20px;
  border: 1px dashed var(--rule-soft);
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft);
  letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.status-notice .ico { color: var(--accent); }

/* ── Tablet ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .nameplate { font-size: 80px; }
  .fold { grid-template-columns: 1fr 280px; gap: 24px; }
  .hero-headline { font-size: 52px; }
  .grid-3 { gap: 24px; }
}

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wrap { padding: 16px 16px 80px; }

  /* Ribbon — keep live pill + refresh, hide middle metadata */
  .ribbon { gap: 10px; flex-wrap: nowrap; overflow: hidden; }
  .ribbon > span:not(.live):not(:last-child) { display: none; }
  .ribbon .sep { display: none; }
  .ribbon .right { gap: 8px; }

  /* Masthead */
  .masthead { padding: 8px 0 14px; }
  .masthead-ornament { display: none; }
  .nameplate { font-size: 52px; letter-spacing: -0.02em; }
  .nameplate-sub { font-size: 9px; letter-spacing: 0.18em; margin-top: 6px; }

  /* Meta row */
  .meta-row { flex-direction: column; gap: 2px; text-align: center; font-size: 9.5px; }

  /* Section nav — horizontal scroll, no wrap */
  .sections {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 0 10px;
    margin-bottom: 20px;
    gap: 0;
  }
  .sections::-webkit-scrollbar { display: none; }
  .section-btn { padding: 6px 14px; font-size: 11px; white-space: nowrap; flex-shrink: 0; }

  /* Fold — single column; sidebar becomes a horizontal scroll strip */
  .fold {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Hero */
  .hero-headline { font-size: 34px; line-height: 1.05; }
  .hero-dek { font-size: 16px; }
  .hero-byline { font-size: 10px; }
  .hero-lede { column-count: 1; font-size: 16px; line-height: 1.6; }
  .hero-lede p:first-of-type::first-letter {
    font-size: 52px; padding: 4px 8px 0 0;
  }

  /* Sidebar — horizontal scroll strip of compact cards */
  .sidebar-col {
    border-top: 2px solid var(--rule);
    border-bottom: 2px solid var(--rule);
    margin: 24px 0;
    padding: 16px 0;
    gap: 0;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar-col::-webkit-scrollbar { display: none; }
  .sidebar-col .side-headline { display: none; }
  .side-story {
    flex: 0 0 240px;
    border-bottom: 0;
    border-right: 1px solid var(--rule-soft);
    padding: 0 16px 0 0;
    margin-right: 16px;
  }
  .side-story:last-child { border-right: 0; margin-right: 0; }
  .side-story h3 { font-size: 16px; }
  .side-story p { font-size: 12px; }

  /* Grid — single column */
  .grid-3 { grid-template-columns: 1fr; gap: 28px; }
  .story-card h3 { font-size: 22px; }

  /* Briefs — 2 columns */
  .briefs { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .brief .num { font-size: 28px; }
  .brief h4 { font-size: 15px; }

  /* Reader drawer — full width, reduced padding */
  .drawer { width: 100vw; }
  .drawer-header { padding: 12px 16px; }
  .drawer-body { padding: 24px 20px 60px; }
  .drawer-body h1 { font-size: 30px; line-height: 1.1; }
  .drawer-body .dek { font-size: 16px; }
  .drawer-body .byline { flex-wrap: wrap; gap: 8px; font-size: 10px; }
  .drawer-body article p { font-size: 16px; line-height: 1.65; }
  .drawer-body article p:first-of-type::first-letter {
    font-size: 48px; line-height: 0.88;
  }
  .pullquote { font-size: 18px; padding: 16px 18px; }

  /* Status notice */
  .status-notice { font-size: 10px; }
  .status-notice > span:nth-child(2) {
    flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
}

/* ── Small phones ──────────────────────────────────────────────────── */
@media (max-width: 390px) {
  .nameplate { font-size: 42px; }
  .hero-headline { font-size: 28px; }
  .side-story { flex: 0 0 200px; }
  .briefs { grid-template-columns: 1fr; }
}
