/* ======================================================
   RESET & BASE
   ====================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --iron-night: #1C2028;
  --forge-steel: #2D3340;
  --amber-gold: #C8861A;
  --amber-light: #E5A830;
  --ash: #8A8F9A;
  --fog: #E0E3E9;
  --off-white: #F5F7FA;
  /* Page variant backgrounds */
  --page-light-bg: #F8F4EE;
  --page-navy-bg: #1A2535;
  --page-forest-bg: #141F18;
  --page-deep-bg: #131820;
  /* Explorer / Foundry accent */
  --slate-cobalt: #4A6080;
  --slate-cobalt-rgb: 74, 96, 128;
}

body {
  background: var(--iron-night); /* Fix A: was #181A1F */
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  line-height: 1.6;
}

/* ======================================================
   PAGE SHELL
   ====================================================== */
.page {
  width: 100%;
  max-width: 960px;
  padding: clamp(28px, 5vw, 64px);
  background: var(--iron-night);
  color: var(--off-white);
  margin-bottom: 24px;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}
/* Fix C: page variant backgrounds now reference named variables */
.page-light  { background: var(--page-light-bg);  color: var(--iron-night); }
.page-navy   { background: var(--page-navy-bg);   color: var(--off-white); }
.page-forest { background: var(--page-forest-bg); color: var(--off-white); }
.page-deep   { background: var(--page-deep-bg);   color: var(--off-white); }

/* ======================================================
   SHARED TYPOGRAPHY
   ====================================================== */
.eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase;
  color: rgba(255,255,255,0.28); margin-bottom: 12px;
}
.eyebrow-dark { color: rgba(28,32,40,0.38); }

.section-hed {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(32px, 5vw, 48px); font-weight: 900; line-height: 0.94;
  letter-spacing: -0.01em; text-transform: uppercase; margin-bottom: 20px;
}
.divider-hed {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
  border-left: 3px solid var(--amber-gold);
  padding-left: 14px; margin: 32px 0 16px;
}
.divider-hed:first-of-type { margin-top: 0; }

p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 300;
  color: rgba(245,247,250,0.55); line-height: 1.8; margin-bottom: 14px;
}
.page-light p { color: rgba(28,32,40,0.6); }
strong { font-weight: 600; }

/* ======================================================
   COVER
   ====================================================== */
.cover {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--iron-night);
  min-height: clamp(480px, 60vw, 720px);
}
.cover-ghost {
  position: absolute; font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(100px, 28vw, 320px); font-weight: 900;
  color: rgba(255,255,255,0.022);
  bottom: -20px; right: -16px; line-height: 1;
  letter-spacing: -0.04em; pointer-events: none; user-select: none;
}
.cover-rule { width: 44px; height: 4px; background: var(--amber-gold); margin-bottom: 20px; }
.cover-wordmark {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(72px, 14vw, 120px); font-weight: 900; line-height: 0.88;
  letter-spacing: -0.02em; text-transform: uppercase; color: var(--off-white);
}
.cover-tagline {
  font-family: 'Roboto Slab', serif;
  font-size: 15px; font-weight: 300;
  color: rgba(245,247,250,0.45); letter-spacing: 0.03em; margin-top: 22px;
}
.cover-tagline strong { color: rgba(245,247,250,0.82); font-weight: 600; }
.cover-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1px solid rgba(255,255,255,0.07); padding-top: 22px;
  flex-wrap: wrap; gap: 12px; margin-top: 28px;
}
.cover-footer-label {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.2);
}
.cover-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--amber-gold) 0%, var(--forge-steel) 60%); /* Fix B: was hardcoded #2D3340 */
}
.cover-toc {
  display: flex; flex-direction: column; gap: 7px; margin-top: 36px;
}
.toc-item {
  display: flex; align-items: center; gap: 10px;
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.25);
}
.toc-num { color: var(--amber-gold); opacity: 0.7; width: 20px; }

/* ======================================================
   FOUNDATION PAGE
   ====================================================== */
.pillar-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 22px 0;
}
.pillar-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: 3px solid var(--amber-gold);
  border-radius: 8px; padding: 18px;
}
.pillar-num {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 0.2em; color: var(--amber-gold); margin-bottom: 8px;
}
.pillar-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.02em; margin-bottom: 8px; color: var(--off-white);
}
.pillar-desc { font-size: 13px; line-height: 1.7; color: rgba(245,247,250,0.4); margin: 0; }

