/* ==========================================================================
   EVLENA — Base / reset / typography / layout primitives
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--ff-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body:has(dialog[open]) { overflow: hidden; }

img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--sp-6) 0; }

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

::selection { background: var(--c-sand-300); color: var(--c-ink); }

/* ---- Typography --------------------------------------------------------- */
.display, h1, h2, .h1, .h2, .h3 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-2xl); }
h2, .h2 { font-size: var(--fs-xl); }
.h3 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
h3, h4 { font-size: var(--fs-md); font-weight: 600; line-height: var(--lh-snug); }
.display em, h1 em, h2 em { font-style: italic; font-weight: 400; }
p { text-wrap: pretty; }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--c-muted);
}
.lead { font-size: var(--fs-md); color: var(--c-ink-soft); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-sm); }

/* ---- Layout primitives -------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * .6); }
.section--sand { background: var(--c-sand-100); }

.stack > * + * { margin-top: var(--stack, var(--sp-4)); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, var(--sp-3)); align-items: center; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.section-head .stack { --stack: var(--sp-2); }

.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 {
  position: absolute; left: var(--sp-4); top: -100px;
  background: var(--c-ink); color: var(--c-bg);
  padding: var(--sp-3) var(--sp-4); z-index: 100; border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--sp-4); }

/* Reveal on scroll (progressive enhancement; JS adds .is-in) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}
