:root {
  --bg: #0a0a0b;
  --panel: #101012;
  --ink: #ececea;
  --muted: #7b7c7e;
  --line: rgba(236, 236, 234, .15);
  --line-hot: rgba(236, 236, 234, .42);
  --accent: #bd8b4c;
  --pad: clamp(24px, 4vw, 68px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Helvetica Neue", "Inter", Arial, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.grain {
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%,3%); }
  40% { transform: translate(3%,-5%); }
  60% { transform: translate(5%,4%); }
  80% { transform: translate(-3%,-2%); }
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 74px;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(10,10,11,.94), rgba(10,10,11,.54));
  backdrop-filter: blur(12px);
}
.mark { font-size: 13px; font-weight: 650; letter-spacing: .17em; }
.mark span { color: var(--accent); }
.top-meta { display: flex; gap: 38px; color: var(--muted); font: 10px/1 monospace; letter-spacing: .12em; }
.top-actions { display: flex; align-items: center; gap: 36px; }
.contact-nav {
  color: var(--ink);
  font: 9px/1 monospace;
  letter-spacing: .15em;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--line-hot);
  transition: border-color .25s, color .25s;
}
.contact-nav span { color: var(--accent); margin-left: 8px; }
.contact-nav:hover { border-color: var(--ink); }
.live { color: #a5a6a4; }
.live i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin: 0 8px 1px 0; box-shadow: 0 0 12px var(--accent); }

