@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono.woff2") format("woff2");
}

:root {
  --bg: #07080B;
  --surface: #10131A;
  --hairline: #1C222C;
  --text: #E6E2D6;
  --muted: #7A808A;
  --accent: #A8B8C4; /* cold moonlight — almost never use */
  --glow: #3D5A78; /* one faint bloom only */
  --ink: #2A4158;

  --font-display: "Instrument Serif", "Times New Roman", Times, serif;
  --font-body: Geist, "Inter Tight", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --pad-x: clamp(1.25rem, 5vw, 2.5rem);
}

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

html {
  color-scheme: dark;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.58;
  overflow-x: hidden;
}

::selection {
  background: color-mix(in srgb, var(--glow) 42%, transparent);
  color: var(--text);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

/* ——— a11y ——— */

.skip {
  position: absolute;
  left: var(--pad-x);
  top: 0.75rem;
  z-index: 40;
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  color: var(--text);
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip:focus {
  transform: translateY(0);
}

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

:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

/* ——— nav ——— */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: max(1.15rem, env(safe-area-inset-top))
    max(var(--pad-x), env(safe-area-inset-right))
    1.15rem
    max(var(--pad-x), env(safe-area-inset-left));
  background: transparent;
  pointer-events: none;
}

.nav a,
.nav .wordmark,
.nav .mark {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.wordmark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.55rem;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1;
}

.mark {
  display: flex;
  line-height: 0;
}

.mark img {
  height: 2.25rem;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  pointer-events: auto;
}

.nav-links a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.2rem;
  transition: color 180ms var(--ease-out);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-dot {
  color: var(--muted);
  user-select: none;
}

/* ——— hero ——— */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6.5rem var(--pad-x) 5rem;
}

.hero canvas,
.page-eeg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* one faint bloom only */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 46% 32% at 50% 48%,
    color-mix(in srgb, var(--glow) 16%, transparent),
    transparent 72%
  );
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(40rem, 100%);
  transform: translateY(-4vh);
}

.hero-line {
  margin: 0;
  max-width: none;
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2.05rem, 10.2vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-align: center;
  color: var(--text);
  animation: rise 1.4s var(--ease-out) both;
}

.hero-form {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
  width: min(34rem, 100%);
  margin-top: 1.85rem;
  pointer-events: auto;
  animation: rise 1.4s var(--ease-out) 0.12s both;
}

.hero-form input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  padding: 0.7rem 0.95rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 18%, var(--hairline));
  border-radius: 2px;
  color: var(--text);
  caret-color: var(--text);
  font-size: 1rem;
}

.hero-form input[type="email"]::placeholder {
  color: var(--muted);
  opacity: 1;
}

.hero-form input[type="email"]:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--hairline));
}

.hero-form input[type="email"]:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--hairline));
  background: color-mix(in srgb, var(--surface) 80%, #000);
}

.hero-form button[type="submit"] {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  background: var(--text);
  border: none;
  border-radius: 2px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background-color 180ms var(--ease-out),
    color 180ms var(--ease-out);
}

.hero-form button[type="submit"]:hover,
.hero-form button[type="submit"]:focus-visible {
  background: #fff;
  color: #1e3348;
}

.hero-form button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: wait;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— sections ——— */

.section {
  position: relative;
  z-index: 2;
  max-width: 48ch;
  margin: 0 auto;
  padding: 12vh var(--pad-x) 8vh;
  scroll-margin-top: 5.5rem;
}

.section p {
  margin: 0;
  color: var(--text);
  text-wrap: pretty;
}

.section p + p {
  margin-top: 1.35em;
}

.lead {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.38rem);
  line-height: 1.42;
  letter-spacing: -0.018em;
  text-wrap: pretty;
}

.hz {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 2.25rem;
}

.sign {
  margin-top: 2.1em;
  color: var(--muted);
}

.site-foot {
  position: relative;
  z-index: 2;
  max-width: 48ch;
  margin: 0 auto;
  padding: 6vh var(--pad-x) 2.75rem;
}

.legal {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* ——— thanks ——— */

body.thanks {
  min-height: 100vh;
  min-height: 100dvh;
}

body.thanks .page-eeg {
  position: fixed;
}

body.thanks::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 42% 28% at 50% 48%,
    color-mix(in srgb, var(--glow) 12%, transparent),
    transparent 72%
  );
}

.thanks-main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem var(--pad-x) 4rem;
}

.thanks-lead {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.18;
  text-wrap: balance;
  animation: rise 1.3s var(--ease-out) both;
}

.thanks-note {
  margin: 1.15rem 0 0;
  max-width: 28ch;
  color: var(--text);
  text-wrap: pretty;
  animation: rise 1.3s var(--ease-out) 0.12s both;
}

.return {
  margin-top: 2.75rem;
  color: var(--muted);
  transition: color 180ms var(--ease-out);
  animation: rise 1.3s var(--ease-out) 0.24s both;
}

.return:hover,
.return:focus-visible {
  color: var(--text);
}

/* ——— reduced motion ——— */

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

  .hero-line,
  .hero-form,
  .thanks-lead,
  .thanks-note,
  .return {
    animation: none;
  }

  .hero-form button[type="submit"]:active {
    transform: none;
  }
}

/* ——— mobile ——— */

@media (max-width: 560px) {
  .nav {
    padding: max(1rem, env(safe-area-inset-top))
      max(1.25rem, env(safe-area-inset-right))
      1rem
      max(1.25rem, env(safe-area-inset-left));
  }

  .wordmark {
    font-size: 1.4rem;
  }

  .mark img {
    height: 2rem;
  }

  .nav-links {
    font-size: 0.8125rem;
  }

  .hero {
    padding: 6.25rem var(--pad-x) 4.5rem;
  }

  .hero-inner {
    transform: translateY(-2vh);
  }

  .hero-line {
    font-size: clamp(1.7rem, 8.4vw, 2.4rem);
  }

  .section {
    padding-top: 9vh;
    padding-bottom: 7vh;
  }

  .hero-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    margin-top: 1.5rem;
  }

  .hero-form button[type="submit"] {
    width: 100%;
    padding: 0.8rem 1.15rem;
  }

  .site-foot {
    padding-top: 4vh;
    padding-bottom: max(2.75rem, env(safe-area-inset-bottom));
  }
}
