/* ==========================================================================
   LUDWIG GLOBAL ACADEMY — base styles & shared primitives
   Reset · typography · layout · buttons · section header · cards · reveal
   ========================================================================== */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scroll-padding-bottom: 96px; /* keep focused elements clear of the WhatsApp button */
  color-scheme: light;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
::selection {
  background: var(--gold);
  color: var(--navy-900);
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--blue-600);
  outline-offset: 3px;
}
.theme-dark :focus-visible {
  outline-color: var(--gold);
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-preloader) + 10);
  padding: 0.75rem 1.1rem;
  border-radius: var(--r-pill);
  background: var(--navy-800);
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ---------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.container--wide {
  width: min(100% - 2 * var(--gutter), var(--container-wide));
  margin-inline: auto;
}
.section {
  position: relative;
  padding-block: var(--section-y);
  isolation: isolate;
}
.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}
.section--sky {
  background: var(--grad-sky);
}
.section--white {
  background: var(--surface);
}

/* ---------- Dark theme (navy sections) ---------- */
.theme-dark {
  --ink: var(--on-dark);
  --ink-soft: var(--on-dark-soft);
  --ink-mute: #8fa6cb;
  --line: var(--line-on-dark);
  color: var(--on-dark);
  background: var(--grad-night);
  color-scheme: dark;
}

/* ---------- Type helpers ---------- */
.script {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: var(--fs-script);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--blue-600);
}
.theme-dark .script {
  color: var(--gold);
}
.text-gradient {
  background: var(--grad-text-blue);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.theme-dark .text-gradient {
  background-image: linear-gradient(100deg, #8cc0ff 0%, #fff 55%, #ffe08a 100%);
}
.lead {
  font-size: var(--fs-lg);
  line-height: 1.6;
  color: var(--ink-soft);
}
.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Eyebrow (small label above section titles) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-600);
}
.theme-dark .eyebrow {
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 6px;
  border-radius: 3px;
  background: var(--grad-flag);
  flex: none;
}

/* ---------- Section header ---------- */
.section-head {
  max-width: 46rem;
  display: grid;
  gap: var(--space-4);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}
.section-title {
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.035em;
  color: var(--navy-800);
}
.theme-dark .section-title {
  color: #fff;
}
.section-lead {
  font-size: var(--fs-lg);
  color: var(--ink-soft);
  max-width: 38rem;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--grad-blue);
  --btn-fg: #fff;
  --btn-shadow: 0 10px 28px rgba(11, 91, 196, 0.34);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 52px;
  padding: 0.95rem 1.6rem;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  color: var(--btn-fg);
  background: var(--btn-bg);
  box-shadow: var(--btn-shadow);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn::after {
  /* sheen sweep */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
}
.btn:hover::after {
  transform: translateX(120%);
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0) scale(0.985);
}
.btn__icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  transition: transform var(--dur-base) var(--ease-out);
}
.btn:hover .btn__icon--arrow {
  transform: translateX(4px);
}
.btn--wa {
  --btn-bg: linear-gradient(135deg, #2ee07a 0%, #25d366 50%, #12a150 100%);
  --btn-shadow: 0 10px 28px rgba(37, 211, 102, 0.38);
  color: #03230f;
}
.btn--gold {
  --btn-bg: var(--grad-gold);
  --btn-fg: var(--navy-900);
  --btn-shadow: var(--shadow-glow-gold);
}
.btn--dark {
  --btn-bg: var(--navy-800);
  --btn-shadow: 0 10px 28px rgba(10, 42, 92, 0.35);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--navy-800);
  --btn-shadow: none;
  box-shadow: inset 0 0 0 2px var(--navy-800);
}
.btn--ghost:hover {
  --btn-bg: var(--navy-800);
  --btn-fg: #fff;
}
.theme-dark .btn--ghost {
  --btn-fg: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}
.theme-dark .btn--ghost:hover {
  --btn-bg: #fff;
  --btn-fg: var(--navy-900);
}
.btn--lg {
  min-height: 60px;
  padding: 1.1rem 2rem;
  font-size: var(--fs-base);
}
.btn--sm {
  min-height: 44px;
  padding: 0.7rem 1.2rem;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.card--glass {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-color: rgba(255, 255, 255, 0.7);
}
.theme-dark .card {
  background: var(--surface-glass-dark);
  border-color: var(--line-on-dark);
  box-shadow: none;
}

/* ---------- Brush-stroke motif (poster headline banners) ----------
   <svg class="brush" aria-hidden="true"><use href="#brush-1"/></svg>
   Colour via `color:` (fill is currentColor). Stretches to its box. */
.brush {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  overflow: visible;
}

/* ---------- Icons ---------- */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* ---------- Reveal system (driven by core.js) ----------
   Content is visible by default (no-JS safe). `html.js` hides reveal targets
   until GSAP animates them in. A failsafe class un-hides everything. */
html.js [data-reveal]:not([data-reveal-group]),
html.js [data-reveal-item] {
  opacity: 0;
}
html.js.reveal-failsafe [data-reveal],
html.js.reveal-failsafe [data-reveal-item] {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}
[data-split] {
  /* SplitText line masks need the wrapper to not clip descenders */
  --split-pad: 0.12em;
}

/* ---------- Lenis ---------- */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: clip;
}

/* ---------- Misc utilities ---------- */
.nowrap {
  white-space: nowrap;
}
.visually-hidden-until-focus:not(:focus) {
  position: absolute;
  clip: rect(0 0 0 0);
}
.will-anim {
  will-change: transform, opacity;
}
.no-select {
  user-select: none;
  -webkit-user-select: none;
}
.hide-sm {
  display: none;
}
@media (min-width: 720px) {
  .hide-sm {
    display: revert;
  }
  .hide-md-up {
    display: none !important;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html.js [data-reveal],
  html.js [data-reveal-item] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}

/* Sections far off-screen pause their ambient CSS animations (toggled by core.js) */
.is-offscreen, .is-offscreen *, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }
