:root {
  --bg: #14110f;
  --bg-elevated: #1f1b18;
  --bg-raised: #27221e;
  --line: rgba(245, 239, 230, 0.08);
  --text: #f5efe6;
  --text-2: #a89f94;
  --text-3: #7d756c;
  --accent: #e8a13a;
  --accent-soft: rgba(232, 161, 58, 0.16);
  --accent-on: #14110f;
  --cool: #4fa3e8;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius: 18px;
  --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, .nav, .footer { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  background: var(--accent);
  color: var(--accent-on);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px var(--gutter);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.mark { width: 30px; height: 30px; color: var(--text); }
.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 4px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: 0 0 0 0 rgba(232, 161, 58, 0), 0 10px 30px -10px rgba(232, 161, 58, 0.55);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 6px rgba(232, 161, 58, 0.14), 0 14px 36px -10px rgba(232, 161, 58, 0.7); }
.btn-ghost { border: 1px solid rgba(245, 239, 230, 0.18); color: var(--text); }
.btn-ghost:hover { border-color: rgba(245, 239, 230, 0.4); background: rgba(245, 239, 230, 0.04); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow-x: clip;
  padding: clamp(28px, 6vw, 72px) 0 0;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -180px;
  width: min(1100px, 140vw);
  height: 760px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 30%, rgba(232, 161, 58, 0.13), transparent 62%);
  pointer-events: none;
}
.hero-copy { position: relative; max-width: 820px; margin: 0 auto; padding: 0 var(--gutter); }
.hero h1 {
  font-size: clamp(46px, 9vw, 96px);
  line-height: 1;
  letter-spacing: -0.035em;
}
.glow {
  color: var(--accent);
  text-shadow: 0 0 28px rgba(232, 161, 58, 0.45), 0 0 80px rgba(232, 161, 58, 0.25);
}
.lede {
  margin: 24px auto 0;
  max-width: 600px;
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-2);
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

/* ---------- Stage (interactive table) ---------- */

.stage {
  position: relative;
  max-width: 1160px;
  height: clamp(340px, 46vw, 540px);
  margin: clamp(24px, 4vw, 40px) auto 0;
  perspective: 1200px;
  perspective-origin: 50% -10%;
  scroll-margin-top: 40px;
}
.beam {
  position: absolute;
  left: 50%;
  top: -10px;
  width: 92%;
  height: 100%;
  transform: translateX(-50%);
  clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(245, 225, 190, 0), rgba(245, 225, 190, 0.07) 30%, rgba(245, 225, 190, 0.015) 80%, transparent);
  filter: blur(14px);
  pointer-events: none;
}
.table {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 4%;
  bottom: 2%;
  border-radius: 36px;
  transform: rotateX(46deg);
  transform-origin: 50% 70%;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, rgba(245, 220, 170, 0.11), transparent 70%),
    repeating-linear-gradient(92deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #221c17, #1a1511);
  box-shadow:
    inset 0 0 0 1px rgba(245, 239, 230, 0.05),
    inset 0 0 120px rgba(0, 0, 0, 0.55),
    0 60px 80px -40px rgba(0, 0, 0, 0.9);
}

.card {
  --w: clamp(64px, 10.5vw, 124px);
  --c: 232, 161, 58;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  aspect-ratio: 63 / 88;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(var(--r));
  -webkit-tap-highlight-color: transparent;
}
.card[data-theme="tide"] { --c: 79, 163, 232; }
.card[data-theme="grove"] { --c: 95, 184, 122; }
.card[data-theme="star"] { --c: 245, 210, 122; }
.card[data-theme="moon"] { --c: 180, 156, 240; }

.card:focus-visible { outline: none; }
.card:focus-visible .face { box-shadow: 0 0 0 3px var(--accent), 0 18px 30px -12px rgba(0, 0, 0, 0.8); }

