/* ============================================================
   SCUUPR — landing
   Monochrome canvas. The signal is the only color.
   ============================================================ */

:root {
  --ink: #0a0a0b;          /* near-black canvas */
  --ink-2: #121214;        /* raised panel */
  --bone: #f4f2ec;         /* primary text */
  --noise: #8a8a86;        /* muted / secondary */
  --noise-dim: #4a4a48;    /* faint lines, borders */
  --signal: #5fc6c7;       /* THE accent — Scuupr brand teal */
  --signal-dim: rgba(95, 198, 199, 0.16);

  --font-display: "Hanken Grotesk", system-ui, sans-serif;
  --font-head: "Young Serif", Georgia, serif;  /* big editorial headlines */
  --font-serif: "Fraunces", Georgia, serif;     /* the Scuupr. wordmark (matches logo) */
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1200px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1); /* expo-ish */
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.serif {
  font-family: var(--font-head); font-weight: 400; letter-spacing: -0.005em;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 400;
}

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

/* ---------- ambient layers ---------- */
#signal-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* fine film grain over everything */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: 0.5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' 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");
}

/* ---------- the signal dot ---------- */
.dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 0.6em;
  border-radius: 50%; background: var(--signal); vertical-align: middle;
  box-shadow: 0 0 8px 1px var(--signal-dim);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

/* ---------- HUD: corner brackets ---------- */
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.hud__corner { position: absolute; width: 14px; height: 14px; border: 1px solid var(--noise-dim); opacity: 0.7; }
.hud__corner--tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.hud__corner--tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.hud__corner--bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.hud__corner--br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }

/* ---------- HUD: hero telemetry + coordinate readouts ---------- */
.hero__telemetry, .hero__coord {
  position: absolute; bottom: clamp(1.4rem, 4vh, 2.4rem);
  color: var(--noise); font-size: 0.62rem; letter-spacing: 0.16em;
  display: inline-flex; align-items: center; gap: 0.55em; white-space: nowrap;
}
.hero__telemetry { left: clamp(1.4rem, 4vw, 3rem); }
.hero__telemetry .dot { margin: 0; }
.hero__telemetry [data-telemetry] { color: var(--signal); }
.hero__telemetry .sep { color: var(--noise-dim); }
.hero__coord { right: clamp(1.4rem, 4vw, 3rem); color: var(--noise-dim); }

/* ---------- layout shells ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1.1rem, 2.5vw, 1.8rem) var(--pad);
  mix-blend-mode: difference; /* stays legible over canvas */
}
.wordmark {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 1.6rem; letter-spacing: 0; color: var(--bone);
  display: inline-flex; align-items: center; gap: 0.42em; line-height: 1;
}
.wordmark__text { position: relative; top: 0.04em; }
.wordmark__text em { font-style: normal; color: var(--signal); }
.wordmark .mark { width: 26px; height: 26px; overflow: visible; color: var(--bone); flex-shrink: 0; }
.wordmark .mark__wave { stroke: var(--signal); filter: drop-shadow(0 0 3px var(--signal-dim)); }
.wordmark--sm { font-size: 1.1rem; }
.nav__status { color: var(--bone); display: inline-flex; align-items: center; }

main { position: relative; z-index: 2; }

section { padding-inline: var(--pad); }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: clamp(1.2rem, 2.5vh, 2rem);
  padding-block: 18vh 12vh; position: relative;
}
.eyebrow {
  color: var(--signal);
  display: inline-flex; align-items: center;
}
.eyebrow .dot { animation: none; }

.hero__headline {
  font-size: clamp(3.4rem, 13vw, 9rem);
  line-height: 0.94; letter-spacing: -0.02em;
  max-width: 14ch;
}
.hero__headline em { font-style: italic; }

.hero__sub {
  color: var(--noise);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  letter-spacing: 0; max-width: 34ch;
}

/* ---------- capture form ---------- */
.capture { width: min(440px, 100%); display: flex; flex-direction: column; gap: 0.85rem; }
.capture__field {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--ink-2);
  border: 1px solid var(--noise-dim);
  border-radius: 100px;
  padding: 0.4rem 0.4rem 0.4rem 1.25rem;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.capture__field:focus-within {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-dim);
}
.capture__input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  color: var(--bone); font-family: var(--font-display);
  font-size: 1rem; letter-spacing: 0;
}
.capture__input::placeholder { color: var(--noise); } /* AA-legible on field bg */

.capture__submit {
  flex-shrink: 0;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: var(--signal); color: var(--ink);
  display: grid; place-items: center;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}
.capture__submit:hover { box-shadow: 0 0 22px 0 var(--signal-dim); }
.capture__submit:disabled { opacity: 0.5; cursor: progress; }
.capture__submit svg { display: block; }

