/* ==========================================================================
   SN Athletics — Design Tokens
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --bg-raised: #111111;
  --text: #ffffff;
  --text-secondary: #999999;
  --gold: #c8a84b;
  --divider: #2a2a2a;

  --font-display: 'Anton', 'Archivo Black', sans-serif;
  --font-body: 'IBM Plex Sans', 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;

  --container: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Glass surfaces: rounded, translucent, blurred, gold-lit — used for
     every card/button/badge. Plain text and tables stay sharp on
     purpose, so the rounding reads as a material, not a blanket style. */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --glass-bg: rgba(17, 17, 17, 0.55);
  --glass-bg-gold: rgba(24, 20, 10, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-gold: rgba(200, 168, 75, 0.45);
  --glass-blur: blur(20px);
  --glow-gold: 0 20px 44px -18px rgba(200, 168, 75, 0.3);
  --glow-dark: 0 20px 40px -22px rgba(0, 0, 0, 0.75);
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Visible focus state for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Large, sliding motion is removed; short opacity fades remain
     (see component-level reduced-motion rules below for the hero). */
  .reveal {
    transform: none;
    transition: opacity 0.3s ease;
  }
}

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(4rem, 9vw, 7rem) 0;
  border-top: 1px solid var(--divider);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.1;
}

.section-lede {
  margin-top: 1rem;
  color: var(--text-secondary);
  max-width: 52ch;
}

/* Reveal-on-scroll (used for every non-signature element) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.3s ease;
}

.site-header.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.site-header.is-scrolled {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 15px;
  color: var(--text);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}

.main-nav a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  opacity: 1;
  color: var(--gold);
}

.nav-cta {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--gold);
  color: var(--gold) !important;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  transition: background-color 0.2s ease, color 0.2s ease !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--gold);
  color: var(--bg) !important;
}

.nav-toggle {
  display: none;
  width: 28px;
  height: 20px;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }

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

/* ==========================================================================
   Hero — signature scroll-scrubbed reveal
   ========================================================================== */

/* .hero-pin is the scroll runway: its extra height is what gives the
   scrub room to work with. .hero itself sticks to the top of the
   viewport for that whole runway, so scroll position maps 1:1 to draw
   progress — scroll down and the mark draws, scroll back up and it
   undraws, exactly in step (see primeScrollScrub in js/main.js). */
.hero-pin {
  position: relative;
  height: 320vh;
}

.hero {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem var(--gutter) 4rem;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  /* No scroll-jacked runway for reduced motion: the hero is a normal
     single-viewport section and JS paints it fully revealed up front
     instead of scrubbing it. */
  .hero-pin {
    height: auto;
  }
  .hero {
    position: relative;
    min-height: 100svh;
  }
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Translucent on purpose: this is a legibility vignette over the
     .hero-parallax scene behind it, not an opaque backdrop of its own —
     an opaque layer here would hide the parallax depth completely. */
  background: linear-gradient(180deg, rgba(10,10,10,0.35) 0%, rgba(10,10,10,0.75) 55%, var(--bg) 100%);
  /* TODO: once real training photos exist, add one as a new
     .hero-parallax__layer (see below) so it inherits the scroll depth,
     rather than pasting it in here. */
  opacity: 0; /* JS drives this directly in lockstep with scroll progress */
}

/* Parallax depth layers — atmosphere behind the hero content, built from
   the brand mark itself rather than stock photography. Purely
   scroll-position-driven (see js/main.js), not part of the reveal
   sequence above, and deliberately kept off the transform/transition
   properties the entrance animation already owns so the two never
   fight over the same element. */
.hero-parallax {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Starts fully hidden: at scroll-progress 0 the screen should read as
     empty/black (nothing revealed yet), not show the atmosphere at full
     strength with no darkening vignette over it yet. JS fades this in
     alongside the mark drawing. */
  opacity: 0;
}

.hero-parallax__layer {
  position: absolute;
  inset: -20% 0;
  height: 140%;
  will-change: transform;
}

.hero-parallax__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(45% 35% at 60% 30%, rgba(200, 168, 75, 0.16) 0%, rgba(200, 168, 75, 0) 70%);
}

.hero-parallax__mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160vw;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
  color: #fff;
  fill: currentColor;
  opacity: 0.05;
}

