/* Wasteland Logbook — design tokens + components. Dark only. */
:root {
  --ground: #0e110c;
  --surface-1: #171b13;
  --surface-2: #20261b;
  --line: #2f3a28;
  --line-strong: #56664a;
  --ink: #e6e9d8;
  --ink-muted: #9ba68b;
  --phosphor: #8cf27a;
  --phosphor-deep: #1f3a1a;
  --amber: #f2b544;
  --amber-deep: #3a2c10;
  --rust: #e8704a;
  --rust-deep: #3a1b10;
  --sky: #7cc4e6;
  --sky-deep: #132b36;
  --paper: #d9cfae;
  --paper-ink: #2a2414;
  --on-accent: #0e110c;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-pill: 999px;
  --glow: 0 0 12px rgba(140, 242, 122, 0.35);
  --font-display: "Big Shoulders Display", "Arial Narrow", system-ui, sans-serif;
  --font-sans: "Barlow", system-ui, sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --font-terminal: "VT323", ui-monospace, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/24px var(--font-sans);
  min-height: 100vh;
}
a { color: var(--phosphor); }
a:hover { color: var(--ink); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Type */
.wl-label { font-family: var(--font-mono); font-size: 13px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; }
.wl-h1 { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 40px; margin: 0; }
.wl-h2 { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 30px; margin: 0; }
.wl-h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 24px; margin: 0; }
.wl-readout { font-family: var(--font-terminal); font-size: 24px; line-height: 24px; color: var(--phosphor); text-shadow: var(--glow); white-space: nowrap; }
.wl-muted { color: var(--ink-muted); }
.wl-lead { margin: 0; color: var(--ink-muted); }
.wl-lead b { color: var(--ink); font-weight: 600; }
.wl-small { font-size: 14px; line-height: 20px; }
.wl-back { text-decoration: none; }

/* Top bar */
.wl-sticky { position: sticky; top: 0; z-index: 10; background: var(--ground); }
.wl-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface-1); border-bottom: 1px solid var(--line); }
.wl-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.wl-brand i { display: inline-block; width: 10px; height: 10px; background: var(--amber); border-radius: var(--radius-sm); }
.wl-nav { display: flex; align-items: center; gap: 16px; }
.wl-nav .wl-navlink { display: none; color: var(--ink-muted); text-decoration: none; }
.wl-nav .wl-navlink:hover { color: var(--ink); }
.wl-player { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); color: var(--ink-muted); text-decoration: none; }
.wl-player b { width: 6px; height: 6px; border-radius: 50%; background: var(--phosphor); box-shadow: var(--glow); }
.wl-player.is-off b { background: var(--rust); box-shadow: none; }

