/* ============================================================
   Opifex site core — tokens, base, header, footer, motion.
   Shared by every page; page-specific styles stay inline in
   each HTML file. Load AFTER fonts.css, BEFORE the page style.
   ============================================================ */

:root {
  --deep-green: #1F3B2D;
  --deep-green-soft: #2a4a3a;
  --cream: #F5F1E8;
  --cream-soft: #EFEADE;
  --burnt-orange: #C84B31;
  --ink: #1F3B2D;
  --subtle: #6d6d63;
  --rule: rgba(31, 59, 45, 0.12);
}

/* ===== Dark scheme tokens ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #141F19;
    --cream-soft: #1A2A20;
    --ink: #EDE8DC;
    --subtle: #A3A396;
    --rule: rgba(237, 232, 220, 0.14);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-size: 17px;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible {
  outline: 2px solid var(--burnt-orange);
  outline-offset: 3px;
  border-radius: 2px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--deep-green);
  color: #F5F1E8;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { left: 16px; }
.container { max-width: 880px; margin: 0 auto; padding: 0 28px; }
a { color: inherit; }

em {
  font-family: 'Instrument Serif', 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 20px 0;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
header.scrolled {
  background: rgba(245, 241, 232, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: 0 1px 0 var(--rule);
}
@media (prefers-color-scheme: dark) {
  header.scrolled { background: rgba(20, 31, 25, 0.82); }
}
.header-inner { display: flex; justify-content: space-between; align-items: baseline; }
.brand {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
}
.brand-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--burnt-orange);
  margin-left: 2px;
  vertical-align: 0.35em;
}
.nav { display: flex; gap: 32px; }
.nav a {
  font-size: 15px;
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 0.2s;
}
.nav a:hover { opacity: 1; }

/* ===== Shared section furniture ===== */
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--subtle);
  margin-bottom: 20px;
}

/* ===== Footer ===== */
footer {
  padding: 52px 0 44px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--subtle);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
}
.footer-emails a {
  display: block;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 6px;
  transition: color 0.15s;
}
.footer-emails a:hover { color: var(--burnt-orange); }
.footer-meta { text-align: right; }
.footer-meta-links a {
  color: var(--subtle);
  text-decoration: none;
  margin-left: 20px;
  transition: color 0.15s;
}
.footer-meta-links a:hover { color: var(--ink); }
.footer-copy {
  margin-top: 18px;
  font-size: 13px;
}

/* ===== Motion layer ===== */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.22s; }

[id] { scroll-margin-top: 88px; }

html.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}
html.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ===== Shared responsive ===== */
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; }
  .footer-meta { text-align: left; }
  .footer-meta-links a { margin-left: 0; margin-right: 20px; }
}
