/* ============================================================
   EXPLORER'S ACADEMY — global.css
   Ancient map meets a living cosmos. Gold firelight on near-black.
   All design tokens, shared components, and atmosphere live here.
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* core palette */
  --bg:            #0A0A0A;
  --bg-warm:       #100D09;   /* warm near-black for raised sections */
  --bg-raised:     #16110B;   /* card surface */
  --bg-raised-2:   #1E1710;
  --line:          rgba(242, 170, 76, 0.16);
  --line-soft:     rgba(240, 237, 230, 0.10);

  --gold:          #F2AA4C;
  --gold-bright:   #FFCE7E;
  --gold-deep:     #C8821F;
  --gold-glow:     rgba(242, 170, 76, 0.40);

  --text:          #F0EDE6;
  --text-dim:      rgba(240, 237, 230, 0.66);
  --text-faint:    rgba(240, 237, 230, 0.42);

  /* jewel accents — one per pillar / book family */
  --emerald:       #4FB286;
  --indigo:        #7C84E8;
  --crimson:       #D85C57;
  --amethyst:      #B57BD6;

  /* type */
  --display: 'Cormorant Garamond', Georgia, serif;
  --body:    'DM Sans', system-ui, sans-serif;

  /* rhythm */
  --section-y: clamp(5rem, 12vh, 9.5rem);
  --gutter:    clamp(1.25rem, 5vw, 4rem);
  --maxw:      1180px;
  --readw:     64ch;

  --radius:    14px;
  --radius-lg: 22px;

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

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

::selection { background: var(--gold); color: #1a1206; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.display, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.lede {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 400;
  line-height: 1.42;
  color: var(--text);
  font-style: italic;
}

p { text-wrap: pretty; }

.prose { max-width: var(--readw); }
.prose p { color: var(--text-dim); font-size: 1.125rem; line-height: 1.78; }
.prose p + p { margin-top: 1.25em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--gold-bright); font-style: italic; }

/* gold ink — italic emphasis in the display face */
.ink { color: var(--gold); font-style: italic; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); position: relative; }
.section--warm { background: var(--bg-warm); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s, 1.5rem); }

/* ============================================================
   ATMOSPHERE — grain, glow, stars, embers
   ============================================================ */

/* film grain — sits above everything, ignores pointer */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* radial gold glow — drop into any hero/section as a child */
.glow {
  position: absolute; pointer-events: none; z-index: 0;
  width: 90vw; max-width: 1100px; aspect-ratio: 1;
  left: 50%; top: 28%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--gold-glow) 0%, rgba(242,170,76,0.10) 32%, transparent 62%);
  filter: blur(8px);
  animation: glowPulse 9s var(--ease) infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

/* starfield — two tiled layers drifting at different speeds */
.stars {
  position: absolute; inset: -10% 0; z-index: 0; pointer-events: none;
  background-repeat: repeat;
  background-image:
    radial-gradient(1.5px 1.5px at 16% 22%, rgba(240,237,230,.55), transparent),
    radial-gradient(1.5px 1.5px at 72% 14%, rgba(240,237,230,.40), transparent),
    radial-gradient(1px 1px   at 42% 62%, rgba(242,170,76,.55), transparent),
    radial-gradient(1px 1px   at 88% 48%, rgba(240,237,230,.45), transparent),
    radial-gradient(1.5px 1.5px at 28% 84%, rgba(240,237,230,.30), transparent),
    radial-gradient(1px 1px   at 60% 78%, rgba(242,170,76,.40), transparent),
    radial-gradient(1px 1px   at 8% 54%,  rgba(240,237,230,.35), transparent),
    radial-gradient(1.5px 1.5px at 95% 90%, rgba(240,237,230,.28), transparent);
  background-size: 420px 420px;
  animation: starDrift 90s linear infinite;
  opacity: 0.9;
}
.stars::after {
  content: ''; position: absolute; inset: 0;
  background-repeat: repeat;
  background-image:
    radial-gradient(1px 1px at 33% 40%, rgba(240,237,230,.30), transparent),
    radial-gradient(1px 1px at 80% 70%, rgba(242,170,76,.30), transparent),
    radial-gradient(1px 1px at 12% 88%, rgba(240,237,230,.22), transparent),
    radial-gradient(1px 1px at 55% 18%, rgba(240,237,230,.25), transparent);
  background-size: 280px 280px;
  animation: starDrift 140s linear infinite reverse;
}
@keyframes starDrift {
  from { background-position: 0 0; }
  to   { background-position: 420px 840px; }
}

/* firelight embers — a few warm motes drifting upward */
.embers { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ember {
  position: absolute; bottom: -8px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px 1px var(--gold-glow);
  opacity: 0; animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  12%  { opacity: 0.9; }
  80%  { opacity: 0.6; }
  100% { transform: translateY(-92vh) translateX(var(--drift, 20px)) scale(0.4); opacity: 0; }
}

/* hairline divider with a centered gold node */
.rule { display: flex; align-items: center; gap: 1rem; color: var(--line); }
.rule::before, .rule::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.rule span {
  width: 26px; height: 26px;
  background: url(../assets/logo-orange.png) center / contain no-repeat;
  filter: drop-shadow(0 0 9px var(--gold-glow));
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.15rem var(--gutter);
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10,10,10,0.78);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--line);
  padding-block: 0.85rem;
}
.brand { display: flex; flex-direction: row; align-items: center; gap: 0.6rem; line-height: 1; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  background: url(../assets/logo-orange.png) center / contain no-repeat;
  transition: transform .55s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(45deg); }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand b {
  font-family: var(--display); font-weight: 600; font-size: 1.3rem;
  color: var(--gold); letter-spacing: 0.01em; white-space: nowrap;
}
@media (max-width: 380px) { .brand b { font-size: 1.1rem; } .brand-mark { width: 26px; height: 26px; } }
.brand small {
  font-family: var(--body); font-size: 0.58rem; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--text-faint);
}
.nav-links { display: flex; align-items: center; gap: 2.2rem; }
.nav-links a {
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-dim);
  position: relative; padding-block: 6px; transition: color .25s var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold); transition: width .3s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
.nav-links .nav-cta { color: var(--gold); }

/* hamburger */
.burger { display: none; flex-direction: column; gap: 5px; padding: 8px; z-index: 101; }
.burger span { width: 24px; height: 2px; background: var(--text); transition: .3s var(--ease); transform-origin: center; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .burger { display: flex; }
  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(80vw, 320px);
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 1.8rem; padding: var(--gutter);
    background: rgba(13,11,8,0.97); backdrop-filter: blur(16px);
    border-left: 1px solid var(--line);
    transform: translateX(100%); transition: transform .42s var(--ease);
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { font-size: 1rem; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  font-family: var(--body); font-weight: 600; font-size: 0.92rem;
  letter-spacing: 0.04em; padding: 0.95em 1.7em; border-radius: 100px;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; }

/* primary — gold with shimmer */
.btn--primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1206;
  box-shadow: 0 0 0 1px rgba(255,206,126,.5), 0 10px 34px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn--primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-130%); 
  animation: shimmer 4.5s var(--ease) infinite;
}
@keyframes shimmer { 0%, 55% { transform: translateX(-130%); } 78%, 100% { transform: translateX(130%); } }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,206,126,.7), 0 18px 44px -10px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.5); }

/* ghost */
.btn--ghost {
  color: var(--text); border: 1px solid var(--line);
  background: rgba(240,237,230,0.02);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-bright); transform: translateY(-2px); background: rgba(242,170,76,0.06); }

/* big — for hero */
.btn--lg { font-size: 1.02rem; padding: 1.1em 2.2em; }

.btn--block { display: flex; width: 100%; }

/* live badge */
.live {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--crimson); padding: 0.5em 1em; border-radius: 100px;
  border: 1px solid rgba(216,92,87,0.4); background: rgba(216,92,87,0.08);
}
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); animation: blink 1.6s ease-in-out infinite; box-shadow: 0 0 8px var(--crimson); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: linear-gradient(180deg, var(--bg-raised-2), var(--bg-raised));
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent);
  opacity: 0.5; transition: opacity .35s var(--ease);
}
.card:hover { transform: translateY(-5px); border-color: color-mix(in oklab, var(--accent, var(--gold)) 45%, transparent); box-shadow: 0 24px 60px -28px rgba(0,0,0,0.9); }
.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px;
  color: var(--accent, var(--gold));
  background: color-mix(in oklab, var(--accent, var(--gold)) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent, var(--gold)) 28%, transparent);
  margin-bottom: 1.4rem;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.7rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-dim); font-size: 1rem; line-height: 1.6; }
.card .num { font-family: var(--display); font-size: 0.95rem; color: var(--accent, var(--gold)); letter-spacing: 0.2em; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line); background: var(--bg-warm);
  padding-block: clamp(3rem, 7vh, 5rem); position: relative;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between; align-items: flex-start; }
.footer .brand b { font-size: 1.5rem; }
.footer .brand-mark { width: 40px; height: 40px; }
.footer-tag { color: var(--text-faint); font-style: italic; font-family: var(--display); font-size: 1.15rem; margin-top: 0.5rem; }
.footer-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-nav a { font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); transition: color .25s var(--ease); }
.footer-nav a:hover { color: var(--gold); }
.footer-base { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--text-faint); font-size: 0.8rem; }

/* ============================================================
   HERO (shared structure)
   ============================================================ */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; overflow: hidden; }
/* faint brand emblem breathing behind hero content */
.hero::before {
  content: ''; position: absolute; z-index: 1; pointer-events: none;
  width: min(80vw, 720px); aspect-ratio: 1; left: 50%; top: 40%; translate: -50% -50%;
  background: url(../assets/logo-orange.png) center / contain no-repeat;
  opacity: 0.08; animation: slowspin 160s linear infinite;
}
@keyframes slowspin { to { transform: rotate(360deg); } }
.hero--page { min-height: 78svh; }
.hero-inner { position: relative; z-index: 2; padding-block: 8rem 4rem; }
.hero h1 { font-size: clamp(3.4rem, 9.5vw, 8.5rem); }
.hero .sub { color: var(--text-dim); font-size: clamp(1.1rem, 2.2vw, 1.5rem); max-width: 40ch; margin-top: 1.5rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2.4rem; }

/* fade to black at hero bottom so sections blend */
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 1;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}

/* scroll cue */
.scroll-cue { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 3; color: var(--text-faint); display: flex; flex-direction: column; align-items: center; gap: .6rem; font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; }
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 50.1% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
