/* ============================================================
   6741 — ART & AUDIO BIBLE
   Shared design system. Dark, lo-fi, VHS/PS1 horror.
   Type: Oswald (display) · IBM Plex Mono (system) · Source Serif 4 (body)
   ============================================================ */

:root {
  /* cold near-black ground */
  --void:      oklch(0.135 0.010 250);
  --void-2:    oklch(0.175 0.012 250);
  --panel:     oklch(0.205 0.013 252);
  --panel-2:   oklch(0.245 0.014 254);
  --line:      oklch(0.82 0.02 250 / 0.14);
  --line-2:    oklch(0.82 0.02 250 / 0.26);

  /* bone text */
  --bone:      oklch(0.88 0.012 90);
  --bone-soft: oklch(0.70 0.012 95);
  --bone-dim:  oklch(0.55 0.012 100);
  --bone-ghost:oklch(0.42 0.012 110);

  /* accents — RED carries from the dossier (danger / the entity),
     AMBER is the flashlight / analog warmth. low chroma elsewhere. */
  --red:       oklch(0.585 0.175 26);
  --red-deep:  oklch(0.45 0.15 27);
  --amber:     oklch(0.80 0.105 75);
  --amber-dim: oklch(0.62 0.08 72);

  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --disp: "Oswald", "Arial Narrow", sans-serif;
  --serif:"Source Serif 4", Georgia, serif;

  /* PS1 grime / grain (svg turbulence baked as a bg image) */
  --grain: 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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--void);
  color: var(--bone);
  font-family: var(--serif);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* global atmospheric overlays: vignette + scanlines + grain */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}
body::before {
  /* flashlight vignette */
  background:
    radial-gradient(120% 90% at 50% 8%, transparent 30%, oklch(0.10 0.01 250 / 0.55) 100%),
    repeating-linear-gradient(0deg, transparent 0 2px, oklch(0 0 0 / 0.16) 2px 3px);
  mix-blend-mode: multiply;
}
body::after {
  background-image: var(--grain);
  background-size: 220px;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

::selection { background: var(--red); color: var(--void); }

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--bone); }

/* ---------------- top nav ---------------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: oklch(0.135 0.01 250 / 0.86);
  backdrop-filter: blur(7px);
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  flex-wrap: wrap;
}
.topnav .brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--bone);
  margin-right: 4px;
}
.topnav .brand b { color: var(--red); }
.topnav .sep { flex: 1; }
.topnav a.nav {
  color: var(--bone-dim);
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
}
.topnav a.nav:hover { color: var(--bone); border-color: var(--line-2); }
.topnav a.nav.here { color: var(--amber); border-color: var(--amber-dim); }

/* ---------------- layout ---------------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.wrap-tight { max-width: 860px; }

section.block { padding: 64px 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: none; }

/* section header */
.sec-h { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 8px; }
.sec-h .no {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--red);
  border: 1px solid var(--red-deep);
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 7px;
  flex: none;
}
.sec-h h2 {
  font-family: var(--disp);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 50px);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 0.98;
  margin: 0;
  color: var(--bone);
}
.sec-sub {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--bone-dim);
  text-transform: uppercase;
  margin: 0 0 30px;
  max-width: 70ch;
  line-height: 1.7;
}

h3.grp {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 38px 0 16px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

p { margin: 0 0 14px; color: var(--bone-soft); max-width: 74ch; }
p.lead { font-size: 18px; color: var(--bone); max-width: 70ch; }
strong, b { color: var(--bone); font-weight: 600; }
em { color: var(--amber); font-style: italic; }

.mono { font-family: var(--mono); }
.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-ghost);
}

/* ---------------- chips / tags ---------------- */
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--bone-dim);
  white-space: nowrap;
}
.chip.red  { border-color: var(--red-deep); color: var(--red); }
.chip.amb  { border-color: var(--amber-dim); color: var(--amber); }
.chip.lock { background: var(--panel-2); color: var(--bone); border-color: var(--line-2); }
.chip.solid{ background: var(--red); color: var(--void); border-color: var(--red); }

/* ---------------- generic cards ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 22px 24px;
}
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

/* spec list (key: value) */
.spec { display: grid; grid-template-columns: 132px 1fr; gap: 4px 14px; margin: 0; }
.spec dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-ghost);
  padding-top: 3px;
}
.spec dd { margin: 0; color: var(--bone-soft); font-size: 14.5px; }
.spec dd b { color: var(--bone); }

/* ---------------- swatches ---------------- */
.swatch {
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  background: var(--panel);
}
.swatch .chipcol { height: 86px; position: relative; }
.swatch .meta { padding: 9px 11px; font-family: var(--mono); }
.swatch .meta .nm { font-size: 12px; color: var(--bone); letter-spacing: 0.04em; }
.swatch .meta .hx { font-size: 10.5px; color: var(--bone-dim); margin-top: 2px; }

/* ---------------- material / texture tile (PS1 grime) ---------------- */
.mat {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
}
.mat .noise {
  position: absolute; inset: 0;
  background-image: var(--grain);
  background-size: 90px;
  opacity: 0.5;
  mix-blend-mode: overlay;
}
.mat .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bone);
  background: oklch(0.12 0.01 250 / 0.74);
  padding: 5px 8px;
  border-top: 1px solid var(--line);
}

/* ---------------- mood tile (rooms / environment) ---------------- */
.mood {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  min-height: 188px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.mood .noise { position: absolute; inset: 0; background-image: var(--grain); background-size: 130px; opacity: 0.16; mix-blend-mode: overlay; }
.mood .fog { position: absolute; inset: 0; }
.mood .tag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bone);
  background: oklch(0.1 0.01 250 / 0.6); padding: 3px 7px; border: 1px solid var(--line-2); border-radius: 2px;
}
.mood h4 {
  position: relative; z-index: 2; margin: 0;
  font-family: var(--disp); font-weight: 600; font-size: 26px;
  letter-spacing: 0.03em; text-transform: uppercase; color: var(--bone);
  text-shadow: 0 2px 14px oklch(0.05 0 0 / 0.9);
}

/* ---------------- character card ---------------- */
.charcard { background: var(--panel); border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.charcard .frame {
  position: relative;
  background:
    radial-gradient(80% 60% at 50% 18%, oklch(0.30 0.02 250 / 0.7), transparent 70%),
    var(--void-2);
  border-bottom: 1px solid var(--line-2);
  min-height: 300px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.charcard .frame .noise { position: absolute; inset: 0; background-image: var(--grain); background-size: 120px; opacity: 0.14; mix-blend-mode: overlay; }
.charcard .frame .stamp {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--bone-dim); text-transform: uppercase;
}
.charcard .frame .stamp .role { color: var(--amber); }
.charcard .body { padding: 20px 22px 24px; }
.charcard .nm {
  font-family: var(--disp); font-weight: 700; font-size: 34px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--bone);
  line-height: 1; margin: 0 0 3px;
}
.charcard .ln { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--bone-dim); text-transform: uppercase; margin-bottom: 16px; }

/* silhouette proportion diagram (built from rectangles only) */
.silo { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 26px; filter: drop-shadow(0 0 20px oklch(0 0 0 / 0.6)); }
.silo .seg { background: oklch(0.07 0.008 250); outline: 1px solid oklch(0.4 0.02 250 / 0.5); }
.silo .glow { position: absolute; bottom: 18px; width: 80px; height: 18px; border-radius: 50%; filter: blur(10px); opacity: 0.6; }
.scale-tick {
  position: absolute; right: 12px; bottom: 26px; top: 30px; width: 1px;
  background: repeating-linear-gradient(0deg, var(--line-2) 0 6px, transparent 6px 12px);
}

/* ---------------- audio cue card ---------------- */
.cue { background: var(--panel); border: 1px solid var(--line-2); border-radius: 3px; padding: 18px 20px; }
.cue .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cue .ttl { font-family: var(--disp); font-weight: 600; font-size: 21px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--bone); }
.cue .vu { display: flex; align-items: flex-end; gap: 2px; height: 26px; margin: 10px 0 14px; }
.cue .vu span { width: 4px; background: var(--amber-dim); opacity: 0.8; }
.cue .vu.hot span { background: var(--red); }

/* ---------------- HUD demo components ---------------- */
.hudstage {
  position: relative;
  background:
    radial-gradient(70% 80% at 50% 40%, oklch(0.22 0.015 250) 0%, var(--void) 75%),
    var(--void);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  min-height: 360px;
  overflow: hidden;
  padding: 18px;
}
.hudstage .noise { position: absolute; inset: 0; background-image: var(--grain); background-size: 150px; opacity: 0.12; mix-blend-mode: overlay; pointer-events: none; }
.hud-el {
  position: absolute;
  font-family: var(--mono);
  color: var(--bone);
}
.hud-bar { width: 150px; height: 9px; background: oklch(0.1 0.01 250 / 0.7); border: 1px solid var(--line-2); }
.hud-bar > i { display: block; height: 100%; }

/* ---------------- tables / checklists ---------------- */
table.asset { width: 100%; border-collapse: collapse; font-size: 14px; }
table.asset th, table.asset td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.asset th { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-ghost); }
table.asset td { color: var(--bone-soft); }
table.asset td b { color: var(--bone); }
table.asset tr:hover td { background: oklch(0.22 0.012 252 / 0.4); }

ul.ticks { list-style: none; margin: 0; padding: 0; }
ul.ticks li { position: relative; padding: 7px 0 7px 26px; color: var(--bone-soft); border-bottom: 1px solid var(--line); font-size: 14.5px; }
ul.ticks li::before { content: "▚"; position: absolute; left: 0; top: 7px; color: var(--red); font-family: var(--mono); font-size: 12px; }
ul.ticks li:last-child { border-bottom: none; }
ul.ticks li b { color: var(--bone); }

/* rules columns (style summary) */
ol.rules { list-style: none; counter-reset: r; margin: 0; padding: 0; }
ol.rules li { counter-increment: r; position: relative; padding: 9px 0 9px 38px; border-bottom: 1px solid var(--line); color: var(--bone-soft); font-size: 14.5px; }
ol.rules li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 0; top: 9px; font-family: var(--mono); font-size: 12px; color: var(--amber); }
ol.rules li:last-child { border-bottom: none; }
ol.rules.avoid li::before { color: var(--red); content: "×"; font-size: 16px; top: 7px; }

/* footer */
.foot { padding: 40px 0 70px; }
.foot .rule { border-top: 1px solid var(--line-2); padding-top: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-ghost); }
.foot .rule b { color: var(--red); }

/* responsive */
@media (max-width: 860px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .spec { grid-template-columns: 110px 1fr; }
}
