:root {
  --bg: #0a0d12;
  --fg: #ece2c7;        /* warm cream — body text, primary readout (~12:1 on bg) */
  --dim: #b3a484;       /* muted cream — smaller / secondary text (~6.5:1 on bg) */
  --accent: #e07b2a;    /* brand accent — wordmark, CTAs, places-on-the-map (nodes/floaters) */
  --globe-line: #607f47;/* olive green — cartographic wireframe (waves, graticule, arcs) */
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

@keyframes wave-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-240px); }
}

.bg-floater {
  fill: var(--accent);
  animation: float-up 45s linear infinite;
  opacity: 0;
}
@keyframes float-up {
  0%   { transform: translateY(0);      opacity: 0;   }
  8%   {                                 opacity: 0.8; }
  92%  {                                 opacity: 0.8; }
  100% { transform: translateY(-1140px); opacity: 0;   }
}

/* Ambient motion (waves drifting, node rings pulsing) runs at all times so
   the background never feels static. The play button only gates the louder
   element — the arcs drawing between nodes. */

.bg-node__dot {
  fill: var(--accent);
  opacity: 0.85;
}
.bg-node__ring {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.55;
  vector-effect: non-scaling-stroke;
  transform-origin: center;
  transform-box: fill-box;
  animation: bg-ring 2.6s ease-out infinite;
}
@keyframes bg-ring {
  from { transform: scale(0.6); stroke-opacity: 0.5; }
  to   { transform: scale(4.2); stroke-opacity: 0;   }
}

.bg-arc {
  fill: none;
  stroke: var(--globe-line);
  stroke-width: 1.2;
  stroke-opacity: 0.75;
  transition: stroke-dashoffset 1.4s ease-out, opacity 1.4s ease-out;
}
.bg-arc--draw { stroke-dashoffset: 0 !important; }
.bg-arc--fade { opacity: 0; }

main {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 2.5rem 1.5rem;
  background:
    radial-gradient(ellipse at center, rgba(10, 13, 18, 0.9) 0%, rgba(10, 13, 18, 0.6) 55%, transparent 85%);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  margin-top: 1.25rem;
}

.brand__logo {
  position: relative;
  display: block;
  width: clamp(72px, 11vw, 130px);
  aspect-ratio: 1;
  flex-shrink: 0;
  /* reset native <button> chrome */
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 50%;
}
.brand__logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.brand__logo-img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.18s ease;
}
.brand__logo:hover  .brand__logo-img { transform: scale(0.96); }
.brand__logo:active .brand__logo-img { transform: scale(0.92); }

/* Pulse echoes — translucent olive rings emanating from the dot outward,
   matching the pulse loop in Cross/logos/pulse/ but native to the SVG so
   it ships as ~zero-bytes vector animation (no video file). The keyframes
   approximate sin(π·t)^1.5 sampled every 10% — opacity peaks at ~0.5 mid-
   cycle and fades to 0 at the start/end so the loop seam is invisible. */
.brand__logo-pulse {
  stroke: #4a6e3c;
  stroke-width: 1.5;
  opacity: 0;
  animation: brand-pulse 3s linear infinite;
}
.brand__logo-pulse--echo {
  animation-delay: -1.5s; /* offset by half the cycle */
}
@keyframes brand-pulse {
  0%   { r:  5;    opacity: 0;     }
  10%  { r:  8.1;  opacity: 0.129; }
  20%  { r: 11.2;  opacity: 0.338; }
  30%  { r: 14.3;  opacity: 0.546; }
  40%  { r: 17.4;  opacity: 0.696; }
  50%  { r: 20.5;  opacity: 0.75;  }
  60%  { r: 23.6;  opacity: 0.696; }
  70%  { r: 26.7;  opacity: 0.546; }
  80%  { r: 29.8;  opacity: 0.338; }
  90%  { r: 32.9;  opacity: 0.129; }
  100% { r: 36;    opacity: 0;     }
}
@media (prefers-reduced-motion: reduce) {
  .brand__logo-pulse { animation: none; opacity: 0; }
}

.brand__title {
  font-size: clamp(2rem, 8vw, 5.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent);
  margin: 0;
}

@media (max-width: 480px) {
  .brand { flex-direction: column; gap: 1rem; }
}

