/* Educircle Website V2 — Base + Components. Depends on tokens.css. */

/* ============ Reset / base ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-ink);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-weight: var(--fw-extrabold); line-height: var(--lh-snug); letter-spacing: var(--ls-tight); color: var(--c-navy); }
:focus-visible { outline: none; box-shadow: var(--sh-focus); border-radius: var(--r-sm); }

/* ============ Layout ============ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 4vw, 4.5rem); }
.section--dark { background: var(--grad-navy); color: var(--c-on-dark); }
.section--alt { background: var(--c-surface-2); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.grid { display: grid; gap: var(--sp-6); }
@media (min-width: 768px){ .grid-2{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:repeat(3,1fr)} .grid-4{grid-template-columns:repeat(4,1fr)} }
.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}

/* ============ Typography helpers ============ */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-eyebrow); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--c-primary);
}
.section--dark .eyebrow { color: #6FD0FF; }
.eyebrow::before { content:""; width: 22px; height: 2px; background: currentColor; opacity:.7; }
h1.display { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2.title { font-size: var(--fs-h2); }
h3.subtitle { font-size: var(--fs-h3); }
.lead { font-size: var(--fs-body-lg); color: var(--c-muted); max-width: 58ch; }
.section--dark .lead { color: var(--c-on-dark-muted); }
.text-green { color: var(--c-green); }
.text-grad { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 0.9rem 1.6rem; border-radius: var(--r-pill); border: 1.5px solid transparent;
  font-weight: var(--fw-bold); font-size: var(--fs-small); letter-spacing: .01em;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--c-primary); color: #fff; box-shadow: var(--sh-sm); }
.btn--primary:hover { background: var(--c-primary-600); box-shadow: var(--sh-md); }
.btn--green { background: var(--c-green-btn); color: #fff; box-shadow: var(--sh-sm); }
.btn--green:hover { background: var(--c-green-btn-hover); box-shadow: var(--sh-md); }
.btn--outline { border-color: var(--c-line); color: var(--c-navy); background: #fff; }
.btn--outline:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn--ghost-light { border-color: rgba(255,255,255,.35); color: #fff; background: rgba(255,255,255,.04); }
.btn--ghost-light:hover { background: rgba(255,255,255,.12); }
/* Light-surface ghost: quiet but unmistakably a button (was previously unstyled). */
.btn--ghost { border: 1.5px solid var(--c-line); color: var(--c-navy); background: #fff; }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--c-navy); background: var(--c-surface-2, #f6f8fb); }
/* Destructive confirm step only — never the first-tap action. */
.btn--danger { background: #B3261E; color: #fff; border: 1.5px solid #B3261E; }
.btn--danger:hover, .btn--danger:focus-visible { background: #8C1D17; border-color: #8C1D17; }
.btn--lg { padding: 1.05rem 2rem; font-size: var(--fs-body); }
.btn__arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============ Skip link (single source — every V2 layout loads this file) ============ */
/* Visually hidden until keyboard focus; never visible on touch/mouse browsing. */
.skip-link {
  position: absolute; left: 12px; top: 8px; z-index: var(--z-modal);
  background: #fff; color: var(--c-primary); padding: .7rem 1.1rem;
  border-radius: var(--r-sm); box-shadow: var(--sh-md); font-weight: 700;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
  width: 1px; height: 1px;
}
.skip-link:focus {
  clip-path: none; width: auto; height: auto;
}

/* ============ Header / nav ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  transition: background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(255,255,255,.9); backdrop-filter: saturate(140%) blur(10px); border-bottom-color: var(--c-line); box-shadow: var(--sh-xs); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.site-header__logo { display: flex; align-items: center; gap: var(--sp-3); font-weight: var(--fw-extrabold); color: #fff; }
.site-header.is-solid .site-header__logo, .site-header.is-solid .nav__link { color: var(--c-navy); }
.site-header__logo img { height: 38px; width: auto; }
.nav { display: none; align-items: center; gap: var(--sp-6); }
.nav__link { color: rgba(255,255,255,.92); font-weight: var(--fw-semibold); font-size: var(--fs-small); position: relative; padding-block: .4rem; }
.nav__link::after { content:""; position:absolute; left:0; bottom:0; height:2px; width:0; background: currentColor; transition: width var(--dur-base) var(--ease-out); }
.nav__link:hover::after, .nav__link:focus-visible::after { width: 100%; }
.header__cta { display: none; }
.nav__cta { display: none; }
.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px; padding: 10px;
  background: none; border: 0;
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
.nav-toggle span { width: 24px; height: 2px; background: currentColor; color: #fff; transition: transform var(--dur-base); }
.site-header.is-solid .nav-toggle span { background: var(--c-navy); }
@media (min-width: 1024px){ .nav, .header__cta { display: flex; } .nav-toggle { display: none; } }
/* Mobile nav drawer (below 1024px) */
@media (max-width: 1023px){
  .site-header.nav-open { background: #fff; box-shadow: var(--sh-md); }
  /* Dim everything behind the open drawer so the panel reads as one designed
     layer — the hero (and its own CTA) can never visually collide with it. */
  .site-header.nav-open::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: rgba(2, 16, 36, .55);
    backdrop-filter: blur(2px);
  }
  .site-header.nav-open .site-header__logo, .site-header.nav-open .nav-toggle span { color: var(--c-navy); }
  .site-header.nav-open .nav-toggle span { background: var(--c-navy); }
  .site-header.nav-open .nav {
    display: flex; position: absolute; inset: 74px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0; background: #fff;
    padding: var(--sp-3) var(--gutter) var(--sp-5);
    border-bottom: 1px solid var(--c-line); box-shadow: var(--sh-md);
    /* Small phones in landscape: the panel scrolls, never the page behind it. */
    max-height: calc(100dvh - 74px); overflow-y: auto;
  }
  .site-header.nav-open .nav__link { color: var(--c-navy); padding-block: .95rem; border-bottom: 1px solid var(--c-line); }
  .site-header.nav-open .nav__link::after { display: none; }
  /* The CTA flows INSIDE the menu panel — never absolutely positioned over the
     hero (owner QA: the old hard-coded top offset floated it over the page). */
  .site-header.nav-open .nav__cta { display: flex; padding: var(--sp-4) 0 var(--sp-2); }
  .site-header.nav-open .nav__cta .btn { width: 100%; justify-content: center; }
}
/* While the drawer is open the page behind must not scroll. */
body.nav-locked { overflow: hidden; }

/* ============ Section heading block ============ */
.section-head { max-width: 62ch; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: var(--sp-4); }
.section-head--center .lead { margin-inline: auto; }
.section-head__title { margin-top: var(--sp-3); }

/* ============ Proof / stat blocks ============ */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
@media (min-width: 768px){ .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: var(--sp-5); border-radius: var(--r-lg); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10); }
.section:not(.section--dark) .stat { background: #fff; border-color: var(--c-line); box-shadow: var(--sh-xs); }
.stat__num { font-size: clamp(1.9rem, 3vw, 2.75rem); font-weight: var(--fw-extrabold); color: #fff; letter-spacing: var(--ls-tight); line-height: 1; }
.section:not(.section--dark) .stat__num { color: var(--c-primary); }
.stat__num .unit { color: var(--c-green); }
.stat__label { margin-top: var(--sp-2); font-size: var(--fs-small); color: var(--c-on-dark-muted); }
.section:not(.section--dark) .stat__label { color: var(--c-muted); }

/* ============ Story section (media + copy) ============ */
.story { display: grid; gap: var(--sp-8); align-items: center; }
@media (min-width: 900px){ .story { grid-template-columns: 1fr 1fr; gap: var(--sp-12); } .story--reverse .story__media { order: 2; } }
.story__media { border-radius: var(--r-2xl); overflow: hidden; box-shadow: var(--sh-lg); position: relative; aspect-ratio: 4/3; background: var(--c-surface-3); }
.story__media img, .story__media video { width: 100%; height: 100%; object-fit: cover; }
.story__list { margin-top: var(--sp-5); display: grid; gap: var(--sp-3); padding: 0; list-style: none; }
.story__list li { display: flex; gap: var(--sp-3); align-items: flex-start; color: var(--c-ink); }
.section--dark .story__list li { color: var(--c-on-dark); }
.story__list .tick { flex: none; width: 24px; height: 24px; border-radius: var(--r-pill); background: rgba(112,163,68,.15); color: var(--c-green); display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* ============ Cards (course / university / ambassador) ============ */
.card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-xs); transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); }
.card__media { aspect-ratio: 16/10; background: var(--c-surface-3); position: relative; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.card__tag { align-self: flex-start; font-size: 12px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .08em; color: var(--c-primary); background: var(--c-surface-3); padding: .35rem .7rem; border-radius: var(--r-pill); }
.card__title { font-size: var(--fs-h4); font-weight: var(--fw-bold); color: var(--c-navy); }
.card__meta { font-size: var(--fs-small); color: var(--c-muted); display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: auto; }
.card__meta span { display: inline-flex; align-items: center; gap: 6px; }
/* University card (logo tile) */
.uni-card { display: flex; align-items: center; justify-content: center; padding: var(--sp-6); background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); min-height: 110px; transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base); }
.uni-card:hover { transform: translateY(-4px); box-shadow: var(--sh-sm); }
.uni-card img { max-height: 56px; width: auto; object-fit: contain; filter: grayscale(1); opacity:.72; transition: filter var(--dur-base), opacity var(--dur-base); }
.uni-card:hover img { filter: none; opacity: 1; }
/* Ambassador card */
.amb-card { background:#fff; border:1px solid var(--c-line); border-radius: var(--r-xl); overflow:hidden; box-shadow: var(--sh-xs); transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base); }
.amb-card:hover { transform: translateY(-6px); box-shadow: var(--sh-md); }
.amb-card__photo { aspect-ratio: 1/1; background: linear-gradient(160deg,var(--c-surface-3),#dfe9f6); display:grid; place-items:center; color: var(--c-primary); }
.amb-card__photo .initials { font-size: 2rem; font-weight: 800; opacity:.6; }
.amb-card__body { padding: var(--sp-5); }
.amb-card__name { font-weight: var(--fw-bold); color: var(--c-navy); }
.amb-card__role { font-size: var(--fs-small); color: var(--c-muted); }
.amb-card__uni { margin-top: var(--sp-3); font-size: var(--fs-small); color: var(--c-primary); font-weight: var(--fw-semibold); }

/* ============ Sage AI product panel ============ */
.sage-panel { border-radius: var(--r-2xl); overflow: hidden; background: var(--c-navy-900); border: 1px solid rgba(255,255,255,.08); box-shadow: var(--sh-lg); }
.sage-chat { padding: var(--sp-6); display: grid; gap: var(--sp-4); }
.sage-bubble { max-width: 84%; padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); font-size: var(--fs-small); line-height: 1.55; }
.sage-bubble--user { justify-self: end; background: var(--c-primary); color: #fff; border-bottom-right-radius: 6px; }
.sage-bubble--sage { justify-self: start; background: rgba(255,255,255,.06); color: var(--c-on-dark); border-bottom-left-radius: 6px; border: 1px solid rgba(255,255,255,.08); }
.sage-bubble__who { display:flex; align-items:center; gap:8px; font-weight:700; font-size:12px; letter-spacing:.06em; text-transform:uppercase; margin-bottom:6px; color:#6FD0FF; }
.sage-dot { width: 26px; height: 26px; border-radius: var(--r-pill); background: var(--grad-sage); display:inline-grid; place-items:center; color:#fff; font-weight:800; font-size:13px; }

/* ============ CTA section ============ */
.cta-band { border-radius: var(--r-2xl); background: var(--grad-primary); color:#fff; padding: clamp(2.5rem, 5vw, 4.5rem); text-align: center; position: relative; overflow: hidden; box-shadow: var(--sh-lg); }
.cta-band h2 { color:#fff; max-width: 20ch; margin-inline:auto; }
.cta-band .lead { color: rgba(255,255,255,.9); margin: var(--sp-4) auto var(--sp-6); }
.cta-actions { display:flex; flex-wrap:wrap; gap: var(--sp-4); justify-content:center; }

/* ============ Footer ============ */
.site-footer { background: var(--c-navy-900); color: var(--c-on-dark-muted); padding-block: var(--sp-12) var(--sp-6); }
.footer-grid { display:grid; gap: var(--sp-8); grid-template-columns: 1fr; }
@media (min-width: 768px){ .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h3 { color:#fff; font-size: var(--fs-small); text-transform: uppercase; letter-spacing:.1em; margin-bottom: var(--sp-4); }
.footer-links { list-style:none; padding:0; display:grid; gap: var(--sp-3); font-size: var(--fs-small); }
.footer-links a:hover { color:#fff; }
.footer-bottom { margin-top: var(--sp-10); padding-top: var(--sp-5); border-top:1px solid rgba(255,255,255,.1); display:flex; flex-wrap:wrap; gap: var(--sp-4); justify-content:space-between; font-size: 13px; }

/* ============ Misc: pills, notes, media placeholder ============ */
.pill { display:inline-flex; align-items:center; gap:8px; padding:.5rem 1rem; border-radius: var(--r-pill); background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); font-size: 13px; font-weight:600; }
.section:not(.section--dark) .pill { background: var(--c-surface-3); border-color: var(--c-line); color: var(--c-primary); }
.media-note { position:absolute; left: 12px; bottom: 12px; z-index:2; font-size: 11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; background: rgba(2,44,84,.82); color:#fff; padding:.35rem .6rem; border-radius: var(--r-sm); }
.marquee { display:flex; gap: var(--sp-8); align-items:center; }

/* Honeypot: out of flow, invisible to humans, still present for bots. */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ============ Ambassador tiles (compact, consent-guarded content) ============ */
.amb-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .amb-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .amb-grid { grid-template-columns: repeat(4, 1fr); } }
.amb-tile { display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-xs); transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.amb-tile:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.amb-tile__photo { aspect-ratio: 1; background: var(--c-surface-3); overflow: hidden; }
.amb-tile__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.amb-tile__photo--fallback { display: flex; align-items: center; justify-content: center; color: var(--c-primary); font-weight: var(--fw-extrabold); font-size: 28px; }
.amb-tile__body { padding: var(--sp-4); display: grid; gap: 4px; }
.amb-tile__name { font-weight: var(--fw-bold); color: var(--c-navy); }
.amb-tile__tag { font-size: 13px; color: var(--c-muted); }
.amb-tile__cta { font-size: 13px; font-weight: var(--fw-semibold); color: var(--c-primary); margin-top: var(--sp-2); }

/* ============ Trust strip (evidence-gated credibility) ============ */
/* The band clips as a hard guard: no badge combination may ever widen the page.
   Mobile: contained horizontal chip scroll. Desktop: the row WRAPS — never a
   single forced row (the QEAC/IEAA badges overflowed the viewport that way). */
.trust-band { background: var(--c-surface); border-bottom: 1px solid var(--c-line); overflow-x: clip; }
.trust-strip { display: flex; align-items: center; gap: var(--sp-3) var(--sp-6); padding: var(--sp-4) 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.trust-strip::-webkit-scrollbar { display: none; }
.trust-strip__item { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--c-navy); white-space: nowrap; }
.trust-strip__icon { width: 20px; height: 20px; color: var(--c-green-600); flex: 0 0 auto; }
.trust-strip__item--verified .trust-strip__icon { color: var(--c-primary); }
@media (min-width: 1024px) {
  .trust-strip { flex-wrap: wrap; justify-content: center; overflow: visible; }
  /* A single extreme label may itself exceed the container: let it break. */
  .trust-strip__item { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
}

/* ============ Motion: reveal base (progressive enhancement) ============ */
/* Hidden pre-reveal ONLY when JS is active AND motion is allowed. No JS / reduced
   motion => content is fully visible, no layout shift. */
html.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); will-change: opacity, transform; }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
html.js [data-reveal-stagger] > * { opacity: 0; transform: translateY(20px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
html.js [data-reveal-stagger].is-in > * { opacity: 1; transform: none; }
/* Cascade (Premium: 60ms steps, total <500ms) */
html.js [data-reveal-stagger].is-in > *:nth-child(1){transition-delay:0ms}
html.js [data-reveal-stagger].is-in > *:nth-child(2){transition-delay:70ms}
html.js [data-reveal-stagger].is-in > *:nth-child(3){transition-delay:140ms}
html.js [data-reveal-stagger].is-in > *:nth-child(4){transition-delay:210ms}
html.js [data-reveal-stagger].is-in > *:nth-child(5){transition-delay:280ms}
html.js [data-reveal-stagger].is-in > *:nth-child(n+6){transition-delay:340ms}
/* Hero children slide up on load (TRANSFORM ONLY — never opacity). The headline is
   the LCP element, so it must paint immediately; GSAP animates the offset to 0.
   No-JS / reduced-motion / no-GSAP => in place. */
html.js [data-hero] > * { transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal], html.js [data-reveal].is-in,
  html.js [data-reveal-stagger] > *, html.js [data-reveal-stagger].is-in > *,
  html.js [data-hero] > * {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .btn:hover, .card:hover, .amb-card:hover, .uni-card:hover { transform: none !important; }
}
