/* ==========================================================================
   Global base — reset, typography, shared nav/footer, reveal utility.
   Depends on tokens.css. Shared across all rebuild pages.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-ink); color: var(--color-cream);
  padding: var(--space-xs) var(--space-sm); z-index: 200;
}
.skip-link:focus { left: var(--space-sm); }

/* --- Layout helpers --- */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 0.5rem + 3vw, 3rem);
}
.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-muted);
}

/* --- Top nav --- */
.nav {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1.25rem, 0.8rem + 1.5vw, 2rem) clamp(1.25rem, 0.5rem + 3vw, 3rem);
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}
.nav__link {
  font-size: var(--text-sm); letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out-expo);
}
.nav__link:hover { border-bottom-color: currentColor; }
.nav__links { display: flex; align-items: center; gap: clamp(0.85rem, 0.4rem + 1.6vw, 2rem); }
@media (max-width: 420px) { .nav__links { gap: 0.8rem; } .nav__link { font-size: var(--text-xs); } }

/* --- Footer --- */
.footer {
  background: var(--color-black);
  color: var(--color-on-dark);
  padding-block: var(--space-xl) var(--space-lg);
}
.footer__top {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: var(--space-xl); padding-bottom: var(--space-lg);
}
.footer__brandcol { max-width: 36ch; }
.footer__brand { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); }
.footer__tagline {
  margin: var(--space-xs) 0 var(--space-md);
  font-size: var(--text-sm); color: var(--color-on-dark-muted); line-height: var(--leading-snug);
}
.footer__cta {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-sm);
  color: var(--color-on-dark); border-bottom: 1px solid currentColor; padding-bottom: 2px;
  transition: color var(--duration-fast) var(--ease-out-expo);
}
.footer__cta:hover { color: var(--color-cream); }
.footer__social { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.footer__social a {
  width: 22px; height: 22px; display: inline-flex; color: var(--color-on-dark-muted);
  transition: color var(--duration-fast) var(--ease-out-expo);
}
.footer__social a:hover { color: var(--color-cream); }
.footer__social .ico {
  width: 100%; height: 100%; background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
          mask: var(--src) center / contain no-repeat;
}
.footer__navs { display: flex; flex-wrap: wrap; gap: var(--space-xl); }
.footer__col { display: flex; flex-direction: column; gap: 0.55rem; }
.footer__col-head {
  font-size: var(--text-xs); letter-spacing: var(--tracking-wide);
  text-transform: uppercase; color: var(--color-on-dark-muted); margin-bottom: 0.2rem;
}
.footer__col a {
  font-size: var(--text-sm); color: var(--color-on-dark);
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.footer__col a:hover { color: var(--color-cream); border-bottom-color: currentColor; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: var(--space-md); }
.footer__fine { font-size: var(--text-xs); color: var(--color-on-dark-muted); }
@media (max-width: 600px) { .footer__navs { gap: var(--space-lg); width: 100%; } }

/* --- Scroll-reveal utility (driven by js/motion.js) ---
   Scoped to .js so that without JS the content is fully visible (no orphaned
   opacity:0). The .js class is set render-blocking by /js/init.js. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: 80ms; }
.js .reveal[data-delay="2"] { transition-delay: 160ms; }
.js .reveal[data-delay="3"] { transition-delay: 240ms; }
.js .reveal[data-delay="4"] { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