.coords {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--dim);
  margin-bottom: 2rem;
  font-variant-numeric: tabular-nums;
}

/* Boot sequence — revealed after the first play click. The boot lines reuse
   the original tagline / signup-label styles, so the final layout matches
   what was there before; they just animate in via the typewriter. The
   status flash and line 1 share a grid cell so swapping them in causes no
   vertical shift. */
.boot {
  margin-top: 1.5rem;
  display: grid;
  justify-items: center;
}
.boot__status,
.boot__line[data-line="1"] {
  grid-area: 1 / 1;
}

.boot__status {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  /* Compensate for the trailing letter-spacing after the last char so the
     visible text centers on the box center (not 0.2em to the left of it). */
  padding-left: 0.4em;
  color: var(--dim);
  margin: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.boot__status.is-shown {
  opacity: 1;
}
.boot__status.is-thinking {
  animation: boot-pulse 0.95s ease-in-out infinite;
}
@keyframes boot-pulse {
  0%, 100% { opacity: 1;    }
  50%      { opacity: 0.45; }
}

/* Line 1 inherits the look of the old .tagline. */
.boot__line[data-line="1"] {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  padding-left: 0.4em; /* offsets trailing letter-spacing so text centers on box center */
  color: var(--dim);
  margin: 0;
}

/* Line 2 inherits the look of the old .signup__label, lives inside .signup
   so it lines up exactly with the input + button row. */
.signup__label {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  padding-left: 0.25em; /* offsets trailing letter-spacing so text centers on box center */
  color: var(--dim);
  margin: 0 0 0.75rem;
}

.boot__line {
  visibility: hidden;
}
.boot__line.is-shown { visibility: visible; }

.boot__cursor {
  display: inline-block;
  width: 0.55ch;
  height: 1em;
  background: currentColor;
  vertical-align: text-bottom;
  margin-left: 2px;
  visibility: hidden;
  animation: boot-blink 0.95s step-end infinite;
}
.boot__line.is-typing .boot__cursor { visibility: visible; }
@keyframes boot-blink {
  0%, 50%      { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* The 3 dots after "Coming soon" pulse slowly forever once typed. */
.boot__line[data-line="1"].is-done .boot__dots {
  animation: boot-dots 1.7s ease-in-out infinite;
}
@keyframes boot-dots {
  0%, 100% { opacity: 1;   }
  50%      { opacity: 0.2; }
}

/* Form is laid out from the start so vertical spacing matches the original;
   only the input row is gated by the boot sequence. */
.signup {
  margin: 2.5rem auto 0;
  max-width: 26rem;
  width: 100%;
}

.signup__row {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.signup__row.is-shown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Once submitted, the row + label fade out and the only thing left is the
   "Thanks" message — prevents repeat submissions. */
.signup.is-submitted .signup__row,
.signup.is-submitted .signup__label {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.signup__row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.signup input {
  flex: 0 1 14rem;
  min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fg);
  padding: 0.75rem 1.1rem;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 999px;
  text-align: center;
  transition: border-color 0.15s ease;
}
.signup input::placeholder { color: var(--dim); }
.signup input:focus {
  outline: none;
  border-color: var(--accent);
}

.signup button {
  background: var(--accent);
  color: #0a0d12;
  border: none;
  padding: 0.75rem 1.4rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: filter 0.15s ease;
}
.signup button:hover { filter: brightness(1.08); }
.signup button:active { filter: brightness(0.95); }

.signup__msg {
  min-height: 1.2em;
  margin-top: 0.75rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--dim);
}
.signup__msg[data-tone="error"] { color: var(--accent); }
.signup__msg[data-tone="ok"]    { color: var(--fg); }

/* "Share a place" prompt — fades in after the signup row reveals.
   Prose-styled (not the uppercase tracked look of the boot lines), since
   it's a longer sentence with an inline mailto link. */
.share {
  margin: 1.75rem auto 0;
  max-width: 26rem;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--dim);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.share.is-shown {
  opacity: 1;
  transform: translateY(0);
}
.share a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(224, 123, 42, 0.4);
  transition: border-color 0.15s ease;
}
.share a:hover,
.share a:focus-visible {
  border-bottom-color: var(--accent);
  outline: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .coords { transition: none; }
  .bg-node__ring { animation: none; opacity: 0.4; }
}
