/* =========================================================================
   forestana.com — 3D atlas hero
   A stack of cartographic plates (satellite, hydrography, parcels, indigenous
   lands) suspended in CSS-3D space, like vellum overlays on a drawing table.
   A figure-eight camera orbits the stack; a light sweep rakes the right edge;
   the middle plates flutter softly; dust drifts at different depths.
   Motion is driven by assets/js/hero-atlas.js. Static + reduced-motion safe.
   ========================================================================= */

.hero-atlas {
  position: relative;
  min-height: clamp(560px, 82vh, 860px);
  background: #0e0d09;
  overflow: hidden;
  isolation: isolate;
}

/* ---- 3D stage ---------------------------------------------------------- */
.hero-atlas__stage {
  position: absolute;
  inset: 0;
  perspective: 1800px;
  perspective-origin: 50% 46%;
  overflow: hidden;
}
.hero-atlas__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, #2a2820 0%, #181712 60%, #0e0d09 100%);
}
.hero-atlas__camera {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* Static / no-JS fallback: a slight tilt reveals the layered depth. */
  transform: scale(var(--fit, 0.9)) rotateX(-3.5deg) translateZ(16px);
  will-change: transform;
}

/* ---- Plates ------------------------------------------------------------ */
.hero-plate {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1400px;
  height: 700px;
  margin-left: -700px;
  margin-top: -350px;
  transform-style: preserve-3d;
  transform: translateZ(var(--z, 0px));   /* JS adds breeze sway on top */
  will-change: transform;
}
.hero-plate__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.hero-plate--paper {
  background: #FBF5E6;
  box-shadow: 0 50px 120px rgba(27, 26, 20, 0.5), 0 20px 50px rgba(27, 26, 20, 0.3);
}
.hero-plate--vellum {
  background: rgba(251, 245, 230, 0.045);
  border: 1px solid rgba(200, 188, 155, 0.55);
  box-shadow: 0 24px 60px rgba(27, 26, 20, 0.16), 0 6px 14px rgba(27, 26, 20, 0.1);
}
/* Right-edge highlight — catches the "light" as the camera turns. */
.hero-plate::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 250, 235, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}
.hero-plate__label {
  position: absolute;
  top: 22px;
  left: 36px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(27, 26, 20, 0.7);
  background: rgba(251, 245, 230, 0.82);
  padding: 4px 8px;
  pointer-events: none;
}
.hero-plate--vellum .hero-plate__label { color: rgba(232, 222, 196, 0.78); background: rgba(20, 19, 14, 0.32); }

/* ---- Light sweep + dust (live in 3D camera space) ---------------------- */
.hero-atlas__sweep {
  position: absolute;
  top: -40px;
  left: 0;
  width: 360px;
  height: calc(100% + 80px);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 250, 235, 0.22) 35%, rgba(255, 250, 235, 0.32) 50%, rgba(255, 250, 235, 0.22) 65%, transparent 100%);
  transform: translateZ(260px) rotate(8deg);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
}
.hero-atlas__dust { position: absolute; inset: 0; pointer-events: none; transform-style: preserve-3d; }
.hero-atlas__mote {
  position: absolute;
  border-radius: 50%;
  background: #F2E5BB;
  pointer-events: none;
  will-change: transform;
}

/* ---- 2D overlay (typography sits over, never inside, the 3D scene) ------ */
.hero-atlas__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(90deg,
    rgba(251, 245, 230, 0.93) 0%,
    rgba(251, 245, 230, 0.84) 30%,
    rgba(251, 245, 230, 0.4) 56%,
    rgba(251, 245, 230, 0) 78%);
}
.hero-atlas__overlay-inner {
  position: relative;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}
.hero-atlas__overlay-inner > * { pointer-events: auto; }
.hero-atlas__eyebrow { color: var(--color-muted); }
.hero-atlas__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.9rem, 8.4vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--color-ink);
  margin: 0.3rem 0 1.4rem;
  max-width: 15ch;
  text-wrap: balance;
}
.hero-atlas__title em { font-style: italic; color: var(--color-ink-2); }
.hero-atlas__byline {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.45;
  color: var(--color-ink-2);
  max-width: 44ch;
  margin: 0 0 1.7rem;
}
.hero-atlas__byline strong { font-weight: 600; color: var(--color-ink); }
.hero-atlas__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ---- Live-feed coordinate ticker --------------------------------------- */
.hero-atlas__ticker {
  position: absolute;
  right: var(--space-3);
  bottom: 1.4rem;
  z-index: 2;
  display: flex;
  gap: 1.4rem;
  align-items: center;
  font: 500 0.68rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 222, 196, 0.72);
  pointer-events: none;
}
.hero-atlas__coords { font-variant-numeric: tabular-nums; }

/* ---- Registration crop marks at the hero corners ----------------------- */
.hero-atlas__crop {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid rgba(120, 112, 84, 0.6);
  z-index: 3;
  pointer-events: none;
}
.hero-atlas__crop--tl { top: 16px; left: 16px; border-top-width: 1px; border-left-width: 1px; }
.hero-atlas__crop--tr { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
.hero-atlas__crop--bl { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }
.hero-atlas__crop--br { bottom: 16px; right: 16px; border-bottom-width: 1px; border-right-width: 1px; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 880px) {
  .hero-atlas { min-height: clamp(520px, 86vh, 720px); }
  .hero-atlas__overlay {
    align-items: flex-start;
    padding-top: clamp(2.5rem, 12vh, 6rem);
    background: linear-gradient(180deg,
      rgba(251, 245, 230, 0.96) 0%,
      rgba(251, 245, 230, 0.9) 42%,
      rgba(251, 245, 230, 0.55) 70%,
      rgba(251, 245, 230, 0.2) 100%);
  }
  .hero-atlas__ticker { left: var(--space-3); right: auto; bottom: 1rem; }
}
@media (max-width: 520px) {
  .hero-atlas__ticker { display: none; }
  .hero-plate__label { display: none; }
}

/* ---- Reduced motion: freeze on a single composed frame ----------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-atlas__sweep,
  .hero-atlas__dust { display: none !important; }
}