@media (prefers-reduced-motion: reduce) {
  .hero-parallax__layer {
    /* JS skips scroll-linked transforms under reduced motion; this is
       the belt-and-suspenders CSS fallback. */
    transform: none !important;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-mark {
  width: min(58vw, 320px);
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero-mark .seg {
  fill: #fff;
  fill-opacity: 0;
  stroke: #fff;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  /* No `transition`: this is a hard scrub (1 scroll pixel = 1 step of
     draw progress, reversibly), so JS writes stroke-dashoffset and
     fill-opacity on every scroll frame instead of animating toward a
     target. A transition here would just make it visibly lag behind
     the scrollbar. */
}

.hero-wordmark {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  opacity: 0; /* scrubbed directly by JS, see .hero-mark .seg note above */
}

.hero-slogan {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4.4vw, 2.4rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.35;
  opacity: 0;
  transform: translateY(24px);
}

.hero-cta {
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(12px);
}

/* Tells a first-time visitor the hero needs scrolling to unfold — the
   screen is otherwise completely black at rest, with no other cue. Sits
   outside .hero-content so the entrance stage windows above don't touch
   it; JS fades it out over the very first sliver of scroll instead. */
.hero-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 2.5rem;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.hero-scroll-hint__text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-scroll-hint__chevron {
  width: 16px;
  height: 16px;
  animation: hero-scroll-hint-bob 1.6s ease-in-out infinite;
}

@keyframes hero-scroll-hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-hint__chevron {
    animation: none;
  }
}

.btn-primary {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 28px -10px rgba(200, 168, 75, 0.45);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #ddbd63;
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -8px rgba(200, 168, 75, 0.6);
}

/* Reduced motion: no scrubbed drawing at all — JS paints every hero
   element in its finished state once, up front (see js/main.js), so
   nothing here needs its own transition. */
@media (prefers-reduced-motion: reduce) {
  .hero-mark .seg {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
  .hero-slogan,
  .hero-cta {
    transform: none;
  }
}

/* ==========================================================================
   Kursplan
   ========================================================================== */

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  text-align: left;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--divider);
}

.schedule-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 400;
}

.schedule-table td:nth-child(2) {
  font-family: var(--font-mono);
  color: var(--gold);
}

.schedule-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.schedule-note strong {
  color: var(--text);
}

/* ==========================================================================
   Disziplinen — horizontal phase flow (matches the real periodization
   sequence: build, build, peak, unload — the order and the shrinking
   volume beneath it both carry information, so both are drawn, not
   just described)
   ========================================================================== */

