/* ============================================================
   ClimbFit — Design System v2
   Clean Modern Sans-Serif headings · Accessible · Logo PNG
   ============================================================ */

/* ----- Fonts ---------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@400;500;600;700;800&display=swap');

/* ----- Design Tokens -------------------------------------- */
:root {
  --font-display:   'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Dark mode (default) */
  --bg:             #080810;
  --surface:        #10101c;
  --surface-raised: #18182a;
  --text:           #e4e4f0;
  --text-muted:     #7a7a9a;
  --text-faint:     #35354a;
  --accent-pink:    #ff4d8d;
  --accent-cyan:    #00e5ff;
  --accent-yellow:  #f5d000;
  --accent-purple:  #b14fff;
  --border:         rgba(255,255,255,0.07);
  --border-active:  rgba(255,255,255,0.18);

  /* Gradients */
  --grad-hero:   linear-gradient(160deg, #0a0a18 0%, #060612 60%, #100a20 100%);
  --grad-accent: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  --grad-pink:   linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  --grad-warm:   linear-gradient(135deg, var(--accent-yellow), var(--accent-pink));

  /* Glows */
  --glow-cyan:   0 0 24px rgba(0,229,255,0.35), 0 0 60px rgba(0,229,255,0.12);
  --glow-pink:   0 0 24px rgba(255,77,141,0.35), 0 0 60px rgba(255,77,141,0.12);
  --glow-yellow: 0 0 24px rgba(245,208,0,0.35),  0 0 60px rgba(245,208,0,0.12);
  --glow-purple: 0 0 24px rgba(177,79,255,0.35), 0 0 60px rgba(177,79,255,0.12);

  /* Focus ring — meets WCAG 2.1 §2.4.7 */
  --focus-ring: 0 0 0 3px rgba(0,229,255,0.55);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-s:  1rem;
  --space-m:  1.5rem;
  --space-l:  3rem;
  --space-xl: 6rem;
  --space-2xl: 10rem;

  /* Layout */
  --max-w: 1180px;
  --nav-h: 64px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

  /* Radius */
  --r-s: 8px;
  --r-m: 16px;
  --r-l: 24px;
  --r-xl: 40px;
}

[data-theme="light"] {
  --bg:             #f2f2f7;
  --surface:        #ffffff;
  --surface-raised: #fafaff;
  --text:           #0d0d18;
  --text-muted:     #666680;
  --text-faint:     #c8c8d8;
  --accent-pink:    #e0005f;
  --accent-cyan:    #007acc;
  --accent-yellow:  #c9a800;
  --accent-purple:  #7c2fe0;
  --border:         rgba(0,0,0,0.08);
  --border-active:  rgba(0,0,0,0.2);
  --grad-hero: linear-gradient(160deg, #f0f0fa 0%, #e8e8f5 60%, #f2eeff 100%);
}

/* ----- Reduced motion ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.35s var(--ease-out), color 0.35s var(--ease-out);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }

/* Global focus-visible — WCAG 2.1 AA */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-s);
}

/* Skip-to-content link for keyboard/SR users */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-s);
  background: var(--accent-cyan);
  color: #080810;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--r-s) var(--r-s);
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ----- Typography ----------------------------------------- */
.heading-hero {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 7.5vw, 6.8rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.heading-1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.heading-2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.heading-3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.body-l   { font-size: 1.125rem; line-height: 1.75; }
.body-m   { font-size: 1rem;     line-height: 1.75; }
.body-s   { font-size: 0.875rem; line-height: 1.65; }
.label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}
.text-muted { color: var(--text-muted); }

.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-warm {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.section    { padding: var(--space-xl) 0; }
.section-sm { padding: var(--space-l) 0; }

/* ----- Navigation ----------------------------------------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s, box-shadow 0.4s;
}

.site-nav.scrolled {
  background: rgba(8,8,16,0.82);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 1px 0 var(--border);
}

[data-theme="light"] .site-nav.scrolled {
  background: rgba(242,242,247,0.88);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo container */
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

/* Unified Logo Image */
.nav-logo-img {
  height: 30px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* Light / Dark theme logo switching */
.nav-logo-img.logo-light-theme {
  display: none;
}
.nav-logo-img.logo-dark-theme {
  display: block;
}

[data-theme="light"] .nav-logo-img.logo-dark-theme {
  display: none;
}
[data-theme="light"] .nav-logo-img.logo-light-theme {
  display: block;
}

/* Legacy fallback classes if used */
.nav-logo-icon,
.nav-logo-wordmark {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nav-logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  animation: pulse-dot 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.7; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent-cyan);
  transition: width 0.25s var(--ease-out);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a:focus-visible { box-shadow: var(--focus-ring); border-radius: 2px; }

.nav-cta {
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-xl);
  background: var(--accent-cyan);
  color: #080810 !important;
  font-weight: 700;
  font-size: 0.875rem;
  transition: box-shadow 0.25s, transform 0.2s;
}

.nav-cta:hover { box-shadow: var(--glow-cyan); transform: translateY(-1px); }
.nav-cta::after { display: none !important; }

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-s);
}

/* Theme toggle */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s, transform 0.3s var(--ease-out);
}

.theme-toggle:hover {
  border-color: var(--border-active);
  color: var(--text);
  transform: rotate(20deg);
}

.theme-toggle svg { width: 18px; height: 18px; }

/* Mobile menu btn */
.nav-menu-btn {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-s);
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  color: var(--text);
}

.nav-menu-btn span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

/* ----- Buttons -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--r-xl);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s;
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #080810;
}
.btn-primary:hover { box-shadow: var(--glow-cyan); transform: translateY(-2px); }

.btn-outline {
  border: 1.5px solid var(--border-active);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-pink {
  background: var(--accent-pink);
  color: #fff;
}
.btn-pink:hover { box-shadow: var(--glow-pink); transform: translateY(-2px); }

.btn-icon { font-size: 1.1em; }

/* ----- Tag / Badge ---------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: var(--r-xl);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border-active);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
}

.tag-cyan   { border-color: var(--accent-cyan);   color: var(--accent-cyan); }
.tag-pink   { border-color: var(--accent-pink);   color: var(--accent-pink); }
.tag-yellow { border-color: var(--accent-yellow); color: var(--accent-yellow); }
.tag-purple { border-color: var(--accent-purple); color: var(--accent-purple); }

/* ----- Card ----------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: var(--space-l);
  transition: border-color 0.3s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* ----- Color utility bg ---------------------------------- */
.bg-cyan   { background: rgba(0,229,255,0.1); }
.bg-pink   { background: rgba(255,77,141,0.1); }
.bg-yellow { background: rgba(245,208,0,0.1); }
.bg-purple { background: rgba(177,79,255,0.1); }

/* ----- Section Header ------------------------------------- */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-xl);
}

.section-header .label {
  color: var(--accent-cyan);
  margin-bottom: var(--space-s);
  display: block;
}

.section-header p {
  color: var(--text-muted);
  margin-top: var(--space-s);
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ----- Grid helpers --------------------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-m); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-m); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-m); }

/* ----- Scroll-reveal animation ---------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.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; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ----- Glow orb ------------------------------------------ */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* ----- Footer --------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-l) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: var(--space-m);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }
.footer-links a:focus-visible { box-shadow: var(--focus-ring); border-radius: 2px; }

/* ----- Noise texture overlay ------------------------------ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ----- Responsive ----------------------------------------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--space-l) 0; }
  .nav-links { display: none; }
  .nav-menu-btn { display: flex; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