.capture__note {
  color: var(--noise); letter-spacing: 0.12em; text-transform: none;
  font-size: 0.72rem; transition: color 0.3s var(--ease);
}
.capture__note[data-state="error"] { color: #ff6b5e; }
.capture__note[data-state="ok"] { color: var(--signal); }

/* success state */
.capture--done .capture__field { display: none; }
.capture__success {
  display: flex; align-items: center; gap: 0.7rem;
  color: var(--bone); font-family: var(--font-display); letter-spacing: 0;
  font-size: 1.05rem;
}
.capture__success .check {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--signal); color: var(--ink); flex-shrink: 0;
}

/* ---------- scroll cue ---------- */
.scroll-cue {
  position: absolute; bottom: clamp(1.5rem, 5vh, 3rem); left: 50%;
  transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.7rem;
  color: var(--noise);
}
.scroll-cue__line {
  width: 1px; height: 42px; background: linear-gradient(var(--noise), transparent);
  animation: drift 2.2s var(--ease) infinite;
}
@keyframes drift {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scaleY(1); transform-origin: top; opacity: 0; }
}

/* ---------- section label ---------- */
.section-label { color: var(--signal); margin-bottom: clamp(1.5rem, 3.5vh, 2.5rem); }

/* ---------- manifesto ---------- */
.manifesto {
  display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin-inline: auto;
  padding-block: clamp(5rem, 14vh, 9rem); /* tightened — content-driven, not 92vh of air */
}
.manifesto__lines { display: flex; flex-direction: column; gap: clamp(0.4rem, 1.5vh, 1rem); }
.manifesto__line {
  font-size: clamp(2.1rem, 6.5vw, 4.75rem);
  line-height: 1.06; letter-spacing: -0.015em; max-width: 18ch;
}
.manifesto__line em { font-style: italic; color: var(--signal); }

/* ---------- second cta ---------- */
.cta {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  gap: clamp(1.1rem, 2.5vh, 1.6rem);
  max-width: var(--maxw); margin-inline: auto;
  padding-block: clamp(5rem, 14vh, 9rem);
}
.cta .section-label { margin-bottom: 0.5rem; }
.cta__headline {
  font-size: clamp(2.4rem, 7vw, 4.75rem); line-height: 1.02; max-width: 16ch;
  text-wrap: balance;
}
.cta__sub {
  color: var(--noise); font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  letter-spacing: 0; max-width: 40ch;
}
.cta__button {
  margin-top: 0.6rem;
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-display); font-size: 1rem; font-weight: 500;
  color: var(--ink); background: var(--signal);
  border: 0; border-radius: 100px; padding: 0.85rem 1.6rem;
  cursor: pointer; letter-spacing: 0;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}
.cta__button:hover { transform: translateY(-2px); box-shadow: 0 8px 30px -6px var(--signal-dim); }
.cta__button svg { transition: transform 0.3s var(--ease); }
.cta__button:hover svg { transform: translateX(3px); }

/* ---------- footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  padding: clamp(2rem, 5vh, 3rem) var(--pad);
  border-top: 1px solid var(--noise-dim);
  color: var(--noise); position: relative; z-index: 2;
}
.footer__link { transition: color 0.3s var(--ease); }
.footer__link:hover { color: var(--bone); }
.footer__meta { display: inline-flex; align-items: center; }
.footer .dot { animation-duration: 3.2s; }

/* ---------- focus visibility ---------- */
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

/* ---------- motion gating: pre-reveal hidden state (JS removes when animating) ---------- */
.js [data-reveal], .js [data-split] { opacity: 0; }

/* Page fade-in: hold the whole page invisible until fonts + reveal states are ready,
   then fade in as one piece. Kills the split-second unstyled/half-drawn flash on load.
   A head-script safety + the no-anim path both add .ready so this can never stick. */
.js body { opacity: 0; }
body { transition: opacity 0.55s var(--ease); }
body.ready { opacity: 1; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .js [data-reveal], .js [data-split] { opacity: 1 !important; }
  .js body { opacity: 1; }
}

/* ---------- tablet ---------- */
@media (max-width: 900px) {
  .manifesto__line { max-width: 14ch; }
}

/* ---------- mobile tuning ---------- */
@media (max-width: 600px) {
  .nav__status { display: none; }
  .hero { padding-block: 20vh 12vh; gap: 1.25rem; }
  .hero__headline { font-size: clamp(3rem, 16vw, 5rem); }
  .manifesto__line { max-width: 100%; font-size: clamp(2rem, 9vw, 3.2rem); }
  .cta__headline { font-size: clamp(2.1rem, 10vw, 3.2rem); }
  .hero__telemetry, .hero__coord { display: none; } /* keep mobile uncluttered */
  .hud__corner { width: 10px; height: 10px; }
  .wordmark { font-size: 1.4rem; }
  .nav { padding-inline: var(--pad); }
}

/* ---------- very small phones ---------- */
@media (max-width: 380px) {
  .hero__headline { font-size: clamp(2.6rem, 15vw, 3.4rem); }
  .capture__field { padding-left: 1rem; }
}
