/* Design site: first browser pass of COPY.md v2. Colours and type follow the tree builder
   (Dust Walkers' UI: Michroma, warm board-black, gold, section colours). The visual design comes later. */
:root {
  color-scheme: dark;
  --bg: #12100d;
  --bg-2: #181510;
  --panel: #1f1c17;
  --panel-2: #29251e;
  --line: #3a342a;
  --line-soft: #2a2620;
  --text: #ece4d6;
  --muted: #a89d8b;
  --dim: #6b6255;
  --gold: #f0c46e;
  --gold-ink: #12100d;
  --loot: #6fa8c9;
  --epic: #b884e0;
  --scope: #7fe0cc;
  --barrel: #c4e38a;
  --magazine: #c9a4f0;
  --ammo: #f0d58a;
  --special: #f08a6e;
  --todo: #e8834f;
  --wide: 1180px;
  --read: 680px;
  --display: Michroma, system-ui, sans-serif;
  --label: Syncopate, Michroma, system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 17px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-underline-offset: 3px; }
img, video, iframe { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
strong { color: #fff6e6; font-weight: 600; }

.wrap { width: min(var(--wide), 100% - 32px); margin-inline: auto; }
.read { max-width: var(--read); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(18, 16, 13, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; min-height: 56px; }
.brand { display: flex; align-items: baseline; gap: 12px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand b { font: 400 14px/1 var(--display); letter-spacing: .06em; }
.brand span { color: var(--muted); font-size: 13px; }
.nav ul { display: flex; gap: 20px; margin: 0 0 0 auto; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.nav li a { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.nav li a:hover { color: var(--text); }
@media (max-width: 880px) { .nav ul { display: none; } }

/* ---------- type ---------- */
/* Small labels: sentence case, untracked, one size. (No tracked capitals: they read as a template.) */
.kicker { margin: 0 0 16px; font: 500 14px/1.3 var(--body); color: var(--gold); }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
h1 { font: 400 clamp(30px, 4.6vw, 54px)/1.18 var(--display); letter-spacing: -.01em; max-width: 17ch; }
h2 { font: 400 clamp(24px, 3vw, 34px)/1.25 var(--display); margin-bottom: 24px; max-width: 24ch; }
h3 { font: 600 20px/1.35 var(--body); color: var(--text); margin: 64px 0 16px; }
.lead { font-size: 20px; line-height: 1.6; color: #d9d0c1; }

/* ---------- sections ---------- */
section.block { padding: 96px 0; border-top: 1px solid var(--line-soft); }
section.block.alt { background: var(--bg-2); }
.principle-tag { margin: 0 0 12px; font: 500 14px/1.3 var(--body); color: var(--gold); }
.leadin { font-size: 21px; line-height: 1.55; color: var(--text); max-width: var(--read); margin: 0 0 32px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 88px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero p.intro { margin: 24px 0 32px; font-size: 19px; color: #d9d0c1; max-width: 46ch; }
.hero .credit { margin-top: 18px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
/* Desktop: the headline runs across both columns; the intro, button and credit sit beside the loop. */
@media (min-width: 901px) {
  .hero-grid { row-gap: 0; align-items: start;
    grid-template-areas: "kicker kicker" "h1 h1" "intro media" "btn media" "credit media"; grid-template-rows: auto auto auto auto 1fr; }
  .hero-grid > div:first-child { display: contents; }
  .hero-grid .kicker { grid-area: kicker; }
  .hero-grid h1 { grid-area: h1; max-width: 22ch; margin-bottom: 40px; }
  .hero-grid .h1-lead { display: block; white-space: nowrap; }
  .hero-grid .intro { grid-area: intro; margin-top: 0; }
  .hero-grid .btn { grid-area: btn; justify-self: start; }
  .hero-grid .credit { grid-area: credit; }
  .hero-grid > .media { grid-area: media; }
}

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px;
  font: 600 16px/1 var(--body);
  color: var(--gold-ink); background: var(--gold); text-decoration: none; border: 0; cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn::after { content: "→"; transition: transform .15s; }
.btn:hover::after { transform: translateX(3px); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Media placeholders: a framed slot that says what goes there. */
.media {
  position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(240, 196, 110, .025) 14px 28px),
    radial-gradient(ellipse at 50% 40%, #221e18, #15130f 75%);
  border: 1px solid var(--line);
}
.media::before, .media::after {
  content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold); opacity: .7;
}
.media::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.media::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.media .slot { max-width: 40ch; padding: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.media .slot b { display: block; margin-bottom: 8px; font: 500 13px/1.3 var(--body); color: var(--muted); }
.media.square { aspect-ratio: 4 / 3; }

/* Placeholder markers for [BUILD] / [CHECK]: visible in this preview, removed before launch. */
.todo {
  display: inline-block; padding: 1px 8px; margin: 0 2px; border: 1px dashed var(--todo);
  color: var(--todo); font: 600 12px/1.6 var(--body); letter-spacing: .02em; vertical-align: 1px; white-space: nowrap;
}

/* ---------- problem / approach ---------- */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 32px; } }
.two h3 { margin-top: 0; }

/* Open columns on one rule, like the reasoning lists: no boxed grid. */
.gets { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 24px 48px; margin-top: 16px; }
.gets div { padding-top: 16px; border-top: 1px solid var(--line); }
.gets b { display: block; margin-bottom: 6px; font: 400 17px/1.3 var(--display); color: var(--gold); }
.gets p { margin: 0; font-size: 16px; color: #d9d0c1; }
@media (max-width: 960px) { .gets { grid-template-columns: 1fr; } }

/* ---------- two builds ---------- */
#same-gun-two-builds h2 { text-align: center; margin-left: auto; margin-right: auto; }
.builds { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.builds figure { margin: 0; }
.builds figcaption { margin-top: 16px; font-size: 16px; }
.builds figcaption .side { display: block; margin-bottom: 6px; font: 500 14px/1.3 var(--body); color: var(--muted); }
.after { margin-top: 32px; font-size: 19px; color: #d9d0c1; }
@media (max-width: 760px) { .builds { grid-template-columns: 1fr; } }

/* ---------- story ---------- */
.story { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: beat; margin: 0; padding: 0; list-style: none; }
.story li { counter-increment: beat; }
.story .media { aspect-ratio: 1; margin-bottom: 16px; }
.story h4 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font: 400 17px/1.3 var(--display); }
.story h4::before { content: counter(beat); font: 400 17px/1.3 var(--display); color: var(--gold); }
.story p { font-size: 16px; color: #d9d0c1; }
@media (max-width: 1000px) { .story { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .story { grid-template-columns: 1fr; } }

/* Reasoning lists: bold lead, then the why. */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; margin: 0; padding: 0; list-style: none; }
.why li { padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; color: #d9d0c1; }
.why li strong { display: block; margin-bottom: 4px; font-size: 17px; }
@media (max-width: 760px) { .why { grid-template-columns: 1fr; } }
.why-text { max-width: var(--read); font-size: 18px; color: #d9d0c1; }

/* Pickup card mock, next to "The pickup card does the maths". */
.pickup-row { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
@media (max-width: 900px) { .pickup-row { grid-template-columns: 1fr; } }
.pickup {
  background: linear-gradient(180deg, #232019, #1a1813); border: 1px solid #4a4030; padding: 18px 18px 16px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  font-size: 14px; position: sticky; top: 88px;
}
.pickup .rar { font: 700 10px/1 var(--label); letter-spacing: .24em; text-transform: uppercase; color: #7fb4ff; }
.pickup .name { margin: 6px 0 14px; font: 400 20px/1.2 var(--display); }
.pickup .nodes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pickup .nodes { display: grid; grid-template-columns: repeat(6, 1fr); }
.pickup .nodes span { padding: 3px 0; text-align: center; border: 1px dashed var(--loot); color: #cfe3ef; font-size: 10px; }
.pickup .nodes span.match { border-style: solid; border-color: var(--gold); color: #ffe6b5; }
.pickup .match-line { padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); }
.pickup .match-line b { color: var(--gold); }
.pickup .cost { margin-top: 4px; color: var(--muted); font-size: 13px; }
.pickup .note { margin-top: 12px; color: var(--dim); font-size: 12px; }

.roads { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.roads div { padding: 24px; border: 1px solid var(--line); background: var(--bg); }
.roads b { display: block; margin-bottom: 6px; font: 400 16px/1.3 var(--display); }
.roads p { margin: 0; color: #d9d0c1; font-size: 16px; }
@media (max-width: 640px) { .roads { grid-template-columns: 1fr; } }

/* ---------- principle 2 ---------- */
.look { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: center; }
@media (max-width: 900px) { .look { grid-template-columns: 1fr; } }
.diagram { margin: 0; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { margin-top: 10px; font-size: 13px; color: var(--dim); text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; }
.legend i.c { border-radius: 50%; border: 2px solid var(--text); }
.legend i.h { width: 14px; background: var(--text); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.nodes-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 16px; }
.node-card { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 18px; border: 1px solid var(--line); background: var(--bg); }
.node-card .shape { width: 40px; height: 40px; display: grid; place-items: center; background: var(--c, var(--text)); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.node-card .shape::after { content: ""; width: 34px; height: 34px; background: var(--panel); clip-path: inherit; }
.node-card b { display: block; font: 400 15px/1.3 var(--display); margin-bottom: 4px; }
.node-card small { color: var(--dim); font-size: 12px; }
.node-card p { margin: 0; font-size: 15px; color: #d9d0c1; }
@media (max-width: 860px) { .nodes-list { grid-template-columns: 1fr; } }

/* ---------- principle 3 ---------- */
.track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 24px 0 20px; position: relative; }
.track li { list-style: none; position: relative; padding: 52px 20px 0 0; }
.track li::before { content: ""; position: absolute; top: 18px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--special), rgba(240, 138, 110, .25)); }
.track li::after {
  content: attr(data-r); position: absolute; top: 6px; left: 0; padding: 0 12px 0 0;
  font: 500 14px/1.2 var(--body); color: var(--special); background: var(--bg);
}
.track { padding: 0; }
.track b { display: block; font: 400 18px/1.3 var(--display); margin-bottom: 6px; }
.track p { margin: 0; font-size: 16px; color: #d9d0c1; }
@media (max-width: 760px) { .track { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- play it ---------- */
.play-frame { margin-top: 32px; }
.play-frame .media { aspect-ratio: 16 / 8; }
.play-frame .media .btn { margin-top: 18px; }
.weapons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 32px 0 20px; }
.weapons div { padding: 22px; border: 1px solid var(--line); background: var(--bg); }
.weapons b { display: block; font: 400 17px/1.3 var(--display); }
.weapons small { display: block; margin: 2px 0 10px; color: var(--muted); font-size: 14px; }
.weapons p { margin: 0; font-size: 16px; color: #d9d0c1; }
@media (max-width: 640px) { .weapons { grid-template-columns: 1fr; } }
.controls { font-size: 14px; color: var(--muted); }
.controls kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--panel); color: var(--text); font: 600 12px/1.6 var(--body); text-align: center; }

/* Generated page (build.mjs): wide slots, and breathing room for text that follows a slot, cards or a list. */
.media.wide { aspect-ratio: 16 / 7; margin: 32px 0 28px; }
.builds + p, .roads + p, .story + p, .nodes-list + p, .track + p, .gets + p, .weapons + p, .why + p, .plain + p { margin-top: 28px; }
.builds + p { font-size: 19px; }
ul.plain, ol.plain { max-width: var(--read); padding-left: 1.2em; color: #d9d0c1; }
code { font-size: .9em; color: var(--muted); }

/* ---------- builder embed ---------- */
.builder-frame { width: min(1360px, 100% - 16px); margin: 40px auto 0; border: 1px solid var(--line); background: #15130f; }
.builder-frame iframe { width: 100%; height: 1100px; border: 0; }

/* ---------- contact / footer ---------- */
.contact { padding: 120px 0; text-align: left; border-top: 1px solid var(--line-soft); }
.contact h2 { max-width: 26ch; }
.contact .email { font: 400 clamp(18px, 2.4vw, 26px)/1.3 var(--display); color: var(--gold); text-decoration: none; word-break: break-all; }
.contact .label { display: block; margin: 32px 0 8px; font: 500 14px/1.3 var(--body); color: var(--muted); }
.next {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 64px; padding: 24px 28px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); text-decoration: none; max-width: 560px;
}
.next { transition: border-color .15s, transform .15s; }
.next:hover { border-color: var(--gold); transform: translateY(-2px); }
.next:hover span { transform: translateX(3px); }
.next span { transition: transform .15s; }
.next small { display: block; font: 500 14px/1.3 var(--body); color: var(--muted); margin-bottom: 6px; }
.next b { font: 400 18px/1.3 var(--display); font-weight: 400; }
.next span { color: var(--gold); font-size: 22px; }
footer { padding: 28px 0 40px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 13px; }

/* ---------- home ---------- */
.home-hero { padding: 120px 0 96px; }
.home-hero h1 { font-size: clamp(36px, 6vw, 72px); max-width: none; }
.home-hero .role { margin: 16px 0 6px; font: 500 17px/1.3 var(--body); color: var(--gold); }
.home-hero .tag { margin: 0; font-size: 20px; color: var(--muted); font-style: italic; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: p; }
.principles li a { display: block; height: 100%; padding: 28px 24px; border: 1px solid var(--line); background: var(--bg); color: inherit; text-decoration: none; counter-increment: p; transition: border-color .15s, transform .15s; }
.principles li a:hover { border-color: var(--gold); transform: translateY(-2px); }
.principles li a::before { content: counter(p); display: block; margin-bottom: 16px; font: 400 17px/1 var(--display); color: var(--gold); }
.principles b { display: block; margin-bottom: 10px; font: 400 18px/1.35 var(--display); }
.principles p { margin: 0; font-size: 16px; color: #d9d0c1; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }
.cases { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.case { display: block; padding: 0 0 24px; border: 1px solid var(--line); background: var(--bg); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.case:hover { border-color: var(--gold); transform: translateY(-2px); }
.case .media { border: 0; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.case b, .case p, .case small { display: block; padding: 0 24px; }
.case b { font: 400 20px/1.3 var(--display); margin-bottom: 8px; }
.case p { margin: 0 0 12px; font-size: 15px; color: #d9d0c1; }
.case small { color: var(--gold); font-size: 13px; }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }
