:root {
  --bg: #050608;
  --bg-soft: #0a0d12;
  --panel: rgba(10, 15, 24, 0.76);
  --panel-strong: rgba(8, 12, 18, 0.92);
  --ink: #ffffff;
  --muted: #97a1b2;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #7ae7ff;
  --accent-2: #8e8bff;
  --danger: #ff6f8f;
  --ok: #a1ffc8;
  --shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
  --radius: 30px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(122, 231, 255, 0.12), transparent 30%),
    radial-gradient(circle at 85% 15%, rgba(142, 139, 255, 0.10), transparent 28%),
    linear-gradient(180deg, #040507 0%, #050608 55%, #070a0d 100%);
  color: var(--ink);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

.noise,
.boot-grid,
.page-shell::before,
.panel::before,
.hero::before { pointer-events: none; }

.noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 0.5px, transparent 0.5px);
  background-size: 7px 7px;
  opacity: 0.06;
  mix-blend-mode: screen;
  z-index: 1;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.boot-screen.is-hidden { opacity: 0; visibility: hidden; }

.boot-grid {
  position: absolute;
  inset: -10%;
  background:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(1000px) rotateX(72deg) translateY(16%);
  opacity: 0.22;
}

.boot-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  width: min(92vw, 1400px);
  padding: 24px;
}

.boot-title {
  margin: 0;
  font-family: "Tektur", sans-serif;
  font-size: clamp(54px, 10vw, 148px);
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.22), 0 0 60px rgba(255, 255, 255, 0.08);
  animation: bootPulse 1.6s ease-in-out infinite alternate;
}

.boot-credit {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  transform: translateY(20px);
  opacity: 0;
  animation: creditSlide 1s ease forwards;
  animation-delay: 0.8s;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset;
}

.boot-credit img { width: 26px; height: 26px; object-fit: contain; }
.boot-credit span {
  color: #fff;
  font-size: clamp(13px, 1.4vw, 18px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.boot-scanline {
  position: absolute;
  inset: auto 0 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.86) 50%, transparent 100%);
  box-shadow: 0 0 16px rgba(255,255,255,0.55);
  animation: sweep 2.6s ease-in-out infinite;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: calc(100vw - 18px);
  max-width: none;
  margin: 0 auto;
  padding: 12px 0 28px;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 12px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 10px 10px 18px;
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; gap: 16px; }
.brand-knot {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255,255,255,0.42);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(122, 231, 255, 0.35);
  transform: rotate(45deg);
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy b {
  font-family: "Tektur", sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 20px;
}
.brand-copy small {
  color: var(--muted);
  letter-spacing: 0.14em;
  font-size: 11px;
  text-transform: uppercase;
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topnav a {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
  transition: 0.25s ease;
}
.topnav a.active,
.topnav a:hover {
  color: #fff;
  border-color: rgba(122, 231, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(122, 231, 255, 0.15) inset, 0 0 24px rgba(122, 231, 255, 0.10);
}

.page { display: none; }
.page.active { display: block; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 16, 25, 0.78), rgba(5, 8, 13, 0.92));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(255,255,255,0.55), transparent 88%);
  opacity: 0.30;
}
.panel > * { position: relative; z-index: 2; }

.hero {
  position: relative;
  min-height: calc(100vh - 106px);
  display: grid;
  grid-template-columns: minmax(610px, 0.88fr) minmax(760px, 1.12fr);
  gap: 16px;
  align-items: stretch;
  padding: 8px 0 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 48px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 20%, rgba(255,255,255,0.12) 80%, transparent 100%);
}

.hero-copy { padding: 48px 54px 36px; }
.eyebrow-row { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.eyebrow-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d9f9ff;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.eyebrow-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(122,231,255,0.4), transparent); }
.hero-title {
  margin: 0 0 22px;
  max-width: 14ch;
  font-family: "Tektur", sans-serif;
  font-weight: 700;
  font-size: clamp(46px, 5vw, 86px);
  line-height: 0.98;
  letter-spacing: 0.02em;
  color: #fff;
}
.hero-lead {
  margin: 0 0 18px;
  max-width: 760px;
  color: #f7fbff;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.6;
}
.hero-text { margin: 0; max-width: 760px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 36px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
}
.button-primary {
  color: #051015;
  background: linear-gradient(135deg, #eafcff 0%, #8fefff 55%, #9da7ff 100%);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 18px 40px rgba(122, 231, 255, 0.16);
}
.button-secondary { color: #fff; background: rgba(255,255,255,0.02); }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metrics article {
  min-height: 174px;
  padding: 18px 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.metrics span { display: block; margin-bottom: 14px; color: #9ad8ff; font-family: "Tektur", sans-serif; letter-spacing: 0.16em; font-size: 14px; }
.metrics b { display: block; margin-bottom: 10px; font-size: 18px; }
.metrics p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 14px; }

.hero-visual { padding: 18px; }
.visual-hud { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; gap: 18px; padding: 8px; }
.hud-topline, .hud-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.hud-topline span, .hud-footer small { color: #9eb0c9; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.hud-footer b { display: block; margin-top: 6px; font-size: 13px; color: #fff; font-weight: 600; line-height: 1.5; }

.case-stage {
  position: relative;
  flex: 1;
  min-height: 680px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at 50% 40%, rgba(142,139,255,0.12), transparent 38%),
    radial-gradient(circle at 30% 30%, rgba(122,231,255,0.10), transparent 32%),
    rgba(0,0,0,0.28);
  overflow: hidden;
}
.case-stage::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 24px;
}
.case-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.4;
}
.case-map { position: relative; z-index: 2; width: min(100%, 1140px); }
.case-image { width: 100%; height: auto; object-fit: contain; }
.case-orbit { position: absolute; border: 1px solid rgba(122,231,255,0.22); border-radius: 50%; filter: drop-shadow(0 0 14px rgba(122,231,255,0.08)); }
.orbit-a { width: 78%; height: 54%; transform: rotate(-8deg); }
.orbit-b { width: 90%; height: 66%; border-color: rgba(255,255,255,0.12); transform: rotate(12deg); }
.orbit-c { width: 58%; height: 82%; border-color: rgba(142,139,255,0.18); }