/* Page progress strip (guide page) */
.wl-progress { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.wl-progress .wl-meter { flex: 1; }

/* Meter */
.wl-meter { display: flex; gap: 4px; align-items: stretch; }
.wl-meter > * { flex: 1; height: 10px; min-width: 4px; background: var(--surface-2); border-radius: var(--radius-sm); }
.wl-meter > .is-done { background: var(--phosphor); }
.wl-meter > .is-now { background: var(--amber); }
.wl-meter.is-sm > * { height: 6px; }
a.wl-pip { display: block; }

/* Layout */
.wl-main { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.wl-stack { display: flex; flex-direction: column; gap: 8px; }
.wl-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.wl-row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wl-guide { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 24px; }
.wl-guide-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.wl-guide-head .wl-stack { max-width: 720px; }
.wl-guide-body { display: flex; flex-direction: column; gap: 16px; }
.wl-guide-aside { display: flex; flex-direction: column; gap: 16px; }
.wl-guide-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wl-toc { display: none; }
.wl-big-readout { display: none; }

@media (min-width: 960px) {
  .wl-nav .wl-navlink { display: inline; }
  .wl-topbar { padding: 12px 32px; }
  .wl-h1 { font-size: 56px; line-height: 54px; }
  .wl-main { padding: 40px 32px 64px; }
  .wl-guide { padding: 40px 32px 64px; gap: 32px; }
  .wl-progress { display: none; }
  .wl-big-readout { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 280px; }
  .wl-big-readout .wl-readout { font-size: 48px; line-height: 44px; }
  .wl-big-readout .wl-meter { width: 280px; }
  .wl-guide-body { display: grid; grid-template-columns: 280px minmax(0, 720px); gap: 32px; align-items: start; }
  .wl-guide-aside { position: sticky; top: 80px; order: 0; }
  .wl-guide-content { order: 1; }
  .wl-toc { display: block; }
}

/* TOC */
.wl-toc { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px; }
.wl-toc .wl-label { display: block; padding: 8px 12px; color: var(--ink-muted); }
.wl-toc a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.wl-toc a:hover { background: var(--surface-2); }
.wl-toc a span:last-child { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
.wl-toc a.is-done span:last-child { color: var(--phosphor); }
.wl-toc a.is-now span:last-child { color: var(--amber); }

/* Checklist */
.wl-list { list-style: none; margin: 0; padding: 0; }
.wl-item {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: 44px;
  padding: 12px 16px; border: 0; border-top: 1px solid var(--line);
  background: transparent; text-align: left; cursor: pointer;
}
.wl-list li:first-child .wl-item { border-top: 0; }
.wl-item:hover { background: var(--surface-2); }
.wl-check { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--ground); }
.wl-check svg { width: 14px; height: 14px; stroke: var(--on-accent); stroke-width: 3; stroke-linecap: square; fill: none; opacity: 0; }
.wl-item.is-done .wl-check { background: var(--phosphor); border-color: var(--phosphor); box-shadow: var(--glow); }
.wl-item.is-done .wl-check svg { opacity: 1; }
.wl-item.is-done .wl-item-text { color: var(--ink-muted); }
.wl-item-hint { display: block; font-size: 14px; line-height: 20px; color: var(--ink-muted); margin-top: 2px; }

/* Section */
.wl-section { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.wl-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.wl-section-head .wl-label { color: var(--amber); }
.wl-section.is-done .wl-section-head { background: var(--phosphor-deep); }
.wl-section.is-done .wl-section-head .wl-label { color: var(--phosphor); }
.wl-section-pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.wl-section-tip { padding: 12px 16px 0; }
.wl-count { font-family: var(--font-terminal); font-size: 24px; line-height: 24px; color: var(--ink-muted); white-space: nowrap; }
.wl-section.is-done .wl-count { color: var(--phosphor); }

/* Guide card */
.wl-cards { display: grid; gap: 12px; }
@media (min-width: 720px) { .wl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wl-card { display: flex; flex-direction: column; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; color: inherit; text-decoration: none; }
.wl-card:hover { border-color: var(--line-strong); color: inherit; }
.wl-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.wl-card p { margin: 4px 0 12px; font-size: 14px; line-height: 20px; color: var(--ink-muted); flex: 1; }
.wl-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; color: var(--ink-muted); }

/* Badge */
.wl-badge { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid currentColor; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); text-decoration: none; }
a.wl-badge:hover { color: var(--ink); }
.wl-badge.is-done { color: var(--phosphor); background: var(--phosphor-deep); }
.wl-badge.is-now { color: var(--amber); background: var(--amber-deep); }
.wl-badge.is-new { color: var(--sky); background: var(--sky-deep); }

/* Callout */
.wl-callout { display: block; border-radius: var(--radius-md); padding: 12px 16px; font-size: 14px; line-height: 20px; color: var(--ink); text-decoration: none; }
.wl-callout .wl-label { display: block; margin-bottom: 4px; }
a.wl-callout:hover { color: var(--ink); filter: brightness(1.15); }
.wl-callout.is-tip { background: var(--sky-deep); } .wl-callout.is-tip .wl-label { color: var(--sky); }
.wl-callout.is-warn { background: var(--rust-deep); } .wl-callout.is-warn .wl-label { color: var(--rust); }
.wl-callout.is-now { background: var(--amber-deep); } .wl-callout.is-now .wl-label { color: var(--amber); }
.wl-callout.is-done { background: var(--phosphor-deep); } .wl-callout.is-done .wl-label { color: var(--phosphor); }

/* Buttons */
.wl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; text-decoration: none; }
.wl-btn:hover { background: var(--surface-2); color: var(--ink); }
.wl-btn.is-primary { background: var(--amber); border-color: var(--amber); color: var(--on-accent); }
.wl-btn.is-primary:hover { filter: brightness(1.08); }
.wl-btn.is-danger { color: var(--rust); border-color: var(--rust); }
.wl-btn.is-block { width: 100%; }

/* Field note */
.wl-note { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius-md); padding: 12px 16px; }
.wl-note .wl-label { display: block; margin-bottom: 6px; color: var(--paper-ink); opacity: .85; }
.wl-note a { color: var(--paper-ink); font-weight: 600; }
.wl-note p { margin: 0 0 8px; font-size: 14px; line-height: 20px; }
.wl-note ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 22px; }
.wl-note textarea {
  display: block; width: 100%; min-height: 96px; border: 0; padding: 0; background: transparent;
  color: var(--paper-ink); font: 400 16px/24px var(--font-sans); resize: vertical;
  background-image: repeating-linear-gradient(transparent 0 23px, rgba(42, 36, 20, .18) 23px 24px);
}
.wl-note textarea:focus { outline: none; }
.wl-note:focus-within { outline: 2px solid var(--phosphor); outline-offset: 2px; }

/* Forms */
.wl-field { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-md); color: var(--ink); }
.wl-field-label { color: var(--ink-muted); }
.wl-kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.wl-kv:first-child { border-top: 0; }

/* Status toast */
.wl-toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink); font-size: 14px; line-height: 20px; z-index: 20; }

.wl-empty { padding: 24px 16px; text-align: center; color: var(--ink-muted); }
.wl-footer { max-width: 1200px; margin: 0 auto; padding: 0 16px 32px; color: var(--ink-muted); font-size: 13px; line-height: 18px; }
