/* ==========================================================================
   MARROW DESIGN SYSTEM
   Premium Brutalist Identity — Two-Page Shared Stylesheet
   ========================================================================== */

:root {
  --paper: #EDEAE2;
  --ink: #171412;
  --marrow: #A32B1E;
  --marrow-rgb: 163, 43, 30;
  --dim: #6E675E;
  --line: #171412;
  --panel: #E2DED4;
  --stamp-done-bg: #171412;
  --stamp-done-fg: #EDEAE2;
  
  --nav-height: 56px;
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16130F;
    --ink: #E8E3D8;
    --marrow: #E05A44;
    --marrow-rgb: 224, 90, 68;
    --dim: #8F887C;
    --line: #E8E3D8;
    --panel: #201C17;
    --stamp-done-bg: #E8E3D8;
    --stamp-done-fg: #16130F;
  }
}

/* ---------- Reset & Base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--paper);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
  border-left: 2px solid var(--line);
}
::-webkit-scrollbar-thumb {
  background: var(--line);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--marrow);
}

/* ---------- Typography ---------- */
.mono {
  font-family: var(--font-mono);
  font-weight: 400;
}

a {
  color: var(--marrow);
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--marrow);
  outline-offset: 2px;
}

/* ---------- Structural Layout ---------- */
.grid-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  border-left: 2px solid var(--line);
  border-right: 2px solid var(--line);
  min-height: 100vh;
  position: relative;
}

@media (max-width: 768px) {
  .grid-container {
    padding: 0 20px;
    border-left: none;
    border-right: none;
  }
}

/* ---------- Film Grain Canvas ---------- */
#noiseCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.12;
}

/* ---------- Paper Block Wipe Loader ---------- */
#blockLoader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--paper);
  z-index: 10001;
  pointer-events: none;
  /* Start animation via JS class */
  clip-path: inset(0 0 0 0);
}

/* 3 Hard steps wipe (Entrance & Exit) */
#blockLoader.wiping {
  animation: hardWipe 0.85s steps(3) forwards;
}

#blockLoader.wiping-out {
  pointer-events: all;
  animation: hardWipeOut 0.35s steps(3) forwards;
}

@keyframes hardWipe {
  0% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(100% 0 0 0);
  }
}

@keyframes hardWipeOut {
  0% {
    clip-path: inset(100% 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

/* ---------- Persistent Brutalist Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  margin: 0 -40px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  height: var(--nav-height);
}

@media (max-width: 768px) {
  header.site-header {
    margin: 0 -20px;
    padding: 0 20px;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
  height: 100%;
  border-right: 2px solid var(--line);
  padding-right: 24px;
}
.header-brand:hover {
  color: var(--marrow);
}

nav.header-nav {
  display: flex;
  height: 100%;
}
nav.header-nav ul {
  display: flex;
  list-style: none;
  height: 100%;
}
nav.header-nav li {
  height: 100%;
}
nav.header-nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  border-left: 2px solid var(--line);
  position: relative;
  transition: background-color 0s, color 0s;
}
nav.header-nav a:hover {
  color: var(--ink);
  background-color: var(--panel);
  transition-duration: 0s !important;
}
nav.header-nav a.active {
  color: var(--marrow);
  background-color: transparent;
}
nav.header-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--marrow);
}

/* ---------- Typography & Spacers ---------- */
h2.section-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 4px solid var(--line);
  padding-top: 14px;
}
h2.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--line);
}

.lede {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 48px;
  max-width: 38ch;
  text-transform: uppercase;
}

section {
  padding: 96px 0;
  border-bottom: 2px solid var(--line);
}
section:last-of-type {
  border-bottom: none;
}

/* ---------- Hero block inside pages ---------- */
.hero-block {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-bottom: 4px solid var(--line);
  padding: 120px 0 60px;
}
.hero-block .kicker {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 24px;
}
.hero-block h1 {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 48px;
}
.hero-block h1 span.l1 {
  display: block;
}
.hero-block h1 span.l2 {
  display: block;
  color: var(--marrow);
}
.northstar {
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.4;
  font-family: var(--font-display);
  font-weight: 700;
  max-width: 32ch;
}
.northstar strong {
  font-weight: 800;
  color: var(--marrow);
}

