/* ═══════════════════════════════════════════
   MELDE — SHARED DESIGN SYSTEM
   Tokens, nav, footer, buttons, waitlist,
   animations, responsive breakpoints.
   All pages import this file.
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Core palette (standardized from homepage values) ── */
  --bg: #000000;
  --bg-card: #111111;
  --bg-card-elevated: #181818;
  --bg-surface: #1f1f1f;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-muted: #6e6e6e;

  /* ── Brand ── */
  --gold: #c8a84e;
  --gold-light: #d4b85c;
  --gold-dim: rgba(200,168,78,0.15);
  --gold-glow: rgba(200,168,78,0.08);

  /* ── Signals ── */
  --green: #34c759;
  --green-dim: rgba(52,199,89,0.12);
  --yellow: #c8a84e;
  --yellow-dim: rgba(200,168,78,0.12);
  --red: #ff453a;
  --red-dim: rgba(255,69,58,0.12);
  --blue: #448aff;

  /* ── Structure ── */
  --border: #222222;
  --border-light: #333333;

  /* ── Typography ── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Ambient glow ─── */
.bg-glow {
  position: fixed;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(200,168,78,0.05) 0%, rgba(200,168,78,0.02) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}


/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.9rem 2rem;
  backdrop-filter: blur(24px) saturate(180%);
  background: rgba(0,0,0,0.75);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold);
  text-decoration: none;
}
.nav-logo span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--gold); }
.nav-links a.btn-gold { color: #fff; font-weight: 800; font-size: 0.88rem; }
.nav-links a.btn-gold:hover { color: #fff; }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }


/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn-gold {
  background: #9A7B2D;
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-decoration: none;
  display: inline-block;
  font-family: var(--font-sans);
}
.btn-gold:hover {
  background: #B8942F;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(200,168,78,0.35);
}
.btn-gold-lg {
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  border-radius: 10px;
}


/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */

section { position: relative; z-index: 1; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 2rem; }


/* ═══════════════════════════════════════════
   SECTION TYPOGRAPHY
   ═══════════════════════════════════════════ */

.section-tag {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
  line-height: 1.1;
}
.section-desc {
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 3rem;
  font-size: 1.05rem;
  line-height: 1.7;
}


/* ═══════════════════════════════════════════
   SUBPAGE HERO (peloton, running, science)
   ═══════════════════════════════════════════ */

.subpage-hero {
  padding: 8rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.subpage-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
}
.subpage-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.50;
  filter: grayscale(0%);
}
.subpage-hero-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, #000 100%);
}


/* ═══════════════════════════════════════════
   ATMOSPHERIC BREAK (peloton, running)
   ═══════════════════════════════════════════ */

.atmosphere-break {
  position: relative;
  height: 360px;
  overflow: hidden;
  margin: 0;
}
.atmosphere-break img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.60;
  filter: grayscale(0%);
}
.atmosphere-break::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.1) 25%, rgba(0,0,0,0.1) 75%, rgba(0,0,0,0.6) 100%);
}
.atmosphere-break-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
}


/* ═══════════════════════════════════════════
   CTA SECTION
   ═══════════════════════════════════════════ */

.cta-section {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(200,168,78,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}
.cta-section p {
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}


/* ═══════════════════════════════════════════
   WAITLIST FORM
   ═══════════════════════════════════════════ */

.waitlist-form {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  max-width: 540px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.waitlist-form input {
  flex: 1;
  min-width: 220px;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.waitlist-form input:focus { border-color: var(--gold); }
.waitlist-form input::placeholder { color: var(--text-muted); }
.waitlist-form .access-code-row {
  width: 100%;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.waitlist-form .access-code-row input { flex: 1; }
.access-code-hint {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.35rem;
  font-style: italic;
}
.waitlist-note {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  font-weight: 500;
}
.waitlist-success {
  display: none;
  text-align: center;
  padding: 1rem;
  background: var(--gold-dim);
  border: 1px solid rgba(200,168,78,0.25);
  border-radius: 12px;
  color: var(--gold);
  font-weight: 600;
  max-width: 460px;
  margin: 0 auto;
}


/* ═══════════════════════════════════════════
   SIGNAL CARDS (homepage + science)
   ═══════════════════════════════════════════ */

.signal-section {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.signal-card {
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.signal-card-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}
.signal-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.50;
  filter: grayscale(0%);
}
.signal-card > *:not(.signal-card-bg) {
  position: relative;
  z-index: 1;
}
.signal-card.green { background: var(--green-dim); border: 1px solid rgba(52,199,89,0.15); }
.signal-card.yellow { background: var(--yellow-dim); border: 1px solid rgba(200,168,78,0.2); }
.signal-card.red { background: var(--red-dim); border: 1px solid rgba(255,69,58,0.15); }
.signal-card-indicator {
  width: 48px; height: 48px;
  border-radius: 50%;
  margin: 0 auto 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.green .signal-card-indicator { background: rgba(52,199,89,0.15); }
.yellow .signal-card-indicator { background: rgba(200,168,78,0.15); }
.red .signal-card-indicator { background: rgba(255,69,58,0.15); }
.signal-card-dot { width: 16px; height: 16px; border-radius: 50%; }
.green .signal-card-dot { background: var(--green); box-shadow: 0 0 18px rgba(52,199,89,0.5); animation: signal-pulse-green 3s ease-in-out infinite; }
.yellow .signal-card-dot { background: var(--gold); box-shadow: 0 0 18px rgba(200,168,78,0.5); animation: signal-pulse-yellow 3s ease-in-out infinite; }
.red .signal-card-dot { background: var(--red); box-shadow: 0 0 18px rgba(255,69,58,0.5); animation: signal-pulse-red 3s ease-in-out infinite; }
.signal-card h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.green h3 { color: var(--green); }
.yellow h3 { color: var(--gold); }
.red h3 { color: var(--red); }
.signal-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */

footer {
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1140px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { font-weight: 700; font-size: 1rem; color: var(--gold); }
.footer-copy { color: var(--text-muted); font-size: 0.8rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-secondary); }


/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes goldPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ── Signal dot pulse animations ── */
@keyframes signal-pulse-green {
  0%, 100% { box-shadow: 0 0 18px rgba(52,199,89,0.5); transform: scale(1); }
  50% { box-shadow: 0 0 28px rgba(52,199,89,0.7); transform: scale(1.05); }
}
@keyframes signal-pulse-yellow {
  0%, 100% { box-shadow: 0 0 18px rgba(200,168,78,0.5); transform: scale(1); }
  50% { box-shadow: 0 0 28px rgba(200,168,78,0.7); transform: scale(1.05); }
}
@keyframes signal-pulse-red {
  0%, 100% { box-shadow: 0 0 18px rgba(255,69,58,0.5); transform: scale(1); }
  50% { box-shadow: 0 0 28px rgba(255,69,58,0.7); transform: scale(1.05); }
}


/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .signal-grid { grid-template-columns: 1fr; }
  .nav-hamburger { display: block; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.2rem; }
  .subpage-hero { padding: 7rem 1.5rem 3rem; }
  .atmosphere-break { height: 180px; }
}
