@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&family=Instrument+Serif&display=swap');

:root {
  --background: 220 12% 5%;
  --foreground: 0 0% 96%;
  --surface: 220 8% 8%;
  --surface-elevated: 220 8% 11%;
  --accent-emerald: 158 42% 52%;
  --accent-emerald-soft: 158 30% 45%;
  --border: 217.2 32.6% 17.5%;
  --radius: 0.5rem;
}

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

/* ── Grain Noise Overlay ── */

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

@media (prefers-reduced-motion: reduce) {
  .grain-overlay { display: none; }
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow-x: clip;
  font-family: 'Geist', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  line-height: 1.6;
}

.font-serif {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
}

.font-mono {
  font-family: 'Geist Mono', ui-monospace, monospace;
}

a, button, [role="button"], summary, label, input, textarea, select {
  transition:
    color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Buttons ── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border: none;
  border-radius: var(--radius);
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px hsl(var(--foreground) / 0.15);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-outline:hover {
  border-color: hsl(var(--foreground) / 0.3);
  background: hsl(var(--foreground) / 0.05);
  transform: translateY(-1px);
}

.btn-outline:active {
  transform: scale(0.98);
}

.btn-emerald {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: hsl(var(--accent-emerald));
  color: hsl(var(--background));
  border: none;
  border-radius: var(--radius);
  font-family: 'Geist', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px hsl(var(--accent-emerald) / 0.3);
}

.btn-emerald:active {
  transform: scale(0.98);
}

/* ── Section Background Imagery ── */

.section-bg {
  position: relative;
  overflow: hidden;
}

.section-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-image: var(--bg-img, none);
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.section-bg > * {
  position: relative;
  z-index: 1;
}

.section-bg-ambient::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, hsl(158 30% 28% / 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Staggered Reveal ── */

.stagger {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.stagger.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* ── Sections ── */

.section {
  padding: 5rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: left;
  margin-bottom: 3rem;
}

.section-header.centered {
  text-align: center;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.04em;
  text-transform: none;
  color: hsl(var(--accent-emerald) / 0.75);
  margin-bottom: 0.75rem;
}

.section-title {
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.section-header.centered .section-title {
  margin: 0 auto;
}

.section-subtitle {
  font-size: 1rem;
  color: hsl(var(--foreground) / 0.6);
  max-width: 55ch;
  margin-top: 1rem;
}

.section-header.centered .section-subtitle {
  margin: 1rem auto 0;
}

/* ── Glass Card ── */

.glass-card {
  background: hsl(0 0% 100% / 0.025);
  border: 1px solid hsl(0 0% 100% / 0.08);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / 0.08),
    inset 0 -1px 0 hsl(0 0% 0% / 0.20),
    0 24px 48px -24px hsl(0 0% 0% / 0.6);
  backdrop-filter: blur(12px);
  transition: all 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.glass-card:hover {
  background: hsl(0 0% 100% / 0.04);
  border-color: hsl(0 0% 100% / 0.12);
  transform: translateY(-2px);
}



/* ── Scroll Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* ── Header ── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 300ms ease-out;
  background: transparent;
}

.site-header.is-solid {
  background: hsl(220 12% 5% / 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.header-logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo-img {
  height: 1.75rem;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  font-size: 0.875rem;
  color: hsl(var(--foreground) / 0.7);
  text-decoration: none;
  transition: color 220ms ease;
}

.header-nav a:hover {
  color: hsl(var(--foreground));
}

.header-nav a[aria-current="page"] {
  color: hsl(var(--foreground));
  position: relative;
}

.header-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  right: 0;
  height: 2px;
  background: hsl(var(--accent-emerald));
  border-radius: 1px;
}

.header-nav .btn-primary {
  color: hsl(var(--background));
}

.header-nav .btn-primary:hover {
  color: hsl(var(--background));
}

/* ── Scroll Progress Bar ── */

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: hsl(var(--accent-emerald));
  width: 0%;
  transition: width 50ms linear;
}

/* ── Stat Counters ── */

.stat-group {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 768px) {
  .stat-group {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-figure {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

.stat-label {
  font-size: 0.8125rem;
  color: hsl(var(--foreground) / 0.5);
  margin-top: 0.25rem;
}



/* ── Ambient Orbs ── */

.orb {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform, opacity;
}

.orb-tl { top: -10%; left: -5%; }
.orb-br { bottom: -15%; right: -10%; }
.orb-tr { top: 5%; right: -8%; }
.orb-bl { bottom: -8%; left: -5%; }
.orb-cr { top: 40%; right: 30%; }

.orb-a {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at 30% 30%, hsl(158 30% 28% / 0.35), transparent 65%);
  animation: drift-a 32s ease-in-out infinite, ambient-fade 16s ease-in-out infinite;
}

.orb-b {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at 70% 40%, hsl(220 8% 22% / 0.55), transparent 65%);
  animation: drift-b 40s ease-in-out infinite, ambient-fade 20s ease-in-out infinite;
}

.orb-c {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle at 50% 60%, hsl(158 24% 24% / 0.20), transparent 65%);
  animation: drift-c 48s ease-in-out infinite, ambient-fade 24s ease-in-out infinite;
}

/* ── Ambient Starfield (page top through Problem, canvas-driven) ── */

.stars-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(1000px, 170svh, 2000px);
  z-index: 0;
  pointer-events: none;
  /* dense overhead, fading out before the Problem section */
  mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 96%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 96%);
}

/* page sections sit above the starfield; header/nav keep their own z-index */
body > section {
  position: relative;
  z-index: 1;
}

@keyframes drift-a {
  0%   { transform: translate3d(-2%, -1.5%, 0) scale(1); }
  50%  { transform: translate3d(2.5%, 2%, 0) scale(1.02); }
  100% { transform: translate3d(-2%, -1.5%, 0) scale(1); }
}

@keyframes drift-b {
  0%   { transform: translate3d(3%, 1%, 0) scale(1.01); }
  50%  { transform: translate3d(-2.5%, -2%, 0) scale(0.99); }
  100% { transform: translate3d(3%, 1%, 0) scale(1.01); }
}

@keyframes drift-c {
  0%   { transform: translate3d(0%, 2.5%, 0) scale(1); }
  50%  { transform: translate3d(-3%, -1%, 0) scale(1.02); }
  100% { transform: translate3d(0%, 2.5%, 0) scale(1); }
}

@keyframes ambient-fade {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.85; }
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  z-index: 100;
  transition: top 200ms ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid hsl(var(--border));
  padding: 3rem 1.25rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border) / 0.5);
}