/* ---------- Kinetic Typography ---------- */
.kinetic-word {
  opacity: 0;
  display: inline-block;
  white-space: nowrap;
  transition: opacity 0.05s steps(2);
}
.kinetic-word.revealed {
  opacity: 1;
}

/* ---------- Section 1: The Problem ---------- */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
@media (max-width: 768px) {
  .problem-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}
.problem-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.problem-text p.body {
  font-size: 18px;
  line-height: 1.6;
  color: var(--dim);
}
.problem-text p.body strong {
  color: var(--ink);
}
.problem-aside {
  border: 4px solid var(--line);
  padding: 40px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sting {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.sting em {
  font-style: normal;
  color: var(--marrow);
}

/* ---------- Section 2: What Marrow Keeps (engine.html) ---------- */
.keeps-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 1024px) {
  .keeps-grid {
    grid-template-columns: 1fr;
  }
}

.keeps-visual {
  position: sticky;
  top: calc(var(--nav-height) + 40px);
  border: 2px solid var(--line);
  padding: 32px;
  background: var(--panel);
}
@media (max-width: 1024px) {
  .keeps-visual {
    position: relative;
    top: 0;
    margin-bottom: 24px;
  }
}
.chain-svg-wrapper {
  width: 100%;
  height: 380px;
}
.chain-svg-wrapper svg {
  width: 100%;
  height: 100%;
}
.svg-layer-block {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 2;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), fill 0.3s;
}
.svg-layer-block.active {
  fill: rgba(var(--marrow-rgb), 0.1);
  stroke: var(--marrow);
  transform: translateX(12px);
}
.svg-layer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--dim);
  text-transform: uppercase;
  transition: fill 0.3s;
}
.svg-layer-block.active + .svg-layer-label,
.svg-layer-block.active ~ .svg-layer-label {
  fill: var(--marrow);
}
.svg-link-line {
  stroke: var(--line);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}

.ledger-preview-box {
  margin-top: 24px;
  border: 2px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 20px;
}
.ledger-preview-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--marrow);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}
.ledger-preview-content {
  white-space: pre-wrap;
  min-height: 120px;
}

.chain {
  display: flex;
  flex-direction: column;
}
.clink {
  border: 2px solid var(--line);
  margin-top: -2px;
  background: var(--paper);
  transition: background-color 0s, color 0s, border-color 0s;
}
.clink:first-child {
  margin-top: 0;
}
.clink.active {
  border-color: var(--marrow);
  z-index: 2;
}

/* 0ms Instant Color Inversion Hover */
.clink:hover {
  background-color: var(--marrow) !important;
  color: var(--paper) !important;
  border-color: var(--marrow) !important;
  transition-duration: 0s !important;
}
.clink:hover .clinkHead h3,
.clink:hover .clinkHead .short,
.clink:hover .glyph,
.clink:hover .clinkMore p {
  color: var(--paper) !important;
  transition-duration: 0s !important;
}

.clinkHead {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 24px 30px;
  text-align: left;
  color: inherit;
}
.clinkHead-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.clinkHead h3 {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: inherit;
}
.clinkHead .short {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}
.clink .glyph {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--marrow);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.clink.open .glyph {
  transform: rotate(45deg);
}
.clinkMore {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.clink.open .clinkMore {
  grid-template-rows: 1fr;
}
.clinkMore > div {
  overflow: hidden;
}
.clinkMore p {
  padding: 0 30px 24px;
  font-size: 16px;
  color: var(--dim);
  line-height: 1.6;
}
.clink.downstream {
  border-style: dashed;
}
.clink.downstream.active {
  border-style: solid;
}

/* ---------- Section 3: Refusals ---------- */
.refusals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .refusals-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
.refusal {
  border: 2px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--paper);
  transition: background-color 0s, color 0s;
  position: relative;
}

/* 0ms Color Inversion Hover */
.refusal:hover {
  background-color: var(--marrow) !important;
  color: var(--paper) !important;
  transition-duration: 0s !important;
}
.refusal:hover .never-stamp-col {
  background-color: var(--marrow) !important;
  border-right-color: var(--paper) !important;
  transition-duration: 0s !important;
}
.refusal:hover .never-stamp {
  background-color: var(--paper) !important;
  color: var(--marrow) !important;
  border-color: var(--paper) !important;
  transition-duration: 0s !important;
}
.refusal:hover h3,
.refusal:hover p {
  color: var(--paper) !important;
  transition-duration: 0s !important;
}

.never-stamp-col {
  padding: 16px 20px;
  border-right: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  transition: background-color 0s, border-color 0s;
}
.never-stamp {
  border: 3px solid var(--marrow);
  color: var(--marrow);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transform: rotate(-6deg);
  background: var(--paper);
  clip-path: polygon(
    0% 2%, 12% 0%, 25% 3%, 38% 0%, 52% 2%, 67% 0%, 81% 3%, 95% 0%, 100% 2%,
    99% 25%, 100% 50%, 98% 75%, 100% 98%, 88% 99%, 76% 97%, 62% 100%, 48% 98%, 32% 100%, 18% 97%, 5% 99%, 0% 96%,
    2% 76%, 0% 52%, 3% 28%, 0% 12%
  );
  box-shadow: 0 0 0 1px rgba(var(--marrow-rgb), 0.1);
  display: inline-block;
  user-select: none;
  transition: background-color 0s, color 0s, border-color 0s;
}
.refusalbody {
  padding: 24px 30px;
}
.refusalbody h3 {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  color: inherit;
}
.refusalbody p {
  font-size: 15px;
  color: var(--dim);
  line-height: 1.5;
}

/* ---------- Section 4: Status Ledger ---------- */
.status-ledger-table {
  border: 2px solid var(--line);
  background: var(--paper);
}
.ledger-row {
  display: grid;
  grid-template-columns: 140px 1.5fr 3fr;
  border-bottom: 1.5px solid var(--line);
  align-items: stretch;
  transition: background-color 0s, color 0s;
}
.ledger-row:last-child {
  border-bottom: none;
}
.ledger-row:not(.header-row):hover {
  background-color: var(--marrow) !important;
  color: var(--paper) !important;
  transition-duration: 0s !important;
}
.ledger-row:not(.header-row):hover .ledger-feature-name,
.ledger-row:not(.header-row):hover .ledger-feature-desc {
  color: var(--paper) !important;
  transition-duration: 0s !important;
}
.ledger-row:not(.header-row):hover .ledger-status-seal {
  background: var(--paper) !important;
  color: var(--marrow) !important;
  border-color: var(--paper) !important;
  transition-duration: 0s !important;
}
.ledger-row.header-row {
  background: var(--line);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ledger-row.header-row:hover {
  background: var(--line);
}
.ledger-col {
  padding: 18px 24px;
  border-right: 1.5px solid var(--line);
  display: flex;
  align-items: center;
}
.ledger-col:last-child {
  border-right: none;
}
.ledger-row.header-row .ledger-col {
  border-color: rgba(255, 255, 255, 0.15);
}
.ledger-feature-name {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}
.ledger-feature-desc {
  font-size: 15px;
  color: var(--dim);
  line-height: 1.5;
}
.ledger-status-seal {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 12px;
  text-align: center;
  border: 2px solid transparent;
  letter-spacing: 0.05em;
  width: 90px;
}
.ledger-row.built .ledger-status-seal {
  background: var(--stamp-done-bg);
  color: var(--stamp-done-fg);
  border-color: var(--line);
}
.ledger-row.half .ledger-status-seal {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.ledger-row.ahead {
  border-style: dashed;
}
.ledger-row.ahead .ledger-col {
  border-right-style: dashed;
}
.ledger-row.ahead .ledger-status-seal {
  border: 2px dashed var(--dim);
  color: var(--dim);
}
.ledger-row.ahead .ledger-feature-name,
.ledger-row.ahead .ledger-feature-desc {
  color: var(--dim);
}

@media (max-width: 768px) {
  .ledger-row {
    grid-template-columns: 100px 1.2fr 1.8fr;
    font-size: 14px;
  }
  .ledger-col {
    padding: 12px 14px;
  }
  .ledger-feature-name {
    font-size: 15px;
  }
}
@media (max-width: 580px) {
  .ledger-row:not(.header-row) {
    grid-template-columns: 1fr;
    border-bottom: 2px solid var(--line);
  }
  .ledger-row.header-row {
    display: none;
  }
  .ledger-col {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
  }
  .ledger-col:last-child {
    border-bottom: none;
  }
}

/* Ledger Teaser specifics */
.ledger-teaser-footer {
  padding: 24px;
  background-color: var(--panel);
  border-top: 1.5px solid var(--line);
  text-align: right;
}
.ledger-teaser-link {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--marrow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ledger-teaser-link:hover {
  color: var(--ink);
}

/* ---------- Section 5: The List / Doors ---------- */
.doors-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  background: var(--panel);
  border: 4px solid var(--line);
  padding: 48px;
}
@media (max-width: 992px) {
  .doors-container {
    grid-template-columns: 1fr;
    padding: 32px;
  }
}
.doors-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.doors-info h3 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.doors-info p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--dim);
}
.doors-form-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
form.list {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 2px solid var(--line);
  background: var(--paper);
}
form.list input[type="email"] {
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 18px 24px;
  outline: none;
  width: 100%;
}
form.list input[type="email"]::placeholder {
  color: var(--dim);
}
form.list button {
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-left: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 32px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  height: 100%;
}
form.list button:hover:not(:disabled) {
  background: var(--marrow);
  color: #EDEAE2;
}
form.list button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
}
.formNote {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--dim);
  min-height: 20px;
}
.formNote.ok {
  color: var(--marrow);
  font-weight: 700;
}
.formNote.err {
  color: var(--marrow);
}

@media (max-width: 580px) {
  form.list {
    grid-template-columns: 1fr;
  }
  form.list button {
    border-left: none;
    border-top: 2px solid var(--line);
    padding: 16px;
  }
}

/* ---------- Engine Closing CTA Panel ---------- */
.engine-cta-container {
  padding: 96px 0;
}
.engine-cta-panel {
  background-color: var(--panel);
  border: 4px solid var(--line);
  padding: 60px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.engine-cta-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.engine-cta-button {
  display: inline-block;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 18px 36px;
  border: 2px solid var(--line);
  transition: background-color 0s, color 0s;
}
.engine-cta-button:hover {
  background-color: var(--marrow);
  color: var(--paper);
  transition-duration: 0s !important;
}

/* ---------- Closing and Footer ---------- */
.closing-container {
  padding: 96px 0;
  border-bottom: 2px solid var(--line);
}
.closing {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  max-width: 24ch;
  letter-spacing: -0.02em;
}
.closing strong {
  color: var(--marrow);
}

footer {
  padding: 80px 0 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-top: 4px solid var(--line);
  margin-top: 40px;
  position: relative;
  z-index: 10;
  background: var(--paper);
}
.footer-brand {
  font-size: clamp(64px, 15vw, 160px);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: var(--panel);
  user-select: none;
  cursor: default;
  transition: color 0s;
}
.footer-brand:hover {
  color: var(--marrow);
  transition-duration: 0s !important;
}
@media (prefers-color-scheme: dark) {
  .footer-brand {
    color: #1a1713;
  }
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  border-top: 2px solid var(--line);
  padding-top: 24px;
}
@media (max-width: 580px) {
  .footer-meta {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* ==========================================================================
   SCROLL AND REVEAL ANIMATIONS (NATIVE CSS / PROGRESSIVE ENHANCEMENT)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes slideUpFade {
      from {
        opacity: 0;
        transform: translateY(40px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    .reveal-scroll {
      animation: slideUpFade linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 45%;
    }
    .reveal-grid > * {
      animation: slideUpFade linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 35%;
    }
  }
}

/* Fallback reveal class toggled by IntersectionObserver */
.reveal-fallback {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal-fallback.in {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   HIGH-IMPACT BRUTALIST INTERACTION ENGINE
   ========================================================================== */

/* 1. HERO MATRIX CANVAS */
.hero-block {
  position: relative;
  overflow: hidden;
}
.hero-matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}
.hero-block > *:not(.hero-matrix-canvas) {
  position: relative;
  z-index: 1;
}

/* 2. BRUTALIST TARGET RETICLE CURSOR */
#brutalistCursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10005;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s;
  font-family: var(--font-mono);
}
body.custom-cursor-active #brutalistCursor {
  opacity: 1;
}
.cursor-reticle {
  font-size: 16px;
  font-weight: 800;
  color: var(--marrow);
  line-height: 1;
  text-shadow: 0 0 2px var(--paper);
}
.cursor-coords {
  font-size: 9px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  padding: 1px 4px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.cursor-badge {
  font-size: 9px;
  font-weight: 800;
  background: var(--marrow);
  color: var(--paper);
  padding: 2px 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  display: none;
}
#brutalistCursor.has-target .cursor-badge {
  display: inline-block;
}

/* 3. HEADER MENU TRIGGER */
.header-menu-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-left: 2px solid var(--line);
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  height: 100%;
  transition: background-color 0s, color 0s;
}
.header-menu-btn:hover {
  background: var(--marrow);
  color: var(--paper);
}

/* 4. FULL-SCREEN COMMAND MATRIX OVERLAY */
.command-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--paper);
  z-index: 10002;
  display: none;
  overflow-y: auto;
}
.command-menu.open {
  display: block;
  animation: hardWipe 0.35s steps(3) forwards;
}
.command-menu-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.command-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 48px;
}
.command-brand {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--marrow);
}
.command-close-btn {
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--line);
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background-color 0s, color 0s;
}
.command-close-btn:hover {
  background: var(--marrow);
  color: var(--paper);
}
.command-menu-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  flex: 1;
}
@media (max-width: 768px) {
  .command-menu-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}
