/* ═══ 4ntar3s · Offensive Security Dispatch ═══════════════════════════
   Editorial broadsheet grounded in Antares (α Scorpii). Day + Night editions. */

:root {
  --paper:      #ece3cf;   /* warm manila dossier — not the cream cliché */
  --paper-2:    #e3d8bf;   /* inset paper */
  --ink:        #1c1813;   /* warm near-black print ink */
  --ink-soft:   #524a3c;   /* secondary text */
  --ink-faint:  #8a7f69;   /* captions, rules text */
  --rule:       #c5b896;   /* hairline */
  --rule-soft:  #d7cbac;
  --star:       #c2381f;   /* Antares as a print spot color (deeper for light) */
  --star-ink:   #a52d18;
  /* terminal intercept panel (dark in both editions) */
  --term-bg:    #141210;
  --term-ink:   #d8cdb6;
  --term-faint: #6f6857;
  --term-star:  #ff6a4d;
  --ok:         #3f7d4f;
  --warn:       #9a6a16;

  --disp: "Fraunces", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --measure: 39rem;   /* article reading width */
  --gutter:  clamp(20px, 5vw, 88px);
}

[data-theme="night"] {
  --paper:      #14120d;   /* deep warm ink-black */
  --paper-2:    #1c1914;
  --ink:        #ece2cd;   /* warm parchment text on night — not pure white */
  --ink-soft:   #b3a88f;
  --ink-faint:  #837962;
  --rule:       #34302708;
  --rule:       #353026;
  --rule-soft:  #2a261e;
  --star:       #ff6a4d;
  --star-ink:   #ff8366;
  --term-bg:    #0c0b08;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease, color .5s ease;
}

/* paper grain texture */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
[data-theme="night"] .grain { mix-blend-mode: screen; opacity: .035; }

main { position: relative; z-index: 1; }

/* selection */
::selection { background: var(--star); color: var(--paper); }

/* ── Masthead ─────────────────────────────────────────────── */
.masthead { padding: 0 var(--gutter); position: relative; z-index: 1;
  border-bottom: 3px double var(--ink); }

.dispatch-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 11px 0 10px; border-bottom: 1px solid var(--rule);
  animation: fadeDown .8s ease both;
}
.dt-mid { color: var(--star); }
@media (max-width: 680px) { .dt-left, .dt-right { display: none; } .dispatch-top { justify-content: center; } }

.nameplate {
  display: flex; align-items: baseline; justify-content: center; gap: .12em;
  text-decoration: none; color: var(--ink);
  padding: 26px 0 6px; line-height: 1; gap: .22em;
  animation: nameRise 1s cubic-bezier(.2,.7,.2,1) .1s both;
}
.np-alpha { font-family: var(--disp); font-weight: 600; color: var(--star);
  font-size: clamp(3rem, 9vw, 5.6rem); font-style: italic; }
.np-word { font-family: var(--disp); font-weight: 900;
  font-size: clamp(3rem, 9vw, 5.6rem); letter-spacing: -.02em;
  font-variation-settings: "opsz" 144; }
.np-sub {
  text-align: center; margin: 0 0 22px; font-family: var(--mono);
  font-size: .7rem; letter-spacing: .42em; text-transform: uppercase;
  color: var(--ink-soft); padding-left: .42em;
  animation: fadeDown 1s ease .25s both;
}

.dispatch-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  border-top: 1px solid var(--rule); padding: 9px 0;
  font-family: var(--mono); font-size: .68rem;
  animation: fadeDown 1s ease .35s both;
}
.db-edition { text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); justify-self: start; }
.db-nav { display: flex; gap: 22px; justify-self: center; }
.db-nav a { color: var(--ink); text-decoration: none; text-transform: uppercase;
  letter-spacing: .08em; position: relative; padding-bottom: 2px; transition: color .18s; }
.db-nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%;
  height: 1px; background: var(--star); transform: scaleX(0); transform-origin: left;
  transition: transform .28s ease; }
.db-nav a:hover { color: var(--star); }
.db-nav a:hover::after { transform: scaleX(1); }

.edition-toggle {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: 5px 12px 5px 9px; cursor: pointer; color: var(--ink-soft);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; transition: border-color .2s, color .2s; }
.edition-toggle:hover { border-color: var(--star); color: var(--star); }
.et-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--star);
  box-shadow: 0 0 0 0 var(--star); transition: box-shadow .3s; }