.rail {
  position: fixed;
  z-index: 15;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 18px;
  padding-left: 30px;
}
.rail-line { position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px; background: var(--line); overflow: hidden; }
.rail-line i { display: block; width: 100%; height: 0; background: var(--ink); transition: height .15s linear; }
.rail a { position: relative; color: #515255; font: 9px/1 monospace; letter-spacing: .16em; transition: color .3s; }
.rail a::before { content: attr(data-index); position: absolute; right: calc(100% + 42px); color: #3d3e40; }
.rail a.active { color: var(--ink); }

main { position: relative; z-index: 2; }
.scene {
  min-height: 100svh;
  position: relative;
  padding: 120px calc(var(--pad) + 165px) 70px var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.scene::after {
  content: "";
  position: absolute;
  inset: 74px 0 0;
  z-index: -1;
  background: linear-gradient(90deg, transparent 49.93%, rgba(255,255,255,.035) 50%, transparent 50.07%);
  opacity: .7;
}
.scene-code { position: absolute; top: 105px; left: var(--pad); color: #57585a; font: 9px/1 monospace; letter-spacing: .18em; }

.scene-hero { justify-content: flex-end; padding-bottom: 9vh; }
.hero-copy { align-self: flex-start; }
.eyebrow { color: var(--muted); margin: 0 0 20px; font: 9px/1.2 monospace; letter-spacing: .2em; }
h1 { margin: 0; font-size: clamp(76px, 13vw, 190px); line-height: .73; letter-spacing: -.075em; font-weight: 500; }
h1 span {
  color: rgba(13,13,15,.995);
  -webkit-text-stroke: clamp(1.35px, .09vw, 1.7px) rgba(236,236,234,.82);
  paint-order: stroke fill;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}
.descriptor { margin: 44px 0 0; color: #c9c9c6; font-size: clamp(14px, 1.5vw, 21px); letter-spacing: .02em; }
.hero-axis {
  position: absolute;
  right: calc(var(--pad) + 165px);
  bottom: 10vh;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #8b8c8d;
  font: 9px/1 monospace;
  letter-spacing: .12em;
}
.hero-axis b { color: #343537; font-weight: 400; }
.scroll-cue { position: absolute; left: var(--pad); bottom: 28px; display: flex; align-items: center; gap: 14px; color: #505154; font: 8px/1 monospace; letter-spacing: .14em; }
.scroll-cue i { width: 45px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue i::after { content:""; position: absolute; inset: 0; background: var(--ink); transform: translateX(-100%); animation: trace 2.4s infinite; }
@keyframes trace { 55%,100% { transform: translateX(100%); } }

.stage-title { display: flex; align-items: flex-start; gap: 22px; }
.stage-number { margin-top: 16px; color: var(--accent); font: 9px/1 monospace; }
h2 { margin: 0; font-size: clamp(64px, 11vw, 158px); line-height: .84; letter-spacing: -.065em; font-weight: 450; }
#pattern .stage-title h2 { letter-spacing: -.03em; white-space: nowrap; }
.pattern-second-t { display: inline-block; margin-left: .075em; }
.thesis { margin: 42px 0 0 clamp(45px, 5vw, 78px); color: #babbba; font-size: clamp(18px, 2.1vw, 30px); line-height: 1.35; letter-spacing: -.02em; }

.specimen {
  position: absolute;
  width: min(430px, 36vw);
  right: calc(var(--pad) + 165px);
  bottom: 10vh;
  border-top: 1px solid var(--line-hot);
}
.data-row { display: grid; grid-template-columns: 1.5fr .7fr .6fr; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); color: #57585a; font: 9px/1 monospace; letter-spacing: .08em; }
.data-row span:last-child { text-align: right; }
.data-row.active { color: var(--ink); }
.data-row.active::before { content:""; position:absolute; left:-14px; width:4px; height:4px; border-radius:50%; background:var(--accent); margin-top:1px; }

.cause-index { position: absolute; right: calc(var(--pad) + 165px); bottom: 11vh; display: grid; width: min(410px, 34vw); }
.cause-index span { padding: 18px 0; border-bottom: 1px solid var(--line); color: #3e3f41; font: 9px/1 monospace; letter-spacing: .14em; }
.cause-index .selected { color: var(--ink); border-color: var(--line-hot); }
.cause-index .selected::after { content:"ROOT CAUSE ISOLATED"; float:right; color:var(--accent); }

.system-map { margin-top: 64px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-hot); border-bottom: 1px solid var(--line-hot); }
.system-map article { min-height: 180px; padding: 22px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(15,15,17,.36); transition: background .4s, transform .4s; }
.system-map article:last-child { border-right: 0; }
.system-map article:hover { background: rgba(236,236,234,.055); transform: translateY(-6px); }
.system-map small { color: var(--accent); font: 9px/1 monospace; }
.system-map strong { margin-top: auto; font-size: clamp(18px, 2vw, 28px); font-weight: 450; letter-spacing: -.03em; }
.system-map span { margin-top: 10px; color: var(--muted); font: 8px/1 monospace; letter-spacing: .14em; }

.scene-action { min-height: 112svh; justify-content: space-between; padding-top: 18vh; }
.action-core {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 31vw);
  align-items: end;
  column-gap: clamp(32px, 6vw, 100px);
}
.action-core .eyebrow { grid-column: 1 / -1; }
.action-core h2 { font-size: clamp(84px, 9.8vw, 190px); white-space: nowrap; }
.action-dot-anchor { display: inline-block; width: .12em; height: .12em; margin-left: .055em; vertical-align: baseline; }
.action-core > p:last-child { margin: 0 0 .12em; font-size: clamp(18px, 1.8vw, 27px); color: #c2c3c0; line-height: 1.35; }
.verification { display: flex; align-items: center; gap: 14px; color: #77787a; font: 8px/1 monospace; letter-spacing: .13em; }
.verification i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-hot), var(--line)); }
footer { margin-top: 15vh; padding-top: 30px; border-top: 1px solid var(--line-hot); }
.contact-heading { display: block; }
.contact-heading > span { color: var(--accent); font: 9px/1 monospace; letter-spacing: .16em; }
.contact-heading p { margin: 0; color: #858688; font-size: clamp(14px, 1.3vw, 18px); line-height: 1.45; }
.contact-cta {
  margin-top: 46px;
  padding: 18px 0 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-hot);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  transition: padding .35s ease, border-color .35s ease;
}
.contact-cta:hover { padding-left: 14px; padding-right: 14px; border-bottom-color: var(--ink); }
.contact-cta span { color: #8a8b8d; font: 9px/1 monospace; letter-spacing: .16em; }
.contact-cta strong { display: flex; align-items: center; gap: .22em; font-size: clamp(22px, 3.3vw, 48px); font-weight: 450; letter-spacing: -.035em; }
.external-icon { width: .72em; height: .72em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; flex: 0 0 auto; }
.footer-base { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 26px; align-items: center; color: #616265; font: 8px/1.3 monospace; letter-spacing: .12em; }
.footer-base a { color: #858688; transition: color .25s; }
.footer-base a:hover { color: var(--ink); }

.legal-page { min-height: 100svh; }
.legal-shell { width: min(1120px, calc(100% - 2 * var(--pad))); margin: 0 auto; padding: 150px 0 70px; }
.legal-shell .scene-code { position: static; margin-bottom: 70px; }
.legal-shell h1 { font-size: clamp(54px, 8.2vw, 118px); line-height: .82; }
.legal-shell h1 span { display: block; font-size: .66em; letter-spacing: -.075em; white-space: nowrap; }
.legal-date { margin: 38px 0 0; color: var(--muted); font: 9px/1 monospace; letter-spacing: .14em; }
.legal-content { margin: 105px 0 0 clamp(0px, 12vw, 170px); border-top: 1px solid var(--line-hot); }
.legal-content section { display: grid; grid-template-columns: minmax(180px, .42fr) 1fr; gap: clamp(30px, 6vw, 90px); padding: 36px 0; border-bottom: 1px solid var(--line); }
.legal-content h2 { margin: 0; color: #77787a; font: 9px/1.4 monospace; letter-spacing: .14em; }
.legal-content p { margin: 0; max-width: 720px; color: #b7b8b6; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.65; }
.legal-content p a { color: var(--ink); border-bottom: 1px solid var(--line-hot); }
.legal-footer { margin-top: 100px; display: flex; justify-content: space-between; color: #656668; font: 8px/1 monospace; letter-spacing: .13em; }
.legal-footer a { color: var(--ink); }

.cursor { position: fixed; z-index: 30; width: 30px; height: 30px; border: 1px solid rgba(236,236,234,.26); border-radius: 50%; pointer-events: none; transform: translate(-50%,-50%); transition: width .2s,height .2s,border-color .2s; mix-blend-mode: difference; }
.cursor i { position: absolute; width: 2px; height: 2px; background: var(--ink); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.cursor.hot { width: 48px; height: 48px; border-color: rgba(236,236,234,.6); }

.scene .stage-title, .scene .thesis, .scene .specimen, .scene .cause-index, .scene .system-map, .scene .action-core, .scene .verification {
  opacity: .18;
  transform: translateY(35px);
  transition: opacity .9s ease, transform 1s cubic-bezier(.2,.7,.2,1);
}
.scene.in-view .stage-title, .scene.in-view .thesis, .scene.in-view .specimen, .scene.in-view .cause-index, .scene.in-view .system-map, .scene.in-view .action-core, .scene.in-view .verification {
  opacity: 1;
  transform: translateY(0);
}
.scene.in-view .thesis { transition-delay: .12s; }
.scene.in-view .specimen, .scene.in-view .cause-index, .scene.in-view .system-map, .scene.in-view .verification { transition-delay: .22s; }

@media (max-width: 900px) {
  .top-meta span:first-child, .rail { display: none; }
  .scene { padding-right: var(--pad); }
  .hero-axis, .specimen, .cause-index { right: var(--pad); }
  .hero-axis { bottom: 15vh; }
  .specimen, .cause-index { width: 42vw; }
  .system-map { grid-template-columns: 1fr; }
  .system-map article { min-height: 110px; border-right: 0; border-bottom: 1px solid var(--line); }
  .action-core { grid-template-columns: minmax(0, 1fr) minmax(230px, 34vw); column-gap: 28px; }
  .footer-base { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 62px; }
  .top-meta { display: none; }
  .top-actions { gap: 0; }
  .contact-nav { font-size: 8px; }
  .scene { min-height: 100svh; padding-top: 105px; padding-bottom: 52px; justify-content: flex-start; }
  .scene::after { inset: 62px 0 0; }
  .scene-code { top: 84px; }
  .scene-hero { justify-content: center; }
  h1 { font-size: 22vw; line-height: .8; }
  h1 span { -webkit-text-stroke-width: 1.25px; }
  .descriptor { margin-top: 30px; }
  .hero-axis { position: static; margin-top: 62px; flex-wrap: wrap; gap: 10px; }
  .scroll-cue { display: none; }
  h2 { font-size: 19vw; margin-top: 10vh; }
  .stage-number { margin-top: calc(10vh + 8px); }
  .thesis { margin-left: 0; font-size: 19px; }
  .specimen, .cause-index { position: static; width: 100%; margin-top: auto; }
  .system-map { margin-top: auto; }
  .action-core { margin-top: 12vh; display: block; }
  .action-core h2 { font-size: 24vw; }
  .action-core > p:last-child { position: static; margin-top: 36px; }
  .verification { margin-top: auto; display: grid; grid-template-columns: auto 1fr; }
  .verification i:last-of-type { display:none; }
  .scene-action { min-height: 120svh; }
  footer { margin-top: 10vh; }
  .contact-heading { grid-template-columns: 1fr; gap: 18px; }
  .contact-cta { margin-top: 34px; }
  .footer-base { grid-template-columns: 1fr; gap: 14px; }
  .legal-shell { padding-top: 110px; }
  .legal-shell .scene-code { margin-bottom: 45px; }
  .legal-content { margin: 70px 0 0; }
  .legal-content section { grid-template-columns: 1fr; gap: 18px; padding: 28px 0; }
  .legal-footer { margin-top: 70px; }
  .cursor { display: none; }
}

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