/* ==========================================================================
   Our Living Earth — shared site styles (site.css)
   Owns: CSS variables, reset, base typography, fixed NAV (+scrolled state),
   mobile menu, canonical BUTTONS, and the FOOTER.
   Page-specific section styles live inline in each page.
   Fonts (add to each page <head>): Cormorant Garamond / Cinzel / Lato.
   ========================================================================== */

:root {
  /* Height of the fixed nav bar — 64px logo + 2×8px padding. Kept as a
     variable so page heroes can size themselves against it. */
  --nav-h: 80px;

  --forest: #3a5233;
  --forest-light: #5a7a52;
  --terracotta: #c4622d;
  --terracotta-dark: #a85224;   /* hover for orange CTAs */
  --sand: #c9b08a;
  --cream: #f0ebe0;
  --off-white: #faf7f2;
  --dark: #1e2a1a;
  --text: #1e2a1a;

  /* Motion (Emil / design-eng tokens) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --duration-fast: 160ms;   /* press feedback */
  --duration-ui: 200ms;     /* hover color, chrome */
  --duration-enter: 220ms;  /* menus, small entrances */
  --duration-reveal: 600ms; /* scroll reveals, marketing */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--off-white);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: 'Cormorant Garamond', serif; font-weight: 400; }

/* ==========================================================================
   NAV  (fixed, cream bar; matches the site design language)
   ========================================================================== */
nav.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 56px;
  background: rgba(250, 247, 242, 0.97);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(58, 82, 51, 0.08);
  /* Shadow only — padding change on scroll stays instant (avoids layout thrash) */
  transition: box-shadow var(--duration-ui) ease;
}
nav.site-nav.scrolled { box-shadow: 0 2px 16px rgba(58, 82, 51, 0.12); padding: 6px 56px; }
/* With the mobile menu open, the nav joins the menu into one surface — the
   menu's own bottom shadow (below the CTA) is the only edge that should cast */
nav.site-nav:has(+ .mobile-menu.open) { box-shadow: none; }

.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 64px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; margin: 0; }
.nav-links a {
  font-family: 'Cinzel', serif; font-size: 14px; letter-spacing: 2px;
  color: var(--forest); text-decoration: none;
  transition: opacity var(--duration-ui) ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { opacity: 0.6; }
}

/* Primary CTA in the nav — terracotta bg, WHITE text, darker-orange hover */
.nav-cta {
  color: #fff !important; background: var(--terracotta);
  padding: 11px 24px; border-radius: 2px;
  box-shadow: 0 2px 14px rgba(196, 98, 45, 0.22);
  transition: background var(--duration-ui) ease, transform var(--duration-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav-cta:hover { background: var(--terracotta-dark); transform: translateY(-1px); opacity: 1 !important; }
}
/* :active after hover so press scale wins over hover lift */
.nav-cta:active { background: var(--terracotta-dark); transform: scale(0.97); opacity: 1 !important; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px; background: none; border: none; z-index: 110;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--forest); border-radius: 2px;
  transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown menu — base: hidden on desktop; open class is for JS only.
   Display + opacity/transform animation live in the 900px media query. */
.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(250, 247, 242, 0.98); backdrop-filter: blur(14px);
  z-index: 99; flex-direction: column; align-items: stretch;
  padding-top: 68px;
  box-shadow: 0 4px 24px rgba(58, 82, 51, 0.12);
  border-bottom: 1px solid rgba(58, 82, 51, 0.1);
}
.mobile-menu a.mobile-menu-item {
  font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 0.21em; text-transform: uppercase;
  color: var(--forest); text-decoration: none;
  padding: 16px 24px; border-bottom: 1px solid rgba(58, 82, 51, 0.07); display: block;
}
.mobile-menu a.mobile-menu-cta {
  font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 0.21em; text-transform: uppercase;
  color: #fff !important; background: var(--terracotta);
  padding: 18px 24px; text-decoration: none; display: block; text-align: center;
}

@media (max-width: 900px) {
  :root { --nav-h: 64px; }   /* 48px logo + 2×8px padding */
  nav.site-nav { padding: 8px 24px; }
  nav.site-nav.scrolled { padding: 6px 24px; }
  .nav-logo img { height: 48px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* Always flex on mobile; animate opacity/transform instead of display toggle */
  .mobile-menu {
    display: flex;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    /* exit (closing): faster */
    transition:
      opacity 160ms var(--ease-out),
      transform 160ms var(--ease-out),
      visibility 160ms;
  }
  .mobile-menu.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    /* enter: slightly longer */
    transition:
      opacity 220ms var(--ease-out),
      transform 220ms var(--ease-out),
      visibility 220ms;
  }

  /* The nav is a solid cream bar, so anything under it is simply invisible.
     On phones that costs a real slice of every hero photo. Start the page
     below the bar instead — heroes then show their full crop, and they size
     themselves with calc(... - var(--nav-h)) to still fill exactly one screen. */
  body { padding-top: var(--nav-h); }
}

