/* ============================================
   Triple Peaks — Design System & Styles
   Light theme, typography-driven, minimal
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Brand Colors */
  --green: #145A32;
  --green-light: #1a7a44;
  --green-dark: #0e3d22;
  --orange: #FF6B00;
  --orange-light: #ff8533;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.02);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-600);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; }

p {
  color: var(--gray-600);
  max-width: 65ch;
}

.text-center { text-align: center; }
.text-center p { margin-inline: auto; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

section {
  padding: var(--space-4xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header p {
  margin-top: var(--space-md);
  font-size: 1.125rem;
  margin-inline: auto;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--white);
  z-index: 1000;
  border-bottom: 1px solid var(--gray-200);
}

.nav .container {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gray-900);
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-logo span {
  color: var(--green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-left: auto;
  order: 2;
}

.nav-links a {
  color: var(--gray-600);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gray-900);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gray-900);
  border-radius: 1px;
}

.nav-links a {
  position: relative;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--green) !important;
  color: var(--white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--transition-fast);
  white-space: nowrap;
  margin-left: var(--space-xl);
  order: 3;
}

.nav-cta:hover {
  background: var(--green-light) !important;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gray-900);
  border-radius: 1px;
  transition: var(--transition-fast);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: var(--space-2xl);
    gap: var(--space-lg);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    border-top: 1px solid var(--gray-200);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.125rem;
    color: var(--gray-900);
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-height: 48px;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  border-color: var(--gray-300);
  color: var(--gray-900);
  transform: translateY(-1px);
}

.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-green:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1.0625rem;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  min-height: 40px;
}

/* --- Hero --- */
.hero {
  padding-top: calc(var(--nav-height) + var(--space-3xl));
  padding-bottom: var(--space-3xl);
  background: var(--white);
  position: relative;
}

.hero-content {
  max-width: 680px;
}

.hero h1 {
  color: var(--gray-900);
  margin-bottom: var(--space-lg);
}

.hero p {
  color: var(--gray-500);
  font-size: 1.25rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + var(--space-3xl));
    padding-bottom: var(--space-3xl);
  }
}

/* --- Feature List (text-only 2-col grid) --- */
.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl) var(--space-3xl);
}

.feature-list-item h3 {
  margin-bottom: var(--space-xs);
  font-size: 1.0625rem;
}

.feature-list-item p {
  font-size: 0.9375rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .feature-list {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

/* --- Sports Section --- */
.sports-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  flex-wrap: wrap;
}

.sport {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 100px;
}

.sport-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-sm);
  padding: 14px;
}

.sport-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sport-multi {
  position: relative;
  width: 90px;
  height: 80px;
  margin: 0 auto var(--space-sm);
}

.sport-multi .mini-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: absolute;
}

.sport-multi .mini-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Triathlon: 3 circles in triangle */
.sport-multi.tri .mini-icon:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.sport-multi.tri .mini-icon:nth-child(2) {
  bottom: 0;
  left: 0;
}

.sport-multi.tri .mini-icon:nth-child(3) {
  bottom: 0;
  right: 0;
}

/* Duathlon: 2 circles side by side */
.sport-multi.du .mini-icon:nth-child(1) {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.sport-multi.du .mini-icon:nth-child(2) {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.sport span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

@media (max-width: 480px) {
  .sports-grid {
    gap: var(--space-lg) var(--space-xl);
  }

  .sport-icon {
    width: 56px;
    height: 56px;
    padding: 12px;
  }
}

/* --- CTA Section --- */
.cta-section {
  background: var(--gray-50);
  text-align: center;
}

.cta-section h2 {
  color: var(--gray-900);
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: var(--gray-500);
  margin-inline: auto;
  margin-bottom: var(--space-xl);
  font-size: 1.125rem;
}

/* --- Footer Simple --- */
.footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: var(--space-xl) 0;
}

.footer-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer-simple .footer-copyright {
  white-space: nowrap;
}

.footer-simple .footer-links {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-simple .footer-links a {
  color: var(--gray-500);
  transition: color var(--transition-fast);
}

.footer-simple .footer-links a:hover {
  color: var(--gray-900);
}

@media (max-width: 768px) {
  .footer-simple {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }

  .footer-simple .footer-links {
    gap: var(--space-md);
  }
}

/* --- Page Header --- */
.page-header {
  padding-top: calc(var(--nav-height) + var(--space-3xl));
  padding-bottom: var(--space-3xl);
  background: var(--white);
}

.page-header h1 {
  color: var(--gray-900);
  margin-bottom: var(--space-md);
}

.page-header p {
  color: var(--gray-500);
  font-size: 1.125rem;
  max-width: 600px;
}

.page-header.text-center p {
  margin-inline: auto;
}

/* --- Features Page (text-driven sections) --- */
.feature-section {
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--gray-100);
}

.feature-section:last-of-type {
  border-bottom: none;
}

.feature-narrow {
  max-width: 640px;
  margin-inline: auto;
}

.feature-narrow h2 {
  margin-bottom: var(--space-lg);
}

.feature-narrow p {
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.feature-narrow ul {
  margin-top: var(--space-lg);
}

.feature-narrow ul li {
  padding-left: var(--space-lg);
  position: relative;
  margin-bottom: var(--space-sm);
  color: var(--gray-600);
}

.feature-narrow ul li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: var(--gray-400);
}

/* --- Pricing Page --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  max-width: 800px;
  margin-inline: auto;
}

.pricing-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
}

.pricing-card.featured {
  border-color: var(--green);
}

.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card h3 {
  margin-bottom: var(--space-sm);
}

.pricing-card .price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: var(--space-lg) 0;
}

.pricing-card .price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
}

.pricing-card .price-note {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: -0.5rem;
  margin-bottom: var(--space-lg);
}

.pricing-features {
  margin: var(--space-xl) 0;
}

.pricing-features li {
  padding: var(--space-sm) 0;
  padding-left: var(--space-xl);
  position: relative;
  font-size: 0.9375rem;
  color: var(--gray-600);
}

.pricing-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.pricing-card .btn {
  width: 100%;
}

@media (max-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* Goal-based pricing */
.goals-section {
  background: var(--gray-50);
}

.goal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  max-width: 900px;
  margin-inline: auto;
}

.goal-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
}

.goal-card h4 {
  margin-bottom: var(--space-xs);
}

.goal-card .goal-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--orange);
  margin: var(--space-md) 0;
}

.goal-card p {
  font-size: 0.875rem;
  margin-inline: auto;
}

/* --- Changelog Page --- */
.changelog-entries {
  max-width: 640px;
  margin-inline: auto;
}

.changelog-entry {
  position: relative;
  padding-left: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-left: 2px solid var(--gray-200);
}

.changelog-entry:last-child {
  border-left-color: transparent;
}

.changelog-entry::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
}

.changelog-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
}

.changelog-version {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--gray-900);
}

.changelog-date {
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.changelog-entry h3 {
  margin-bottom: var(--space-xs);
  font-size: 1rem;
}

.changelog-entry p {
  font-size: 0.9375rem;
  color: var(--gray-500);
}

/* --- Legal Pages --- */
.legal-content {
  max-width: 640px;
  margin-inline: auto;
  padding: var(--space-3xl) 0;
}

.legal-content h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  font-size: 1.375rem;
}

.legal-content h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.legal-content p {
  margin-bottom: var(--space-md);
  max-width: none;
}

.legal-content ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.legal-content ul li {
  list-style: disc;
  margin-bottom: var(--space-xs);
  color: var(--gray-600);
}

.legal-content a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-content a:hover {
  color: var(--green-light);
}

/* --- Utility --- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