.case-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 5;
  width: 1px;
  height: 1px;
}
.marker-pin {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.95);
  background: rgba(122, 231, 255, 0.80);
  box-shadow: 0 0 18px rgba(122,231,255,0.75), 0 0 0 6px rgba(122,231,255,0.12);
}
.marker-label {
  position: absolute;
  left: 18px;
  top: -16px;
  white-space: nowrap;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  color: #fff;
  background: rgba(4, 9, 15, 0.86);
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.marker-dice .marker-label { left: 18px; top: -38px; }
.marker-cover .marker-label { left: auto; right: 18px; top: -16px; }
.marker-weapons .marker-label { left: 18px; top: 8px; }
.marker-decks .marker-label { left: -10px; top: -46px; transform: translateX(-50%); }

.section-grid,
.lore-layout,
.contact-layout {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}
.section-grid { grid-template-columns: minmax(320px, 0.26fr) minmax(0, 0.74fr); }
.section-sticky {
  min-height: calc(100vh - 110px);
  padding: 34px;
  align-self: start;
  position: sticky;
  top: 92px;
}
.section-code {
  display: inline-block;
  margin-bottom: 18px;
  color: #a8f2ff;
  font-family: "Tektur", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.section-sticky h2,
.cards-placeholder h2,
.contact-copy h2,
.lore-main h2 {
  margin: 0 0 18px;
  font-family: "Tektur", sans-serif;
  font-size: clamp(40px, 5vw, 82px);
  line-height: 0.98;
}
.section-sticky p,
.cards-placeholder p,
.contact-copy p,
.lore-main p { color: var(--muted); line-height: 1.78; font-size: 16px; margin: 0 0 18px; }
.side-index { display: grid; gap: 10px; margin-top: 34px; }
.side-index a {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: #dce8f0;
  background: rgba(255,255,255,0.03);
}
.section-flow { display: grid; gap: 16px; }
.rules-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; padding: 34px; }
.rules-hero h3,
.faction-example h3,
.wide-rule h3,
.victory h3 { margin: 0 0 14px; font-family: "Tektur", sans-serif; font-size: clamp(28px, 3vw, 48px); line-height: 1.05; }
.rules-hero p,
.faction-example p,
.wide-rule p { margin: 0; color: var(--muted); line-height: 1.75; max-width: 880px; }
.setup-mini { display: grid; gap: 10px; min-width: 220px; }
.setup-mini span,
.weapon-strip span {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;
  background: rgba(255,255,255,0.04);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.faction-example { padding: 34px; }
.example-head { max-width: 980px; }
.faction-cards {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1fr) minmax(180px, 0.8fr);
  gap: clamp(14px, 2vw, 34px);
  align-items: center;
  justify-items: center;
  margin: 30px 0 26px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  background: radial-gradient(circle at 50% 50%, rgba(122,231,255,0.10), transparent 42%), rgba(255,255,255,0.025);
}
.sample-card { margin: 0; width: min(100%, 280px); }
.sample-card img { width: 100%; border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,0.46); }
.sample-card figcaption {
  margin-top: 12px;
  text-align: center;
  color: #dce8f0;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.personality-main { width: min(100%, 330px); }
.tilt-left { transform: rotate(-3deg); }
.tilt-right { transform: rotate(3deg); }
.score-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.score-line div {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.score-line b { display: block; margin-bottom: 7px; }
.score-line span { color: var(--muted); }
.score-line .result { border-color: rgba(122,231,255,0.36); box-shadow: 0 0 0 1px rgba(122,231,255,0.10) inset; }
.score-line .result span { color: #d9f9ff; }

.rule-cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rule-card { padding: 26px; min-height: 280px; }
.rule-card span { display: block; margin-bottom: 18px; color: #9ad8ff; font-family: "Tektur", sans-serif; letter-spacing: 0.16em; }
.rule-card h3 { margin: 0 0 14px; font-family: "Tektur", sans-serif; font-size: 24px; line-height: 1.1; }
.rule-card p { margin: 0; color: var(--muted); line-height: 1.72; }

.wide-rule { padding: 34px; display: grid; grid-template-columns: 1fr minmax(250px, 360px); gap: 28px; align-items: end; }
.weapon-strip { display: grid; gap: 10px; }
.victory { padding: 34px; }
.victory-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.victory-grid p { margin: 0; min-height: 154px; padding: 18px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.03); }
.victory-grid b { display: block; margin-bottom: 10px; color: #fff; }
.victory-grid span { color: var(--muted); line-height: 1.55; font-size: 14px; }

.cards-placeholder { min-height: calc(100vh - 110px); display: grid; place-content: center; padding: 60px; text-align: center; }
.cards-placeholder p { max-width: 720px; margin-left: auto; margin-right: auto; }

.lore-layout { grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr); }
.lore-main { padding: 46px; min-height: calc(100vh - 110px); }
.lore-main p { max-width: 980px; font-size: 18px; }
.lore-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lore-cell { padding: 30px; min-height: 260px; }
.lore-cell span { color: #9ad8ff; font-family: "Tektur", sans-serif; letter-spacing: 0.16em; }
.lore-cell h3 { margin: 24px 0 12px; font-family: "Tektur", sans-serif; font-size: 30px; }
.lore-cell p { margin: 0; color: var(--muted); line-height: 1.7; }

.contact-layout { grid-template-columns: minmax(0, 1fr) minmax(420px, 0.55fr); min-height: calc(100vh - 110px); }
.contact-copy { padding: 46px; }
.contact-copy p { max-width: 820px; font-size: 18px; }
.contact-lines { display: grid; gap: 12px; margin-top: 34px; max-width: 720px; }
.contact-lines span { display: flex; justify-content: space-between; gap: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.03); color: var(--muted); }
.contact-lines b { color: #fff; }
.newsletter { padding: 34px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.newsletter label { color: #fff; font-family: "Tektur", sans-serif; font-size: 22px; }
.newsletter input {
  width: 100%;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  color: #fff;
  padding: 0 18px;
  outline: none;
}
.newsletter input:focus { border-color: rgba(122,231,255,0.44); box-shadow: 0 0 0 4px rgba(122,231,255,0.08); }
.newsletter p { color: var(--muted); line-height: 1.6; margin: 0; }

@keyframes bootPulse { from { transform: scale(0.995); } to { transform: scale(1.01); } }
@keyframes creditSlide { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sweep { 0% { transform: translateY(-120px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(70vh); opacity: 0; } }

@media (max-width: 1500px) {
  .hero { grid-template-columns: 1fr; }
  .case-stage { min-height: 620px; }
  .section-grid, .lore-layout, .contact-layout { grid-template-columns: 1fr; }
  .section-sticky { min-height: auto; position: relative; top: auto; }
  .rule-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .victory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .page-shell { width: calc(100vw - 12px); padding-top: 8px; }
  .topbar { position: relative; top: auto; flex-direction: column; align-items: flex-start; }
  .topnav { justify-content: flex-start; }
  .hero-copy, .section-sticky, .rules-hero, .faction-example, .wide-rule, .victory, .lore-main, .contact-copy, .newsletter { padding: 24px; }
  .hero-title, .section-sticky h2, .cards-placeholder h2, .contact-copy h2, .lore-main h2 { max-width: 100%; font-size: clamp(38px, 12vw, 60px); }
  .metrics, .rule-cards-grid, .lore-cells, .score-line, .victory-grid, .wide-rule, .rules-hero, .contact-lines span { grid-template-columns: 1fr; }
  .faction-cards { grid-template-columns: 1fr; }
  .tilt-left, .tilt-right { transform: none; }
  .case-stage { min-height: 360px; }
  .case-marker { display: none; }
  .boot-title { letter-spacing: 0.1em; }
  .boot-credit { padding: 10px 14px; gap: 10px; }
  .boot-credit span { letter-spacing: 0.08em; }
}

/* v7 refinements */
.marker-bottom .marker-label { left: 18px; top: 8px; }
.marker-bottom .marker-pin,
.marker-dice .marker-pin {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 18px rgba(255,255,255,0.60), 0 0 0 6px rgba(255,255,255,0.10);
}
.marker-decks .marker-pin { background: rgba(122, 231, 255, 0.86); }
.marker-weapons .marker-pin { background: rgba(255, 218, 122, 0.88); box-shadow: 0 0 18px rgba(255,218,122,0.58), 0 0 0 6px rgba(255,218,122,0.10); }
.marker-cover .marker-pin { background: rgba(142, 139, 255, 0.86); box-shadow: 0 0 18px rgba(142,139,255,0.58), 0 0 0 6px rgba(142,139,255,0.10); }

.faction-cards::before {
  content: "2× ECHO / 1× PERSONALITY / MAJORITY CHECK";
  position: absolute;
  top: 14px;
  left: 18px;
  color: rgba(216,249,255,0.62);
  font-family: "Tektur", sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
}
.faction-cards { position: relative; padding-top: 46px; }
.sample-card img {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
}
.personality-main img {
  border-color: rgba(255, 70, 90, 0.28);
  box-shadow: 0 32px 90px rgba(255, 40, 70, 0.10), 0 28px 80px rgba(0,0,0,0.46);
}
.score-line .result b::after {
  content: " / majority locked";
  color: #a8f2ff;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

/* v8 card archive + compact lore/contact */
.cards-console {
  min-height: calc(100vh - 110px);
  padding: clamp(22px, 2.4vw, 42px);
  overflow: hidden;
}

.cards-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}
.cards-header h2 {
  margin: 12px 0 12px;
  max-width: 980px;
  font-family: "Tektur", sans-serif;
  font-size: clamp(46px, 5vw, 92px);
  line-height: 0.95;
  letter-spacing: 0.02em;
}
.cards-header p {
  margin: 0;
  max-width: 980px;
  color: var(--muted);
  line-height: 1.72;
  font-size: 17px;
}
.archive-status {
  min-width: 220px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(122,231,255,0.22);
  background: rgba(122,231,255,0.045);
  box-shadow: 0 0 34px rgba(122,231,255,0.06) inset;
}
.archive-status span,
.rail-caption {
  display: block;
  color: #9eb0c9;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.archive-status b {
  display: block;
  margin-top: 8px;
  font-family: "Tektur", sans-serif;
  color: #fff;
  letter-spacing: 0.12em;
}

.cards-system {
  display: grid;
  grid-template-columns: minmax(190px, 0.22fr) minmax(230px, 0.27fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 660px;
}

.card-type-column,
.subtype-column,
.card-output {
  position: relative;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 28px;
  background: rgba(0,0,0,0.18);
  overflow: hidden;
}
.card-type-column::before,
.subtype-column::before,
.card-output::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.45;
  pointer-events: none;
}
.card-type-column,
.subtype-column { padding: 18px; }
.rail-caption { margin-bottom: 16px; }
.type-buttons,
.subtype-buttons { position: relative; z-index: 2; display: grid; gap: 12px; }

.archive-type-btn,
.subtype-btn {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  color: #fff;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}
.archive-type-btn:hover,
.subtype-btn:hover { transform: translateX(5px); border-color: rgba(122,231,255,0.34); }
.archive-type-btn.active,
.subtype-btn.active {
  background: linear-gradient(135deg, rgba(122,231,255,0.16), rgba(142,139,255,0.08));
  border-color: rgba(122,231,255,0.48);
  box-shadow: 0 0 0 1px rgba(122,231,255,0.12) inset, 0 18px 46px rgba(0,0,0,0.28);
}
.archive-type-btn span,
.subtype-btn span {
  display: block;
  font-family: "Tektur", sans-serif;
  font-size: 22px;
  line-height: 1.05;
}
.archive-type-btn small,
.subtype-btn small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 10px;
}
.subtype-viewport { position: relative; overflow: hidden; min-height: 370px; }
.subtype-buttons.is-sliding .subtype-btn {
  animation: subtypeSlideIn 0.48s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(var(--order) * 52ms);
}

.card-output {
  display: grid;
  grid-template-columns: minmax(290px, 0.5fr) minmax(0, 0.72fr);
  gap: clamp(18px, 2.4vw, 44px);
  padding: clamp(22px, 2.5vw, 46px);
  align-items: center;
}
.card-output > * { position: relative; z-index: 2; }
.card-output.output-pulse { animation: outputPulse 0.42s ease both; }
.output-card-frame {
  display: grid;
  place-items: center;
  min-height: 560px;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(circle at 50% 30%, rgba(122,231,255,0.12), transparent 38%),
    radial-gradient(circle at 45% 70%, rgba(142,139,255,0.10), transparent 34%),
    rgba(255,255,255,0.025);
  overflow: hidden;
}
.output-card-frame::before {
  content: "";
  position: absolute;
  width: 82%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(122,231,255,0.18);
  border-radius: 50%;
  transform: rotate(-12deg) scaleX(1.24);
}
.card-image-stack { position: relative; display: grid; place-items: center; width: min(78%, 390px); }
.main-card-image {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 30px 100px rgba(0,0,0,0.55), 0 0 50px rgba(122,231,255,0.08);
}
.support-card {
  position: absolute;
  width: 42%;
  right: -14%;
  bottom: 2%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
  transform: rotate(7deg);
}
.output-copy h3 {
  margin: 14px 0 18px;
  font-family: "Tektur", sans-serif;
  font-size: clamp(38px, 4vw, 72px);
  line-height: 0.98;
}
.output-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.78;
  font-size: 17px;
  max-width: 820px;
}
.output-copy .type-summary {
  color: #e9faff;
  font-size: 19px;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.card-tags span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: #d9f9ff;
  background: rgba(122,231,255,0.055);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.lore-layout.lore-compact {
  display: block;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 52px) 0;
}
.lore-layout.lore-compact .lore-main {
  min-height: auto;
  padding: clamp(34px, 4vw, 70px);
}
.lore-layout.lore-compact .lore-main h2 {
  max-width: 880px;
}
.lore-layout.lore-compact .lore-main p {
  max-width: 1040px;
}
.contact-layout.contact-compact {
  max-width: 1320px;
  margin: 0 auto;
  min-height: auto;
  padding: clamp(18px, 3vw, 52px) 0;
  align-items: stretch;
}
.contact-layout.contact-compact .contact-copy,
.contact-layout.contact-compact .newsletter {
  min-height: auto;
}

@keyframes subtypeSlideIn {
  from { opacity: 0; transform: translateX(-44px) skewX(-8deg); filter: blur(7px); }
  to { opacity: 1; transform: translateX(0) skewX(0); filter: blur(0); }
}
@keyframes outputPulse {
  from { opacity: 0.72; transform: translateY(12px); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (max-width: 1500px) {
  .cards-system { grid-template-columns: 210px 260px minmax(0, 1fr); }
  .card-output { grid-template-columns: minmax(260px, 0.48fr) minmax(0, 0.72fr); }
  .output-card-frame { min-height: 500px; }
}

@media (max-width: 1120px) {
  .cards-header { grid-template-columns: 1fr; }
  .cards-system { grid-template-columns: 1fr; min-height: auto; }
  .type-buttons, .subtype-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subtype-viewport { min-height: auto; }
  .card-output { grid-template-columns: 1fr; }
  .output-card-frame { min-height: 460px; }
}

@media (max-width: 760px) {
  .type-buttons, .subtype-buttons, .card-output { grid-template-columns: 1fr; }
  .cards-console { padding: 18px; }
  .output-card-frame { min-height: 390px; }
  .card-image-stack { width: min(82%, 320px); }
}

/* v9 motion pass + approved card library */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 38;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(122,231,255,0.10) 46%, rgba(255,255,255,0.18) 50%, rgba(142,139,255,0.10) 54%, transparent 100%),
    radial-gradient(circle at 50% 50%, rgba(122,231,255,0.08), transparent 42%);
  transform: translateX(-100%) skewX(-12deg);
}
body.route-changing::after { animation: routeSweep 0.72s cubic-bezier(.16,.84,.28,1) both; }

.page.active.is-entering { animation: pageEnter 0.68s cubic-bezier(.16,.84,.28,1) both; }
.panel,
.metrics article,
.sample-card,
.archive-type-btn,
.subtype-btn {
  opacity: 0.001;
  transform: translateY(18px);
}
.panel.reveal-in,
.metrics article.reveal-in,
.sample-card.reveal-in,
.archive-type-btn.reveal-in,
.subtype-btn.reveal-in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.58s cubic-bezier(.16,.84,.28,1) calc(var(--reveal-order, 0) * 26ms),
    transform 0.58s cubic-bezier(.16,.84,.28,1) calc(var(--reveal-order, 0) * 26ms),
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.button,
.topnav a,
.side-index a,
.archive-type-btn,
.subtype-btn,
.contact-lines span,
.score-line div,
.rule-card,
.victory-grid p {
  position: relative;
  overflow: hidden;
}
.button::before,
.topnav a::before,
.side-index a::before,
.archive-type-btn::before,
.subtype-btn::before,
.contact-lines span::before,
.score-line div::before,
.rule-card::before,
.victory-grid p::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.13) 45%, transparent 58%);
  transform: translateX(-120%);
  transition: transform 0.7s cubic-bezier(.16,.84,.28,1);
  pointer-events: none;
}
.button:hover::before,
.topnav a:hover::before,
.side-index a:hover::before,
.archive-type-btn:hover::before,
.subtype-btn:hover::before,
.contact-lines span:hover::before,
.score-line div:hover::before,
.rule-card:hover::before,
.victory-grid p:hover::before {
  transform: translateX(120%);
}
.button:hover { transform: translateY(-2px); }
.button { transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
.button-primary:hover { box-shadow: 0 20px 56px rgba(122, 231, 255, 0.22); }

.brand-knot { animation: knotPulse 2.4s ease-in-out infinite alternate; }
.case-orbit { animation: orbitFloat 9s linear infinite; transform-origin: 50% 50%; }
.orbit-b { animation-duration: 12s; animation-direction: reverse; }
.orbit-c { animation-duration: 15s; }
.marker-pin { animation: markerSignal 1.8s ease-in-out infinite; }
.marker-label { transition: transform 0.26s ease, border-color 0.26s ease, background 0.26s ease; }
.case-marker:hover .marker-label { transform: translateY(-2px); border-color: rgba(122,231,255,0.36); background: rgba(7, 16, 26, 0.94); }

.cards-console::after,
.card-output::after,
.case-stage::after {
  animation: gridDrift 16s linear infinite;
}
.cards-system { perspective: 1600px; }
.subtype-column {
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(.16,.84,.28,1), border-color 0.45s ease, box-shadow 0.45s ease;
}
.subtype-column:has(.is-channel-open),
.subtype-column:hover {
  transform: translateX(3px) rotateY(-1deg);
  border-color: rgba(122,231,255,0.20);
  box-shadow: 0 0 46px rgba(122,231,255,0.07) inset;
}
.subtype-buttons.is-channel-open::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -20px -18px;
  background: linear-gradient(90deg, rgba(122,231,255,0.0), rgba(122,231,255,0.10), rgba(142,139,255,0.08), rgba(122,231,255,0));
  transform: translateX(-120%);
  animation: channelOpen 0.9s cubic-bezier(.16,.84,.28,1) both;
}
.archive-type-btn.active::after,
.subtype-btn.active::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(122,231,255,0.8), 0 0 0 6px rgba(122,231,255,0.08);
  transform: translateY(-50%);
}
.card-output.output-pulse .main-card-image { animation: cardPhase 0.72s cubic-bezier(.16,.84,.28,1) both; }
.card-output.output-pulse .output-copy { animation: copyPhase 0.62s cubic-bezier(.16,.84,.28,1) both; }
.main-card-image,
.support-card {
  transition: transform 0.38s cubic-bezier(.16,.84,.28,1), box-shadow 0.38s ease, filter 0.38s ease;
}
.card-image-stack:hover .main-card-image {
  transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
  box-shadow: 0 42px 120px rgba(0,0,0,0.62), 0 0 70px rgba(122,231,255,0.13);
}
.card-image-stack:hover .support-card { transform: translateY(-4px) rotate(10deg) scale(1.02); }
.output-card-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(122,231,255,0.07);
  background: linear-gradient(120deg, transparent, rgba(122,231,255,0.07), transparent);
  transform: translateX(-120%);
  animation: frameScan 4.8s ease-in-out infinite;
  pointer-events: none;
}
.card-output.type-event .output-card-frame {
  background:
    radial-gradient(circle at 50% 30%, rgba(255,111,143,0.12), transparent 38%),
    radial-gradient(circle at 45% 70%, rgba(122,231,255,0.08), transparent 34%),
    rgba(255,255,255,0.025);
}
.card-output.type-event .main-card-image {
  box-shadow: 0 30px 100px rgba(0,0,0,0.55), 0 0 62px rgba(255,111,143,0.12);
}
.card-output.type-event.subtype-any .output-card-frame { filter: hue-rotate(18deg); }
.card-output.type-event.subtype-immediate .output-card-frame { filter: hue-rotate(-18deg) contrast(1.04); }
.card-output.type-event.subtype-constant .output-card-frame { filter: hue-rotate(38deg) saturate(1.05); }

.output-card-frame { position: relative; }
.card-image-stack { transform-style: preserve-3d; }
.main-card-image { max-height: 620px; object-fit: contain; background: rgba(255,255,255,0.035); }
.support-card { max-height: 260px; object-fit: contain; background: rgba(255,255,255,0.035); }

.lore-layout.lore-compact .lore-main,
.contact-layout.contact-compact .contact-copy,
.contact-layout.contact-compact .newsletter {
  animation: compactPanelFloat 0.9s cubic-bezier(.16,.84,.28,1) both;
}

@keyframes routeSweep {
  0% { opacity: 0; transform: translateX(-100%) skewX(-12deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%) skewX(-12deg); }
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(18px) scale(0.992); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes knotPulse {
  from { box-shadow: 0 0 18px rgba(122,231,255,0.30); }
  to { box-shadow: 0 0 36px rgba(122,231,255,0.62), 0 0 18px rgba(142,139,255,0.28); }
}
@keyframes orbitFloat {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}
@keyframes markerSignal {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.28); }
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 56px 56px, 56px 56px; }
}
@keyframes channelOpen {
  from { transform: translateX(-120%); opacity: 0; }
  40% { opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}
@keyframes cardPhase {
  0% { opacity: 0; transform: translateY(20px) scale(0.96) rotateX(8deg); filter: blur(10px) brightness(1.4); }
  60% { opacity: 1; filter: blur(0) brightness(1.08); }
  100% { transform: translateY(0) scale(1) rotateX(0); filter: blur(0) brightness(1); }
}
@keyframes copyPhase {
  from { opacity: 0; transform: translateX(28px); filter: blur(8px); }
  to { opacity: 1; transform: translateX(0); filter: blur(0); }
}
@keyframes frameScan {
  0%, 52% { transform: translateX(-120%); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}
@keyframes compactPanelFloat {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* v10 random matrix image reveal */
.pixel-reveal {
  position: relative;
  display: grid;
  overflow: hidden;
  isolation: isolate;
}
.pixel-reveal > img {
  grid-area: 1 / 1;
  transition: opacity 0.18s ease;
}
.case-map > .pixel-reveal-wide {
  width: 100%;
  z-index: 2;
}
.sample-card .pixel-reveal,
.card-image-stack > .pixel-reveal-card,
.card-image-stack > .pixel-reveal-small {
  width: 100%;
  border-radius: 18px;
}
.card-image-stack > .pixel-reveal-small {
  position: absolute;
  width: 42%;
  right: -14%;
  bottom: 2%;
  border-radius: 12px;
  transform: rotate(7deg);
}
.card-image-stack > .pixel-reveal-small .support-card {
  position: static;
  width: 100%;
  transform: none;
}
.card-image-stack:hover > .pixel-reveal-small { transform: translateY(-4px) rotate(10deg) scale(1.02); }
.card-image-stack:hover > .pixel-reveal-small .support-card { transform: none; }
.pixel-grid {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(122, 231, 255, 0.16));
}
.pixel-grid::before,
.pixel-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.pixel-grid::before {
  background: linear-gradient(90deg, transparent, rgba(122,231,255,0.20), transparent);
  transform: translateX(-120%);
  animation: pixelRevealScan 1.25s cubic-bezier(.16,.84,.28,1) both;
}
.pixel-grid::after {
  border: 1px solid rgba(122,231,255,0.22);
  box-shadow: 0 0 28px rgba(122,231,255,0.12) inset;
  opacity: 0.65;
}
.pixel-tile {
  min-width: 0;
  min-height: 0;
  opacity: 0;
  transform: scale(0.74) translateY(10px);
  filter: brightness(1.5) contrast(1.12) saturate(1.12);
  animation: tileBoot 0.62s cubic-bezier(.16,.84,.28,1) forwards;
}
.pixel-reveal-wide .pixel-tile { animation-duration: 0.52s; }
.pixel-reveal.reveal-complete .pixel-grid {
  animation: pixelOverlayExit 0.48s ease forwards;
}

@keyframes tileBoot {
  0% { opacity: 0; transform: scale(0.66) translateY(12px); filter: blur(7px) brightness(1.8); }
  50% { opacity: 1; transform: scale(1.05) translateY(0); filter: blur(0) brightness(1.22); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0) brightness(1); }
}
@keyframes pixelOverlayExit {
  from { opacity: 1; filter: brightness(1); }
  to { opacity: 0; filter: brightness(1.4); }
}
@keyframes pixelRevealScan {
  from { transform: translateX(-130%) skewX(-12deg); opacity: 0; }
  24% { opacity: 1; }
  to { transform: translateX(130%) skewX(-12deg); opacity: 0; }
}


/* v11 anti-flash patch for card archive matrix reveal */
.main-card-image[data-pixel-reveal],
.support-card[data-pixel-reveal] {
  opacity: 0;
}
.card-output.output-pulse .main-card-image[data-pixel-reveal],
.card-output.output-pulse .support-card[data-pixel-reveal] {
  animation: none !important;
}
.pixel-reveal:not(.reveal-complete) > img[data-pixel-reveal] {
  opacity: 0 !important;
}
.pixel-reveal.reveal-complete > img[data-pixel-reveal] {
  opacity: 1 !important;
}
.card-output.output-pulse .pixel-reveal-card,
.card-output.output-pulse .pixel-reveal-small {
  animation: cardShellPhase 0.58s cubic-bezier(.16,.84,.28,1) both;
}
@keyframes cardShellPhase {
  from { transform: translateY(18px) scale(0.972) rotateX(6deg); filter: blur(8px) brightness(1.22); }
  to { transform: translateY(0) scale(1) rotateX(0); filter: blur(0) brightness(1); }
}

/* static registration export */
.newsletter .journal-link {
  width: 100%;
  min-height: 48px;
}

.newsletter button:disabled {
  cursor: wait;
  opacity: 0.72;
  filter: grayscale(0.2);
}

/* v14 contacts-only page */
.contact-layout.contact-only {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  max-width: 1280px;
}
.contact-signal {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: 360px;
}
.contact-signal h3 {
  margin: 12px 0 0;
  font-family: "Tektur", sans-serif;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1;
}
.contact-signal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.signal-grid span {
  min-height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  color: #dff9ff;
  font-family: "Tektur", sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-align: center;
}
@media (max-width: 820px) {
  .contact-layout.contact-only {
    grid-template-columns: 1fr;
  }
  .contact-signal {
    padding: 24px;
    min-height: auto;
  }
  .signal-grid {
    grid-template-columns: 1fr;
  }
}
