/* Design tokens */
:root {
  --bg: #0B0B0C;
  --surface: #121214;
  --text: #F5F6F7;
  --muted: #B8BBC2;
  --brand: #4FD1C5;
  --accent: #A78BFA;
  color-scheme: light dark;
  --header-h: 56px;
  /* Type scale */
  --step--1: clamp(0.85rem, 0.8rem + 0.2vw, 0.95rem);
  --step-0: clamp(1rem, 0.95rem + 0.4vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.1rem + 1vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.6vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 3vw, 3rem);
  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  /* Layout */
  --maxw: 72rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 6px 24px rgba(0,0,0,0.35);
}

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  /* Reserve space so the scroll-to-top button never masks content */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

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

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}

/* Typography */
h1 { font-size: var(--step-3); line-height: 1.1; margin: 0 0 var(--space-3); }
h2 { font-size: var(--step-2); line-height: 1.2; margin: 0 0 var(--space-2); }
h3 { font-size: var(--step-1); line-height: 1.3; margin: 0 0 var(--space-2); }
p, li { font-size: var(--step-0); color: var(--text); }
.subhead { color: var(--muted); }

/* Links */
a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -1000px;
  left: 0;
  background: var(--accent);
  color: #000;
  padding: var(--space-1) var(--space-2);
  border-radius: 6px;
  z-index: 1000;
}
.skip-link:focus { top: 0.5rem; left: 0.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  font-size: var(--step-0);
  font-weight: 600;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--bg);
  background: var(--brand);
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-1);
}
.btn:hover, .btn:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-primary { background: var(--brand); color: #00110f; }
.btn-primary:hover { background: #49c4b9; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 12px rgba(0,0,0,0.25);
}
.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1);
  padding-block: var(--space-1);
}
.brand-wordmark { height: auto; width: clamp(120px, 36vw, 180px); }

/* Make primary nav fit on small screens with horizontal scroll */
.primary-nav {
  flex: 1;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox hide scrollbar */
}
.primary-nav::-webkit-scrollbar { display: none; } /* WebKit hide scrollbar */

.primary-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  white-space: nowrap;
}
.primary-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: var(--step-0);
  font-weight: 600;
  padding: 0.375rem 0.25rem;
  border-radius: 6px;
}
.primary-nav a:hover, .primary-nav a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Sections */
.section { padding-block: var(--space-2); }
.section-hero { padding-block: var(--space-2); background: radial-gradient(1200px 400px at 20% -10%, rgba(79,209,197,0.18), transparent 60%), radial-gradient(800px 300px at 120% 10%, rgba(167,139,250,0.15), transparent 60%); }
.section + .section { border-top: 1px solid rgba(255,255,255,0.06); }
section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* Themed section backgrounds */
#legacy { background: linear-gradient(180deg, rgba(79,209,197,0.10), rgba(79,209,197,0.04)); }
#benefits { background: linear-gradient(180deg, rgba(167,139,250,0.10), rgba(167,139,250,0.04)); }
#styles { background: linear-gradient(180deg, rgba(99,102,241,0.10), rgba(99,102,241,0.04)); }
#transparency { background: linear-gradient(180deg, rgba(56,189,248,0.10), rgba(56,189,248,0.04)); }
#process { background: linear-gradient(180deg, rgba(216,180,254,0.10), rgba(216,180,254,0.04)); }
#showcase { background: linear-gradient(180deg, rgba(34,197,94,0.10), rgba(34,197,94,0.04)); }
#contact { background: linear-gradient(180deg, rgba(253,224,71,0.10), rgba(253,224,71,0.04)); }

/* Hero */
.hero-grid {
  display: grid;
  gap: var(--space-4);
}
.hero-copy .subhead { margin-bottom: var(--space-3); }
.hero-copy .actions { margin-top: var(--space-2); margin-bottom: var(--space-2); }
.trust-note { color: var(--muted); font-size: var(--step--1); }
.hero-media { display: flex; justify-content: center; }
.hero-media img {
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  /* 20% larger across breakpoints */
  max-height: clamp(240px, 38.4vh, 456px);
  max-width: 100%;
  height: auto;
  width: auto;
}

/* Benefits */
.benefits-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-1);
  margin: 0;
  padding: 0;
}
.benefits-list li {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

/* Transparency and Process */
#transparency p + p { margin-top: var(--space-2); }
.steps {
  margin: 0;
  padding-left: 1.25rem;
}
.steps li { margin-bottom: 0.75rem; }

/* Showcase */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
}
.shot img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}

.shot img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}

/* Contact */
#contact .note { color: var(--muted); margin-top: var(--space-2); }
#contact .caveat { color: yellow; font-weight: bold; margin-top: var(--space-2); }
#contact .actions { margin-top: var(--space-2); }

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  background: var(--surface);
  padding-block: var(--space-3);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.footer-left { font-size: var(--step--1); color: var(--muted); }