.pool {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250%;
  height: 200%;
  transform: translate(-50%, -50%) scale(0.6);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--c), 0.7), rgba(var(--c), 0.22) 42%, transparent);
  opacity: 0;
  transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border-radius: 7%;
  padding: 7%;
  gap: 6%;
  background: linear-gradient(160deg, #e7ddca, #cdbfa4);
  box-shadow:
    inset 0 0 0 1px rgba(60, 45, 30, 0.25),
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 16px 26px -12px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  filter: brightness(0.82) saturate(0.85);
  transition: filter 0.8s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.8s ease;
}
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(var(--c), 0.65), rgba(var(--c), 0.08) 70%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.band { height: 9%; border-radius: 3px; background: rgba(60, 45, 30, 0.22); }
.art {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: radial-gradient(circle at 50% 45%, #3a3029, #241d18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.art svg { width: 58%; height: auto; fill: rgba(var(--c), 0.55); stroke: rgba(var(--c), 0.55); transition: fill 0.6s, stroke 0.6s, filter 0.6s; overflow: visible; }
.card[data-theme="tide"] .art svg, .card[data-theme="grove"] .vein { fill: none; }
.card[data-theme="grove"] .vein { stroke: #241d18; }
.lines { display: flex; flex-direction: column; gap: 6px; padding: 0 4%; }
.lines i { display: block; height: 3px; border-radius: 2px; background: rgba(60, 45, 30, 0.3); }
.lines i:nth-child(2) { width: 82%; }
.lines i:nth-child(3) { width: 58%; }

.card:hover .face { filter: brightness(0.92) saturate(0.95); }

.card.is-alive .pool { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.card.is-alive .face {
  filter: brightness(1.04) saturate(1.05);
  transform: scale(1.07);
  box-shadow:
    inset 0 0 0 1px rgba(60, 45, 30, 0.2),
    0 0 0 1px rgba(var(--c), 0.5),
    0 0 34px rgba(var(--c), 0.55),
    0 22px 34px -12px rgba(0, 0, 0, 0.8);
}
.card.is-alive .face::after { opacity: 1; }
.card.is-alive .art svg {
  fill: rgb(var(--c));
  stroke: rgb(var(--c));
  filter: drop-shadow(0 0 6px rgba(var(--c), 0.9));
}
.card[data-theme="tide"].is-alive .art svg { fill: none; }

.card.is-alive[data-theme="ember"] .art svg { animation: flicker 0.32s ease-in-out infinite alternate; transform-origin: 50% 90%; }
.card.is-alive[data-theme="tide"] .art svg { animation: sway 1.1s ease-in-out infinite; }
.card.is-alive[data-theme="star"] .art svg { animation: twirl 2.4s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.card.is-alive[data-theme="grove"] .art svg { animation: rustle 0.9s ease-in-out infinite; transform-origin: 25% 75%; }
.card.is-alive[data-theme="moon"] .art svg { animation: breathe 1.6s ease-in-out infinite; }

@keyframes flicker { from { transform: scale(1, 0.94); } to { transform: scale(0.96, 1.08); } }
@keyframes sway { 0%, 100% { transform: translateX(-6%); } 50% { transform: translateX(6%); } }
@keyframes twirl { from { transform: rotate(0) scale(0.7); } 40% { transform: rotate(160deg) scale(1.2); } to { transform: rotate(180deg) scale(1); } }
@keyframes rustle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(7deg); } }
@keyframes breathe { 0%, 100% { transform: scale(0.94); opacity: 0.85; } 50% { transform: scale(1.06); opacity: 1; } }

.ring {
  position: absolute;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(var(--c), 0.75);
  box-shadow: 0 0 18px rgba(var(--c), 0.5), inset 0 0 12px rgba(var(--c), 0.35);
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
  pointer-events: none;
  animation: ring 2.2s cubic-bezier(0.15, 0.6, 0.3, 1) forwards;
}
@keyframes ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); }
}

.fx { position: absolute; inset: -60px 0 0; width: 100%; height: calc(100% + 60px); pointer-events: none; }

.stage-caption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-3);
}
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 230, 0.03);
  color: var(--text-2);
  font: 500 14px var(--font-body);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.sound-toggle:hover { color: var(--text); border-color: rgba(245, 239, 230, 0.2); }
.sound-toggle svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle .spk { fill: currentColor; stroke: none; }
.sound-toggle .off { display: none; }
.sound-toggle[aria-pressed="false"] .on { display: none; }
.sound-toggle[aria-pressed="false"] .off { display: inline; }

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 11vw, 140px) 0 0; }
.section h2 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; }
.body-lg { margin-top: 22px; font-size: clamp(18px, 2vw, 20px); color: var(--text-2); }
.idea, .original { text-align: center; }
.idea .narrow, .original .narrow { margin: 0 auto; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pillars-section { padding-top: clamp(48px, 7vw, 80px); }
.pillar {
  padding: 32px 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elevated), rgba(31, 27, 24, 0.5));
  border: 1px solid var(--line);
}
.pillar .icon {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 8px rgba(232, 161, 58, 0.35));
}
.pillar h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.pillar p { margin-top: 10px; color: var(--text-2); font-size: 16px; }

.section-head { text-align: center; max-width: 720px; margin: 0 auto; }
.steps {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}
.steps::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 161, 58, 0.45), transparent);
}
.step { position: relative; text-align: center; padding: 0 8px; }
.num {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(232, 161, 58, 0.5);
  color: var(--accent);
  font: 600 15px var(--font-display);
  box-shadow: 0 0 22px rgba(232, 161, 58, 0.25);
}
.step h3 { margin-top: 22px; font-size: 22px; font-weight: 600; }
.step p { margin-top: 8px; color: var(--text-2); font-size: 16px; }

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
  position: relative;
  padding-top: 56px;
}
.status-grid::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
}
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.status-list li { display: grid; grid-template-columns: 18px 1fr; gap: 16px; }
.status-list strong { font: 600 18px var(--font-display); }
.status-list p { color: var(--text-2); margin-top: 4px; }
.dot { width: 12px; height: 12px; margin-top: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); }
.dot.now { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(232, 161, 58, 0.16), 0 0 16px rgba(232, 161, 58, 0.7); }

.contact { padding-bottom: clamp(72px, 10vw, 120px); }
.contact-panel {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(48px, 7vw, 80px) clamp(24px, 5vw, 64px);
  border-radius: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}
.contact-panel::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 120%;
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 70% at 50% 0%, rgba(232, 161, 58, 0.2), transparent 70%);
  pointer-events: none;
}
.contact-panel > * { position: relative; }
.contact-panel p { max-width: 520px; margin: 18px auto 30px; color: var(--text-2); font-size: 18px; }
.contact-panel .btn { overflow-wrap: anywhere; }

.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: 14px; color: var(--text-3); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Reveal on scroll ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card.is-alive .art svg { animation: none !important; }
  .ring { display: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; gap: 14px; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps::before { display: none; }
  .status-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 640px) {
  .stage { height: 400px; perspective: 900px; }
  .table { left: 2%; right: 2%; top: 2%; bottom: 3%; transform: rotateX(38deg); border-radius: 26px; }
  .card { --w: clamp(62px, 20vw, 96px); left: var(--mx); top: var(--my); transform: translate(-50%, -50%) rotate(var(--mr)); }
  .beam { width: 130%; }
  .nav { padding-top: 16px; padding-bottom: 16px; }
}
