/* shell styles — consume tokens only; no literal colors below this line.
   Layout geometry (z-index, percentages, gradient stop positions) stays literal. */

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--color-surface);
  color: var(--color-on-surface-strong);
  font-family: var(--font-family);
  font-weight: var(--font-weight-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

a {
  color: var(--color-on-surface-strong);
  text-decoration: none;
  transition: color .25s ease;
}

a:hover {
  color: var(--color-accent-pale);
}

:focus-visible {
  outline: 2px solid var(--color-outline);
  outline-offset: 2px;
}

/* fixed background stack: canvas graph → vignette → grain; content sits above */
.tree,
.vignette,
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.tree {
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette {
  z-index: 1;
  background: radial-gradient(135% 112% at 50% 44%, var(--color-vignette-transparent) 44%, var(--color-vignette-mid) 78%, var(--color-vignette-edge) 100%);
}

.grain {
  z-index: 1;
  opacity: var(--grain-opacity);
  background-image: url('/images/grain.svg');
}

/* header */
header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: var(--space-header-block) var(--space-header-inline);
}

.wordmark {
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-title);
  font-size: var(--font-size-wordmark);
  letter-spacing: var(--tracking-wordmark);
  text-transform: uppercase;
  color: var(--color-on-surface-strong);
}

.crosslink {
  font-size: 12px;
  letter-spacing: var(--tracking-footer);
  text-transform: uppercase;
  color: var(--color-on-surface-muted);
}

/* main column */
main {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100svh - 210px);
  padding: var(--space-page-block) var(--space-page-inline);
  animation: fadeUp var(--duration-entrance) var(--ease-entrance) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 clamp(22px, 3.4vw, 40px);
}

.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent);
}

.eyebrow span:last-child {
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-on-surface-muted);
}

h1 {
  margin: 0;
  max-width: 17ch;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-display);
  font-size: var(--font-size-display);
  line-height: 1.02;
  letter-spacing: var(--tracking-display);
  color: var(--color-on-surface-bright);
  text-wrap: balance;
}

.lede {
  margin: clamp(22px, 3vw, 32px) 0 0;
  max-width: 60ch;
  font-size: var(--font-size-lede);
  line-height: 1.72;
  color: var(--color-on-surface);
  text-wrap: pretty;
}

/* form — posts to /api/subscribe; the honeypot field is off-screen, not display:none */
form {
  width: 100%;
  max-width: 720px;
  margin: clamp(30px, 4vw, 46px) 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--color-hairline-strong);
  border-radius: var(--rounded-panel);
  background: var(--color-panel);
  backdrop-filter: blur(14px);
}

.field-shell input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  background: transparent;
  border: 0;
  color: var(--color-on-surface-strong);
}

input::placeholder {
  color: var(--color-placeholder);
  opacity: 1;
}

input[type='email']:user-invalid {
  border-bottom: 1px solid var(--color-accent);
}

.field-divider {
  width: 1px;
  align-self: stretch;
  background: var(--color-hairline-mid);
}

button {
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--rounded-button);
  padding: 14px 26px;
  font: inherit;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  color: var(--color-on-accent);
  background: var(--color-accent-strong);
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}

button:hover {
  background: var(--color-accent-bright);
  transform: translateY(-1px);
}

.form-helper {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-on-surface-muted);
}

.form-helper a {
  border-bottom: 1px solid var(--color-hairline-input);
}

/* the submitted state — served as /subscribe/thanks */
.panel {
  width: 100%;
  max-width: 720px;
  margin: clamp(30px, 4vw, 46px) 0 0;
  padding: 26px 28px;
  border: 1px solid var(--color-success-border);
  border-radius: var(--rounded-panel);
  background: var(--color-success-surface);
  text-align: left;
  animation: fadeUp .5s ease both;
}

.panel h2 {
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-title);
  font-size: 22px;
  color: var(--color-on-surface-bright);
}

.panel p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-on-surface);
}

/* privacy stance, under the form */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 640px;
  margin: clamp(34px, 4.6vw, 58px) 0 0;
  padding-top: clamp(26px, 3.4vw, 34px);
  border-top: 1px solid var(--color-hairline-soft);
  text-align: left;
}

.privacy-note .dot {
  flex: 0 0 auto;
  margin-top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.privacy-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--color-on-surface-muted);
}

.privacy-note strong {
  font-weight: var(--font-weight-regular);
  color: var(--color-on-surface-strong);
}

/* why we are building it */
.why {
  width: 100%;
  max-width: 1000px;
  margin: clamp(56px, 9vw, 120px) 0 0;
  padding-top: clamp(30px, 4vw, 44px);
  border-top: 1px solid var(--color-hairline-soft);
  text-align: left;
}

.why > h2 {
  margin: 0 0 clamp(24px, 3.4vw, 38px);
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-on-surface-muted);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(24px, 4vw, 52px);
}

.why-grid h3 {
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-title);
  font-size: var(--font-size-card-title);
  color: var(--color-on-surface-bright);
}

.why-grid p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.72;
  color: var(--color-on-surface-muted);
  text-wrap: pretty;
}

/* footer */
footer {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(18px, 2.4vw, 26px) var(--space-header-inline);
  border-top: 1px solid var(--color-hairline-faint);
  font-size: 11.5px;
  letter-spacing: var(--tracking-footer);
  text-transform: uppercase;
  color: var(--color-on-surface-muted);
}

footer nav {
  display: flex;
  gap: 18px;
}

footer a {
  color: var(--color-on-surface-muted);
}

footer a:hover {
  color: var(--color-accent-pale);
}

/* prose pages (privacy) */
.prose {
  max-width: 640px;
  text-align: left;
  align-self: center;
}

.prose h1 {
  font-size: clamp(30px, 4vw, 46px);
  max-width: none;
}

.prose h2 {
  margin: clamp(28px, 4vw, 40px) 0 12px;
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-on-surface-muted);
}

.prose p {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--color-on-surface);
  text-wrap: pretty;
}

.prose a {
  border-bottom: 1px solid var(--color-hairline-input);
}

/* 404 */
.notice {
  max-width: 44ch;
}

.notice h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.notice p {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-on-surface);
}

.notice a {
  color: var(--color-on-surface-strong);
  border-bottom: 1px solid var(--color-accent);
  padding-bottom: 2px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* the static state (S4): entrances neutralized; the graph holds still in tree.js while
   still drawing and still responding to the cursor */
@media (prefers-reduced-motion: reduce) {
  main,
  .panel {
    animation: none;
  }

  a,
  button,
  .field-shell input {
    transition: none;
  }

  button:hover {
    transform: none;
  }
}
