/* design/home-preview/css/hero-work.css
   Purpose: hero (arch window that opens into a slow scroll-zoom on a real Epic photo) and the pinned horizontal gallery.
   NOT for: AI video or AI interiors — only Epic's real photos are shown as Epic's work.
   WHY gated by .motion: motion.js adds it; without JS the hero and gallery fall back to plain, fully usable layouts. */
.hero { position: relative; }
.hero__stage { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 5.6rem var(--gutter) 3.5rem; }
.flutes { position: absolute; inset: 0; opacity: .55; pointer-events: none;
  background:
    radial-gradient(600px circle at var(--mx, 70%) var(--my, 30%), rgba(201,183,159,.16), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 14px, rgba(0,0,0,.28) 14px 22px, transparent 22px 28px),
    linear-gradient(180deg, var(--ink-2), var(--ink)); }
.hero__copy { position: relative; z-index: 3; max-width: 40rem;
  transform: translateY(calc(var(--p, 0) * -60px)); opacity: calc(1 - var(--p, 0) * 2.8); }
.hero__title { font-family: var(--serif); font-weight: 300; font-size: clamp(2.5rem, 1.1rem + 6vw, 7rem);
  line-height: .98; letter-spacing: -.02em; margin: 1.2rem 0 1.6rem; font-variation-settings: "opsz" 144; }
.hero__title .line { display: block; }
.hero__lead { max-width: 31rem; color: var(--mute); line-height: 1.75; font-size: 1rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.2rem; }

.arch { position: absolute; overflow: hidden; margin: 0; }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch--main { z-index: 1; position: relative; order: -1; height: 44vh; min-height: 300px; margin-bottom: 2.2rem; border-radius: 999px 999px 0 0; }
.arch--main img { object-position: 60% 70%; }
.arch--main::after { content: ""; position: absolute; inset: 0; background: var(--ink); opacity: calc(var(--p, 0) * .55); pointer-events: none; }
.hero__scroll { display: none; position: absolute; right: var(--gutter); bottom: 2rem; z-index: 3; writing-mode: vertical-rl;
  font-size: .68rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }
.hero__scroll::after { content: ""; display: block; width: 1px; height: 54px; margin: .8rem auto 0; background: var(--gold);
  animation: drip 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* WORK — native horizontal scroll on phones and without JS; pinned scroll-driven track from 900px. */
.work { position: relative; background: var(--ink); overflow-x: clip; }
.work__pin { padding: var(--section) 0 4rem; }
.work__head { display: grid; gap: .4rem; padding: 0 var(--gutter); margin-bottom: 2.4rem; }
.work__head .title { margin-top: .4rem; }
.work__count { display: none; font-family: var(--serif); color: var(--mute); font-size: 1.1rem; }
.work__track { display: flex; gap: 1rem; padding: 0 var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.card { position: relative; flex: 0 0 auto; scroll-snap-align: start; margin: 0; overflow: hidden; background: var(--stone); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.card:hover img { transform: scale(1.05); }
.card--tall { width: 72vw; aspect-ratio: 3 / 4; }
.card--wide { width: 86vw; aspect-ratio: 4 / 3; }
.card figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1.1rem 1rem; font-size: .9rem;
  background: linear-gradient(transparent, rgba(20,19,18,.88)); }
.card figcaption span { display: block; margin-bottom: .3rem; font-size: .66rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-hi); }
.card--end { width: 60vw; display: flex; flex-direction: column; justify-content: space-between; padding: 1.6rem;
  border: 1px solid var(--gold); font-family: var(--serif); font-size: 1.6rem; line-height: 1.15; background: transparent; }
.card--end b { font-weight: 300; font-size: 2.4rem; color: var(--gold-hi); transition: transform .5s var(--ease); }
.card--end:hover b { transform: translateX(10px); }

@media (min-width: 900px) {
  .hero__stage { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-content: center;
    min-height: 100vh; padding-top: 7rem; }
  .arch--main { position: absolute; inset: 13vh calc(var(--gutter) + 2vw) 9vh auto; width: min(38vw, 560px); height: auto;
    margin: 0; border-radius: 280px 280px 0 0; }
  .hero__scroll { display: block; opacity: calc(1 - var(--p, 0) * 4); }
  .work__count { display: block; }
  .work__head { grid-template-columns: 1fr auto; align-items: end; }
  .work__head .eyebrow { grid-column: 1 / -1; }

  /* Motion version: 175vh sticky stage; --p (0..1) opens the arch to full bleed, then keeps zooming slowly in. */
  .motion .hero { height: 175vh; }
  .motion .hero__stage { position: sticky; top: 0; height: 100vh; min-height: 640px; }
  .motion .arch--main { --q: calc(1 - var(--p, 0)); inset: 0; width: auto; border-radius: 0;
    clip-path: inset(calc(var(--q) * 13vh) calc(var(--q) * (var(--gutter) + 2vw)) calc(var(--q) * 9vh) calc(var(--q) * (100vw - var(--gutter) - 2vw - min(38vw, 560px)))
      round calc(var(--q) * 280px) calc(var(--q) * 280px) 0 0); }
  /* At p=0 the whole house sits inside the arch; it settles to full bleed and ends at a gentle 1.08 zoom (Herk-style still). */
  .motion .arch--main img { position: absolute; left: 0; top: var(--top, 0); width: 100%; height: auto; object-fit: fill;
    transform-origin: 50% 60%;
    transform: translate(calc(var(--q) * var(--tx, 0px)), calc(var(--q) * var(--ty, 0px)))
      scale(calc((1 - var(--q) * (1 - var(--s, 1))) * (1 + var(--p, 0) * .08))); }

  .motion .work { height: var(--track-h, 360vh); }
  .motion .work__pin { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 6rem 0 3rem; }
  .motion .work__track { overflow: visible; gap: 1.6rem; will-change: transform; transform: translateX(calc(var(--x, 0) * -1px)); }
  .motion .card--tall { width: auto; height: 62vh; }
  .motion .card--wide { width: auto; height: 50vh; align-self: center; }
  .motion .card--low { align-self: flex-end; height: 46vh; }
  .motion .card--end { width: 26vw; height: 50vh; align-self: center; }
  /* No JS: plain swipeable row at desktop size. */
  :root:not(.motion) .card--tall { width: 30vw; }
  :root:not(.motion) .card--wide { width: 44vw; }
  :root:not(.motion) .card--end { width: 26vw; }
}
@media (prefers-reduced-motion: reduce) {
  .motion .hero { height: auto; } .motion .hero__stage { position: relative; height: auto; }
  .motion .work { height: auto; } .motion .work__pin { position: relative; height: auto; }
  .motion .work__track { transform: none; overflow-x: auto; }
  .hero__scroll::after { animation: none; }
}
