/* ==========================================================================
   Base: reset + typography. Depends on tokens.css.
   ========================================================================== */

/* ---- Web font (self-hosted, OFL — see assets/fonts/OFL.txt) --------------
   Variable weight 400–800. Latin is preloaded in partials/head.html;
   latin-ext covers ₹ (U+20B9) and accented characters. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Font fallback -------------------------------------------------------
   Local Arial scaled to Plus Jakarta Sans metrics, so the web-font swap
   (display=swap) doesn't reflow text and cause layout shift (CLS). */
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 106.99%;
  ascent-override: 96.08%;
  descent-override: 20.55%;
  line-gap-override: 0%;
}

/* ---- Reset --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img,
video {
  height: auto;
}

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

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

button:disabled {
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}

dialog {
  padding: 0;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* ---- Typography ---------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  overflow-wrap: break-word;
  text-wrap: balance;
}

h1 { font-size: var(--fs-5xl); font-weight: var(--fw-extrabold); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h5 { font-size: var(--fs-md); line-height: var(--lh-snug); letter-spacing: var(--tracking-normal); }
h6 { font-size: var(--fs-base); line-height: var(--lh-snug); letter-spacing: var(--tracking-normal); }

p,
li,
dd,
figcaption {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

p + p {
  margin-top: var(--space-4);
}

small {
  font-size: var(--fs-sm);
}

strong,
b {
  font-weight: var(--fw-bold);
}

a {
  color: var(--color-link);
  text-decoration-thickness: from-font;
  text-underline-offset: 0.15em;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--color-primary-hover);
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-border);
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

::selection {
  background: var(--blue-100);
  color: var(--color-text);
}

/* ---- Focus --------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: var(--border-width-thick) solid var(--color-focus);
  outline-offset: var(--border-width-thick);
  border-radius: var(--radius-xs);
}

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-modal);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--color-on-primary);
}

@media (max-width: 991.98px) {
  .u-hide-below-lg { display: none !important; }
}

.is-scroll-locked {
  overflow: hidden;
}

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