/* ═══════════════════════════════════════════════════════════
   VOLLEY — Global Base Styles  (global.css)
   Reset · Body · Navbar · Shared components · Animations
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--obsidian);
  color: var(--ghost);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.026'/%3E%3C/svg%3E");
  pointer-events: none;
}

body > * { position: relative; z-index: 1; }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 800; line-height: 1.0; letter-spacing: 0.02em; }
p   { line-height: 1.6; }
a   { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(17,17,17,0.82);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  /* Allow absolute centering of tagline */
  position: fixed;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}

/* FIX #9 — PNG logo replaces inline SVG */
.nav-logo-img {
  width: 36px;
  height: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 800;
  letter-spacing: 0.10em; text-transform: lowercase;
  color: var(--ghost); line-height: 1;
  transition: color 0.2s;
}
.nav-brand:hover .nav-wordmark { color: var(--lime); }

.nav-tagline {
  font-size: var(--text-xs); font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--grey);
  animation: fadeIn 0.6s 1.0s both;
  /* True center — independent of left/right widths */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.nav-link {
  font-size: var(--text-sm); font-weight: 500;
  color: var(--ghost-2); text-decoration: none;
  padding: 6px 12px; border-radius: var(--r-sm);
  transition: color 0.18s, background 0.18s;
  letter-spacing: 0.01em; white-space: nowrap;
}
.nav-link:hover  { color: var(--ghost); background: var(--ghost-5); }
.nav-link.active { color: var(--lime); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: var(--lime-muted); border: 1px solid var(--lime-border);
  border-radius: var(--r-pill);
  color: var(--lime); font-family: var(--font-body);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-spring);
  white-space: nowrap;
}
.nav-cta:hover { background: var(--lime-glow); box-shadow: var(--shadow-lime); transform: scale(1.04); }

/* FIX #12 — Streak badge */
.nav-streak {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 700;
  color: var(--ghost-2); letter-spacing: 0.06em;
  white-space: nowrap; transition: border-color 0.2s, color 0.2s;
}
.nav-streak.has-streak { border-color: rgba(255,184,0,0.35); color: var(--warning); }
.nav-streak-icon { font-size: 13px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: var(--font-body); font-weight: 600;
  border-radius: var(--r-pill);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.22s, background 0.15s, color 0.15s, border-color 0.15s;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn-lg  { font-size: var(--text-base); padding: 14px 40px; }
.btn-md  { font-size: var(--text-base); padding: 12px 30px; }
.btn-sm  { font-size: var(--text-sm);   padding: 9px  20px; }

.btn-primary {
  background: var(--lime); color: var(--obsidian);
  box-shadow: 0 0 24px rgba(200,241,53,0.28);
}
.btn-primary:hover { background: var(--lime-bright); transform: scale(1.05); box-shadow: 0 0 40px rgba(200,241,53,0.45); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { background: transparent; color: var(--ghost-2); border: 1.5px solid var(--ghost-4); }
.btn-secondary:hover { border-color: var(--lime); color: var(--lime); background: var(--lime-muted); transform: scale(1.03); }

.btn-ghost { background: var(--ghost-5); color: var(--ghost-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ghost); border-color: var(--border-strong); transform: scale(1.02); }

/* Full-width button variant */
.btn-full { width: 100%; justify-content: center; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(72px);
  background: var(--surface-3); color: var(--ghost);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 11px 22px; font-size: var(--text-sm); font-weight: 500;
  z-index: 9999; opacity: 0; pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.28s, transform 0.36s var(--ease-spring);
  backdrop-filter: blur(12px); max-width: calc(100vw - 48px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── ECG ─────────────────────────────────────────────────── */
.ecg-line { display: block; overflow: visible; }
.ecg-animated { animation: ecgScroll 4s linear infinite; transform-origin: left center; }
@keyframes ecgScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
@keyframes fadeInUp  { from { opacity:0; transform:translateY(22px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeInDown{ from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes scaleIn   { from { opacity:0; transform:scale(0.88); } to { opacity:1; transform:scale(1); } }
@keyframes pulse     { 0%,100%{ opacity:0.45; transform:scale(1); } 50%{ opacity:1; transform:scale(1.06); } }
@keyframes float     { 0%,100%{ transform:translateY(0) scale(1); } 50%{ transform:translateY(-16px) scale(1.04); } }
@keyframes shimmer   { from{ background-position:-200% 0; } to{ background-position:200% 0; } }
@keyframes starPop   { 0%{ transform:scale(0.5); } 60%{ transform:scale(1.35); } 100%{ transform:scale(1); } }

/* ── UTILITY ─────────────────────────────────────────────── */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 540px) {
  .nav-tagline { display: none; }
  .navbar      { padding: 0 16px; }
  .nav-streak  { display: none; }
}
