/* ============================================
   CALIBR HEALTH — Design Tokens & Styles
   Art Direction: Clean, precise, scientific.
   Warm slate + amber. Modern men's health.
   ============================================ */

/* --- Type Scale (fluid) --- */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* --- Spacing (4px base) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* --- Fonts --- */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;
}

/* ============================================
   LIGHT MODE — Warm Slate + Amber
   ============================================ */
:root,
[data-theme='light'] {
  --color-bg: #f5f3ef;
  --color-surface: #faf9f6;
  --color-surface-2: #ffffff;
  --color-surface-offset: #edeae4;
  --color-divider: #d9d5cd;
  --color-border: #ccc8bf;

  --color-text: #1a1814;
  --color-text-muted: #6b665d;
  --color-text-faint: #a09b92;
  --color-text-inverse: #faf9f6;

  /* Primary — Deep Slate */
  --color-primary: #2c3e3a;
  --color-primary-hover: #1e2e2a;
  --color-primary-active: #141f1c;

  /* Accent — Warm Amber */
  --color-accent: #c4803a;
  --color-accent-hover: #a96a2b;
  --color-accent-light: #f4e8d8;

  /* Semantic */
  --color-success: #3d7a3f;
  --color-error: #a13544;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 60 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 60 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 60 / 0.12);
}

/* ============================================
   DARK MODE — Deep Charcoal + Warm Amber
   ============================================ */
[data-theme='dark'] {
  --color-bg: #141210;
  --color-surface: #1c1a17;
  --color-surface-2: #232019;
  --color-surface-offset: #1e1c18;
  --color-divider: #2e2b26;
  --color-border: #3a3630;

  --color-text: #d8d4cc;
  --color-text-muted: #8a857c;
  --color-text-faint: #5e5a53;
  --color-text-inverse: #1a1814;

  --color-primary: #a8c4b8;
  --color-primary-hover: #8fb0a2;
  --color-primary-active: #769c8c;

  --color-accent: #d4944e;
  --color-accent-hover: #e0a86a;
  --color-accent-light: #2e2418;

  --color-success: #6daa45;
  --color-error: #dd6974;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #141210;
    --color-surface: #1c1a17;
    --color-surface-2: #232019;
    --color-surface-offset: #1e1c18;
    --color-divider: #2e2b26;
    --color-border: #3a3630;
    --color-text: #d8d4cc;
    --color-text-muted: #8a857c;
    --color-text-faint: #5e5a53;
    --color-text-inverse: #1a1814;
    --color-primary: #a8c4b8;
    --color-primary-hover: #8fb0a2;
    --color-primary-active: #769c8c;
    --color-accent: #d4944e;
    --color-accent-hover: #e0a86a;
    --color-accent-light: #2e2418;
    --color-success: #6daa45;
    --color-error: #dd6974;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-8);
  }
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.06);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.header--scrolled {
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}
.header-logo svg {
  width: 32px;
  height: 32px;
}
.header-logo span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}
.header-nav {
  display: none;
  align-items: center;
  gap: var(--space-8);
}
@media (min-width: 768px) {
  .header-nav {
    display: flex;
  }
}
.header-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.header-nav a:hover {
  color: var(--color-text);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text);
}
@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile menu */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 49;
  padding: var(--space-8) var(--space-4);
  flex-direction: column;
  gap: var(--space-6);
}
.mobile-nav.is-open {
  display: flex;
}
.mobile-nav a {
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
}
.btn-primary:active {
  background: var(--color-primary-active);
}
.btn-accent {
  background: var(--color-accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--color-accent-hover);
}
.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid oklch(from var(--color-text) l c h / 0.15);
}
.btn-outline:hover {
  background: var(--color-surface-offset);
  border-color: oklch(from var(--color-text) l c h / 0.25);
}
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 20%;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    oklch(from var(--color-bg) l c h / 0.95) 0%,
    oklch(from var(--color-bg) l c h / 0.85) 35%,
    oklch(from var(--color-bg) l c h / 0.5) 60%,
    oklch(from var(--color-bg) l c h / 0.1) 80%,
    transparent 100%
  );
}
@media (max-width: 767px) {
  .hero-overlay {
    background: linear-gradient(
      to top,
      oklch(from var(--color-bg) l c h / 0.95) 0%,
      oklch(from var(--color-bg) l c h / 0.8) 40%,
      oklch(from var(--color-bg) l c h / 0.3) 80%,
      transparent 100%
    );
  }
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}
@media (max-width: 767px) {
  .hero {
    min-height: 90vh;
    align-items: flex-end;
    padding-bottom: var(--space-12);
  }
  .hero-content {
    max-width: 100%;
  }
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}
.hero-tag::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--color-accent);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.hero p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 36ch;
}
.hero-ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  padding-block: var(--space-8);
  text-align: center;
}
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
    padding-block: var(--space-10);
  }
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-grid {
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 768px) {
  .how-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}
.how-step {
  position: relative;
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
}
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.how-step h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.how-step p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  margin-bottom: var(--space-12);
}
.section-header.center {
  text-align: center;
}
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.section-tag::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--color-accent);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.section-header p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 50ch;
  line-height: 1.65;
}
.section-header.center p {
  margin-inline: auto;
}

/* ============================================
   SPLIT SECTION (image + text)
   ============================================ */
.split {
  display: grid;
  gap: var(--space-10);
  align-items: center;
}
@media (min-width: 768px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
}
.split-image {
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.split-image img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* ============================================
   PRICING CARD
   ============================================ */
.pricing-wrapper {
  max-width: 480px;
  margin-inline: auto;
}
.pricing-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
}
.pricing-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.pricing-amount {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-1);
}
.pricing-period {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}
.pricing-divider {
  height: 1px;
  background: var(--color-divider);
  margin-bottom: var(--space-6);
}
.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}
.pricing-features li svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-success);
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonials-grid {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.testimonial-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.testimonial-stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}
.testimonial-card blockquote {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  font-style: normal;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
}
.testimonial-info {
  display: flex;
  flex-direction: column;
}
.testimonial-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.testimonial-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   FAQ
   ============================================ */
.faq-list {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}
.faq-item {
  border-bottom: 1px solid var(--color-divider);
}
.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-5) 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  gap: var(--space-4);
  cursor: pointer;
  background: none;
  border: none;
}
.faq-trigger svg {
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--color-text-muted);
}
.faq-item.is-open .faq-trigger svg {
  transform: rotate(45deg);
}
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-item.is-open .faq-content {
  max-height: 300px;
}
.faq-content p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  padding-bottom: var(--space-5);
  max-width: 60ch;
}

/* ============================================
   CTA BANNER
   ============================================ */
.cta-banner {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  text-align: center;
  padding-block: clamp(var(--space-12), 8vw, var(--space-20));
}
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-3);
  color: var(--color-text-inverse);
}
.cta-banner p {
  font-size: var(--text-base);
  opacity: 0.8;
  margin-bottom: var(--space-8);
  max-width: 44ch;
  margin-inline: auto;
  line-height: 1.65;
}
.btn-cta-white {
  background: #fff;
  color: var(--color-primary);
  font-weight: 700;
}
.btn-cta-white:hover {
  background: #f0efed;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-10);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-brand-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.footer-brand-name svg {
  width: 24px;
  height: 24px;
}
.footer-tagline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: 32ch;
}
.footer-links {
  display: flex;
  gap: var(--space-8);
}
.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  padding-block: var(--space-1);
}
.footer-col a:hover {
  color: var(--color-accent);
}
.footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.6;
  max-width: 80ch;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
