@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600&family=Source+Sans+3:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --bg: #161826;
  --surface: #232532;
  --text: #e9e9ed;
  --muted: #b2b6ca;
  --quiet: #75798c;
  --line: #3f424d;
  --accent: #5ab6bf;
  --accent-soft: #b3e4e9;
  --accent-deep: #18333a;
  --font-heading: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.page-shell {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  overflow: hidden;
  padding: clamp(28px, 4.4vw, 60px) clamp(24px, 6vw, 88px);
}

.ambient {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  pointer-events: none;
}

.ambient-top {
  top: -390px;
  right: -180px;
  width: 900px;
  height: 650px;
  background: color-mix(in srgb, var(--accent-deep) 60%, transparent);
  filter: blur(120px);
}

.ambient-bottom {
  bottom: -410px;
  left: -250px;
  width: 800px;
  height: 650px;
  background: rgba(0, 0, 0, .28);
  filter: blur(100px);
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .02em;
}

.brand-mark {
  width: 7px;
  height: 7px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(90, 182, 191, .2);
}

.hero {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin-block: auto;
}

h1 {
  max-width: 20ch;
  margin: 0 0 0 -.05em;
  font-family: var(--font-heading);
  font-size: clamp(38px, 5.8vw, 70px);
  font-weight: 500;
  letter-spacing: -.028em;
  line-height: 1.08;
}

.intro {
  max-width: 54ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
  text-wrap: pretty;
}

.waitlist {
  display: flex;
  width: min(660px, 100%);
  margin-top: 40px;
  flex-direction: column;
  gap: 16px;
}

.waitlist[hidden] { display: none; }

.signup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

#email {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--text);
  caret-color: var(--accent);
  background: rgba(35, 37, 50, .9);
  border: 1px solid rgba(233, 233, 237, .16);
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

#email::placeholder { color: var(--quiet); }
#email:hover { border-color: rgba(233, 233, 237, .36); }
#email:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(90, 182, 191, .14); }
#email[aria-invalid="true"] { border-color: #d88f91; }

button {
  min-height: 44px;
  padding: 8px 18px;
  font-family: var(--font-heading);
  color: var(--accent-soft);
  white-space: nowrap;
  background: rgba(90, 182, 191, .02);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
}

button:hover { color: var(--text); background: rgba(90, 182, 191, .11); }
button:active { transform: translateY(1px); background: rgba(90, 182, 191, .18); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }

.role-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.role-label { color: var(--quiet); font-size: 13px; }

.role-options {
  display: inline-flex;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(233, 233, 237, .16);
  border-radius: 8px;
}

.role-options label { cursor: pointer; }
.role-options label + label { border-left: 1px solid rgba(233, 233, 237, .16); }
.role-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.role-options span {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.role-options label:hover span { background: rgba(233, 233, 237, .06); }
.role-options input:checked + span { color: var(--accent-soft); background: rgba(90, 182, 191, .08); box-shadow: inset 0 0 0 1px var(--accent); }
.role-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.form-error {
  min-height: 20px;
  margin: -6px 0 0;
  color: #e4a8aa;
  font-size: 13px;
}

.success {
  display: flex;
  min-height: 92px;
  margin-top: 40px;
  align-items: baseline;
  gap: 12px;
}

.success[hidden] { display: none; }
.success span { width: 28px; height: 1px; flex: none; background: var(--accent); transform: translateY(-5px); }
.success p { max-width: 42ch; margin: 0; color: var(--accent-soft); font-size: 17px; line-height: 1.6; }

.route-map {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 58%;
  overflow: visible;
  opacity: .72;
  pointer-events: none;
}

.route-layer,
.route-flows,
.cargo-lights {
  transition: transform 700ms cubic-bezier(.2, .8, .2, 1);
  transform-box: fill-box;
  transform-origin: center;
}

.route-layer-far,
.route-flows-far,
.cargo-lights-far { transform: translate(var(--route-x-far, 0), var(--route-y-far, 0)); }
.route-layer-near,
.route-flows-near,
.cargo-lights-near { transform: translate(var(--route-x, 0), var(--route-y, 0)); }

.route-layer path {
  fill: none;
  stroke: rgba(117, 121, 140, .2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.route-layer-near path { stroke: rgba(90, 182, 191, .22); }

.route-flows use {
  fill: none;
  stroke: rgba(179, 228, 233, .6);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1 24;
  vector-effect: non-scaling-stroke;
  animation: route-flow 1.8s linear infinite;
}

.route-flows use:nth-child(even) {
  stroke: rgba(178, 182, 202, .38);
  animation-duration: 2.6s;
  animation-direction: reverse;
}

.cargo-lights circle {
  fill: var(--accent-soft);
  stroke: rgba(179, 228, 233, .22);
  stroke-width: 8;
  paint-order: stroke;
}

.route-cursor {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 182, 191, .09), rgba(90, 182, 191, 0) 68%);
  pointer-events: none;
  transform: translate(calc(var(--cursor-x, -500px) - 50%), calc(var(--cursor-y, -500px) - 50%));
  transition: opacity 250ms ease;
}

.page-shell:hover .route-cursor { opacity: 1; }

@keyframes route-flow { to { stroke-dashoffset: -50; } }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .page-shell { min-height: 100svh; gap: 36px; }
  h1 { font-size: clamp(38px, 12vw, 56px); }
  .intro { font-size: 15.5px; }
  .signup-row { grid-template-columns: 1fr; }
  button { width: 100%; }
  .role-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .role-options { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
  .role-options label { text-align: center; }
  .role-options label + label { border-left: 0; }
  .role-options label:nth-child(even) { border-left: 1px solid rgba(233, 233, 237, .16); }
  .role-options label:nth-child(n + 3) { border-top: 1px solid rgba(233, 233, 237, .16); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .route-map { opacity: .52; }
  .route-flows use { animation-duration: 6s !important; animation-iteration-count: infinite !important; }
  .cargo-lights { opacity: .5; }
}