/* ==========================================================================
   BUTTONS  (canonical). Every button keeps WHITE text in every state.
   ========================================================================== */
.btn {
  font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 16px 36px; border: none; border-radius: 2px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; text-align: center; white-space: nowrap;
  transition:
    background var(--duration-ui) ease,
    border-color var(--duration-ui) ease,
    transform var(--duration-fast) var(--ease-out);
}
/* Primary: orange bg, white text */
.btn-primary {
  background: var(--terracotta); color: #fff !important;
  box-shadow: 0 4px 24px rgba(196, 98, 45, 0.26);
}
/* Color focus for keyboard without lift */
.btn-primary:focus-visible {
  background: var(--terracotta-dark);
  color: #fff !important;
}
.btn-primary:focus { background: var(--terracotta-dark); color: #fff !important; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--terracotta-dark);
    color: #fff !important;
    transform: translateY(-2px);
  }
}
/* :active after hover so press scale wins over hover lift when both match */
.btn-primary:active {
  background: var(--terracotta-dark);
  color: #fff !important;
  transform: scale(0.97);
}

/* Secondary: transparent outline, white text (used over dark imagery) */
.btn-secondary {
  background: transparent; color: #fff !important;
  border: 1.5px solid rgba(240, 235, 224, 0.45);
}
.btn-secondary:focus,
.btn-secondary:focus-visible {
  background: rgba(240, 235, 224, 0.10);
  border-color: rgba(240, 235, 224, 0.75);
  color: #fff !important;
}
@media (hover: hover) and (pointer: fine) {
  .btn-secondary:hover {
    background: rgba(240, 235, 224, 0.10);
    border-color: rgba(240, 235, 224, 0.75);
    color: #fff !important;
    transform: translateY(-2px);
  }
}
.btn-secondary:active {
  background: rgba(240, 235, 224, 0.10);
  border-color: rgba(240, 235, 224, 0.75);
  color: #fff !important;
  transform: scale(0.97);
}

/* Kill lift on disabled (hover/active would otherwise still fire) */
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* Section tag / eyebrow heading (canonical) — the "Episode 02" style.
   Pages currently carry local variants (.ep-tag, .project-tag); new work
   should use this. */
.section-tag {
  font-family: 'Cinzel', serif; font-size: 12px; font-weight: 600; letter-spacing: 0.25em;
  text-transform: uppercase; color: var(--terracotta); margin-bottom: 8px;
}

/* Photo credit overlay (shared) — pages may add positional variants like
   Máret's .photo-credit.top. font-weight + line-height are pinned so page
   wrappers (e.g. veld's .episode-doc { font-weight: 300 }) cannot lighten them. */
.photo-credit {
  position: absolute; bottom: 14px; left: 16px; right: 16px; z-index: 4;
  font-family: 'Lato', sans-serif; font-weight: 400; font-size: 10px;
  line-height: 1.3; letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Scroll reveal (progressive; content is visible without JS via .no-js guard
   applied in site.js — if JS is off, .reveal stays fully visible).
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
}
.js .reveal.visible { opacity: 1; transform: none; }
/* Stagger helpers for reveals inside one section */
.js .reveal-d1 { transition-delay: 0.05s; }
.js .reveal-d2 { transition-delay: 0.1s; }
.js .reveal-d3 { transition-delay: 0.15s; }

/* Keyboard focus ring (mouse clicks don't trigger :focus-visible) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.btn:focus-visible,
.nav-cta:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Reduced motion — nuanced: kill movement and long animations; keep short
   opacity/color comprehension aids. Hero zoom/fadeUp are page-local and
   covered by animation-duration: 0.001ms on *. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  /* Drop movement; keep short opacity/color comprehension aids where transitions exist */
  .js .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn, .nav-cta, .hamburger span, .mobile-menu, .nav-links a, .footer-links a {
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .btn:hover, .btn:active, .nav-cta:hover, .nav-cta:active {
    transform: none !important;
  }
  .mobile-menu {
    transition: none !important;
    transform: none !important;
  }
  .mobile-menu:not(.open) {
    /* still hide when closed */
    opacity: 0;
    visibility: hidden;
  }
}

/* ==========================================================================
   FOOTER  (shared, dark)
   ========================================================================== */
.site-footer {
  background: var(--dark);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 40px 60px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;
}
.footer-links { display: flex; gap: 28px; list-style: none; margin: 0; flex-wrap: wrap; }
.footer-links a {
  font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(240, 235, 224, 0.88); text-decoration: none;
  transition: color var(--duration-ui) ease;
}
.footer-links a:hover { color: rgba(240, 235, 224, 1); }
.footer-copy {
  font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(240, 235, 224, 0.8);
}
@media (max-width: 640px) {
  .site-footer { flex-direction: column; text-align: center; padding: 32px 24px; }
  .footer-links { flex-direction: column; align-items: center; gap: 14px; }
  .footer-copy { font-size: 10px; }
  /* Copyright: bullet on desktop, own line on mobile */
  .footer-dot { display: none; }
  .footer-rights { display: block; }
}
