/* ==========================================================================
   Base layer — additions that cannot collide with the legacy stylesheet.
   Global look-and-feel lives in /assets/css/style.css.
   ========================================================================== */

/* ---- typography (mirrors style.css so the first paint is correct even
        before the deferred stylesheet is promoted to media="all") ---- */
html {
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--c-text);
  background: var(--c-white);
}

::selection {
  background: rgba(4, 78, 163, 0.9);
  color: #fff;
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ---- focus ---- */
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- skip link (keyboard + crawler friendly) ---- */
.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: var(--z-skip);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--c-blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top var(--d-fast) var(--ease);
}

.skip-link:focus-visible {
  top: 16px;
}

/* ---- main focus target after route change ---- */
#main-content:focus {
  outline: none;
}

/* ---- scroll progress ---- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: var(--z-progress);
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--g-brand);
  pointer-events: none;
  will-change: transform;
}



/* ---- 3D tilt + glare primitives (CSS 3D, no WebGL) ---- */
.tilt {
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--d-base) var(--ease), box-shadow var(--d-base) var(--ease);
  will-change: transform;
}

.tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--d-base) var(--ease);
  background: radial-gradient(
    320px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.38),
    rgba(255, 255, 255, 0) 62%
  );
}

.tilt:hover .tilt-glare,
.tilt:focus-within .tilt-glare {
  opacity: 1;
}

/* ---- magnetic buttons ---- */
.magnetic {
  will-change: transform;
  transition: transform var(--d-base) var(--ease);
}

/* ---- accessibility helpers ---- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- reduced motion: content shows instantly, hijacking disabled ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }


}
