:root {
  --bg: #050816;
  --ink: #f2f6ff;
  --muted: #c2cbdf;
  --line: rgba(232, 238, 252, 0.12);
  --blue: #4d8dff;
  --cyan: #9ad8ff;
  --violet: #6b5cff;
  --pad: 16px;
  --nav: 64px;
  --font: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (hover: none), (pointer: coarse) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(120% 80% at 50% 20%, #0a1230 0%, var(--bg) 55%, #03050f 100%);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

#fieldCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}
html[data-webgl="off"] #fieldCanvas { display: none; }
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
@media (max-width: 767px) {
  .grain { opacity: 0.02; }
}

main, .foot { position: relative; z-index: 5; }

.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav);
  padding: 12px var(--pad);
  padding-top: max(12px, env(safe-area-inset-top));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 28, 0.55);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.mark {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  box-shadow: inset 0 0 0 3px rgba(77, 141, 255, 0.25), 0 0 10px rgba(77, 141, 255, 0.35);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  clip-path: polygon(50% 8%, 92% 88%, 8% 88%);
  background: var(--blue);
}
.links {
  display: none;
  gap: 18px;
  margin-left: 8px;
  padding: 0 16px;
  min-height: 40px;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 28, 0.45);
  backdrop-filter: blur(10px);
}
.links a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d7deef;
}
.links a:hover,
.links a:focus-visible { color: #fff; }
.cta, .send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #3d7bff, #6b5cff);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(77, 141, 255, 0.35);
  white-space: nowrap;
}
.cta { margin-left: auto; }
.menu-btn {
  width: 44px; height: 44px;
  margin-left: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 28, 0.55);
  color: var(--ink);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.menu-btn span { display: block; width: 14px; height: 1.5px; background: currentColor; }
