/* Reset, typography and layout primitives shared by the public site and admin. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* `clip` (not `hidden`) so sticky positioning keeps working while horizontal overflow is impossible */
  overflow-x: clip;
}

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

/* Progressive image fade-in: applied via JS (site.js) once a lazy-loaded image finishes
   loading, so thumbnails/gallery shots ease in instead of popping in abruptly. */
img.img-fade { opacity: 0; transition: opacity 0.5s var(--ease); }
img.img-fade.is-loaded { opacity: 1; }

h1, h2, h3, h4 { margin: 0 0 var(--space-3); line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

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

[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.sr-only {
  position: absolute; 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(--space-3); top: -4rem; z-index: 200;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius); text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-3); }

.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--space-3);
}

.text-muted { color: var(--text-muted); }
.stack > * + * { margin-top: var(--space-4); }

/* Scroll reveal: hidden state applies only after site.js confirms it can reveal (so no-JS users see everything). */
.reveal-ready [data-reveal] {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal-ready [data-reveal].is-revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important;
  }
  .reveal-ready [data-reveal] { opacity: 1; transform: none; }
  .img-fade { opacity: 1 !important; transition: none !important; }
}