.footer-logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1rem;
  color: hsl(var(--foreground) / 0.7);
}

.footer-tagline {
  font-size: 0.8125rem;
  color: hsl(var(--foreground) / 0.4);
}

.footer-copy {
  font-size: 0.75rem;
  color: hsl(var(--foreground) / 0.3);
}

/* ── Mobile Nav ── */

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: hsl(var(--foreground));
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: hsl(220 12% 8% / 0.98);
  backdrop-filter: blur(24px);
  border-left: 1px solid hsl(var(--border));
  z-index: 60;
  padding: 5rem 2rem 2rem;
  transition: right 300ms cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav.is-open {
  right: 0;
}

.mobile-nav a {
  font-size: 1.125rem;
  color: hsl(var(--foreground) / 0.7);
  text-decoration: none;
  transition: color 220ms ease;
}

.mobile-nav a[aria-current="page"] {
  color: hsl(var(--foreground));
}

.mobile-nav a:hover {
  color: hsl(var(--foreground));
}

.mobile-nav .btn-primary {
  margin-top: auto;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: hsl(0 0% 0% / 0.5);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Utilities ── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.text-emerald {
  color: hsl(var(--accent-emerald));
}

.bg-surface {
  background: hsl(var(--surface));
}

.bg-surface-elevated {
  background: hsl(var(--surface-elevated));
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

  .stat-group {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 1024px) {
  .stat-figure {
    font-size: 2rem;
  }
}

/* Tablet step — iPad portrait/landscape between phone and desktop */
@media (min-width: 769px) and (max-width: 1024px) {
  .section {
    padding: 4rem 1.5rem;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .orb-a {
    width: 380px;
    height: 380px;
  }

  .orb-b {
    width: 320px;
    height: 320px;
  }

  .orb-c {
    width: 280px;
    height: 280px;
  }
}



html {
  scroll-padding-top: 6rem;
}

/* ── Reduced Motion ── */

@media (prefers-reduced-motion: reduce) {
  .orb-a, .orb-b, .orb-c { animation: none; }
  .stars-canvas { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .stagger { opacity: 1; transform: none; transition: none; }
  .site-header { transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Before/After Comparison Grid ── */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .ba-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

.ba-card {
  position: relative;
  overflow: hidden;
}

.ba-card.before {
  border-color: rgba(239, 68, 68, 0.2) !important;
  background: radial-gradient(circle at top left, rgba(239, 68, 68, 0.03), transparent 60%) !important;
}

.ba-card.after {
  border-color: rgba(16, 185, 129, 0.25) !important;
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.04), transparent 60%) !important;
}

/* ── Checklists and list icons ── */
.bullet-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  list-style: none;
}

.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: hsl(var(--foreground) / 0.7);
  line-height: 1.5;
}

.bullet-icon {
  flex-shrink: 0;
  margin-top: 0.2rem;
  display: inline-flex;
}

