/* =========================================
   MiniCodex — Global Typography System
   =========================================
   Fonts:   Roboto (headers) + Open Sans (body)
   Scale:   8px spacing grid
   ========================================= */

/* --- Fallback font-face with metric overrides to reduce CLS --- */
@font-face {
  font-family: 'Open Sans Fallback';
  src: local('Arial');
  size-adjust: 105.5%;
  ascent-override: 110%;
  descent-override: 30%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Roboto Fallback';
  src: local('Arial');
  size-adjust: 100.3%;
  ascent-override: 93%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/open-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/open-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/roboto-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/roboto-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- CSS Custom Properties ---- */
:root {
  /* Font families */
  --font-heading: 'Roboto', 'Roboto Fallback', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --font-body:    'Open Sans', 'Open Sans Fallback', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --fw-heading-bold: 700;
  --fw-heading-medium: 500;
  --fw-body-regular: 400;

  /* Desktop type scale */
  --fs-h1:    48px;
  --fs-h2:    36px;
  --fs-h3:    28px;
  --fs-h4:    22px;
  --fs-body-lg: 18px;
  --fs-body:  16px;
  --fs-small: 14px;
  --fs-micro: 12px;
  --fs-btn:   16px;
  --fs-nav:   16px;

  /* Line heights */
  --lh-heading:   1.2;
  --lh-heading-2: 1.3;
  --lh-body:      1.6;

  /* Paragraph max width */
  --prose-max: 680px;

  /* 8px spacing grid */
  --sp-1:  8px;
  --sp-2:  16px;
  --sp-3:  24px;
  --sp-4:  32px;
  --sp-6:  48px;
  --sp-8:  64px;
  --section-space: var(--sp-6);

  /* Colour palette (global — previously in index.css) */
  --haiti:       #161032;
  --java:        #14CFBC;
  --bright-sun:  #FFE830;
  --butterfly:   #5C51A2;
  --mine:        #333333;
  --alabaster:   #FAFAFA;
  --glass-1:     rgba(255, 255, 255, .10);
  --glass-2:     rgba(255, 255, 255, .06);

  /* Border radii */
  --radius-xxl: 32px;
  --radius-xl:  24px;
  --radius-lg:  16px;
  --radius-md:  12px;

  /* Shadows */
  --shadow-1: 0 10px 30px rgba(0, 0, 0, .25);
  --shadow-2: 0 16px 50px rgba(20, 207, 188, .15);

  /* Layout */
  --page-max:    1200px;
  --page-pad:    24px;
  --content-max: 70ch;
}

/* ---- Mobile type scale ---- */
@media (max-width: 768px) {
  :root {
    --fs-h1:    34px;
    --fs-h2:    28px;
    --fs-h3:    22px;
    --fs-h4:    20px;
    --fs-body:  16px;
  }

  /* On touch devices scrollbars overlay the page. Reserving a desktop-style
     gutter costs valuable width on small phones and can make forms overflow. */
  html { scrollbar-gutter: auto; }
}

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

html, body { height: 100%; }

/* Reserve the scrollbar gutter on every page so the fixed, centered navbar
   never shifts horizontally when navigating between a tall page (scrollbar
   present) and a short one (login / 404 / success — no scrollbar). */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  padding-top: 64px; /* reserve space for fixed navbar */
  color: var(--alabaster);
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(92, 81, 162, .35), rgba(92, 81, 162, 0)) no-repeat,
    radial-gradient(1000px 700px at 90% 10%, rgba(255, 232, 48, .2), rgba(255, 232, 48, 0)) no-repeat,
    var(--haiti);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

p,
li,
label,
input,
select,
textarea {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  font-weight: var(--fw-heading-bold);
  margin-top: 0;
  margin-bottom: var(--sp-2);
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-heading-bold);
  line-height: var(--lh-heading);   /* 1.2 */
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-heading-bold);
  line-height: var(--lh-heading-2); /* 1.3 */
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-heading-medium);
  line-height: var(--lh-heading-2); /* 1.3 */
}

h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-heading-medium);
  line-height: var(--lh-heading-2); /* 1.3 */
}

/* ---- Body text utilities ---- */
p {
  max-width: var(--prose-max);
  margin-top: 0;
  margin-bottom: var(--sp-2);
  line-height: var(--lh-body);
}

.text-lg {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
}

.text-sm {
  font-size: var(--fs-small);
  line-height: var(--lh-body);
}

.text-micro {
  font-size: var(--fs-micro);
  line-height: var(--lh-body);
}

/* ---- Navigation text ---- */
nav, nav a, .navbar a, .links a {
  font-family: var(--font-body);
  font-size: var(--fs-nav);
  line-height: var(--lh-body);
}

/* ---- Buttons ---- */
button, .btn, [type="submit"] {
  font-family: var(--font-body);
  font-size: var(--fs-btn);
  line-height: 1.2;
}

/* ---- Labels, pills, badges, eyebrows ---- */
.eyebrow, .kicker, .hero-badge {
  font-family: var(--font-heading);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: var(--lh-heading-2);
}

/* ---- Lead / subtitle ---- */
.lead, .sub, .enroll-subtitle, .enroll-sub {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
}

/* ---- Credits / fine print ---- */
.credits {
  font-size: var(--fs-small);
}

/* ---- Prose sections (article content) ---- */
.prose p,
.prose li {
  max-width: var(--prose-max);
  line-height: var(--lh-body);
}

