:root {
  --bg: #040807;
  --ink: #eef5f1;
  --ink-dim: rgba(238, 245, 241, 0.62);
  --ink-faint: rgba(238, 245, 241, 0.38);
  --accent: #46e0a4;
  --accent-soft: rgba(70, 224, 164, 0.14);
  --line: rgba(238, 245, 241, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Space Grotesk", system-ui, sans-serif;
}

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

html { height: 100%; }

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 340;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #04140d; }

/* ---------- WebGL canvas & overlays ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* Fallback when WebGL is unavailable */
body.no-webgl #scene { display: none; }
body.no-webgl::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 90% at 78% 30%, rgba(70, 224, 164, 0.16), transparent 55%),
    radial-gradient(90% 80% at 20% 85%, rgba(103, 232, 249, 0.08), transparent 60%),
    var(--bg);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(4, 8, 7, 0.88) 0%, rgba(4, 8, 7, 0.55) 42%, rgba(4, 8, 7, 0.05) 72%),
    linear-gradient(to top, rgba(4, 8, 7, 0.75), transparent 30%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 3%); }
  50%  { transform: translate(3%, -2%); }
  75%  { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- Layout ---------- */

.page {
  position: relative;
  z-index: 3;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.75rem) clamp(1.25rem, 5vw, 4.5rem);
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.wordmark em {
  font-style: normal;
  color: var(--accent);
}

.wordmark__mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: rgba(238, 245, 241, 0.04);
  color: var(--accent);
}

.wordmark__mark svg { width: 1.15rem; height: 1.15rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  background: rgba(4, 8, 7, 0.35);
  backdrop-filter: blur(8px);
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(70, 224, 164, 0.55);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(70, 224, 164, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(70, 224, 164, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 224, 164, 0); }
}

/* ---------- Hero ---------- */

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 46rem;
  padding-block: clamp(2.5rem, 6vh, 5rem);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(1.1rem, 2.5vh, 1.75rem);
}

.headline {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(2.6rem, 7.2vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.headline__line { display: block; }

.headline em {
  font-style: italic;
  font-weight: 420;
  color: var(--accent);
}

.headline__dot { color: var(--accent); }

.lede {
  margin-top: clamp(1.4rem, 3vh, 2.1rem);
  max-width: 34rem;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-dim);
  text-wrap: pretty;
}

/* ---------- CTA ---------- */

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: clamp(1.8rem, 4vh, 2.6rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.9rem 1.6rem;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease, background-color 0.35s ease,
              border-color 0.35s ease, color 0.35s ease;
}

.btn svg { width: 1rem; height: 1rem; transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }

.btn--primary {
  background: var(--accent);
  color: #04140d;
  box-shadow: 0 0 0 0 rgba(70, 224, 164, 0), 0 10px 30px -12px rgba(70, 224, 164, 0.55);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 16px 40px -12px rgba(70, 224, 164, 0.7);
}

.btn--primary:hover svg { transform: translateX(3px); }

.btn--ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(238, 245, 241, 0.03);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  border-color: rgba(70, 224, 164, 0.5);
  color: var(--accent);
  transform: translateY(-2px);
}

.cta-note {
  margin-top: 1.1rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: clamp(1rem, 2vh, 1.5rem);
}

.site-footer__tag { color: var(--ink-dim); font-style: italic; font-family: var(--font-display); }

/* ---------- Reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  filter: blur(6px);
  animation: reveal 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .status { display: none; }
  .scrim {
    background:
      linear-gradient(to top, rgba(4, 8, 7, 0.9) 0%, rgba(4, 8, 7, 0.55) 55%, rgba(4, 8, 7, 0.15) 100%);
  }
  .site-footer { justify-content: center; text-align: center; }
  .site-footer__tag { width: 100%; order: 3; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .reveal { animation-duration: 0.01s; animation-delay: 0s; }
  .grain, .status__dot { animation: none; }
  .btn, .btn svg { transition: none; }
}
