/* ============================================================
   Lilla Beirut — Base & reset
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; padding: 0; }

::selection { background: var(--pom); color: var(--sand); }

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

/* ---- Headings: display face, Swedish-safe leading ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: -0.005em;
  color: var(--ink);
  /* Yeseva One has tall ring/diaeresis on Å Ä Ö — pad the top so they never
     touch the element edge or a line above. */
  padding-top: 0.04em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-family: var(--font-body); font-weight: 600; line-height: var(--lh-tight); letter-spacing: 0; padding-top: 0; }

p { max-width: 68ch; }

/* ---- Layout helpers ---- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: var(--max-narrow); }
.section { padding-block: clamp(var(--space-3xl), 8vw, var(--space-5xl)); }

.surface-2 { background: var(--sand-2); }
.surface-3 { background: var(--sand-3); }
.surface-dark { background: var(--dark); color: var(--on-dark); }

/* ---- Eyebrow: small-caps label with cedar mark ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay-deep);
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--gold-deep);
}
.surface-dark .eyebrow { color: var(--gold); }
.surface-dark .eyebrow::before { background: var(--gold); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--sand);
  padding: var(--space-sm) var(--space-md); border-radius: var(--r-md);
}
.skip-link:focus { left: var(--space-md); top: var(--space-md); }

/* ---- Scroll reveal (JS toggles .is-in) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-reveal) var(--ease-out),
              transform var(--dur-reveal) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
/* lead-with-most-important stagger: 70ms steps (emil-anim rule 5) */
.reveal--d1 { transition-delay: 70ms; }
.reveal--d2 { transition-delay: 140ms; }
.reveal--d3 { transition-delay: 210ms; }

/* Global reduced-motion safety net (emil-anim rule 36) */
@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;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
