/* ==========================================================
   THE DAILY PRINT ($DAILY) — shared brand system
   Morning Edition (light) / Night Edition (dark)
   ========================================================== */

:root {
  /* Paper & ink */
  --paper:   #F2EADB;
  --paper-2: #E7DCC6;
  --paper-3: #DCCFB5;
  --ink:     #15110E;
  --ink-2:   #3A322B;
  --muted:   #776B5E;
  --rule:    #15110E;

  /* Fire */
  --fire:    #FF4A1C;   /* primary — the take */
  --ember:   #FF9F1C;   /* secondary — the glow */
  --flare:   #FFE27A;   /* highlight — the core */
  --char:    #241A14;   /* burnt edge */
  --ash:     #A39A90;   /* what's left */

  /* Furnace (always-dark sections) */
  --furnace:    #120D0A;
  --furnace-2:  #1E1611;
  --furnace-ink:#F4E8D6;
  --furnace-mut:#9C8E7E;

  --on-fire: #15110E;

  --f-head: "Anton", "Impact", "Haettenschweiler", sans-serif;
  --f-serif: "Fraunces", "Georgia", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --f-black: "UnifrakturMaguntia", "Old English Text MT", serif;

  --gutter: clamp(16px, 3.5vw, 64px);
  --maxw: 1680px;
  --noise-a: .07;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #17110D;
    --paper-2: #211913;
    --paper-3: #2C221A;
    --ink:     #F3E7D4;
    --ink-2:   #D3C4AE;
    --muted:   #998B7A;
    --rule:    #F3E7D4;
    --fire:    #FF5A2B;
    --char:    #050302;
    --ash:     #6E655C;
    --furnace:   #090605;
    --furnace-2: #15100C;
    --noise-a: .05;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper:   #17110D;
  --paper-2: #211913;
  --paper-3: #2C221A;
  --ink:     #F3E7D4;
  --ink-2:   #D3C4AE;
  --muted:   #998B7A;
  --rule:    #F3E7D4;
  --fire:    #FF5A2B;
  --char:    #050302;
  --ash:     #6E655C;
  --furnace:   #090605;
  --furnace-2: #15100C;
  --noise-a: .05;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .22  0 0 0 0 .1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.13'/></svg>");
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 18px;
  line-height: 1.5;
  font-optical-sizing: auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s ease, color .4s ease;
}
::selection { background: var(--fire); color: #15110E; }

a { color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.head { font-family: var(--f-head); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; line-height: .88; }
.ticker { font-family: var(--f-mono); font-weight: 700; letter-spacing: 0; }
.fire-text {
  background: linear-gradient(100deg, var(--fire) 0%, var(--ember) 35%, var(--fire) 60%, #E0300B 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: flicker-grad 5s ease-in-out infinite;
}
@keyframes flicker-grad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.sim-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 7px; border: 1px dashed currentColor; border-radius: 2px; opacity: .8;
  white-space: nowrap;
}
.sim-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fire); box-shadow: 0 0 8px var(--fire); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Double newspaper rule */
.rule-2 { border: 0; height: 7px; margin: 0; border-top: 3px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rule-1 { border: 0; height: 0; margin: 0; border-top: 1px solid var(--rule); }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--ink); --b-fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--f-head); font-size: 20px; text-transform: uppercase; letter-spacing: .03em; line-height: 1;
  padding: 14px 20px 13px; min-height: 48px;
  color: var(--b-fg); background: var(--b-bg);
  border: 2px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--fire); outline-offset: 3px; }
.btn--fire { --b-bg: var(--fire); --b-fg: #15110E; }
.btn--ghost { --b-bg: transparent; --b-fg: var(--ink); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Top marquee ---------- */
.wire {
  background: var(--ink); color: var(--paper);
  overflow: hidden; white-space: nowrap; position: relative;
  border-bottom: 2px solid var(--fire);
}
.wire__track { display: inline-flex; animation: wire 42s linear infinite; padding: 8px 0; }
.wire__track span { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 0 22px; }
.wire__track span b { color: var(--fire); font-weight: 700; }
.wire__track span::after { content: "✶"; color: var(--ember); margin-left: 44px; }
@keyframes wire { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .wire__track { animation: none; } }

/* ---------- Masthead ---------- */
.masthead { padding-top: 14px; }
.masthead__meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 10px;
}
.masthead__meta .mono { font-size: 11px; }
.masthead__title {
  display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.6vw, 20px);
  padding: 6px 0 10px; text-decoration: none;
}
.masthead__title svg { width: clamp(40px, 6vw, 78px); height: auto; flex: none; animation: mark-flicker 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.masthead__title span { font-family: var(--f-black); font-size: clamp(42px, 9vw, 150px); line-height: 1; letter-spacing: -.01em; }
@keyframes mark-flicker {
  0%,100% { transform: scale(1,1) rotate(0); }
  20% { transform: scale(1.02,.98) rotate(-1.5deg); }
  45% { transform: scale(.98,1.04) rotate(1deg); }
  70% { transform: scale(1.01,.99) rotate(-.5deg); }
}
@media (prefers-reduced-motion: reduce) { .masthead__title svg { animation: none; } }

.nav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 9px 0;
}
.nav ul { display: flex; gap: 0 clamp(12px, 2.2vw, 30px); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; padding: 6px 0; display: inline-block; }
.nav a:hover { color: var(--fire); }

.edition {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  background: none; color: var(--ink); border: 1px solid var(--ink); padding: 6px 9px; cursor: pointer; border-radius: 0;
  min-height: 32px;
}
.edition:hover { background: var(--ink); color: var(--paper); }
.edition:focus-visible { outline: 3px solid var(--fire); outline-offset: 2px; }

/* ---------- Charred edges ---------- */
.char-edge { display: block; width: 100%; height: 34px; color: var(--furnace); }
.char-edge path.glow { fill: none; stroke: var(--fire); stroke-width: 1.5; vector-effect: non-scaling-stroke; opacity: .9; filter: drop-shadow(0 0 3px var(--ember)); }
.char-edge--flip { transform: scaleY(-1); }

/* ---------- Footer ---------- */
.footer { background: var(--furnace); color: var(--furnace-ink); padding: 48px 0 40px; }
.footer a { color: var(--furnace-ink); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer__brand { display: flex; align-items: center; gap: 12px; font-family: var(--f-black); font-size: 40px; line-height: 1; }
.footer__brand svg { width: 44px; }
.footer p { color: var(--furnace-mut); font-size: 15px; margin: 12px 0 0; max-width: 46ch; }
.footer h4 { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ember); margin: 4px 0 12px; font-weight: 500; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer li a { text-decoration: none; font-size: 15px; }
.footer li a:hover { color: var(--fire); }
.footer__base { margin-top: 40px; padding-top: 16px; border-top: 1px solid #3a2d24; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__base .mono { color: var(--furnace-mut); font-size: 11px; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > :first-child { grid-column: 1 / -1; } }

/* Ember cursor canvas */
#embers { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

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