:root {
  --navy: #07152f;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #16a34a;
  --purple: #7c3aed;
  --orange: #ea580c;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.wrap { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.navbar { min-height: 76px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; flex-direction: column; min-width: max-content; }
.brand b { font-size: 27px; letter-spacing: -.04em; line-height: 1; }
.brand span { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.site-nav a { padding: 9px 10px; border-radius: 999px; color: #334155; font-size: 13px; font-weight: 800; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--blue-dark); background: var(--blue-soft); }
.site-nav .nav-cta { margin-left: 4px; padding: 10px 15px; color: white; background: var(--blue); }
.site-nav .nav-cta:hover, .site-nav .nav-cta[aria-current="page"] { color: white; background: var(--blue-dark); }
.menu { display: none; margin-left: auto; padding: 8px; border: 0; color: var(--navy); background: transparent; font-size: 25px; cursor: pointer; }

.hero { position: relative; overflow: hidden; padding: 104px 0 96px; color: white; background: var(--navy); }
.hero::before, .hero::after { position: absolute; content: ""; border-radius: 50%; }
.hero::before { width: 460px; height: 460px; top: -160px; right: -120px; background: rgba(37, 99, 235, .27); }
.hero::after { width: 330px; height: 330px; right: 170px; bottom: -220px; background: rgba(124, 58, 237, .17); }
.hero .wrap { position: relative; z-index: 1; }
.eyebrow, .section-kicker { color: #60a5fa; font-size: 11px; font-weight: 900; letter-spacing: .2em; }
.hero h1 { max-width: 900px; margin: 18px 0 24px; font-size: clamp(44px, 7vw, 80px); line-height: .98; letter-spacing: -.055em; }
.hero p { max-width: 760px; margin: 0; color: #cbd5e1; font-size: 19px; line-height: 1.75; }

.page-hero { padding: 88px 0 68px; background: linear-gradient(180deg, #eff6ff 0%, #fff 100%); }
.page-hero .eyebrow { color: var(--blue); }
.page-hero h1 { max-width: 900px; margin: 16px 0 20px; color: var(--navy); font-size: clamp(42px, 6vw, 68px); line-height: 1; letter-spacing: -.05em; }
.page-hero p { max-width: 760px; margin: 0; color: #475569; font-size: 19px; line-height: 1.75; }

section { padding: 78px 0; }
.band { background: var(--soft); }
.dark-band { color: white; background: var(--navy); }
.dark-band .lead { color: #cbd5e1; }
.section-kicker { color: var(--blue); }
h2 { margin: 10px 0 18px; font-size: clamp(31px, 4vw, 48px); line-height: 1.05; letter-spacing: -.04em; }
h3 { letter-spacing: -.02em; }
.lead { max-width: 780px; color: #475569; font-size: 18px; line-height: 1.75; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 18px; border: 0; border-radius: 999px; font-size: 14px; font-weight: 900; cursor: pointer; }
.btn-primary { color: white; background: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { color: white; border: 1px solid #64748b; background: transparent; }
.btn-soft { color: var(--blue-dark); background: var(--blue-soft); }

.grid-2, .grid-3, .grid-4 { display: grid; gap: 18px; margin-top: 32px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { padding: 27px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: 0 10px 30px rgba(15, 23, 42, .04); }
a.card { transition: transform .2s, box-shadow .2s; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(15, 23, 42, .09); }
.card h3 { margin: 10px 0; font-size: 22px; }
.card p { margin-bottom: 0; color: var(--muted); line-height: 1.68; }
.label { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .17em; }
.branch { border-top: 4px solid; }
.branch.learn { border-top-color: var(--blue); }
.branch.explore { border-top-color: var(--green); }
.branch.discover { border-top-color: var(--purple); }
.branch.apply { border-top-color: var(--orange); }
.subject-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 13px; color: var(--blue-dark); background: var(--blue-soft); font-size: 13px; font-weight: 900; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 42px; }
.step { padding: 0 25px; border-left: 1px solid #cbd5e1; }
.step:first-child { padding-left: 0; border-left: 0; }
.step b { display: block; margin-bottom: 9px; color: var(--blue); font-size: 12px; letter-spacing: .15em; }
.step h3 { margin: 0 0 8px; font-size: 21px; }
.step p { color: var(--muted); line-height: 1.6; }

.lesson { max-width: 870px; }
.lesson h3 { margin-top: 34px; font-size: 28px; }
.lesson p, .lesson li { color: #475569; font-size: 17px; line-height: 1.8; }
.lesson ul { padding-left: 22px; }
.callout { margin: 26px 0; padding: 20px 22px; border-left: 4px solid var(--blue); border-radius: 0 18px 18px 0; background: var(--blue-soft); }
.notice { margin-top: 30px; padding: 16px 18px; border: 1px solid #fed7aa; border-radius: 14px; color: #9a3412; background: #fff7ed; line-height: 1.65; }

.quiz { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: white; }
.question { padding: 20px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; }
.question b { display: block; margin-bottom: 12px; }
.question label { display: block; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.question label:hover { background: var(--soft); }
.score { display: none; margin-top: 18px; padding: 14px 16px; border-radius: 12px; color: #1e40af; background: var(--blue-soft); font-weight: 900; }

.mapbox { position: relative; z-index: 1; height: 500px; margin-top: 30px; overflow: hidden; border: 1px solid #cbd5e1; border-radius: 28px; background: #dbeafe; box-shadow: 0 16px 38px rgba(15, 23, 42, .10); }
.map-help { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 800; }
.map-help::before { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); content: "↔"; }
.sage-map-marker { position: relative; width: 24px; height: 24px; border: 4px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 4px 14px rgba(15, 23, 42, .42); }
.sage-map-marker::after { position: absolute; inset: -9px; border: 2px solid rgba(37, 99, 235, .28); border-radius: 50%; content: ""; }
.mapbox .leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.mapbox .leaflet-popup-content { margin: 16px 18px; font-family: inherit; line-height: 1.5; }
.chapter-popup-title { margin-bottom: 3px; color: var(--navy); font-size: 16px; font-weight: 900; }
.chapter-popup-status { display: inline-block; margin-top: 9px; padding: 5px 9px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.mapbox .leaflet-control-attribution { font-size: 10px; }

.cta-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 40px; border-radius: 28px; color: white; background: linear-gradient(135deg, var(--navy), #153875); }
.cta-panel h2 { margin-top: 0; }
.cta-panel p { max-width: 700px; color: #cbd5e1; line-height: 1.7; }

.site-footer { margin-top: 70px; color: white; background: #040d1f; }
.footer-main { display: flex; justify-content: space-between; gap: 40px; padding: 54px 0; }
.footer-main p { max-width: 450px; color: #cbd5e1; line-height: 1.65; }
.footer-links { display: grid; grid-template-columns: repeat(2, max-content); gap: 12px 28px; align-content: start; color: #cbd5e1; font-size: 14px; font-weight: 700; }
.footer-links a:hover { color: white; }
.copyright { padding: 20px 0; border-top: 1px solid #1e293b; color: #64748b; text-align: center; font-size: 12px; }

@media (max-width: 1100px) {
  .menu { display: block; }
  .site-nav { position: absolute; top: 76px; left: 20px; right: 20px; display: none; flex-direction: column; align-items: stretch; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 18px 40px rgba(15, 23, 42, .14); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 13px; }
  .site-nav .nav-cta { margin: 5px 0 0; text-align: center; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 28px, 1160px); }
  .navbar { min-height: 68px; }
  .brand span { display: none; }
  .site-nav { top: 68px; left: 14px; right: 14px; }
  .hero { padding: 78px 0 72px; }
  .page-hero { padding: 68px 0 52px; }
  section { padding: 60px 0; }
  .grid-2, .grid-3, .grid-4, .steps { grid-template-columns: 1fr; }
  .step { padding: 0 0 22px; border-left: 0; }
  .mapbox { height: 430px; border-radius: 20px; }
  .cta-panel, .footer-main { flex-direction: column; align-items: flex-start; }
  .cta-panel { padding: 30px 24px; }
}