.phase-flow {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.phase-step {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.phase-step__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
}

.phase-step__weeks {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.phase-step--peak {
  border-color: var(--glass-border-gold);
  background: var(--glass-bg-gold);
  box-shadow: var(--glow-gold);
}

.phase-step--peak .phase-step__name {
  color: var(--gold);
}

.phase-step--rest .phase-step__name {
  color: var(--text-secondary);
}

.phase-arrow {
  flex-shrink: 0;
  align-self: center;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.phase-volume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.phase-volume svg {
  width: 13px;
  height: 13px;
}

.phase-note {
  margin-top: 2.5rem;
  color: var(--text-secondary);
  max-width: 60ch;
}

.phase-note a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.phase-note a:hover,
.phase-note a:focus-visible {
  border-color: var(--gold);
}

/* ==========================================================================
   Trainer
   ========================================================================== */

.trainer {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.trainer-photo {
  aspect-ratio: 3 / 4;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--glow-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem;
  /* TODO: replace with <img src="assets/trainer.jpg" alt="Theofanis Geropoulos"> */
}

.trainer-name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.trainer-title {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: block;
}

.trainer-bio {
  color: var(--text-secondary);
  max-width: 56ch;
}

.trainer-facts {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
}

.trainer-facts li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.trainer-facts strong {
  color: var(--text);
  font-weight: 400;
}

/* ==========================================================================
   Preise
   ========================================================================== */

.pricing-grid {
  position: relative;
  display: grid;
  /* Fixed column counts (not auto-fit) on purpose: 6 cards divide evenly
     into 3, 2 or 1 columns at every breakpoint, so no row ever ends in
     an empty trailing cell. Real gap now (not a 1px hairline grid) since
     each card is its own floating glass surface. */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* A soft glow behind the grid — without it the backdrop-blur on the
   cards above has nothing but flat --bg to blur, so it would render
   with no visible effect at all. */
.pricing-grid::before,
.chapter-grid::before {
  content: '';
  position: absolute;
  inset: -15% -5%;
  z-index: -1;
  background:
    radial-gradient(45% 55% at 25% 15%, rgba(200, 168, 75, 0.1) 0%, transparent 70%),
    radial-gradient(40% 50% at 85% 85%, rgba(200, 168, 75, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.price-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-dark);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.price-card:hover,
.price-card:focus-visible {
  background: var(--bg-raised);
  transform: translateY(-4px);
  box-shadow: 0 24px 44px -18px rgba(0, 0, 0, 0.8);
}

.price-card--highlight {
  background: var(--glass-bg-gold);
  border: 1px solid var(--glass-border-gold);
  box-shadow: var(--glow-gold);
  position: relative;
}

.price-card--highlight:hover,
.price-card--highlight:focus-visible {
  background: rgba(28, 24, 9, 0.7);
  box-shadow: 0 28px 52px -16px rgba(200, 168, 75, 0.4);
}

.price-badge {
  position: absolute;
  top: -0.8rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 18px -6px rgba(200, 168, 75, 0.6);
}

.price-badge svg {
  width: 11px;
  height: 11px;
}

.price-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(200, 168, 75, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem;
  margin-bottom: 1rem;
}

.price-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.price-amount {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.price-card--highlight .price-amount {
  color: var(--gold);
}

.price-amount span {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.price-condition {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.price-link {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

/* The one card meant to read as the primary action gets the full pill
   button; the other five stay as quiet text links — gold is a spice,
   not the seasoning on every card. */
.price-card--highlight .price-link {
  color: var(--bg);
  background: var(--gold);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 22px -8px rgba(200, 168, 75, 0.55);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.price-card--highlight:hover .price-link {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -6px rgba(200, 168, 75, 0.7);
}

/* ==========================================================================
   Standort & Kontakt
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.contact-list {
  display: grid;
  gap: 1.25rem;
}

.contact-list dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.contact-list dd {
  margin: 0;
}

.contact-list a {
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
}

.map-embed {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-dark);
  min-height: 280px;
  overflow: hidden;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
  filter: grayscale(1) invert(0.92) contrast(0.9);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: 2.5rem var(--gutter);
  border-top: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--gold);
}

/* ==========================================================================
   Legal / eBook shared "simple page" chrome
   ========================================================================== */

.page-hero {
  padding: 8rem var(--gutter) 3rem;
  border-bottom: 1px solid var(--divider);
}

.page-hero .section-title {
  font-size: clamp(2rem, 5vw, 3rem);
}

.legal-body {
  padding: 3rem var(--gutter) 5rem;
  max-width: 72ch;
  margin: 0 auto;
  color: var(--text-secondary);
}

.legal-body p {
  margin-bottom: 1rem;
}

.chapter-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.chapter-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glow-dark);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.chapter-card:hover,
.chapter-card:focus-visible {
  border-color: var(--glass-border-gold);
  transform: translateY(-4px);
  box-shadow: var(--glow-gold);
}

.chapter-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 70%);
}

.chapter-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease);
}

.chapter-card:hover .chapter-card__media img,
.chapter-card:focus-visible .chapter-card__media img {
  transform: scale(1.06);
}

.chapter-card__media::after {
  /* Legibility gradient so the tag/overlay stay readable over any photo.
     z-index matters here: ::after paints after the real DOM children by
     default, which would otherwise bury the tag/overlay under it. */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
}

.chapter-card__media-index {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.07);
}

.chapter-card__tag {
  position: absolute;
  z-index: 2;
  left: 0.75rem;
  bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(10, 10, 10, 0.75);
  color: var(--gold);
  border: 1px solid rgba(200, 168, 75, 0.4);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.6rem;
}

.chapter-card__overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.chapter-card:hover .chapter-card__overlay,
.chapter-card:focus-visible .chapter-card__overlay {
  opacity: 1;
}

.chapter-card__overlay span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 24px -6px rgba(200, 168, 75, 0.6);
}

.chapter-card__overlay svg {
  width: 14px;
  height: 14px;
}

.chapter-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
}

.chapter-card__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
}

.chapter-card__excerpt {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.chapter-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
}

.chapter-card__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chapter-card__author img {
  width: 20px;
  height: 12px;
}

.chapter-card__author span,
.chapter-card__readtime {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.chapter-card__readtime {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chapter-card__readtime svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Article pages (eBook chapters)
   ========================================================================== */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.article-meta strong {
  color: var(--gold);
  font-weight: 400;
}

.article-hero-img {
  max-width: var(--container);
  margin: 2.5rem auto 0;
  padding: 0 var(--gutter);
}

.article-hero-img img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glow-dark);
}

.article-body {
  padding: 3rem var(--gutter) 4rem;
}

.article-body__inner {
  max-width: 68ch;
  margin: 0 auto;
}

.article-body__inner h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  margin: 2.5rem 0 1rem;
}

.article-body__inner p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.article-body__inner strong {
  color: var(--text);
  font-weight: 600;
}

.article-body__inner ul {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.article-body__inner li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-body__inner li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--gold);
}

.article-body__inner em {
  display: block;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--divider);
  color: var(--text);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.article-nav {
  border-top: 1px solid var(--divider);
  padding: 2rem var(--gutter);
}

.article-nav__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.article-nav a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-nav a:hover,
.article-nav a:focus-visible {
  color: var(--gold);
}

.article-nav__spacer {
  color: var(--divider);
}

.chapter-item--locked {
  opacity: 0.55;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trainer {
    grid-template-columns: 1fr;
  }

  .trainer-photo {
    max-width: 220px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .chapter-item {
    grid-template-columns: auto 1fr;
  }

  .chapter-cta {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    inset: 0;
    /* Belt-and-suspenders for `inset: 0`: .main-nav is a flex item of
       .site-header, and some engines size a fixed-position flex item by
       its cross-axis align-items behavior instead of stretching it to
       its inset edges, collapsing it to content height. Explicit
       viewport dimensions sidestep that entirely. */
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 90;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }

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

  .main-nav a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: block;
    z-index: 91;
  }

  .schedule-table {
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .phase-flow {
    flex-direction: column;
  }

  .phase-arrow {
    align-self: center;
    transform: rotate(90deg);
  }
}

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