/* ==========================================================================
   ESSARDAS GROUP — BASE
   Reset, document defaults, typography scale, links, focus, selection.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;          /* fallback when Lenis is off */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* When Lenis is active it manages scrolling; disable native smooth to avoid
   conflict. The .lenis classes are added by the Lenis runtime. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--bone);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Media -------------------------------------------------------------- */
img, picture, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}
img { font-style: italic; color: var(--smoke); } /* graceful alt styling */

/* ---- Form elements inherit type ---------------------------------------- */
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* ---- Headings — Cormorant display -------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-lead); }

p { text-wrap: pretty; }

/* ---- Links -------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-luxe);
}

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

/* ---- Selection ---------------------------------------------------------- */
::selection {
  background: var(--champagne);
  color: var(--obsidian);
}

/* ---- Focus -------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

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

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: var(--z-banner);
  background: var(--obsidian);
  color: var(--chalk);
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--champagne);
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-ui);
  text-transform: uppercase;
}
.skip-link:focus { top: 1rem; }

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