/* PULS3 living site — Fable. Dark canvas, organism behind, type in front. */

:root {
  --canvas: #071512;
  --canvas-2: #0C221D;
  --ink: #F4F8F6;
  --ink-dim: rgba(233, 242, 238, 0.62);
  --ink-faint: rgba(233, 242, 238, 0.38);
  --coral: #EE7048;
  --coral-ink: #0E1512;
  --hairline: rgba(233, 242, 238, 0.12);
  --max: 1200px;
}

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

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

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.4;
}

/* ---------- organism canvas + grain ---------- */

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

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

/* ---------- header / footer ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2.5vw, 26px) clamp(18px, 4vw, 44px);
  background: linear-gradient(to bottom, rgba(7, 21, 18, 0.92) 0%, rgba(7, 21, 18, 0.6) 55%, rgba(7, 21, 18, 0) 100%);
}

.wordmark {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); }
.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 2px;
  transition: color 0.25s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  color: var(--coral-ink);
  background: var(--coral);
  padding: 11px 18px;
  border-radius: 999px;
  min-height: 20px;
}
.site-nav .nav-cta:hover { color: var(--coral-ink); filter: brightness(1.07); }

@media (max-width: 700px) {
  .site-nav a:not(.nav-cta) { display: none; }
  /* the two hidden destinations stay one scroll away as the Doors chapter */
}

.site-footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px clamp(18px, 4vw, 44px) 40px;
  color: var(--ink-faint);
  font-size: 13px;
  border-top: 1px solid var(--hairline);
}
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--ink-dim); text-decoration: none; padding: 8px 0; }
.site-footer a:hover { color: var(--ink); }

/* ---------- shared type ---------- */

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

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4), filter 0.25s ease;
}
.button:active { transform: scale(0.97); }
.button.primary { background: var(--coral); color: var(--coral-ink); }
.button.primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.button.ghost {
  color: var(--ink);
  border: 1px solid rgba(233, 242, 238, 0.28);
}
.button.ghost:hover { border-color: rgba(233, 242, 238, 0.6); }

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px clamp(18px, 5vw, 64px) 80px;
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}

.hero-title {
  font-size: min(clamp(64px, 14.5vw, 200px), 24vh);
  line-height: 0.88;
  font-weight: 850;
  letter-spacing: -0.035em;
  display: flex;
  flex-direction: column;
  margin: 18px 0 30px;
}
.hero-title .accent { color: var(--coral); }

.hero-sub {
  font-size: clamp(17px, 2.2vw, 23px);
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

/* staggered rise on load */
.rise {
  opacity: 0;
  transform: translateY(38px);
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.rise:nth-child(1) { animation-delay: 0.05s; }
.hero-title .rise:nth-child(1) { animation-delay: 0.12s; }
.hero-title .rise:nth-child(2) { animation-delay: 0.22s; }
.hero-title .rise:nth-child(3) { animation-delay: 0.32s; }
.hero-sub.rise { animation-delay: 0.5s; }
.hero-actions.rise { animation-delay: 0.62s; }
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  width: 1px;
  height: 56px;
  background: var(--hairline);
  overflow: hidden;
}
.scroll-hint span {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--coral);
  animation: hint-fall 2.2s ease-in-out infinite;
}
@keyframes hint-fall {
  0% { top: -40%; }
  70%, 100% { top: 110%; }
}

/* ---------- chapters ---------- */

.chapter {
  position: relative;
  padding: clamp(110px, 16vh, 190px) clamp(18px, 5vw, 64px);
  max-width: var(--max);
  margin: 0 auto;
}

.chapter-copy h2 {
  font-size: clamp(40px, 7.2vw, 92px);
  line-height: 0.98;
  font-weight: 830;
  letter-spacing: -0.03em;
  margin: 14px 0 26px;
}

.big {
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 30em;
}

.fine {
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-faint);
  max-width: 44em;
}

.chapter-foot {
  margin-top: 46px;
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--ink-dim);
  max-width: 36em;
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.on {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .rise, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .scroll-hint { display: none; }
}

/* ---------- advice drift field ---------- */

.noise-field { overflow: visible; }