.edition-toggle:hover .et-dot { box-shadow: 0 0 10px 1px var(--star); }
@media (max-width: 680px) {
  .dispatch-bar { grid-template-columns: 1fr; justify-items: center; gap: 10px; text-align: center; }
  .db-edition { display: none; } .db-nav { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .edition-toggle { justify-self: center; }
}

/* ── Kickers / shared furniture ───────────────────────────── */
.kicker { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.kicker > span:first-child { color: var(--star); }
.k-dot { color: var(--rule); }
.k-diff { font-weight: 700; }
.diff-easy   { color: var(--ok); }
.diff-medium { color: var(--warn); }
.diff-hard   { color: var(--star); }
.diff-insane { color: var(--star); }

/* ── Front page ───────────────────────────────────────────── */
.frontpage { padding: 0 var(--gutter) 40px; max-width: 1320px; margin: 0 auto; }

.lead { padding: clamp(40px, 6vw, 72px) 0 clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--ink); }
.lead-link { display: block; text-decoration: none; color: inherit; max-width: 56rem; }
.lead-title { font-family: var(--disp); font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -.025em;
  margin: 0 0 .25em; font-variation-settings: "opsz" 144; transition: color .25s; }
.lead-link:hover .lead-title { color: var(--star); }
.lead-standfirst { font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.45;
  color: var(--ink-soft); margin: 0 0 1em; max-width: 44rem; font-weight: 400; }
.lead-standfirst::first-letter { initial-letter: 2.4; font-weight: 600; color: var(--star);
  font-family: var(--disp); margin-right: .08em; }
.lead-byline { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--ink-faint); display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  text-transform: uppercase; }
.read-more { color: var(--star); }

.section-label { display: flex; align-items: center; gap: 18px;
  margin: clamp(36px, 5vw, 56px) 0 28px; }
.section-label::before, .section-label::after { content: ""; height: 1px; background: var(--rule); flex: 1; }
.section-label span { font-family: var(--mono); font-size: .68rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-faint); }

.story-grid { display: grid; grid-template-columns: 1fr;
  gap: 0; }
.story { border-top: 1px solid var(--rule); }
.story-link { display: block; text-decoration: none; color: inherit;
  padding: 28px clamp(0px, 2.5vw, 34px) 30px 0; height: 100%; transition: padding-left .25s ease; }
.story:nth-child(odd) .story-link { padding-right: clamp(0px, 2.5vw, 34px); }
.story-link:hover { padding-left: 6px; }
.story-title { font-family: var(--disp); font-weight: 600; font-size: 1.62rem;
  line-height: 1.1; letter-spacing: -.01em; margin: 0 0 .35em; transition: color .2s; }
.story-link:hover .story-title { color: var(--star); }
.story-standfirst { color: var(--ink-soft); margin: 0 0 1em; font-size: 1.02rem; line-height: 1.5; }
.story-byline { font-family: var(--mono); font-size: .66rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); display: flex; gap: 8px; align-items: center; }

/* vertical rule between grid columns on wide screens */
@media (min-width: 720px) {
  .story-grid { grid-template-columns: 1fr 1fr; }
  .story:nth-child(odd) { border-right: 1px solid var(--rule); }
  .story:nth-child(odd) .story-link { padding-right: 38px; }
  .story:nth-child(even) .story-link { padding-left: 38px; }
  .story:nth-child(even) .story-link:hover { padding-left: 44px; }
}

/* empty state */
.empty { padding: clamp(60px,10vw,120px) 0; text-align: center; }
.empty-kicker { font-family: var(--mono); color: var(--star); letter-spacing: .1em;
  text-transform: uppercase; font-size: .8rem; margin: 0 0 16px; }
.empty-title { font-family: var(--disp); font-weight: 900; font-size: clamp(2rem,5vw,3.2rem);
  margin: 0 0 12px; }
.empty-note { color: var(--ink-soft); font-size: 1.1rem; }

/* ── Dispatch (article) ───────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--star); z-index: 50; transition: width .08s linear; }

.dispatch { max-width: none; margin: 0;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 40px; }
.dispatch-head { border-bottom: 1px solid var(--ink); padding-bottom: 30px; margin-bottom: 38px; }
.dispatch-title { font-family: var(--disp); font-weight: 900;
  font-size: clamp(2.3rem, 6vw, 3.7rem); line-height: 1.04; letter-spacing: -.022em;
  margin: 0 0 .3em; font-variation-settings: "opsz" 144;
  animation: nameRise .8s cubic-bezier(.2,.7,.2,1) both; }
.dispatch-standfirst { font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.45;
  color: var(--ink-soft); margin: 0 0 1.1em; font-weight: 400; font-style: italic; }
.dispatch-byline { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.by-author { color: var(--ink-soft); }
.dispatch-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag { font-family: var(--mono); font-size: .64rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; border: 1px solid var(--rule);
  padding: 3px 9px; border-radius: 2px; transition: all .18s; }
.tag::before { content: "#"; color: var(--star); margin-right: 1px; }
.tag:hover { border-color: var(--star); color: var(--star); }

/* body copy */
.dispatch-body { font-size: 1.18rem; line-height: 1.72; }
.dispatch-body > p:first-of-type::first-letter {
  initial-letter: 3; font-family: var(--disp); font-weight: 900; color: var(--star);
  margin-right: .07em; padding-top: .02em; }
