/* ============================================================================
   base.css — reset, shell, type utilities, reduced-motion, view-transitions
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* Desktop framing: subtle spotlight glow bleeding above the centered app column */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--grad-spotlight);
  pointer-events: none;
  z-index: 0;
}

/* ---- App column ---- */
#app {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--page-x);
  padding-top: calc(var(--safe-top));
  padding-bottom: calc(64px + var(--safe-bottom) + var(--s-8));
  min-height: 100dvh;
}
/* Full-bleed elements (hero, etc.) escape the column gutter */
.bleed {
  margin-inline: calc(var(--page-x) * -1);
}
@media (min-width: 480px){
  #app { padding-inline: var(--page-x-lg); }
  .bleed { margin-inline: calc(var(--page-x-lg) * -1); }
}

/* ---- Type utility classes (map the scale tokens; exact weights/lh/ls) ---- */
.t-hero {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--t-hero);
  line-height: 1.06;
  letter-spacing: -.02em;
}
.t-h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--t-h1);
  line-height: 1.12;
  letter-spacing: -.015em;
}
.t-h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--t-h2);
  line-height: 1.18;
  letter-spacing: -.01em;
}
.t-h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-h3);
  line-height: 1.25;
}
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--t-eyebrow);
  text-transform: uppercase;
  letter-spacing: .22em;
  line-height: 1.4;
}
.subhead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--t-subhead);
  line-height: 1.5;
}
.lead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--t-lead);
  line-height: 1.7;
}
.body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.78;
}
.small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--t-small);
  line-height: 1.6;
}
.caption {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--t-caption);
  letter-spacing: .04em;
  line-height: 1.4;
}
.button-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--t-button);
  text-transform: uppercase;
  letter-spacing: .14em;
}
.serif { font-family: var(--font-serif); }
.text-soft  { color: var(--text-on-dark-soft); }
.text-faint { color: var(--text-on-dark-faint); }
.text-red   { color: var(--red); }
.text-gold  { color: var(--gold); }

/* Multi-line clamp helper */
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* visually-hidden (for a11y labels) */
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---- Scroll reveal (choreographed entrance) ---- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}
.reveal.reveal-in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--d-base) var(--ease-out),
    transform var(--d-base) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--d-stagger));
}

/* ---- View Transitions base ---- */
@media (prefers-reduced-motion: no-preference){
  ::view-transition-old(root) { animation: vt-fade-out var(--d-base) var(--ease-in-out) both; }
  ::view-transition-new(root) { animation: vt-fade-in  var(--d-slow) var(--ease-in-out) both; }
}
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* Tab bar persists across route transitions (named so it doesn't flicker) */
#tabbar { view-transition-name: tabbar; }

/* ---- Reduced motion: kill parallax / bar-draw / stagger / VT-translate ---- */
@media (prefers-reduced-motion: reduce){
  :root { --parallax: 0; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  ::view-transition-new(root) { animation: none !important; }
  ::view-transition-old(root) { animation: none !important; }
}

/* Honor explicit no-motion class set by JS as a belt-and-suspenders */
.no-motion .reveal { opacity: 1 !important; transform: none !important; }
