/* ============================================================
   LEARNAI — BASE / RESET / TYPOGRAPHY / UTILITIES
   ============================================================ */

*, *::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 {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, picture { display: block; max-width: 100%; height: auto; }

img { object-fit: cover; }

input, button, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: 1.1;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p { text-wrap: pretty; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------- Selection & Focus ---------- */

::selection { background: var(--emerald-900); color: var(--on-dark); }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--emerald-700);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100%;
  z-index: 1000;
  background: var(--emerald-900);
  color: var(--on-dark);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-xs);
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus { top: var(--s-2); }

/* ---------- Type helpers ---------- */

.display-xl { font-size: var(--text-display-xl); }
.display-lg { font-size: var(--text-display-lg); }
.display-md { font-size: var(--text-display-md); }
.display-sm { font-size: var(--text-display-sm); }

.text-xl { font-size: var(--text-xl); }
.text-lg { font-size: var(--text-lg); }
.text-md { font-size: var(--text-md); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-2xs { font-size: var(--text-2xs); }

.eyebrow {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow--emerald { color: var(--emerald-700); }
.eyebrow--gold { color: var(--gold-600); }
.eyebrow--on-dark { color: var(--on-dark-muted); }

.tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.mono { font-family: var(--font-mono); font-size: .92em; }

.muted { color: var(--muted); }
.ink-soft { color: var(--ink-soft); }
.strong { font-weight: 600; }

.lede {
  font-size: var(--text-lg);
  color: var(--ink-soft);
  max-width: 46ch;
}

/* ---------- Layout utilities ---------- */

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - (var(--gutter) * 2), var(--container-wide));
  margin-inline: auto;
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.section-head { margin-bottom: var(--s-10); }

.section-head .eyebrow { margin-bottom: var(--s-3); display: inline-block; }

.section-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
}

.section-head--split > * { min-width: 0; }

.section-head--split h2 { max-width: 22ch; }

.section-head__aside { flex-shrink: 0; }

.stack > * + * { margin-top: var(--s-4); }
.stack--sm > * + * { margin-top: var(--s-2); }
.stack--lg > * + * { margin-top: var(--s-8); }

.grid { display: grid; gap: var(--s-6); }

.split { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }

/* ---------- Motion reveals ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Dark section ---------- */

.dark {
  background: var(--dark);
  color: var(--on-dark);
}

.dark h1, .dark h2, .dark h3, .dark h4 { color: var(--on-dark); }

/* ---------- Scrollbar (subtle) ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------- Print ---------- */

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
