/* ==========================================================================
   Griefcase — Base / reset / global element styles
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-charcoal);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; height: 100vh; }

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

/* The `hidden` attribute ties with a class selector in specificity, so any
   component rule that sets its own `display` (flex layouts, mostly) will
   silently beat the browser's default `[hidden]{display:none}` and leave
   the "hidden" element still laid out and hit-testable. Force the
   attribute to always win — this is the one styling rule allowed an
   !important, because "hidden" should never mean "hidden, unless a
   component happens to set display elsewhere." */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--lh-tight);
  margin: 0;
  color: var(--color-charcoal);
  letter-spacing: -0.01em;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration-color: var(--color-line);
  text-underline-offset: 3px;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

textarea, input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul { margin: 0; padding: 0; list-style: none; }

/* ---- Focus states: visible, calm, never harsh ---- */
:focus { outline: none; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ---- Accessibility utilities ---- */
.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: fixed;
  top: -60px;
  left: var(--space-4);
  z-index: 1000;
  background: var(--color-charcoal);
  color: var(--color-paper);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: top var(--dur-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---- Selection ---- */
::selection {
  background: var(--color-accent-soft);
  color: var(--color-charcoal);
}

/* ---- Eyebrow / label pattern used across sections ---- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-taupe-deep);
  margin-bottom: var(--space-3);
}

.section-head {
  max-width: var(--content-narrow);
  margin: 0 auto var(--space-6);
  text-align: center;
}

.section-head p.lede {
  margin-top: var(--space-4);
  font-size: var(--fs-body-lg);
  color: var(--color-charcoal-soft);
  line-height: var(--lh-relaxed);
}

/* ---- Grain overlay: a subtle animated noise layer used on dark/atmospheric
   sections. Generated with SVG turbulence, no image asset needed. ---- */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 9s steps(6) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-2%, 2%); }
  40%  { transform: translate(2%, -1%); }
  60%  { transform: translate(-1%, -2%); }
  80%  { transform: translate(1%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---- Visually-hidden live region for status/announcements ---- */
.live-region {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
