/* Ashley Hallam Photography — base: reset, typography, grain, reveal, utilities.
   No colors or fonts declared here except via tokens. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-body);
  font-weight: var(--body-weight);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open { overflow: hidden; }
img, picture, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-optical-sizing: auto;
  line-height: var(--lh-display);
  letter-spacing: -.01em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--display-weight-strong); }
h1 em, h2 em, h3 em, .display em { font-style: italic; font-weight: var(--display-weight); }
strong, b { font-weight: var(--body-weight-strong); }
.lede { font-size: var(--fs-small); max-width: var(--measure); }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }

/* layout helpers */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-tight { padding-block: calc(var(--section-y) * .6); }
.stack { display: grid; gap: var(--space-3); }
.flow > * + * { margin-top: var(--space-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--brown); color: var(--cream); padding: .6rem 1rem; }
.skip:focus { top: var(--space-2); }

/* image boxes: never let an image shift layout */
.ph { position: relative; overflow: hidden; }
.ph > picture, .tile > picture, .hero > .ph > picture { position: absolute; inset: 0; }
.ph img, .ph picture img { width: 100%; height: 100%; object-fit: cover; }
.ph.r-3x4 { aspect-ratio: 3 / 4; }
.ph.r-4x3 { aspect-ratio: 4 / 3; }
.ph.r-2x3 { aspect-ratio: 2 / 3; }
.ph.r-1x1 { aspect-ratio: 1; }
.ph.r-16x9 { aspect-ratio: 16 / 9; }
.lqip { background-size: cover; background-position: center; }

/* film grain overlay (body.grain) */
body.grain::after {
  content: ""; position: fixed; inset: -50%; pointer-events: none; z-index: 60;
  opacity: var(--grain-opacity); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) { body.grain::after { animation: none; } }

/* reveal on scroll: visible by default; JS adds .js and .pre, then removes .pre when in view */
.reveal { opacity: 1; transform: none; }
html.js .reveal.pre { opacity: 0; transform: translateY(18px); }
html.js .reveal { transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { html.js .reveal.pre { opacity: 1; transform: none; } html.js .reveal { transition: none; } }
