/* ==========================================================================
   Base — reset, document, typography primitives, utilities, accessibility
   ========================================================================== */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;          /* offset sticky header for in-page anchors */
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Subtle warm grain + a faint top glow for atmosphere (pure CSS, no media). */
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 154, 43, 0.06), transparent 60%);
  background-attachment: fixed;
}

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

img { height: auto; }

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

input,
select,
textarea { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--temp); color: var(--void); }

/* ---- Focus: always visible, accessible ---- */
:focus-visible {
  outline: 3px solid var(--temp);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Utilities ---- */
.mono {
  font-family: var(--f-mono);
  font-size: 0.78em;
  letter-spacing: 0.02em;
  font-feature-settings: "tnum" 1;
}

.ghost { color: var(--ink-3); }

.link {
  color: var(--temp-ink);
  border-bottom: 1px solid rgba(184, 90, 18, 0.4);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.link:hover { border-bottom-color: currentColor; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  margin: 0 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--temp);
  box-shadow: 0 0 12px var(--temp);
  flex: none;
}

.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 */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--void);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---- Scroll reveal (progressive, JS adds .reveal-in) ---- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.reveal-in { opacity: 1; transform: none; }

/* ---- Reduced motion: honor the user's preference ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