.dispatch-body p { margin: 0 0 1.3em; }
.dispatch-body h2 { font-family: var(--disp); font-weight: 600; font-size: 1.85rem;
  letter-spacing: -.01em; line-height: 1.15; margin: 1.9em 0 .5em;
  padding-top: .5em; border-top: 1px solid var(--rule-soft); }
.dispatch-body h2::before { content: "§ "; color: var(--star); font-weight: 600; }
.dispatch-body h3 { font-family: var(--disp); font-weight: 600; font-size: 1.4rem;
  margin: 1.6em 0 .4em; }
.dispatch-body a { color: var(--star-ink); text-decoration: none;
  background-image: linear-gradient(var(--star), var(--star));
  background-size: 100% 1px; background-position: 0 1.15em; background-repeat: no-repeat;
  transition: background-size .2s; }
[data-theme="night"] .dispatch-body a { color: var(--star); }
.dispatch-body a:hover { background-size: 100% 2px; }
.dispatch-body strong { font-weight: 600; color: var(--ink); }
.dispatch-body em { font-style: italic; }
.dispatch-body ul, .dispatch-body ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.dispatch-body li { margin: .4em 0; }
.dispatch-body li::marker { color: var(--star); }
.dispatch-body blockquote { border-left: 2px solid var(--star); margin: 1.6em 0;
  padding: .3em 0 .3em 1.3em; font-style: italic; color: var(--ink-soft);
  font-size: 1.22rem; line-height: 1.5; }
.dispatch-body img { max-width: 100%; height: auto; display: block; margin: 1.8em 0;
  border: 1px solid var(--rule); }
.dispatch-body hr { border: 0; height: 1px; background: var(--rule); margin: 2.4em 0; }

/* inline code */
.dispatch-body code { font-family: var(--mono); font-size: .82em;
  background: var(--paper-2); color: var(--star-ink); padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--rule-soft); }
[data-theme="night"] .dispatch-body code { color: var(--star); }

/* code blocks — "terminal intercept" panels, dark in both editions */
.dispatch-body pre { background: var(--term-bg); color: var(--term-ink);
  border: 1px solid #2a2620; border-radius: 6px; padding: 18px 18px 18px 16px;
  overflow-x: auto; margin: 1.8em 0; font-size: .82rem; line-height: 1.6;
  position: relative; box-shadow: 0 14px 34px -22px rgba(0,0,0,.6); }
.dispatch-body pre::before { content: "▌ intercept"; position: absolute; top: 0; right: 0;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--term-faint); padding: 6px 10px; }
.dispatch-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.highlight { margin: 1.8em 0; }
.highlight pre { margin: 0; }
.highlight .lnt { color: var(--term-faint); margin-right: 14px; user-select: none; }

/* dispatch footer */
.dispatch-foot { margin-top: 52px; }
.foot-rule { height: 3px; border-top: 3px double var(--ink); margin-bottom: 18px; }
.dispatch-foot { display: flex; align-items: center; justify-content: space-between; }
.back { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; transition: color .18s; }
.back:hover { color: var(--star); }
.foot-mark { font-family: var(--disp); font-style: italic; font-weight: 600; color: var(--star);
  font-size: 1.6rem; }

/* ── Colophon ─────────────────────────────────────────────── */
.colophon { padding: 0 var(--gutter) 48px; max-width: 1320px; margin: 0 auto; position: relative; z-index: 1; }
.colo-rule { height: 1px; background: var(--rule); margin-top: 20px; }
.colo-inner { display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between;
  padding-top: 32px; }
.colo-block { max-width: 34rem; }
.colo-mark { font-family: var(--disp); font-style: italic; font-weight: 600; color: var(--star);
  font-size: 2rem; display: block; line-height: 1; }
.colo-name { font-family: var(--disp); font-weight: 600; font-size: 1.2rem; margin: .3em 0 .4em; }
.colo-note { color: var(--ink-soft); font-size: .98rem; line-height: 1.5; margin: 0; max-width: 32rem; }
.colo-meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
  color: var(--ink-faint); text-align: right; }
.colo-meta p { margin: 0 0 5px; }
.colo-year { margin-top: 12px !important; color: var(--ink-faint); }
@media (max-width: 620px) { .colo-meta { text-align: left; } }

/* ── Scroll reveal ────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes nameRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .reveal { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}
