:root {
  color-scheme: dark;
  --bg: #050811;
  --panel: rgba(13, 19, 37, 0.78);
  --panel-strong: #0d1325;
  --line: rgba(144, 168, 214, 0.18);
  --text: #f7f9ff;
  --muted: #9aa9c7;
  --cyan: #20d9ff;
  --blue: #3488ff;
  --violet: #9b5cff;
  --orange: #ff9a45;
  --green: #37e7a0;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 10%, rgba(93, 53, 255, 0.16), transparent 28rem),
    radial-gradient(circle at 20% 18%, rgba(0, 185, 255, 0.09), transparent 24rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(121, 148, 202, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 148, 202, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a { color: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

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

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: #00131a;
  background: var(--cyan);
  border-radius: 0.6rem;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(32, 217, 255, 0.55);
  border-radius: 0.55rem;
  background: rgba(32, 217, 255, 0.08);
  box-shadow: inset 0 0 20px rgba(32, 217, 255, 0.1);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

nav { display: flex; gap: 1.4rem; }

nav a,
footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover,
footer a:hover { color: var(--cyan); }

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  min-height: 690px;
  align-items: center;
  gap: 4rem;
  padding: 5.5rem 0 4.5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pulse {
  display: inline-block;
  width: 0.52rem;
  height: 0.52rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(55, 231, 160, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(55, 231, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(55, 231, 160, 0); }
}

h1,
h2,
h3,
p { text-wrap: balance; }

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.4rem, 7.7vw, 6.9rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

h1 span {
  color: transparent;
  background: linear-gradient(90deg, var(--cyan), var(--blue) 45%, var(--violet));
  background-clip: text;
}

.lede {
  max-width: 650px;
  margin: 2rem 0 0;
  color: #bbc7df;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.button:hover { transform: translateY(-2px); }

.button.primary {
  color: #00121a;
  border-color: transparent;
  background: linear-gradient(120deg, var(--cyan), #70f1ff);
  box-shadow: 0 12px 35px rgba(32, 217, 255, 0.18);
}

.button.secondary { background: rgba(255, 255, 255, 0.035); }
.button.secondary:hover { border-color: rgba(32, 217, 255, 0.55); }

.proof-list {
  display: flex;
  gap: 2.6rem;
  margin: 3.4rem 0 0;
  padding: 0;
  list-style: none;
}

.proof-list li { display: grid; gap: 0.1rem; }
.proof-list strong { font-size: 1.35rem; }
.proof-list span { color: var(--muted); font-size: 0.75rem; }

.hero-visual {
  position: relative;
  display: grid;
  min-height: 510px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background:
    linear-gradient(145deg, rgba(32, 217, 255, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(155, 92, 255, 0.12), transparent 45%),
    rgba(8, 13, 27, 0.7);
  box-shadow: var(--shadow);
}

.hero-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(255, 255, 255, 0.018) 6px);
  pointer-events: none;
}

.radar {
  position: relative;
  display: grid;
  width: min(72vw, 365px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(32, 217, 255, 0.35);
  border-radius: 50%;
  background:
    linear-gradient(rgba(32, 217, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 217, 255, 0.22) 1px, transparent 1px),
    radial-gradient(circle, rgba(32, 217, 255, 0.08), transparent 65%);
  background-size: 50% 50%;
  box-shadow: 0 0 80px rgba(39, 107, 255, 0.18);
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(32, 217, 255, 0.25);
  border-radius: 50%;
}

.ring-one { inset: 16%; }
.ring-two { inset: 31%; }
.ring-three { inset: 43%; }

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 285deg, rgba(32, 217, 255, 0.42) 348deg, transparent 360deg);
  animation: scan 5s linear infinite;
}

@keyframes scan { to { transform: rotate(360deg); } }

.radar-core {
  z-index: 1;
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border: 1px solid rgba(255, 154, 69, 0.8);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 154, 69, 0.12);
  box-shadow: 0 0 35px rgba(255, 154, 69, 0.32), inset 0 0 25px rgba(255, 154, 69, 0.18);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.safety-chip {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  left: 1.2rem;
  z-index: 2;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
  color: #c9ffe8;
  border: 1px solid rgba(55, 231, 160, 0.3);
  border-radius: 0.75rem;
  background: rgba(7, 30, 28, 0.88);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lab { padding: 7rem 0; scroll-margin-top: 1rem; }

.section-heading {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

h2 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.section-heading > p,
.boundary p,
.cta > p { color: var(--muted); }

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.control {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  font-weight: 750;
}

.control:hover,
.control.active { color: var(--text); border-color: rgba(32, 217, 255, 0.52); }
.control.active { background: rgba(32, 217, 255, 0.07); }
.control.reset { margin-left: auto; }

.control-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; }
.control-dot.danger { background: var(--orange); box-shadow: 0 0 12px rgba(255, 154, 69, 0.7); }
.control-dot.safe { background: var(--green); box-shadow: 0 0 12px rgba(55, 231, 160, 0.7); }

.lab-grid {
  display: grid;
  grid-template-columns: 1.14fr 0.86fr;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.chain-panel,
.result-panel { padding: 1.35rem; }
.chain-panel { border-right: 1px solid var(--line); }

.chain-header,
.result-topline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.event-chain { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }

.event-button {
  display: grid;
  width: 100%;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.025);
  transition: opacity 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.event-button:hover { border-color: rgba(32, 217, 255, 0.45); transform: translateX(3px); }
.event-button.disabled { opacity: 0.35; border-style: dashed; }

.event-number {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(32, 217, 255, 0.28);
  border-radius: 50%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 900;
}

.event-label { display: grid; gap: 0.12rem; }
.event-label strong { font-size: 0.94rem; }
.event-label span { color: var(--muted); font-size: 0.76rem; }

.event-state {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.65rem;
  font-weight: 900;
}

.disabled .event-state { color: var(--muted); }

.interaction-hint { margin: 1rem 0 0; color: var(--muted); font-size: 0.75rem; text-align: center; }

.result-panel { min-width: 0; background: rgba(4, 8, 18, 0.4); }
.live-label { color: var(--green); }
.live-label .pulse { width: 0.4rem; height: 0.4rem; margin-right: 0.25rem; }

.result-card {
  display: grid;
  justify-items: center;
  padding: 2.4rem 1.2rem;
  text-align: center;
  border: 1px solid rgba(255, 154, 69, 0.25);
  border-radius: 1rem;
  background: radial-gradient(circle at 50% 20%, rgba(255, 154, 69, 0.13), transparent 60%);
}

.result-card.clear {
  border-color: rgba(55, 231, 160, 0.25);
  background: radial-gradient(circle at 50% 20%, rgba(55, 231, 160, 0.12), transparent 60%);
}

.result-icon {
  display: grid;
  width: 4.2rem;
  height: 4.2rem;
  place-items: center;
  margin-bottom: 1rem;
  color: var(--orange);
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255, 154, 69, 0.2);
  font-size: 2rem;
  font-weight: 900;
}

.clear .result-icon { color: var(--green); box-shadow: 0 0 30px rgba(55, 231, 160, 0.18); }
.result-kicker { margin: 0; color: var(--orange); font: 800 0.68rem ui-monospace, monospace; letter-spacing: 0.12em; }
.clear .result-kicker { color: var(--green); }
.result-card h3 { margin: 0.35rem 0 0.6rem; font-size: 1.35rem; }
.result-card p:last-child { max-width: 400px; margin: 0; color: var(--muted); font-size: 0.85rem; }

.evidence { display: grid; gap: 0; margin: 1rem 0 0; }
.evidence div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.evidence dt { color: var(--muted); font-size: 0.76rem; }
.evidence dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; text-align: right; }

.json-toggle {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
}

.json-toggle:hover { color: var(--text); border-color: rgba(32, 217, 255, 0.45); }
.json-output { max-height: 300px; margin: 0.75rem 0 0; padding: 1rem; overflow: auto; color: #b9eaff; border: 1px solid var(--line); border-radius: 0.65rem; background: #03060d; font-size: 0.68rem; white-space: pre-wrap; }

.boundary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  margin: 2rem 0 8rem;
  padding: 2rem;
  border: 1px solid rgba(55, 231, 160, 0.22);
  border-radius: 1.2rem;
  background: rgba(55, 231, 160, 0.035);
}

.boundary-icon {
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  color: var(--green);
  border: 1px solid rgba(55, 231, 160, 0.35);
  border-radius: 1rem;
  font-size: 2rem;
}

.boundary h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
.boundary p:last-child { max-width: 820px; margin-bottom: 0; }

.cta {
  padding: 6rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle, rgba(64, 92, 255, 0.1), transparent 58%);
}

.cta > p { margin-inline: auto; max-width: 650px; }
.centered { justify-content: center; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 4rem; }
  .hero-visual { min-height: 440px; }
  .section-heading { grid-template-columns: 1fr; gap: 0.8rem; }
  .lab-grid { grid-template-columns: 1fr; }
  .chain-panel { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .site-header nav a:first-child { display: none; }
  .hero { min-height: auto; padding-top: 3rem; }
  h1 { font-size: clamp(3.1rem, 17vw, 5rem); }
  .proof-list { gap: 1.4rem; }
  .proof-list span { max-width: 6.5rem; }
  .hero-visual { min-height: 380px; }
  .control-bar { display: grid; grid-template-columns: 1fr; }
  .control.reset { margin-left: 0; }
  .event-button { grid-template-columns: auto 1fr; }
  .event-state { grid-column: 2; }
  .boundary { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

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