.footer-right { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.footer-right small { color: var(--muted); }
.footer-right nav { display: inline-flex; gap: var(--space-2); }
.footer-right a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-right a:hover, .footer-right a:focus-visible { color: var(--text); }

/* Mobile footer layout to keep bottom-right corner free */
@media (max-width: 599px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }
  .footer-right {
    align-self: flex-start;
  }
}

/* Media queries */
@media (min-width: 600px) {
  .hero-grid { grid-template-columns: 1fr; }
  .section { padding-block: var(--space-4); }
  .primary-nav ul { gap: var(--space-3); }
  .brand-wordmark { width: 200px; }
  .showcase-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .showcase-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Feature grid and cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-1);
}
.feature-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--text);
  box-shadow: var(--shadow-1);
}
.feature-card h3 { margin: 0 0 var(--space-1); }
.feature-card p { margin: 0; color: var(--muted); }

/* Personas grid */
.personas-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-1);
  margin: 0;
  padding: 0;
}
.personas-grid li {
  border: 1px dashed rgba(255,255,255,0.16);
  border-radius: var(--radius);
  padding: var(--space-2);
  text-align: center;
  color: var(--muted);
}

/* Teaser card */
.teaser-card {
  background: linear-gradient(180deg, rgba(79,209,197,0.12), rgba(79,209,197,0.04));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: var(--space-3);
  box-shadow: var(--shadow-2);
}
.teaser-card .actions { margin-top: var(--space-2); }

/* Parallax panels (progressive enhancement friendly) */
.parallax-panel {
  --amp: 12px; /* mobile amplitude ±12px */
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr;
  isolation: isolate; /* ensure overlay stacks correctly */
}

.parallax-panel--interlude {
  min-height: 80svh;
}

.parallax-bg,
.parallax-overlay {
  position: sticky;
  top: 0;
  height: 100svh;
}

.parallax-bg {
  z-index: 0;
  transform: translateY(calc(var(--parallax, 0) * var(--amp)));
  will-change: transform;
}

.parallax-bg > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.parallax-overlay {
  z-index: 1;
  pointer-events: none;
  /* bottom-to-top gradient: 0.35 at bottom to 0.05 by mid for legibility */
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.05) 55%,
    rgba(0,0,0,0) 100%
  );
}

.parallax-fg {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: end;
  padding-block: var(--space-2);
}

/* Give foreground content breathing room from bottom edge */
.parallax-fg .container {
  padding-bottom: max(var(--space-6), 12vh);
}

/* Tablet amplitude */
@media (min-width: 600px) {
  .parallax-panel { --amp: 30px; } /* tablet amplitude ±30px */
}

/* Desktop amplitude and interlude height tweak */
@media (min-width: 1024px) {
  .parallax-panel { --amp: 60px; } /* desktop amplitude ±60px */
  .parallax-panel--interlude { min-height: 85svh; }
}

/* Respect reduced motion: no parallax movement */
@media (prefers-reduced-motion: reduce) {
  .parallax-panel { --amp: 0px; }
}

/* Parallax tuning v2: smoother scroll and better text readability (overrides) */

/* Make panels scroll naturally (no sticky pinning); clip overflow of moving bg */
.parallax-panel { overflow: clip; overflow: hidden; }

/* Background and overlay now follow section height instead of pinning to viewport */
.parallax-bg,
.parallax-overlay {
  position: absolute;
  inset: 0;
  height: 100%;
}

/* Stronger bottom scrim for legibility */
.parallax-overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.45) 0%,
    rgba(0,0,0,0.08) 55%,
    rgba(0,0,0,0) 100%
  );
}

/* Reduce interlude panel height so scroll feels less "sticky" */
.parallax-panel--interlude { min-height: 70svh; }
@media (min-width: 1024px) {
  .parallax-panel--interlude { min-height: 75svh; }
}

