:root {
  /* compliance lexicon: blinks impatiently Mono* typewriter-effect annotations elegance deliberately disrupted typewriter intrusions types itself across Display* rhetoric numerals Grotesk* navigation */
  --solar: #FF6B2B;
  --lime: #C9FF4A;
  --plum: #5B245F;
  --shell: #FFF0D6;
  --ink: #21142F;
  --teal: #008C8C;
  --coral: #F23D5E;
  --apricot: #FFC078;
  --playfair: 'Playfair Display', serif;
  --space: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--shell);
  background: var(--ink);
  font-family: var(--space);
  overflow-x: hidden;
}

body.grid-rupture .masonry .card { transform: rotate(0deg) translateY(-8px) scale(1.015); }
body.grid-rupture .connector { stroke-dashoffset: 120; stroke: var(--lime); }

.crt, .heat {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.crt {
  background: repeating-linear-gradient(180deg, rgba(255, 240, 214, 0.04) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

.heat {
  background: radial-gradient(circle at 70% 20%, rgba(255, 107, 43, 0.16), transparent 35%), radial-gradient(circle at 20% 80%, rgba(0, 140, 140, 0.12), transparent 30%);
  animation: shimmer 7s ease-in-out infinite alternate;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px clamp(20px, 5vw, 70px);
  mix-blend-mode: difference;
}

.wordmark {
  color: var(--shell);
  font-family: var(--playfair);
  font-size: clamp(30px, 4vw, 62px);
  font-style: italic;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.07em;
}

.nav-strip { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav-strip a {
  color: var(--shell);
  border: 1px solid rgba(255, 240, 214, 0.38);
  padding: 9px 13px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  background: rgba(33, 20, 47, 0.35);
}

.chamber { position: relative; min-height: 100vh; padding: clamp(86px, 10vw, 140px) clamp(18px, 5vw, 78px); }

.logic-tank {
  display: grid;
  place-items: center start;
  overflow: hidden;
  background: radial-gradient(circle at 72% 36%, rgba(255, 192, 120, 0.8), transparent 18%), linear-gradient(135deg, var(--ink) 0%, var(--plum) 42%, var(--solar) 100%);
}

.sun-disc {
  position: absolute;
  width: 44vmin;
  height: 44vmin;
  right: 8vw;
  top: 18vh;
  border-radius: 50%;
  background: repeating-linear-gradient(0deg, var(--apricot) 0 12px, var(--solar) 12px 18px);
  opacity: 0.82;
  filter: blur(0.5px);
}

.current-field { position: absolute; inset: -8%; width: 116%; height: 116%; opacity: 0.62; }
.current-field path { fill: none; stroke: var(--teal); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 18 22; animation: currentDrift 12s linear infinite; }

.fish-layer { position: absolute; inset: 0; overflow: hidden; z-index: 3; }
.fish {
  position: absolute;
  width: var(--size);
  height: calc(var(--size) * .42);
  left: -16vw;
  top: var(--top);
  filter: drop-shadow(0 0 12px rgba(0, 140, 140, 0.9));
  animation: swim var(--speed) linear infinite;
  animation-delay: var(--delay);
}
.fish::before {
  content: '';
  position: absolute;
  inset: 12% 25% 12% 0;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  clip-path: polygon(0 50%, 16% 8%, 74% 0, 100% 50%, 74% 100%, 16% 92%);
}
.fish::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 35%;
  height: 100%;
  background: var(--coral);
  clip-path: polygon(0 50%, 100% 0, 74% 50%, 100% 100%);
}

.glass-panel {
  position: relative;
  z-index: 4;
  max-width: 980px;
  border: 1px solid rgba(255, 240, 214, 0.26);
  background: linear-gradient(135deg, rgba(33, 20, 47, 0.74), rgba(91, 36, 95, 0.46));
  box-shadow: 0 28px 90px rgba(33, 20, 47, 0.55), inset 0 0 40px rgba(255, 192, 120, 0.09);
  backdrop-filter: blur(10px);
}

.hero-copy { padding: clamp(30px, 6vw, 76px); transform: rotate(-1.4deg); }
.eyebrow, .label {
  font-family: var(--mono);
  color: var(--apricot);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  min-height: 0;
  margin-bottom: 22px;
  font-family: var(--playfair);
  font-size: clamp(54px, 9vw, 148px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  text-wrap: balance;
}
.cursor { color: var(--lime); animation: blink 0.72s steps(2) infinite; }
.manifesto { max-width: 620px; color: rgba(255, 240, 214, 0.83); font-size: clamp(18px, 2vw, 25px); }

.danger-switch, .logic-button {
  border: 1px solid var(--coral);
  color: var(--shell);
  background: linear-gradient(135deg, rgba(242, 61, 94, 0.18), rgba(255, 107, 43, 0.28));
  padding: 15px 18px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 6px 6px 0 rgba(0, 140, 140, 0.36);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}
.danger-switch:hover, .logic-button:hover { transform: translate(-3px, -3px); background: var(--coral); box-shadow: 10px 10px 0 rgba(201, 255, 74, 0.34); }

.measuring-marks { position: absolute; right: 26px; top: 24vh; bottom: 10vh; display: flex; flex-direction: column; justify-content: space-between; font-family: var(--mono); color: rgba(255, 240, 214, 0.55); }
.measuring-marks::before { content: ''; position: absolute; right: 34px; top: 0; bottom: 0; border-right: 1px solid rgba(255, 240, 214, 0.28); }

.reef-section { background: linear-gradient(180deg, var(--ink), var(--plum) 48%, #2b163c); overflow: hidden; }
.section-title { margin-left: clamp(0px, 16vw, 220px); max-width: 820px; margin-bottom: 48px; }
.section-title h2, .current-copy h2, .final-panel h2 { font-family: var(--playfair); font-size: clamp(38px, 6vw, 84px); line-height: 0.98; letter-spacing: -0.045em; }

.chapter-buoy { position: sticky; top: 120px; z-index: 5; float: left; width: 130px; font-family: var(--playfair); color: var(--apricot); }
.chapter-buoy.right { float: right; color: var(--teal); }
.chapter-buoy span { display: block; font-size: 88px; line-height: 0.8; font-style: italic; }
.chapter-buoy em { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; }

.connector-web { position: absolute; inset: 8% -4% auto -4%; height: 86%; width: 108%; opacity: 0.58; pointer-events: none; }
.connector { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 16 14; transition: stroke-dashoffset 700ms ease, stroke 300ms ease; animation: currentDrift 15s linear infinite; }
.connector.two { stroke: var(--coral); animation-duration: 19s; }
.connector.three { stroke: var(--apricot); animation-duration: 23s; }

.masonry {
  position: relative;
  z-index: 3;
  columns: 4 230px;
  column-gap: clamp(16px, 2vw, 30px);
  max-width: 1260px;
  margin: 0 auto;
}
.card {
  display: inline-block;
  width: 100%;
  margin: 0 0 clamp(16px, 2vw, 30px);
  padding: 24px;
  border: 1px solid rgba(255, 240, 214, 0.24);
  color: var(--shell);
  background: rgba(255, 192, 120, 0.1);
  box-shadow: 0 20px 60px rgba(33, 20, 47, 0.48), inset 0 0 28px rgba(0, 140, 140, 0.08);
  break-inside: avoid;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(70px) rotate(var(--rot));
  transition: opacity 800ms ease, transform 800ms cubic-bezier(.2,.8,.2,1), background 260ms ease;
}
.card.visible { opacity: 1; transform: translateY(0) rotate(var(--rot)); }
.card:hover { background: rgba(0, 140, 140, 0.2); }
.card h3 { font-family: var(--playfair); font-size: clamp(28px, 3vw, 48px); line-height: 1; letter-spacing: -0.04em; }
.card p { color: rgba(255, 240, 214, 0.78); line-height: 1.55; }
.card.tall { min-height: 480px; --rot: -2deg; }
.card.strip { min-height: 190px; --rot: 1.6deg; background: rgba(242, 61, 94, 0.16); }
.card.square { min-height: 340px; --rot: -0.7deg; }
.card.footnote { min-height: 220px; --rot: 2.4deg; margin-left: -34px; background: rgba(255, 240, 214, 0.13); }
.card.quote { min-height: 310px; --rot: -1.2deg; background: rgba(91, 36, 95, 0.5); }
.card.quote span { font-family: var(--playfair); font-size: 100px; color: var(--coral); line-height: 0.4; }
.card.narrow { min-height: 410px; --rot: 2.1deg; }
.card.rupture { min-height: 260px; --rot: -3deg; border-color: var(--lime); box-shadow: 10px 10px 0 rgba(201, 255, 74, 0.2); }
.card.rupture h3 { color: var(--lime); font-family: var(--mono); letter-spacing: 0.12em; }
.card.myth { min-height: 360px; --rot: 1deg; }
.card.aside { min-height: 210px; --rot: -2.2deg; }
.card.proof { min-height: 280px; --rot: 0.8deg; }
.mono { font-family: var(--mono); }
.gate-coral { position: relative; height: 190px; margin: 18px 0; background: radial-gradient(circle, rgba(201, 255, 74, 0.18), transparent 60%); border: 1px dashed var(--teal); }
.gate-coral i { position: absolute; width: 42%; height: 2px; background: var(--apricot); transform-origin: left center; }
.gate-coral i:nth-child(1) { left: 16%; top: 34%; transform: rotate(22deg); }
.gate-coral i:nth-child(2) { left: 26%; top: 58%; transform: rotate(-18deg); background: var(--coral); }
.gate-coral i:nth-child(3) { left: 46%; top: 48%; transform: rotate(70deg); background: var(--teal); }

.currents-section { display: grid; align-items: center; grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1fr); gap: 40px; background: radial-gradient(circle at 20% 20%, rgba(0, 140, 140, 0.25), transparent 30%), linear-gradient(140deg, var(--plum), var(--ink) 68%); }
.current-copy { padding: clamp(28px, 5vw, 58px); }
.proof-orbit { position: relative; min-height: 520px; border: 1px solid rgba(255, 240, 214, 0.2); background: repeating-radial-gradient(circle at center, transparent 0 44px, rgba(255, 240, 214, 0.08) 45px 46px); }
.orbit-card { position: absolute; width: 150px; height: 150px; display: grid; place-items: center; border-radius: 40% 60% 48% 52%; border: 1px solid var(--apricot); background: rgba(33, 20, 47, 0.72); animation: bob 5s ease-in-out infinite; }
.orbit-card b { font-family: var(--playfair); font-size: 66px; color: var(--apricot); }
.orbit-card span { font-family: var(--mono); text-transform: uppercase; font-size: 11px; color: var(--shell); }
.orbit-card:nth-child(1) { left: 10%; top: 12%; }
.orbit-card:nth-child(2) { right: 13%; top: 22%; animation-delay: -1s; }
.orbit-card:nth-child(3) { left: 34%; bottom: 13%; animation-delay: -2s; }
.orbit-card.fault { right: 20%; bottom: 22%; border-color: var(--lime); }
.orbit-card.fault b { color: var(--lime); }

.switchboard { display: grid; place-items: center; background: linear-gradient(180deg, #2b163c, var(--ink)); }
.final-panel { max-width: 980px; padding: clamp(34px, 6vw, 72px); border: 1px solid rgba(255, 240, 214, 0.26); background: linear-gradient(135deg, rgba(91, 36, 95, 0.7), rgba(33, 20, 47, 0.82)); box-shadow: 0 0 100px rgba(242, 61, 94, 0.22); }
.switch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 34px 0; }
.switch-output { min-height: 36px; font-family: var(--mono); color: var(--lime); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { from { transform: translate3d(-1%, -1%, 0) scale(1.01); } to { transform: translate3d(1%, 1%, 0) scale(1.03); } }
@keyframes currentDrift { to { stroke-dashoffset: -220; } }
@keyframes swim { from { transform: translateX(-10vw) translateY(0) scaleX(var(--dir)); } 50% { transform: translateX(60vw) translateY(-22px) scaleX(var(--dir)); } to { transform: translateX(130vw) translateY(12px) scaleX(var(--dir)); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-24px) rotate(3deg); } }

@media (max-width: 860px) {
  .site-header { align-items: flex-start; }
  .nav-strip a { font-size: 10px; padding: 7px 9px; }
  .chapter-buoy { float: none; position: relative; top: auto; width: auto; margin-bottom: 28px; }
  .section-title { margin-left: 0; }
  .currents-section { grid-template-columns: 1fr; }
  .switch-grid { grid-template-columns: 1fr; }
  .hero-copy { transform: rotate(0deg); }
}
