/* IW5V website: dev journal styles. Dark, MW3-menu inspired: graphite panels, HUD green, stencil headings. */
:root {
  --bg: #0b0c0b;
  --bg-2: #121412;
  --panel: #171a17;
  --panel-2: #1d211d;
  --line: #2a2f29;
  --line-2: #3a4138;
  --text: #d9dcd4;
  --text-dim: #9aa094;
  --text-faint: #6c7266;
  --accent: #9ccc3b;       /* MW3 HUD green */
  --accent-dim: #6f9227;
  --warn: #d9a441;         /* khaki / objective amber */
  --danger: #d0563f;
  --code-bg: #0f110f;
  --radius: 4px;
  --max: 1120px;
  --read: 720px;
  --font-head: "Rajdhani", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(156, 204, 59, .06), transparent 60%),
    linear-gradient(180deg, #0d0f0d 0, var(--bg) 600px);
  color: var(--text);
  font: 17px/1.7 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(156, 204, 59, .35); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 12, 11, .86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: var(--max); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 22px/1 var(--font-head); letter-spacing: .12em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 28px; height: 28px; }
.brand small { color: var(--text-faint); font-weight: 600; font-size: 13px; letter-spacing: .2em; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-dim); font: 600 15px/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---- reading progress ---- */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 30; }

/* ---- hero ---- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero picture img { width: 100%; height: min(72vh, 640px); object-fit: cover; filter: saturate(.9) brightness(.55); }
.hero .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,12,11,.2) 0%, rgba(11,12,11,.55) 55%, var(--bg) 100%);
}
.hero .content {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: var(--max); margin: 0 auto; padding: 0 20px 48px;
}
.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--accent); font: 700 13px/1 var(--font-head); letter-spacing: .28em; text-transform: uppercase; }
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.hero h1 {
  margin: 14px 0 12px; max-width: 900px;
  font: 700 clamp(34px, 5.4vw, 64px)/1.02 var(--font-head); letter-spacing: .01em; text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0,0,0,.6);
}
.hero .dek { max-width: 680px; margin: 0; color: var(--text); font-size: clamp(16px, 1.6vw, 19px); }
.meta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--text-dim); font: 600 14px/1.4 var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.meta span::before { content: "// "; color: var(--accent-dim); }

/* ---- stats strip ---- */
.stats { max-width: var(--max); margin: 0 auto; padding: 28px 20px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 16px 14px; }
.stat b { display: block; color: var(--accent); font: 700 30px/1 var(--font-head); }
.stat span { display: block; margin-top: 6px; color: var(--text-dim); font-size: 13px; line-height: 1.35; }

/* ---- layout: TOC + article ---- */
.layout { max-width: var(--max); margin: 0 auto; padding: 8px 20px 80px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 76px; align-self: start; font: 600 14px/1.4 var(--font-head); letter-spacing: .06em; text-transform: uppercase; }
.toc p { margin: 0 0 10px; color: var(--text-faint); letter-spacing: .24em; font-size: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-dim); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }

article { min-width: 0; }
article > section { max-width: var(--read); margin: 0 0 72px; scroll-margin-top: 80px; }
.sec-num { color: var(--accent); font: 700 14px/1 var(--font-head); letter-spacing: .3em; }
article h2 { margin: 8px 0 18px; font: 700 clamp(26px, 3.2vw, 36px)/1.1 var(--font-head); text-transform: uppercase; letter-spacing: .02em; }
article h3 { margin: 34px 0 10px; font: 700 21px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
article p { margin: 0 0 18px; }
article ul, article ol { padding-left: 22px; margin: 0 0 18px; }
article li { margin-bottom: 6px; }
article strong { color: #fff; font-weight: 600; }
code { font: 14px/1.5 var(--font-mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; color: #cfe3a5; overflow-wrap: anywhere; }

/* wide blocks break out of the reading column */
.wide { width: min(100%, 980px); }

/* ---- figures ---- */
figure { margin: 26px 0 30px; }
figure .frame { position: relative; border: 1px solid var(--line-2); background: #000; border-radius: var(--radius); overflow: hidden; }
figure .frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
figure a.zoom { display: block; cursor: zoom-in; }
figure img { width: 100%; transition: transform .6s ease; }
figure a.zoom:hover img { transform: scale(1.015); }
figcaption { margin-top: 10px; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
figcaption b { color: var(--text); font-weight: 600; }
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fig-pair figure { margin: 0; }
.fig-group { margin: 26px 0 30px; }

/* ---- callouts ---- */
.note { border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--panel); padding: 16px 18px; margin: 24px 0; border-radius: 0 var(--radius) var(--radius) 0; }
.note.warn { border-left-color: var(--warn); }
.note p:last-child { margin-bottom: 0; }
.note .label { display: block; margin-bottom: 6px; color: var(--accent); font: 700 13px/1 var(--font-head); letter-spacing: .24em; text-transform: uppercase; }
.note.warn .label { color: var(--warn); }

/* ---- code ---- */
.code { margin: 24px 0 28px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.code .bar { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--text-dim); font: 600 13px/1.3 var(--font-mono); }
.code .bar span:last-child { color: var(--text-faint); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--font-mono); color: #d6dccd; tab-size: 4; }
.code .c { color: #7f8a78; }
.code .k { color: #9ccc3b; }
.code .s { color: #d9a441; }
.code .n { color: #8fb7d6; }

/* terminal-style git log */
.term pre { color: #c9cfc0; }
.term .h { color: var(--warn); }
.term .d { color: var(--text-faint); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 22px 0 28px; border: 1px solid var(--line-2); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel-2); color: var(--text-dim); font: 700 13px/1.2 var(--font-head); letter-spacing: .16em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td.n { white-space: nowrap; color: var(--accent); font-family: var(--font-mono); font-size: 13px; }

/* ---- diagrams ---- */
.diagram { margin: 26px 0 30px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); padding: 18px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram svg text { font-family: var(--font-body); }
.diagram .box { fill: var(--panel-2); stroke: var(--line-2); }
.diagram .box.hi { stroke: var(--accent); }
.diagram .box.amber { stroke: var(--warn); }
.diagram .t { fill: var(--text); font-size: 19px; font-weight: 600; }
.diagram .t2 { fill: var(--text-dim); font-size: 15.5px; }
.diagram .lab { fill: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: .08em; }
.diagram .lab.amber { fill: var(--warn); }
.diagram .wire { stroke: var(--text-faint); stroke-width: 1.6; fill: none; }
.diagram .wire.hi { stroke: var(--accent); }
.diagram .wire.dash { stroke-dasharray: 5 5; }
.diagram .wire.no { stroke: var(--danger); stroke-dasharray: 4 5; }
.diagram .head { fill: var(--text-faint); }
.diagram .head.hi { fill: var(--accent); }

/* ---- timeline ---- */
.timeline { list-style: none; margin: 26px 0 30px; padding: 0; border-left: 2px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 22px 22px; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; background: var(--bg); border: 2px solid var(--accent); transform: rotate(45deg); }
.timeline .when { display: block; color: var(--accent); font: 700 14px/1.3 var(--font-head); letter-spacing: .16em; text-transform: uppercase; }
.timeline p { margin: 4px 0 0; color: var(--text); }

/* ---- status lists ---- */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0 28px; }
.status { border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--radius); padding: 16px 18px; }
.status h4 { margin: 0 0 10px; font: 700 15px/1 var(--font-head); letter-spacing: .2em; text-transform: uppercase; }
.status.ok h4 { color: var(--accent); }
.status.todo h4 { color: var(--warn); }
.status ul { margin: 0; padding-left: 18px; font-size: 15px; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); color: var(--text-faint); font-size: 14px; }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 28px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---- home ---- */
.home-hero { max-width: var(--max); margin: 0 auto; padding: 80px 20px 40px; }
.home-hero h1 { margin: 14px 0; font: 700 clamp(40px, 7vw, 84px)/.95 var(--font-head); text-transform: uppercase; }
.home-hero p { max-width: 640px; color: var(--text-dim); font-size: 19px; }
.cards { max-width: var(--max); margin: 0 auto; padding: 0 20px 80px; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card { display: block; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card img { aspect-ratio: 16 / 9; object-fit: cover; filter: brightness(.8); }
.card .body { padding: 16px 18px 20px; }
.card h2 { margin: 8px 0; font: 700 24px/1.1 var(--font-head); text-transform: uppercase; }
.card p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ---- reveal animation ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  figure img, .card { transition: none; }
}

/* ---- responsive ---- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .inner, .stats, .layout, .hero .content { padding-left: 16px; padding-right: 16px; }
  .brand small { display: none; }
  .site-nav { gap: 14px; }
  .hero picture img { height: 78vh; }
  .hero .content { padding-bottom: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .fig-pair, .status-grid { grid-template-columns: 1fr; }
  .code pre { font-size: 12.5px; }
  th, td { padding: 8px 10px; }
}