.advice-drift {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.advice-drift span {
  position: absolute;
  font-size: clamp(14px, 1.9vw, 21px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(233, 242, 238, 0.13);
  white-space: nowrap;
  animation: drift-x var(--dur, 34s) linear infinite;
  top: var(--y, 10%);
  animation-delay: var(--delay, 0s);
}
.advice-drift span:nth-child(1)  { --y: 4%;  --dur: 38s; --delay: -4s; }
.advice-drift span:nth-child(2)  { --y: 13%; --dur: 46s; --delay: -20s; }
.advice-drift span:nth-child(3)  { --y: 22%; --dur: 34s; --delay: -9s; }
.advice-drift span:nth-child(4)  { --y: 30%; --dur: 52s; --delay: -30s; }
.advice-drift span:nth-child(5)  { --y: 39%; --dur: 40s; --delay: -14s; }
.advice-drift span:nth-child(6)  { --y: 48%; --dur: 57s; --delay: -41s; }
.advice-drift span:nth-child(7)  { --y: 57%; --dur: 36s; --delay: -6s; }
.advice-drift span:nth-child(8)  { --y: 65%; --dur: 49s; --delay: -25s; }
.advice-drift span:nth-child(9)  { --y: 73%; --dur: 42s; --delay: -17s; }
.advice-drift span:nth-child(10) { --y: 81%; --dur: 55s; --delay: -37s; }
.advice-drift span:nth-child(11) { --y: 89%; --dur: 39s; --delay: -11s; }
.advice-drift span:nth-child(12) { --y: 96%; --dur: 47s; --delay: -28s; }
@keyframes drift-x {
  from { transform: translateX(105vw); }
  to { transform: translateX(-105%); }
}
@media (prefers-reduced-motion: reduce) {
  .advice-drift span { animation: none; left: var(--delay-static, 10%); opacity: 0.5; }
}

/* ---------- team field ---------- */

.team-field {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(14px, 2.4vw, 26px);
  margin-top: clamp(40px, 6vw, 72px);
}
.team-field li {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--hairline);
  border-radius: 22px;
  backdrop-filter: blur(6px);
  background: rgba(9, 26, 22, 0.42);
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.team-field li:hover {
  border-color: color-mix(in srgb, var(--tint) 55%, transparent);
  transform: translateY(-4px);
}
.team-field li.wide { grid-column: 1 / -1; }
.team-field i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: 0 0 22px 4px color-mix(in srgb, var(--tint) 55%, transparent);
  margin-bottom: 16px;
  animation: orb-breathe 3.2s ease-in-out infinite;
}
.team-field li:nth-child(2n) i { animation-delay: -1.1s; }
.team-field li:nth-child(3n) i { animation-delay: -2.2s; }
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  .team-field i { animation: none; }
}
.team-field strong {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.team-field span {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* ---------- adapt beats ---------- */

.beat-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3.5vw, 36px);
  margin-top: clamp(36px, 5vw, 60px);
}
.beat {
  border-left: 3px solid var(--coral);
  padding: 6px 0 6px clamp(20px, 3vw, 34px);
}
.beat-when {
  font-size: clamp(26px, 4.4vw, 52px);
  font-weight: 830;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.beat-then {
  margin-top: 10px;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.55;
  color: var(--ink-dim);
  max-width: 30em;
}

/* ---------- doors ---------- */

.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 2.6vw, 30px);
}
.door {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 28px;
  padding: clamp(30px, 4.5vw, 54px);
  background: rgba(9, 26, 22, 0.42);
  backdrop-filter: blur(6px);
  transition: border-color 0.35s ease, transform 0.35s ease;
}
.door:hover {
  border-color: rgba(238, 112, 72, 0.65);
  transform: translateY(-5px);
}
.door h3 {
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1.02;
  font-weight: 830;
  letter-spacing: -0.025em;
  margin: 14px 0 22px;
}
.door-go {
  font-size: 16px;
  font-weight: 700;
  color: var(--coral);
}

/* ---------- honesty + finale ---------- */

.honesty { border-top: 1px solid var(--hairline); }

.finale { text-align: center; padding-bottom: clamp(120px, 18vh, 220px); }
.finale-title {
  font-size: min(clamp(56px, 13vw, 180px), 26vh);
  line-height: 0.9;
  font-weight: 850;
  letter-spacing: -0.035em;
  margin-bottom: 38px;
}
.finale .hero-actions { justify-content: center; }

/* ---------- waitlist form (beta) ---------- */

.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
  max-width: 34em;
}

.waitlist-input {
  flex: 1 1 240px;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid rgba(233, 242, 238, 0.28);
  background: rgba(233, 242, 238, 0.06);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.waitlist-input::placeholder { color: var(--ink-faint); }
.waitlist-input:focus {
  border-color: var(--coral);
  background: rgba(233, 242, 238, 0.09);
}

.waitlist-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 34em;
}

.waitlist-status {
  margin-top: 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  max-width: 34em;
  min-height: 1.4em;
}
.waitlist-status.is-error { color: #F2A93B; }