/* Tinted readability cards for hero and interludes */
.section-hero.parallax-panel .hero-copy,
.parallax-panel--interlude .parallax-fg .container {
  background: rgba(12, 12, 14, 0.56);
  -webkit-backdrop-filter: saturate(140%) blur(2px);
  backdrop-filter: saturate(140%) blur(2px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: var(--space-3);
  box-shadow: var(--shadow-2);
  max-width: min(var(--maxw), 48rem);
}

/* Keep interlude card compact and centered */
.parallax-panel--interlude .parallax-fg {
  display: grid;
  align-items: end;
}
.parallax-panel--interlude .parallax-fg .container {
  margin-left: auto;
  margin-right: auto;
}

/* Subtle heading shadow on imagery */
.section-hero.parallax-panel h1,
.parallax-panel--interlude h2 {
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Interlude placement modifiers */
/* Center the foreground content vertically within the panel */
.parallax-panel--center .parallax-fg {
  align-items: center;
}

/* Center the card horizontally and remove large bottom padding used for bottom-aligned layout */
.parallax-panel--center .parallax-fg .container {
  margin-left: auto;
  margin-right: auto;
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

/* Testimonials (accessible, no‑JS) */
.section-testimonials h2 { margin-bottom: var(--space-2); }

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
}

@media (min-width: 600px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
}

.testimonial-card {
  position: relative;
  background: linear-gradient(180deg, rgba(167,139,250,0.12), rgba(79,209,197,0.06));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: var(--space-3);
  box-shadow: var(--shadow-2);
}

.testimonial-card::before {
  content: "“";
  position: absolute;
  top: 0.35rem;
  left: 0.65rem;
  font-size: 4rem;
  line-height: 1;
  color: rgba(255,255,255,0.08);
  pointer-events: none;
}

.testimonial-card blockquote { margin: 0; }
.testimonial-card blockquote p { margin: 0 0 var(--space-2); }
.testimonial-card figcaption { margin: 0; }
.testimonial-card cite {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: var(--step--1);
}

/* Testimonial star ratings */
.testimonial-card .rating {
  display: inline-flex;
  gap: 4px;
  margin-bottom: var(--space-2);
}
.testimonial-card .rating .star {
  font-size: 1.1rem;
  line-height: 1;
  color: #FBBF24; /* accessible amber on dark */
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35));
}

/* Visually hidden utility for accessible text (SR-only) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Foldable lists (details/summary) */
.folds details {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: var(--space-2);
}
.folds details + details { margin-top: var(--space-1); }
.folds summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.folds summary::-webkit-details-marker { display: none; }
.folds details[open] { box-shadow: var(--shadow-1); }

/* Top-level collapsible wrappers */
.folds-top {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: var(--space-3);
  box-shadow: var(--shadow-1);
}
.folds-top[open] { box-shadow: var(--shadow-2); }

/* Make summary look/act like an H2 while remaining collapsible */
.folds-top > .h2-like {
  font-size: var(--step-2);
  line-height: 1.2;
  margin: 0;
  list-style: none;
  cursor: pointer;
}
.folds-top > .h2-like::-webkit-details-marker { display: none; }

/* Spacing for nested fold groups inside the top fold */
.folds-top .folds { margin-top: var(--space-2); }

/* Match collapsible headers to section H2 styling (like "What teachers say") */
.folds-top > .h2-like {
  font-size: var(--step-2);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--text);
  cursor: pointer;
  display: inline-block;
  position: relative;
  padding-right: 1.25rem; /* space for chevron */
}
.folds-top > .h2-like::-webkit-details-marker { display: none; }

/* Collapsible indicator: high-contrast pill chevron */
.folds-top > .h2-like::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0.05rem;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #00110f;                /* dark text on brand background for contrast */
  background: var(--brand);      /* bright brand pill for visibility */
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.folds-top[open] > .h2-like::after {
  content: '+';
  transform: rotate(180deg);
}

/* Collapsible headers: align to standard H2 (match "What teachers say") */
.folds-top {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.folds-top[open] { box-shadow: none !important; }

.folds-top > .h2-like {
  font-size: var(--step-2);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-weight: 700; /* match visual weight of H2 */
  display: inline-block;
  padding-right: 1.25rem; /* space for chevron */
}
.folds-top > .h2-like:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Override: plus/minus circle for collapsibles (stronger, appended last) */
.folds-top > .h2-like { padding-right: 2.5rem; position: relative; }

.folds-top > .h2-like::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.8em;
  height: 1.8em;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  color: #00110f;           /* dark glyph for contrast */
  background: var(--brand); /* brand color pill */
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  transition: background-color .2s ease, color .2s ease;
}

.folds-top[open] > .h2-like::after { transform: translateY(-50%) rotate(45deg); }

/* Final override: plus-to-X indicator (ensures no chevron/minus is used) */
.folds-top > .h2-like::after { content: '+'; }
.folds-top[open] > .h2-like::after { content: '+'; transform: translateY(-50%) rotate(45deg); }

/* Final override v2: brand plus → rotate to X; no circle; center pivot */
.folds-top > .h2-like { padding-right: 2rem; position: relative; }
.folds-top > .h2-like::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transform-origin: 50% 50%;
  font-size: 2.2rem;           /* ~200% larger than prior 1.1rem */
  font-weight: 900;
  line-height: 1;
  color: var(--brand);         /* brand-colored glyph */
  background: none !important; /* remove prior circle styles */
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
}
.folds-top[open] > .h2-like::after {
  content: '+';
  transform: translateY(-50%) rotate(45deg); /* plus pivots to X */
}

/* Header spacing + logo baseline tweak (override) */
.header-inner { column-gap: var(--space-3); } /* more space between logo and nav */
.primary-nav { margin-left: var(--space-3); }  /* additional separation from logo */
.brand-wordmark { position: relative; top: 3px; } /* drop Cadance logo slightly */
