/* ==========================================================================
   Arca — global styles
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
  background: var(--c-ink); /* behind the paper: avoids white flashes on overscroll */
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  font-variation-settings: var(--fv-body);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}

/* Paper grain: very light texture across the whole site */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, picture, video, svg, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); }
::selection { background: var(--accent); color: var(--on-accent); }

/* ---- Headings ------------------------------------------------------------- */
h1, h2, h3, h4, .t-display-xl, .t-display-l, .t-mega {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-variation-settings: var(--fv-display);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-display); }
h2 { font-size: var(--fs-h2); line-height: 0.94; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); letter-spacing: -0.025em; }
h4 { font-size: var(--fs-h4); line-height: 1.15; letter-spacing: -0.015em; font-variation-settings: "opsz" 48, "SOFT" 0, "WONK" 0; font-weight: 450; }
p { text-wrap: pretty; }
em, .italic { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }

.t-mega { font-size: var(--fs-mega); line-height: 0.8; }
.t-display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-display); }
.t-display-l { font-size: var(--fs-display-l); line-height: var(--lh-display); }
.t-lead { font-size: var(--fs-lead); line-height: 1.45; font-variation-settings: "opsz" 24, "SOFT" 0, "WONK" 0; }
.t-small { font-size: var(--fs-small); line-height: 1.5; }

/* Gallery label: mono, uppercase, small */
.t-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 450;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: 1.45;
  font-variation-settings: normal;
}
/* Caption: italic serif */
.t-caption {
  font-style: italic;
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--fg-muted);
  font-variation-settings: "opsz" 14, "SOFT" 100, "WONK" 1;
}
.t-muted { color: var(--fg-muted); }
.t-num { font-variant-numeric: tabular-nums lining-nums; }

/* ---- Focus & accessibility ----------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}
[data-theme="accent"] :focus-visible { outline-color: var(--on-accent); }
.skip-link {
  position: fixed; left: var(--s-4); top: -4rem; z-index: 200;
  background: var(--c-ink); color: var(--c-paper);
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-mono); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: var(--ls-label);
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Sections ------------------------------------------------------------- */
.section {
  position: relative;
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--section-y);
}
.section--tight { padding-block: calc(var(--section-y) * 0.55); }
.section--flush { padding-block: 0; }

/* ---- Reduced motion: same experience, content always visible --------- */
@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; }
}
