/* ==========================================================================
   Aurea — Reset, base typography, accessibility primitives
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky header must not cover anchor targets. */
  scroll-padding-top: calc(var(--h-header) + var(--sp-4));
  /* `clip` rather than `hidden`: overflow-x:hidden on html/body silently
     breaks `position: sticky` descendants. */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-ink-700);
  background-color: var(--c-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Belt-and-braces against horizontal scroll — `clip`, not `hidden`, so
     sticky positioning keeps working. */
  overflow-x: clip;
}

/* Prevent background scroll behind drawer/modal. */
body.is-locked {
  overflow: hidden;
}

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

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Headings
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--ff-display);
  font-weight: var(--fw-semibold);
  color: var(--c-ink-900);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }

h5,
h6 {
  font-family: var(--ff-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink-900);
}

/* --------------------------------------------------------------------------
   Focus — visible everywhere, never removed
   -------------------------------------------------------------------------- */

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

/* Only suppress the default ring where we draw our own; never remove wholesale. */
:focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--c-accent);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Accessibility utilities
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-ink-900);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--t-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Text helpers
   -------------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent);
}

.text-muted { color: var(--c-ink-500); }
.text-center { text-align: center; }
.lead {
  font-size: var(--fs-lg);
  color: var(--c-ink-500);
  line-height: var(--lh-loose);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hide until JS decides otherwise (used for state swaps). */
[hidden] {
  display: none !important;
}