.prose h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading-2);
  margin-bottom: var(--sp-2);
}

.prose h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-heading-2);
  margin-bottom: var(--sp-1);
}

/* ---- Footer headings ---- */
.footer-col h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-heading-medium);
  line-height: var(--lh-heading-2);
}

/* ---- Card typography ---- */
.card-title, .course-title, .enroll-title {
  font-family: var(--font-heading);
  font-weight: var(--fw-heading-bold);
}

.card-title,
.course-title,
.enroll-title,
.card h3,
.card h4,
.benefit h3,
.benefit h4,
.faq-q .t,
.footer-col h4 {
  line-height: var(--lh-heading-2);
}

.card p,
.benefit p,
.site-footer p,
.site-footer li,
.journey-content p,
.faq-a p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* ---- Input fields ---- */
input, select, textarea {
  font-family: var(--font-body);
  font-size: var(--fs-body);
}

small,
.small,
.fine-print {
  font-size: var(--fs-small);
  line-height: var(--lh-body);
}

/* =========================================
   Scroll Reveal & Stagger (global)
   ========================================= */
/* Hidden state only applies when JS is available (html.js set inline in <head>).
   Without JS, content stays fully visible. */
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}

html.js .reveal.show {
  opacity: 1;
  transform: none;
}

html.js .stagger > * {
  opacity: 0;
  transform: translateY(18px);
}

html.js .stagger.show > * {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .6s ease;
}

.stagger.show > *:nth-child(1) { transition-delay: .05s }
.stagger.show > *:nth-child(2) { transition-delay: .12s }
.stagger.show > *:nth-child(3) { transition-delay: .20s }
.stagger.show > *:nth-child(4) { transition-delay: .28s }
.stagger.show > *:nth-child(5) { transition-delay: .36s }
.stagger.show > *:nth-child(6) { transition-delay: .44s }
.stagger.show > *:nth-child(7) { transition-delay: .52s }
.stagger.show > *:nth-child(8) { transition-delay: .60s }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .stagger > * {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ---- Global page width, scales up on large monitors (whole-site consistency) ---- */
:root { --page-max: 1200px; }
@media (min-width: 1600px) { :root { --page-max: 1400px; } }
@media (min-width: 2200px) { :root { --page-max: 1500px; } }

/* ===== Nivel hero visual stage (cluster de logo-uri reale) ===== */
header.hero .hero-inner{ display:grid; grid-template-columns:1.1fr .9fr; gap:40px; align-items:center; }
.hero-stage{ position:relative; min-height:320px; display:flex; align-items:center; justify-content:center; }
.hero-stage__glow{ position:absolute; inset:4%; border-radius:46% 54% 56% 44%/52% 46% 54% 48%;
  background:radial-gradient(closest-side at 35% 30%, rgba(20,207,188,.30), transparent 70%),
             radial-gradient(closest-side at 72% 72%, rgba(92,81,162,.34), transparent 72%);
  filter:blur(10px); }
.hero-logos{ position:relative; display:flex; flex-wrap:wrap; gap:20px; max-width:300px; justify-content:center; }
.hero-logos .hlogo{ width:120px; height:120px; border-radius:24px; background:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 18px 40px -16px rgba(0,0,0,.55); border:1px solid rgba(255,255,255,.6);
  animation:hfloat 5.5s ease-in-out infinite; }
.hero-logos .hlogo img{ width:66px; height:66px; object-fit:contain; }
.hero-logos .hlogo:nth-child(2){ animation-delay:.7s; }
.hero-logos .hlogo:nth-child(3){ animation-delay:1.4s; }
.hero-logos .hlogo:nth-child(4){ animation-delay:2.1s; }
@keyframes hfloat{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@media (prefers-reduced-motion:reduce){ .hero-logos .hlogo{ animation:none; } }
@media (max-width:900px){
  header.hero .hero-inner{ grid-template-columns:1fr; gap:24px; }
  .hero-stage{ min-height:auto; }
  .hero-logos{ max-width:none; gap:14px; }
  .hero-logos .hlogo{ width:84px; height:84px; border-radius:18px; }
  .hero-logos .hlogo img{ width:46px; height:46px; }
}

/* Override: nivel CSS sets hero-inner to 1 column; force 2 columns when a stage is present */
header.hero .hero-inner:has(> .hero-stage){ grid-template-columns:1.1fr .9fr; gap:40px; align-items:center; }
@media (max-width:900px){
  header.hero .hero-inner:has(> .hero-stage){ grid-template-columns:1fr; }
}

/* =========================================================
   Site-wide fixes
   ========================================================= */

/* Content links: brand color instead of the browser-default blue underline.
   Scoped to content areas and excludes .btn so buttons stay intact. */
.prose a:not(.btn),
.article-content a:not(.btn),
.panel a:not(.btn),
.lead a:not(.btn),
.faq-item a:not(.btn),
main p a:not(.btn),
main li a:not(.btn) {
  color: var(--java);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
.prose a:not(.btn):hover,
.article-content a:not(.btn):hover,
.panel a:not(.btn):hover,
.lead a:not(.btn):hover,
.faq-item a:not(.btn):hover,
main p a:not(.btn):hover,
main li a:not(.btn):hover {
  color: var(--bright-sun);
}

/* Breathing room between the last page section and the footer (site-wide).
   The footer is intentionally flush (no top margin), so the gap is added
   below the page content instead. */
body > main {
  padding-bottom: clamp(48px, 6vw, 88px);
}
