/* Fodero Capital — effects (load AFTER style.css)
   1. Mountain image in three layers   2. Soft image loading   3. Panels fade in and out */

/* ---------- 1. Mountain image in three layers ----------
   .hero-stack holds three pictures on top of each other: the whole photograph (.hero-img, styled in style.css),
   the far range and the front ranges. The two layers are cut from the same photograph at full quality,
   so at rest the three line up exactly and look like the single image. site.js moves the two layers
   a little faster than the sky while scrolling. The slow zoom on load sits on the stack, so all layers zoom together.
   The pictures are background images (not <img>), because browsers draw backgrounds with the crisper scaling
   that keeps the photograph's fine grain intact. */
.hero-stack { position: absolute; inset: 0; transform-origin: center 60%; animation: settle 18s cubic-bezier(.22,.61,.36,1) both; }
.hero-stack .hero-img { animation: none; }   /* the stack zooms instead */
.hero-layer { position: absolute; inset: 0; background: center 60% / cover no-repeat; }
.hero-l1 { background-image: url("img/hero-layer-1-hq.webp"); }   /* far range */
.hero-l2 { background-image: url("img/hero-layer-2-hq.webp"); }   /* front ranges */
.hero { background: var(--bg); }   /* a solid floor under the layers while the pictures are still loading */

/* ---------- 2. Soft image loading ----------
   A small script in <head> adds .hero-fade before anything is drawn; site.js adds .hero-ready when the pictures have arrived. */
.hero-fade .hero-stack { opacity: 0; }
.hero-fade.hero-ready .hero-stack { opacity: 1; transition: opacity 1.4s ease; }

/* Phone: one picture only (the tall crop from style.css), no layers; hidden layers are never downloaded */
@media (max-width: 640px) {
  .hero-l1, .hero-l2 { display: none; }
}

/* ---------- 3. Panels (Contact, Legal Notice, Privacy Policy) fade in and out ---------- */
dialog.panel[open] { animation: panel-in .35s ease both; }
dialog.panel[open] .panel-bar { animation: panel-rise .6s cubic-bezier(.2,.7,.2,1) .05s both; }
dialog.panel[open] .panel-body { animation: panel-rise .7s cubic-bezier(.2,.7,.2,1) .12s both; }
dialog.panel.closing { animation: panel-out .18s ease both; }      /* must stay below the [open] rule */
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes panel-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Reduced motion: nothing fades, zooms or slides ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-stack { animation: none; }
  .hero-fade .hero-stack { opacity: 1; }
  dialog.panel[open], dialog.panel[open] .panel-bar, dialog.panel[open] .panel-body, dialog.panel.closing { animation: none; }
}
