/* OpenOutposts — night cartography.
   One world: slate-charcoal terrain, mint-teal outpost lights, a cartographic
   serif for the voice, mono strictly for machine data. */

@font-face {
  font-family: "Gambarino";
  src: url("/assets/fonts/gambarino-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #15191e;
  --bg-top: #1a2129;
  --bg-deep: #10151a;
  --ink: #f0f3f3;
  --ink-dim: #9fabb3;
  --ink-faint: #78838e;
  --accent: #93d2cc;
  --accent-soft: #a5ddd8;
  --display: "Gambarino", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

::selection { background: var(--accent); color: #404c5c; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 34%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

/* Grain on the substrate, behind all content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: .5rem .9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: .4rem;
  text-decoration: none;
  transition: top .15s ease;
}
.skip:focus-visible { top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- top bar ---- */

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
  max-width: 110rem;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 22px;
  height: 22px;
  stroke: var(--ink-dim);
  fill: var(--accent);
}
.brand-mark path { stroke-width: 1.3; fill: none; }
.brand-name {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: .01em;
}

.top-mail {
  color: var(--ink-faint);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s ease;
}
.top-mail:hover, .top-mail:focus-visible { color: var(--ink-dim); }

/* ---- hero ---- */

.hero {
  position: relative;
  min-height: min(100svh, 72rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(52rem, calc(100% - 2.5rem));
  margin-inline: auto;
  padding-top: clamp(5.5rem, 14vh, 10rem);
  padding-bottom: 2rem;
  text-align: center;
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.06;
  letter-spacing: -0.005em;
}
h1 em {
  font-style: normal;
  color: var(--accent-soft);
}

.lede {
  margin: 1.4rem auto 0;
  max-width: 36rem;
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.35vw, 1.125rem);
  text-wrap: pretty;
}

/* ---- waitlist form: a measured line, not a pill ---- */

.waitlist {
  margin: 2.6rem auto 0;
  width: min(30rem, 100%);
}

.field {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: .75rem;
  padding-bottom: .65rem;
}
/* Baseline: rounded caps, with small survey ticks at each end. */
.field::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  transition: background-color .2s ease;
}
.field::before,
.field .tick {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
  transition: background-color .2s ease;
}
.field::before { left: 0; }
.field .tick { right: 0; }
.field:focus-within::after,
.field:focus-within::before,
.field:focus-within .tick {
  background: color-mix(in srgb, var(--accent) 70%, transparent);
}

.field input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  padding: .55rem .1rem;
}
.field input::placeholder { color: var(--ink-faint); }

.join-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-family: var(--body);
  font-size: .98rem;
  font-weight: 500;
  padding: .55rem .15rem;
  transition: color .15s ease;
}
.join-btn:hover { color: var(--accent-soft); }
.join-btn:focus-visible,
.field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.join-btn:disabled { color: var(--ink-faint); cursor: default; }
.join-arrow {
  width: 13px;
  height: 13px;
  transition: transform .18s ease;
}
.join-btn:hover:not(:disabled) .join-arrow { transform: translate(2px, -2px); }

.form-note {
  margin-top: .8rem;
  font-size: .875rem;
  color: var(--ink-faint);
  min-height: 1.4em;
  transition: color .2s ease;
}
.form-note.ok { color: var(--accent-soft); }
.form-note.err { color: #dd9484; }

/* ---- the scene (WebGL layer; SVG below is the fallback) ---- */

.scene3d {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(58vh, 620px);
  z-index: 1;
  overflow: hidden;
}
.scene3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .9s ease;
}
.scene3d canvas.on { opacity: 1; }
.lbl3d {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--ink-faint);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .3s ease;
}
body:not(.gl) .scene3d { display: none; }
body.gl .scene { visibility: hidden; }

.scene {
  margin-top: auto;
  align-self: center;
  flex-shrink: 0;
  height: clamp(280px, 46vh, 620px);
  aspect-ratio: 1440 / 620;
  width: auto;
  max-width: none;
  display: block;
}

.scene .lbl {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 420;
  fill: var(--ink-faint);
  letter-spacing: .04em;
}
.gateway .lbl { fill: var(--ink-dim); }

.op-ring {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: .35;
  stroke-width: 1;
}
.op-dot { fill: var(--accent); }

/* Lights breathe gently; nothing is hidden behind the motion. */
@media (prefers-reduced-motion: no-preference) {
  .op-dot {
    animation: breathe 5.2s ease-in-out infinite;
  }
  .op-b2 { animation-delay: 1.1s; }
  .op-b3 { animation-delay: 2.3s; }
  .op-b4 { animation-delay: 3.2s; }
  .op-b5 { animation-delay: 4.3s; }
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse { display: none; }
}

/* ---- about ---- */

.about {
  width: min(37rem, calc(100% - 2.5rem));
  margin: clamp(5rem, 12vh, 8rem) auto;
  text-align: center;
}
.about-mark {
  width: 20px;
  height: 20px;
  stroke: var(--ink-faint);
  fill: var(--accent);
  margin-bottom: 1.3rem;
}
.about-mark path { stroke-width: 1.3; fill: none; }
.about p {
  color: var(--ink-dim);
  font-size: 1.02rem;
  text-wrap: pretty;
}

/* ---- footer ---- */

.foot {
  overflow: hidden;
  padding-top: 2rem;
}
.foot-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 0 1.25rem 2.6rem;
  text-align: center;
}
.foot-row a {
  color: var(--accent-soft);
  text-decoration: none;
  font-size: .95rem;
  transition: color .15s ease;
}
.foot-row a:hover, .foot-row a:focus-visible { color: var(--accent); }
.foot-row p {
  color: var(--ink-faint);
  font-size: .82rem;
}
.foot-links {
  display: inline-flex;
  align-items: baseline;
  gap: .6rem;
  color: var(--ink-faint);
}

.foot-mark {
  font-family: var(--display);
  font-size: clamp(4rem, 12.5vw, 12rem);
  line-height: 1;
  text-align: center;
  color: #1e252d;
  letter-spacing: .005em;
  white-space: nowrap;
  transform: translateY(.22em);
  padding-top: .05em;
  user-select: none;
}

/* ---- small screens ---- */

@media (max-width: 720px) {
  .top-mail { display: none; }
  .scene { height: clamp(230px, 34vh, 340px); }
  .scene .lbl { font-size: 21px; }
  .gateway .lbl, .op-3 .lbl { display: none; }
  .hero-copy { padding-top: 6rem; }
  h1 { font-size: clamp(2rem, 9.4vw, 2.5rem); }
  h1 br { display: none; }
  .field { flex-direction: column; align-items: stretch; gap: .2rem; padding-bottom: 0; }
  .field::after, .field::before, .field .tick { display: none; }
  .field input {
    border-bottom: 2px solid color-mix(in srgb, var(--ink) 26%, transparent);
    padding-bottom: .6rem;
    transition: border-color .2s ease;
  }
  .field input:focus { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
  .join-btn { justify-content: center; padding-top: 1rem; }
}
