/* GW Mechanical — light hero, code-driven scroll animation (no video).
   Companion of gw-light-hero.js. Only transform / opacity / clip-path are animated. */

:root {
  --gwl-bg: #FBF8F4;
  --gwl-espresso: #3B2418;
  --gwl-shadow-rgb: 59, 36, 24;
}

/* ───────── shared ───────── */
[data-gwl] img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.gwl-track { position: relative; background: var(--gwl-bg); }
.gwl-center { display: flex; align-items: center; }
.gwl-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden; background: var(--gwl-bg);
}
/* soft page-colour fade on the stage edges so the photo background melts into the page */
.gwl-stage::before, .gwl-stage::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: 5; pointer-events: none;
}
.gwl-stage::before { top: 0;    height: 9%; background: linear-gradient(180deg, var(--gwl-bg), rgba(251,248,244,0)); }
.gwl-stage::after  { bottom: 0; height: 9%; background: linear-gradient(0deg,   var(--gwl-bg), rgba(251,248,244,0)); }

/* ───────── desktop hero: boiler world ───────── */
.gwl-world {
  position: absolute; left: 50%; top: 50%;
  width: 2754px; height: 1536px; margin: -768px 0 0 -1377px;
  transform-origin: 50% 50%;
  will-change: transform;
  contain: layout style;
}
.gwl-world > * { position: absolute; }
.gwl-base { left: 0; top: 0; width: 2754px; height: 1536px; z-index: 1; }
.gwl-pipes { left: 0; top: 0; width: 2754px; height: 1536px; z-index: 2; pointer-events: none; }
.gwl-pipes > * { position: absolute; will-change: transform; }
.gwl-strip { height: 208px; background-repeat: no-repeat; background-size: 100% 100%; }
.gwl-strip.is-r { transform-origin: 0 50%; }
.gwl-cap { height: 208px; }
.gwl-cap img { width: 100%; height: 100%; }
.gwl-cap.is-r { width: 174px; }

/* shadow appears only once the pipes have finished growing (class toggled by JS) */
.gwl-pipes { transition: filter .6s ease; }
.gwl-hero[data-settled="1"] .gwl-pipes {
  filter: drop-shadow(0 14px 14px rgba(var(--gwl-shadow-rgb), .20)) drop-shadow(0 2px 3px rgba(var(--gwl-shadow-rgb), .16));
}

/* ───────── rails (clip reveal) ───────── */
.gwl-rails { position: relative; width: 100vw; flex: none; margin: 0; overflow: visible; }
.gwl-rails img { width: 100%; height: auto; will-change: clip-path; transition: filter .6s ease; }
.gwl-rails[data-settled="1"] img {
  filter: drop-shadow(0 12px 12px rgba(var(--gwl-shadow-rgb), .20)) drop-shadow(0 2px 3px rgba(var(--gwl-shadow-rgb), .14));
}

/* ───────── expander (drift + fade in) ───────── */
.gwl-expander { position: relative; width: min(86vw, 1100px); margin: 0 auto; }
.gwl-expander img { width: 100%; height: auto; will-change: transform, opacity; transition: filter .6s ease; }
.gwl-expander[data-settled="1"] img {
  filter: drop-shadow(0 18px 20px rgba(var(--gwl-shadow-rgb), .22)) drop-shadow(0 3px 5px rgba(var(--gwl-shadow-rgb), .14));
}

/* ───────── mobile crane (≤767px) ───────── */
.gwl-crane { display: none; }
@media (max-width: 767px) {
  .gwl-hero { display: none; }
  .gwl-crane {
    display: block; position: relative; width: 100%; overflow: hidden;
    height: calc(52px + 29.03vw + 86vw);
    background: url("assets/crane-tail.webp") 0 0 / 100% auto repeat-y, var(--gwl-bg);
  }
  .gwl-crane .gwl-cr {
    position: absolute; left: 0; top: 12px; width: 100%;
    aspect-ratio: 1116 / 2000; transform: translateY(-43.85%); pointer-events: none;
  }
  .gwl-crane .gwl-cr-base { display: block; width: 100%; height: auto; max-width: none; }
  .gwl-crane .gwl-cr-wheel {
    position: absolute; left: 51.25%; top: 52.90%; width: 20.75%; height: auto; max-width: none;
    transform: translate3d(-50%, -50%, 0); transform-origin: 50% 50%; will-change: transform;
  }
  .gwl-crane .gwl-cr-needles { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
}

/* ───────── soft light shadows with a highlight (cards, panels, logo) ───────── */
.gwl-card, .gwl-panel, [data-gwl-shadow="card"], [data-gwl-shadow="panel"] {
  background: #fff; border-radius: 14px;
  box-shadow: none; transition: box-shadow .7s ease, transform .7s ease;
}
.gwl-card.is-shadowed, .gwl-panel.is-shadowed, [data-gwl-shadow="card"].is-shadowed, [data-gwl-shadow="panel"].is-shadowed {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .95) inset,
    0 14px 32px -10px rgba(var(--gwl-shadow-rgb), .20),
    0 3px 8px rgba(var(--gwl-shadow-rgb), .08);
}
.gwl-logo, [data-gwl-shadow="logo"] { transition: filter .7s ease; }
.gwl-logo.is-shadowed, [data-gwl-shadow="logo"].is-shadowed {
  filter: drop-shadow(0 6px 8px rgba(var(--gwl-shadow-rgb), .18)) drop-shadow(0 -1px 0 rgba(255, 255, 255, .8));
}

/* ───────── reduced motion: static poster, no transitions ───────── */
@media (prefers-reduced-motion: reduce) {
  .gwl-track { height: auto !important; }
  .gwl-pipes, .gwl-rails img, .gwl-expander img, .gwl-card, .gwl-panel, .gwl-logo { transition: none; }
  .gwl-world, .gwl-pipes > *, .gwl-rails img, .gwl-expander img, .gwl-crane .gwl-cr-wheel { will-change: auto; }
}
