/*
Theme Name:  SleepMetric
Theme URI:   https://sleepmetricscience.com
Author:      SleepMetric Team
Description: Custom theme for SleepMetric Science — science-backed sleep for real life. Built for performance, affiliate monetization, and automated SEO content publishing.
Version:     2.0
License:     Private
Text Domain: sleepmetric
*/

/* ══════════════════════════════════════════
   GLOBAL RESET & DESIGN TOKENS
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

:root {
  --ink:       #060e18;
  --navy:      #0D1B2A;
  --navy-mid:  #0f2035;
  --navy-lo:   #132540;
  --teal:      #00D4FF;
  --teal-dim:  rgba(0,212,255,0.12);
  --teal-glow: rgba(0,212,255,0.25);
  --white:     #F0F6FF;
  --muted:     #7a9ab8;
  --border:    rgba(0,212,255,0.12);
  --border-h:  rgba(0,212,255,0.32);
  --green:     #22d37f;
  --amber:     #f5a623;

  --font-display: 'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
}

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--white);
  overflow-x: hidden;
  cursor: auto;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* ══════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════ */
.sm-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 6%;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(6,14,24,0);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
.sm-nav.scrolled {
  background: rgba(6,14,24,0.88);
  backdrop-filter: blur(20px);
  border-color: var(--border);
}
.sm-nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.sm-nav-logo img {
  max-height: 68px; width: auto; display: block;
}
.sm-nav-logo-icon {
  width: 34px; height: 34px;
  background: var(--teal-dim);
  border: 1.5px solid var(--border-h);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sm-nav-logo-icon svg { width: 18px; height: 18px; }
.sm-nav-logo-text {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  color: var(--white); letter-spacing: -0.02em;
}
.sm-nav-logo-text em { color: var(--teal); font-style: normal; }

/* Nav links — works with both hardcoded UL and wp_nav_menu output */
.sm-nav-links { display: flex; gap: 32px; list-style: none; }
.sm-nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--white); text-decoration: none;
  transition: color 0.2s;
}
.sm-nav-links a:hover,
.sm-nav-links .current-menu-item > a,
.sm-nav-links .current_page_item > a { color: var(--teal); }

/* wp_nav_menu may output sub-menus — hide by default */
.sm-nav-links .sub-menu { display: none; }

.sm-nav-cta {
  background: var(--teal);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px; font-weight: 700;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: box-shadow 0.25s, transform 0.2s;
}
.sm-nav-cta:hover {
  box-shadow: 0 0 28px rgba(0,212,255,0.4);
  transform: translateY(-1px);
}

/* Mobile nav toggle */
.sm-nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
  background: none; border: none;
}
.sm-nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Shared scroll-reveal class */
.sr { opacity: 0; transform: translateY(48px); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.sm-footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--ink);
  padding: 70px 6% 40px;
}
.sm-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.sm-footer-brand {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--white); letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.sm-footer-brand em { color: var(--teal); font-style: normal; }
.sm-footer-desc {
  font-size: 14px; color: var(--muted); line-height: 1.7; max-width: 240px;
}
.sm-footer-col-h {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.sm-footer-links {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
}
.sm-footer-links a {
  font-size: 14px; color: var(--muted); text-decoration: none; transition: color 0.2s;
}
.sm-footer-links a:hover { color: var(--white); }
.sm-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
}

/* ══════════════════════════════════════════
   AFFILIATE CTA BOX (reusable across templates)
══════════════════════════════════════════ */
.sm-affiliate-cta {
  background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(13,27,42,0.9));
  border: 1px solid var(--border-h);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 40px 0;
}
.sm-affiliate-cta .cta-kicker {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.sm-affiliate-cta h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--white); margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.sm-affiliate-cta p {
  font-size: 15px; color: var(--muted); line-height: 1.7; margin-bottom: 18px;
}
.sm-affiliate-cta .cta-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal); color: var(--ink);
  font-weight: 700; font-size: 14px;
  padding: 12px 24px; border-radius: 10px;
  text-decoration: none;
  transition: box-shadow 0.25s, transform 0.2s;
}
.sm-affiliate-cta .cta-btn:hover {
  box-shadow: 0 0 28px rgba(0,212,255,0.4);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   EMAIL CAPTURE INLINE (reusable)
══════════════════════════════════════════ */
.sm-email-inline {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin: 48px 0;
  text-align: center;
}
.sm-email-inline h3 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--white); margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.sm-email-inline p {
  font-size: 15px; color: var(--muted); margin-bottom: 20px;
}
.sm-email-inline .email-form {
  display: flex; gap: 10px; max-width: 460px; margin: 0 auto;
}
.sm-email-inline .email-form input[type="email"] {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--white);
  font-size: 14px;
  font-family: var(--font-body);
}
.sm-email-inline .email-form input[type="email"]::placeholder {
  color: var(--muted);
}
.sm-email-inline .email-form button {
  background: var(--teal);
  color: var(--ink);
  font-weight: 700; font-size: 14px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none; cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: box-shadow 0.25s;
}
.sm-email-inline .email-form button:hover {
  box-shadow: 0 0 28px rgba(0,212,255,0.4);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .sr { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 768px) {
  .sm-nav-links { display: none; }
  .sm-nav-cta { display: none; }
  .sm-nav-toggle { display: flex; }
  .sm-nav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: 72px; left: 0; right: 0;
    background: rgba(6,14,24,0.97);
    backdrop-filter: blur(20px);
    padding: 24px 6%;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }
  .sm-footer-grid { grid-template-columns: 1fr 1fr; }
  .sm-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .sm-email-inline .email-form { flex-direction: column; }
}