.archetype-row { display: flex; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.archetype-pill {
  flex: 1; min-width: 160px; background: rgba(200,134,26,0.07);
  border: 1px solid rgba(200,134,26,0.2); border-radius: 8px;
  padding: 16px 20px;
}
/* Fix D: Explorer pill uses --slate-cobalt instead of off-system inline values */
.archetype-pill-explorer {
  background: rgba(var(--slate-cobalt-rgb), 0.08);
  border-color: rgba(var(--slate-cobalt-rgb), 0.2);
}
.archetype-label {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--amber-gold); opacity: 0.7; margin-bottom: 4px;
}
.archetype-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px; font-weight: 800; text-transform: uppercase; color: var(--off-white);
}
.promise-box {
  background: rgba(200,134,26,0.06);
  border: 1px solid rgba(200,134,26,0.18);
  border-left: 4px solid var(--amber-gold);
  border-radius: 0 8px 8px 0; padding: 18px 20px; margin-top: 20px;
}
.promise-box p { color: rgba(245,247,250,0.55); font-size: 12px; margin: 0; }

/* ======================================================
   VOICE & POSITIONING PAGE
   ====================================================== */
.audience-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0;
}
.audience-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 18px;
}
.audience-label {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--amber-gold); margin-bottom: 10px;
}
.audience-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 800; text-transform: uppercase;
  color: var(--off-white); margin-bottom: 8px; letter-spacing: 0.02em;
}
.audience-message { font-size: 13px; color: rgba(245,247,250,0.42); line-height: 1.75; margin: 0; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 18px 0; }
.voice-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.voice-table th {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.22); text-align: left;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.voice-table td {
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 300;
  color: rgba(245,247,250,0.45); padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: top;
}
.voice-table td:first-child {
  font-family: 'Roboto Slab', serif; font-weight: 400;
  color: var(--off-white); font-size: 14px; white-space: nowrap;
}
.voice-table tr:last-child td { border-bottom: none; }

.is-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.is-col {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 16px 18px;
}
.is-col-not { border-color: rgba(110,31,31,0.25); background: rgba(110,31,31,0.04); }
.is-col-header {
  font-family: 'DM Mono', monospace; font-size: 8.5px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.25); margin-bottom: 12px;
}
.is-col-header.not { color: rgba(200,120,120,0.5); }
.is-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 300;
  color: rgba(245,247,250,0.5); line-height: 1.6; margin-bottom: 7px;
}
.is-item-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber-gold); margin-top: 6px; flex-shrink: 0; }
.is-item-dot.not { background: rgba(200,80,80,0.6); }

/* ======================================================
   PALETTE PAGES — SHARED
   ====================================================== */
.pal-ghost {
  position: absolute; font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(80px, 18vw, 200px); font-weight: 900; color: rgba(255,255,255,0.02);
  right: 32px; top: 24px; line-height: 1; pointer-events: none;
  letter-spacing: -0.04em;
}
.pal-header {
  display: grid; grid-template-columns: 1fr 220px; gap: 28px;
  align-items: start; margin-bottom: 28px;
}
.pal-label {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: rgba(255,255,255,0.22); margin-bottom: 8px;
}
.pal-label-dark { color: rgba(28,32,40,0.3); }
.pal-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(36px, 6vw, 50px); font-weight: 900; line-height: 0.92;
  letter-spacing: -0.01em; text-transform: uppercase; margin-bottom: 10px;
}
.pal-desc {
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 300;
  color: rgba(245,247,250,0.38); line-height: 1.8; max-width: 480px; margin: 0;
}
.pal-desc-dark { color: rgba(28,32,40,0.5); }
.strat-box {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 8px; padding: 16px 18px;
}
.strat-box-light {
  background: rgba(28,32,40,0.04);
  border: 1px solid rgba(28,32,40,0.1); border-radius: 8px; padding: 16px 18px;
}
.strat-lbl {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.2); margin-bottom: 8px;
}
.strat-lbl-dark { color: rgba(28,32,40,0.3); }
.strat-txt { font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 300; color: rgba(255,255,255,0.38); line-height: 1.75; margin: 0; }
.strat-txt-dark { color: rgba(28,32,40,0.55); }
.use-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.use-tag {
  font-family: 'DM Mono', monospace; font-size: 7.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.32);
}
.use-tag-dark { border-color: rgba(28,32,40,0.18); color: rgba(28,32,40,0.45); }

.swatches { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.sw { flex-shrink: 0; }
.sw-block {
  width: 76px; height: 76px; border-radius: 8px; margin-bottom: 7px;
  position: relative; overflow: hidden;
}
.sw-block::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg,rgba(255,255,255,0.09) 0%,transparent 55%);
}
.sw-name {
  font-family: 'DM Mono', monospace; font-size: 8px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.42); margin-bottom: 2px;
}
.sw-hex { font-family: 'DM Mono', monospace; font-size: 9px; color: rgba(255,255,255,0.2); }
.sw-role { font-family: 'Space Grotesk', sans-serif; font-size: 8.5px; font-weight: 300; color: rgba(255,255,255,0.13); margin-top: 2px; }
.sw-name-dark { color: rgba(28,32,40,0.45); }
.sw-hex-dark  { color: rgba(28,32,40,0.3); }
.sw-role-dark { color: rgba(28,32,40,0.2); }

.mocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.mock-lbl {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.18); margin-bottom: 6px;
}
.mock-lbl-dark { color: rgba(28,32,40,0.28); }

.slide-mock {
  aspect-ratio: 16/9; border-radius: 7px; overflow: hidden; position: relative;
  box-shadow: 0 8px 36px rgba(0,0,0,0.5); padding: 6% 7%;
  display: flex; flex-direction: column; justify-content: space-between;
}
.sm-eye { font-family: 'DM Mono', monospace; font-size: 5.5px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.38; }
.sm-rule { width: 16px; height: 2.5px; border-radius: 2px; margin-bottom: 5px; }
.sm-title { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 900; line-height: 1.05; letter-spacing: -0.01em; text-transform: uppercase; }
.sm-sub { font-family: 'Space Grotesk', sans-serif; font-size: 5.5px; font-weight: 300; opacity: 0.36; max-width: 55%; line-height: 1.65; }
.sm-wm { font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.14; }
.sm-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }

.bcard {
  aspect-ratio: 3.5/2; border-radius: 7px;
  padding: 7% 8%; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; box-shadow: 0 5px 22px rgba(0,0,0,0.42);
}
.bc-wm { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; }
.bc-name { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; line-height: 1.1; }
.bc-ttl { font-family: 'Space Grotesk', sans-serif; font-size: 7.5px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.48; margin-top: 3px; }
.bc-ct  { font-family: 'Space Grotesk', sans-serif; font-size: 7.5px; font-weight: 300; opacity: 0.38; line-height: 1.85; margin-top: 6px; }

/* ======================================================
   TYPOGRAPHY PAGE
   ====================================================== */
.type-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 8px;
  padding: 20px 24px; margin-bottom: 16px;
  border-left: 3px solid rgba(255,255,255,0.07);
}
.type-row.accent { border-left-color: var(--amber-gold); }
.type-row.secondary { border-left-color: rgba(var(--slate-cobalt-rgb), 0.5); } /* Fix D: Roboto Slab row */
.type-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.type-role-tag {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.3);
}
.type-role-tag.gold { border-color: rgba(200,134,26,0.4); color: var(--amber-gold); }
.type-role-tag.cobalt { border-color: rgba(var(--slate-cobalt-rgb), 0.3); color: #7A9ABE; } /* Fix D */
.type-font-name { font-family: 'DM Mono', monospace; font-size: 11px; color: rgba(255,255,255,0.22); letter-spacing: 0.12em; }
.type-usage { font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 300; color: rgba(245,247,250,0.32); margin-top: 8px; line-height: 1.65; }
.type-weights { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.type-weight-item { font-size: 11px; color: rgba(255,255,255,0.22); font-family: 'DM Mono', monospace; }

/* ======================================================
   HOUSE OF BRANDS PAGE
   ====================================================== */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 20px 0; }
.badge-example {
  border-radius: 8px; padding: 22px 24px;
  position: relative; overflow: hidden;
}
.badge-example-label {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.22); margin-bottom: 14px;
}
.badge-co-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.02em; margin-bottom: 14px;
}
.forge-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px 4px 4px; border-radius: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.badge-dot { width: 20px; height: 20px; border-radius: 3px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.badge-dot-text { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 900; letter-spacing: 0; }
.badge-sep { width: 1px; height: 16px; opacity: 0.22; }
.badge-note {
  font-family: 'Space Grotesk', sans-serif; font-size: 10.5px; font-weight: 300;
  color: rgba(255,255,255,0.32); line-height: 1.65; margin-top: 12px;
}

.chameleon-rule-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 8px;
  padding: 18px 20px; margin-top: 22px;
}
.chameleon-rule-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 300;
  color: rgba(245,247,250,0.45); line-height: 1.65; margin-bottom: 9px;
}
.chameleon-rule-item:last-child { margin-bottom: 0; }
.cr-num {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--amber-gold); margin-top: 4px; flex-shrink: 0; width: 18px;
}

/* ======================================================
   RESPONSIVE BREAKPOINTS
   ====================================================== */
@media (max-width: 700px) {
  .pal-header { grid-template-columns: 1fr; }
  .cover-toc { margin-top: 24px; }
}
@media (max-width: 480px) {
  body { padding: 16px 10px; }
  .page { padding: 24px 18px; }
  .cover { min-height: 380px; }
  .mocks { grid-template-columns: 1fr; }
}

/* ======================================================
   PRINT
   ====================================================== */
@media print {
  body { padding: 0; background: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page { margin-bottom: 0; border-radius: 0; box-shadow: none; max-width: 100%; page-break-after: always; }
  .page:last-child { page-break-after: auto; }
}