body.nav-open .links {
  display: flex;
  flex-direction: column;
  position: absolute;
  left: var(--pad); right: var(--pad);
  top: calc(100% + 4px);
  gap: 0;
  padding: 8px 14px 12px;
  border-radius: 16px;
  align-items: stretch;
}
body.nav-open .links a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.story {
  position: relative;
}
.scene {
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: calc(var(--nav) + 24px) var(--pad) 48px;
  position: relative;
  overflow-x: clip;
}
#signal {
  align-content: start;
  padding-top: calc(var(--nav) + 18vh);
}
#core .scene-copy {
  margin-top: 8vh;
}
.scene-copy {
  position: relative;
  z-index: 5;
  width: min(720px, 100%);
  text-align: center;
  --show: 1;
  opacity: 1;
  transform: translate3d(0, calc((1 - var(--show)) * 10px), 0);
  will-change: transform;
}
.scene-copy::before {
  content: "";
  position: absolute;
  inset: -28% -10%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(5, 8, 22, 0.78) 0%,
    rgba(5, 8, 22, 0.42) 42%,
    rgba(5, 8, 22, 0) 72%
  );
}
.line {
  margin: 0;
  font-size: clamp(1.875rem, 8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
  color: #f5f8ff;
  text-shadow:
    0 1px 2px rgba(5, 8, 22, 0.95),
    0 0 22px rgba(5, 8, 22, 0.75);
}
.line span { color: #dce3f4; font-weight: 500; }
.sub {
  margin: 14px auto 0;
  max-width: 42ch;
  color: #c8d1e6;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  text-shadow: 0 1px 14px rgba(5, 8, 22, 0.85);
}
.orbit-meta {
  position: absolute;
  left: 50%;
  bottom: 14vh;
  z-index: 5;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c5cee3;
  opacity: 1;
  text-shadow: 0 1px 10px rgba(5, 8, 22, 0.9);
}
.orbit-meta i {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}

.side-labels {
  position: absolute;
  inset: calc(var(--nav) + 40px) var(--pad) auto;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  pointer-events: none;
  max-width: 1100px;
  width: calc(100% - 2 * var(--pad));
  margin: 0 auto;
  left: 0; right: 0;
}
.side-labels p {
  margin: 0;
  display: grid;
  gap: 4px;
  justify-items: start;
  max-width: 14ch;
  text-shadow: 0 1px 12px rgba(5, 8, 22, 0.9);
}
.side-labels .right { justify-self: end; justify-items: end; text-align: right; }
.side-labels b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #eef3ff;
}
.side-labels span {
  font-size: 12px;
  color: #c5cee3;
  letter-spacing: 0.02em;
  font-weight: 400;
}

.scene-close .close-form {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.close-form input {
  min-height: 48px;
  flex: 1 1 140px;
  max-width: 220px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 32, 0.75);
  color: var(--ink);
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
}
.send {
  width: 48px;
  min-width: 48px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
}
.form-note, .form-error, .form-ok { margin: 12px 0 0; font-size: 14px; }
.form-note { color: #c5cee3; }
.form-error { color: #ffb4a8; }
.form-ok { color: #b7e3c4; }

.foot {
  display: grid;
  gap: 12px;
  padding: 28px var(--pad) max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(3, 5, 15, 0.65);
}
.foot .brand { background: transparent; border: 0; padding: 0; min-height: 0; width: fit-content; }
.foot p { margin: 0; color: #c5cee3; font-size: 14px; line-height: 1.5; }

.panel[hidden] { display: none; }
.panel {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(3, 5, 15, 0.72);
  display: grid; place-items: end center;
  padding: 16px;
}
.panel form {
  width: min(420px, 100%);
  background: #0b1024;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  display: grid; gap: 12px;
}
.panel h2 { margin: 0; font-size: 24px; font-weight: 560; letter-spacing: -0.02em; }
.panel p { margin: 0; color: var(--muted); font-size: 14px; }
.panel label { display: grid; gap: 6px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.panel input {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: #080d1c; color: var(--ink); padding: 0 14px; font: inherit; font-size: 16px;
}
.form-row { display: flex; gap: 12px; align-items: center; }
.text-btn {
  background: none; border: 0; color: var(--muted); min-height: 44px; font: inherit; font-size: 14px; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene-copy,
  .js .scene-copy {
    --show: 1 !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .grain { display: none; }
}

@media (min-width: 390px) { :root { --pad: 18px; } }
@media (min-width: 414px) { :root { --pad: 20px; } }
@media (min-width: 768px) {
  :root { --pad: 24px; --nav: 72px; }
  .line { font-size: clamp(2.375rem, 4vw, 2.75rem); line-height: 1.1; letter-spacing: -0.022em; }
  .sub { font-size: 16px; line-height: 1.6; }
  .scene { min-height: 100svh; padding-top: calc(var(--nav) + 32px); padding-bottom: 56px; }
  #signal { padding-top: calc(var(--nav) + 14vh); }
  .side-labels { inset: calc(var(--nav) + 56px) 6vw auto; }
  .orbit-meta { font-size: 12px; }
  .foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
  }
}
@media (min-width: 820px) {
  :root { --pad: 28px; }
  .line { font-size: clamp(2.5rem, 3.8vw, 2.875rem); }
  .scene { min-height: 105svh; }
}
@media (min-width: 981px) {
  :root { --pad: 32px; }
  .menu-btn { display: none; }
  .links { display: flex; }
  .line { font-size: clamp(28px, 2.8vw, 48px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.12; }
  .scene { min-height: 120svh; }
  .scene-close { min-height: 100svh; }
  #signal { padding-top: calc(var(--nav) + 18vh); align-content: start; }
  #core .scene-copy { margin-top: 0; }
}
@media (min-width: 1100px) {
  :root { --pad: 40px; }
}
@media (max-width: 767px) {
  .scene {
    min-height: 92svh;
    min-height: 92dvh;
    padding-top: calc(var(--nav) + 20px);
    padding-bottom: 40px;
  }
  #signal {
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: calc(var(--nav) + 10vh);
    align-content: start;
  }
  #signal .scene-copy { max-width: 34ch; }
  #orbit .scene-copy { align-self: start; margin-top: 6vh; }
  #core {
    align-content: start;
    padding-top: calc(var(--nav) + 16px);
  }
  #core .scene-copy { margin-top: 12px; }
  .scene-close { min-height: 100svh; min-height: 100dvh; }
  .side-labels {
    position: relative;
    inset: auto;
    margin: 0 auto 16px;
    width: 100%;
    max-width: 360px;
    gap: 12px 16px;
  }
  .orbit-meta {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 20px auto 0;
    justify-content: center;
  }
  .cta { padding: 0 14px; font-size: 14px; font-weight: 600; min-height: 44px; }
  .sub { font-size: 15px; line-height: 1.55; }
  .line { font-size: clamp(1.875rem, 7.2vw, 2.25rem); font-weight: 600; line-height: 1.12; }
  .brand { min-height: 44px; }
}
@media (max-width: 430px) and (min-width: 360px) {
  .line { font-size: clamp(2rem, 8vw, 2.25rem); }
}
@media (max-width: 359px) {
  :root { --pad: 16px; }
  .line { font-size: 1.875rem; line-height: 1.12; }
  .brand { font-size: 12px; padding-right: 10px; }
  .cta { font-size: 13px; }
  .cta span { display: none; }
  .scene { min-height: 88svh; }
}
@media (max-width: 980px) and (orientation: landscape) and (max-height: 500px) {
  .scene {
    min-height: 120svh;
    padding-top: calc(var(--nav) + 12px);
    padding-bottom: 28px;
  }
  #signal { padding-top: calc(var(--nav) + 8px); }
  .side-labels { display: none; }
  .orbit-meta { display: none; }
}
