/* Self-hosted fonts (SIL Open Font Licence): no requests to third parties. */
@font-face { font-family: "Newsreader"; src: url("assets/fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("assets/fonts/public-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("assets/fonts/public-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("assets/fonts/public-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("assets/fonts/public-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("assets/fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
/* Layout: chart-room desk. Masthead + watch-log strip, story column with a quiet right rail; rail drops below at phone width. */
:root {
  --bg: #eef2f4;          /* chart paper */
  --surface: #ffffff;
  --ink: #0f2233;         /* navy ink */
  --muted: #4d6070;
  --rule: #cfd9e0;
  --accent: #b86a06;      /* hazard amber */
  --accent-ink: #ffffff;
  --ru: #a3343a;          /* Russia */
  --ir: #16786b;          /* Iran */
  --ot: #6450a8;          /* other states */
  --law-bg: #e4ecf1;
  --shadow: 0 1px 2px rgba(15,34,51,.06), 0 8px 24px rgba(15,34,51,.06);
  --f-display: "Newsreader", Georgia, "Times New Roman", serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --s-1: .75rem; --s-2: .875rem; --s-3: 1rem; --s-4: 1.2rem; --s-5: 1.55rem; --s-6: 2.1rem; --s-7: 2.9rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1620; --surface: #122230; --ink: #dde7ee; --muted: #93a7b6; --rule: #22384a;
    --accent: #e9a13b; --accent-ink: #1a1203; --ru: #e2767b; --ir: #4fc2b1; --ot: #a697e6;
    --law-bg: #173042; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1620; --surface: #122230; --ink: #dde7ee; --muted: #93a7b6; --rule: #22384a;
  --accent: #e9a13b; --accent-ink: #1a1203; --ru: #e2767b; --ir: #4fc2b1; --ot: #a697e6;
  --law-bg: #173042; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; }
img { max-width: 100%; height: auto; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: var(--s-3); line-height: 1.55; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }

/* Masthead */
.mast { border-bottom: 1px solid var(--rule); background: var(--surface); }
.mast-inner { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; padding-block: 22px 18px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand svg { flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1; letter-spacing: -.01em; }
.brand-sub { font-size: var(--s-1); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-top: 6px; }
.watch { font-family: var(--f-mono); font-size: var(--s-1); color: var(--muted); text-align: right; line-height: 1.6; font-variant-numeric: tabular-nums; }
.watch b { color: var(--ink); font-weight: 500; }

/* Filter bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { font: 600 var(--s-2)/1 var(--f-body); color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 9px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { border-color: var(--muted); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab .n { font-family: var(--f-mono); font-weight: 400; font-size: var(--s-1); opacity: .75; font-variant-numeric: tabular-nums; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.sw.russia { background: var(--ru); } .sw.iran { background: var(--ir); } .sw.other { background: var(--ot); } .sw.all { background: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; background: var(--surface); min-width: 0; flex: 0 1 280px; }
.search input { border: 0; background: transparent; color: var(--ink); font: 400 var(--s-2) var(--f-body); width: 100%; min-width: 0; outline: none; }
.search svg { flex: none; color: var(--muted); }

/* Main grid */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-block: 32px 64px; }
@media (max-width: 900px) { .main { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.feed { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.feed-empty { padding: 40px 0; color: var(--muted); }

.story { padding-block: 26px; border-top: 1px solid var(--rule); display: grid; gap: 10px; min-width: 0; }
.story:first-child { border-top: 0; padding-top: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: var(--s-1); color: var(--muted); }
.meta time { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.cat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.cat.russia { color: var(--ru); } .cat.iran { color: var(--ir); } .cat.other { color: var(--ot); }
.kind { text-transform: uppercase; letter-spacing: .1em; }
.story h2 { font-family: var(--f-display); font-weight: 600; font-size: var(--s-5); line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
.story.lead h2 { font-size: clamp(1.8rem, 4vw, var(--s-7)); line-height: 1.08; font-weight: 700; }
.story.lead .summary { font-size: var(--s-4); }
.summary { margin: 0; max-width: 66ch; }
.vessels { display: flex; flex-wrap: wrap; gap: 6px; }
.vessel { font-family: var(--f-mono); font-size: var(--s-1); border: 1px solid var(--rule); border-radius: 4px; padding: 2px 8px; color: var(--muted); }
.vessel b { color: var(--ink); font-weight: 500; }
.sources { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--s-2); }
.sources span.lbl { color: var(--muted); font-size: var(--s-1); text-transform: uppercase; letter-spacing: .1em; align-self: center; }
.src { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; border-bottom: 1px solid var(--rule); }
.src:hover { border-bottom-color: var(--accent); }
.src em { font-style: normal; font-size: var(--s-1); color: var(--muted); }

/* Rail */
.rail { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.panel h3 { font: 700 var(--s-1)/1.2 var(--f-body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px; }
.panel p, .panel li { font-size: var(--s-2); margin: 0; }
.panel ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.box { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 18px; box-shadow: var(--shadow); }
.ad-slot-unused { border: 1px dashed var(--rule); border-radius: 8px; min-height: 250px; display: grid; place-items: center; color: var(--muted); font-size: var(--s-1); text-transform: uppercase; letter-spacing: .12em; }
.ad-inline { min-height: 120px; margin-block: 10px; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Footer */
.foot { border-top: 1px solid var(--rule); background: var(--surface); font-size: var(--s-2); color: var(--muted); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Dialogs */
dialog { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 760px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(6,14,22,.5); }
.dlg { padding: 24px; display: grid; gap: 14px; overflow-y: auto; max-height: inherit; }
.dlg h2 { font-family: var(--f-display); font-size: var(--s-5); margin: 0; }
.dlg h3 { font-size: var(--s-3); margin: 8px 0 0; }
.dlg p, .dlg li { font-size: var(--s-2); margin: 0; }
.dlg ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.note { font-size: var(--s-1); color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: .92em; user-select: all; }

@media (prefers-reduced-motion: no-preference) {
  .story { animation: rise .35s ease both; }
  @keyframes rise { from { transform: translateY(4px); } to { transform: none; } }
}

/* Advertising: labelled, boxed apart from editorial content */
.ad { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.ad-inline { margin-block: 18px; }
.ad-label { font-size: var(--s-1); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.ad-body { display: grid; gap: 4px; text-decoration: none; font-size: var(--s-2); }
.ad-body strong { font-size: var(--s-3); }
.ad-body img { border-radius: 4px; }
.ad { min-height: 120px; }
.ad-rail-box { min-height: 250px; }