.command-col-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--dim);
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}
.command-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.command-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  transition: background-color 0s, color 0s, border-color 0s;
}
.command-link:hover {
  background: var(--marrow);
  color: var(--paper);
  border-color: var(--marrow);
}
.command-link:hover .cmd-num,
.command-link:hover .cmd-sub {
  color: var(--paper);
}
.cmd-num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--marrow);
  margin-right: 12px;
}
.cmd-sub {
  font-size: 14px;
  font-weight: 400;
  font-family: var(--font-mono);
  color: var(--dim);
  text-transform: none;
}

.command-status-box {
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.cmd-status-item {
  display: flex;
  align-items: center;
  gap: 16px;
}
.cmd-status-seal {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border: 2px solid var(--line);
  min-width: 90px;
  text-align: center;
}
.cmd-status-item.built .cmd-status-seal {
  background: var(--ink);
  color: var(--paper);
}
.cmd-status-item.half .cmd-status-seal {
  background: var(--paper);
  color: var(--ink);
}
.cmd-status-item.ahead .cmd-status-seal {
  border-style: dashed;
  color: var(--dim);
}
.cmd-status-text {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--ink);
}
.command-shortcut-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  border-top: 2px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.command-shortcut-hint code {
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
  font-size: 10px;
}

/* 5. LEDGER FILTER BAR */
.ledger-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--line);
  padding-bottom: 16px;
}
.filter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--dim);
  margin-right: 8px;
}
.filter-seal {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0s, color 0s, border-color 0s;
}
.filter-seal:hover {
  background: var(--marrow);
  color: var(--paper);
  border-color: var(--marrow);
}
.filter-seal.active {
  background: var(--ink);
  color: var(--paper);
}

/* 6. 3D REFUSAL TILT & PRESS STAMP EFFECT */
.refusal {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, background-color 0s, color 0s;
}
.refusal:active .never-stamp {
  transform: rotate(-10deg) scale(0.9) !important;
  transition: transform 0.05s steps(2);
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal-scroll, .reveal-grid > *, .reveal-fallback {
    opacity: 1 !important;
    transform: none !important;
  }
  .kinetic-word {
    opacity: 1 !important;
  }
  #noiseCanvas {
    display: none !important;
  }
  #blockLoader {
    display: none !important;
  }
}
