/* homepage-motion.css — pkg74 (2026-11-28): production build of the owner-approved
   homepage motion final version. Demo reference: homepage-motion-demo-20261128
   (changes.md there carries every measured value; this sheet reproduces them).
   New file only; no original CSS modified. Palette: only colours already used by
   the live homepage (#050505, #0f0e0b, #C9A961, white at 5%/10% alpha). */

/* ---- G6: header height per breakpoint (measured; see demo changes.md) ---- */
:root { --md-hdr-h: 64px; }
@media (min-width: 768px) { :root { --md-hdr-h: 72px; } }
html { scroll-padding-top: calc(var(--md-hdr-h) + 12px); }

/* ---- 1) Sticky header: sticky semantics, minimal height, opaque, no slide animation ---- */
/* Selector note: the app strips data-hs-static during hydration (measured), so the
   stable hook is the header element's own class. Specificity (0,1,1) beats .fixed. */
header.fixed {
  position: sticky;
  top: 0;
  height: var(--md-hdr-h);
  margin-bottom: calc(-1 * var(--md-hdr-h)); /* overlay hero exactly like the old fixed header */
  padding-top: 0;
  padding-bottom: 0;
  background: #050505;
  border-bottom: 1px solid rgb(255 255 255 / 0.05);
  transition: none;
}
header.fixed > div { height: 100%; }

/* ---- 2) Resources panel (click-led; hover is a desktop-only extra) ---- */
.md-navwrap { position: relative; }
/* Chevron: pure CSS (a static node inside the app root would be discarded by the
   app's render — measured). Same size/placement/timing as the demo's inline SVG:
   ~10px box, 6px left margin, 150ms rotation, flips when expanded. */
header nav[class*="md:flex"] a[href="/sourcing/"]::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 2px;
  transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1);
}
header nav[class*="md:flex"] a[href="/sourcing/"][aria-expanded="true"]::after { transform: rotate(225deg); }
.md-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 264px;
  background: #0f0e0b;
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.5);
  padding: 8px;
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-4px); /* G1: starts at 0.95, never scale(0) */
  transform-origin: top right;            /* G1: origin on the trigger's side */
  transition: opacity 150ms ease-in, transform 150ms ease-in, visibility 0s linear 150ms; /* G2: close <= open */
}
.md-panel.md-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 190ms cubic-bezier(0.16, 1, 0.3, 1), transform 190ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s; /* G2: open 190ms ease-out, transition-based = interruptible */
}
.md-panel a {
  display: block;
  padding: 9px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgb(255 255 255 / 0.7); /* same value as the live nav links (text-white/70) */
  text-transform: uppercase;
}
/* Mobile variant: the app re-renders its menu, so the sub-list is a static
   body-level layer (outside the app root) with the same motion spec. */
.md-msub { position: fixed; left: 16px; right: 16px; width: auto; transform-origin: top left; }

/* ---- 3) Hero parallax layer (JS-gated: no JS = original static framing) ---- */
.md-js .hs-hero-image { top: -7%; height: 114%; bottom: auto; will-change: transform; }

/* ---- 4) Mask reveal for the factory photograph (armed by JS only) ---- */
.md-mask-armed { clip-path: inset(0 0 100% 0); }
.md-mask-in { clip-path: inset(0 0 0% 0); transition: clip-path 600ms cubic-bezier(0.16, 1, 0.3, 1); }

/* ---- Story chapters reveal: same parameters as the site's data-reveal system
   (rise 24px + unblur 6px, 0.6s), driven by homepage-motion.js under G5 thresholds ---- */
.md-js .md-reveal { opacity: 0; transform: translateY(24px); filter: blur(6px); }
.md-js .md-reveal.md-in { opacity: 1; transform: none; filter: none; transition: opacity 600ms cubic-bezier(0.33, 1, 0.68, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1), filter 600ms cubic-bezier(0.33, 1, 0.68, 1); }

/* ---- G8: main CTA press feedback ---- */
.md-cta { transition: transform 120ms ease-out; }
.md-cta:active { transform: scale(0.97); }

/* ---- 5) Story section: four chapters, black-gold language of the live sections ---- */
.md-story { background: #050505; border-top: 1px solid rgb(255 255 255 / 0.05); padding: 56px 0 72px; }
@media (min-width: 768px) { .md-story { padding: 128px 0 144px; } }
.md-story-inner { max-width: 80rem; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .md-story-inner { padding: 0 24px; } }
.md-story-eyebrow { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.md-story-eyebrow span { color: #C9A961; font-size: 11px; font-weight: 700; letter-spacing: 0.6em; text-transform: uppercase; }
.md-story-eyebrow i { display: block; height: 1px; flex: 1; max-width: 112px; background: rgb(201 169 97 / 0.3); }
.md-story h2 { font-family: Playfair Display, Georgia, serif; color: #fff; font-size: 2.2rem; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 16px; }
@media (min-width: 768px) { .md-story h2 { font-size: 3.75rem; } }
.md-story-lede { color: #a8a29e; font-weight: 300; font-size: 14px; line-height: 1.75; max-width: 36rem; margin: 0 0 56px; }
@media (min-width: 768px) { .md-story-lede { font-size: 16px; margin-bottom: 96px; } }
.md-chapter { display: grid; gap: 24px; margin-bottom: 64px; align-items: center; }
.md-chapter:last-child { margin-bottom: 0; }
@media (min-width: 768px) { .md-chapter { grid-template-columns: 5fr 7fr; gap: 48px; margin-bottom: 96px; } .md-chapter.md-flip { grid-template-columns: 7fr 5fr; } .md-chapter.md-flip .md-chapter-img { order: 2; } }
.md-chapter-img { width: 100%; height: auto; display: block; }
.md-chapter-num { font-family: Playfair Display, Georgia, serif; color: #C9A961; font-size: 15px; letter-spacing: 0.35em; margin: 0 0 12px; }
.md-chapter h3 { font-family: Playfair Display, Georgia, serif; color: #fff; font-size: 1.7rem; line-height: 1.15; margin: 0 0 14px; }
@media (min-width: 768px) { .md-chapter h3 { font-size: 2.3rem; } }
.md-chapter p { color: #a8a29e; font-weight: 300; font-size: 14px; line-height: 1.8; margin: 0 0 10px; max-width: 34rem; }
.md-chapter-link { display: inline-block; margin-top: 10px; color: #C9A961; font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }

/* ---- G3: every hover effect only where hover really exists ---- */
@media (hover: hover) and (pointer: fine) {
  .md-panel a { transition: background-color 150ms ease-out, color 150ms ease-out; }
  .md-panel a:hover { background: rgb(255 255 255 / 0.05); color: #fff; }
  .md-chapter-link { transition: color 150ms ease-out; }
  .md-chapter-link:hover { color: #fff; }
}

/* ---- G4: reduced motion — everything lands in its final state, nothing animates ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .md-panel, .md-cta, .md-panel a, .md-chapter-link { transition: none !important; }
  header nav[class*="md:flex"] a[href="/sourcing/"]::after { transition: none !important; }
  .md-mask-armed { clip-path: none; }
  .md-js .md-reveal { opacity: 1; transform: none; filter: none; transition: none !important; }
  header.fixed a, header.fixed button { transition: none !important; }
}

/* ---- 6) Three refinements (2026-11-28, owner-approved additions) ---- */
/* 6a) Hero headline: stop the perpetual hs-breathe loop from home-static.css
   (opacity .55<->1, 6s ease-in-out, infinite alternate). Same selector as the
   source rule; this sheet is the last one in <head>, and opacity is pinned to
   the bright end state so the static frame is the fully-lit one. Under
   reduced motion the source sheet already stopped it — now it never runs. */
#home h1 > span:first-child { animation: none; opacity: 1; }

/* 6b) Micro-interaction tightening. Scoped to <main>: the header subtree, the
   Resources panel (it lives inside the header nav) and the story layer (its
   elements carry no duration-* classes) are structurally out of reach.
   Baseline truth (measured): homepage-upgrade.css already caps the
   .duration-700/.duration-1000 utility classes at .6s, so computed values
   start at 0.6s — this block tightens them further (controls 0.3s, imagery
   0.5s) and replaces transition-all with named properties. The 300/500ms
   class sets are not touched. */
/* Controls: duration-700 links/buttons -> 300ms, named properties only. */
main a[class*="duration-700"], main button[class*="duration-700"] {
  transition-property: background-color, color, border-color, box-shadow, transform;
  transition-duration: 300ms;
}
/* Card imagery, hover-zoom set: the source classes already name their
   property (transition-transform); only the duration is capped 700 -> 500ms. */
main img[class*="duration-700"] { transition-duration: 500ms; }
/* Hover-fade set: source is transition-all at 1000ms -> 500ms, properties
   named to opacity/transform. */
main img[class*="duration-1000"], main div[class*="duration-1000"] {
  transition-property: opacity, transform;
  transition-duration: 500ms;
}
/* Card overlays/accents on duration-700 divs: source classes already name
   their property (transition-opacity / transition-transform); cap only. */
main div[class*="duration-700"] { transition-duration: 500ms; }
/* ...except the two transition-all divs, whose properties are named here:
   the hairline animates width + background-color; the card frame is inert. */
main div[class*="duration-700"][class*="group-hover:w-full"] { transition-property: width, background-color; }
main div[class*="duration-700"][class*="aspect-"] { transition-property: opacity, transform; }
/* The main CTA keeps its G8 press spec inside the new cap: transform stays
   120ms, the hover-facing properties run at the 300ms control speed. */
main .md-cta[class*="duration-700"] {
  transition: transform 120ms ease-out, background-color 300ms ease-out, color 300ms ease-out, border-color 300ms ease-out, box-shadow 300ms ease-out;
}

/* 6c) Word-by-word reveal (.hs-word): NO overlay needed — homepage-upgrade.css
   already carries this exact fix (.7s -> .6s on the opacity/filter legs), and
   computed values measure 0.6s/0.6s/0.6s in both versions. See demo changes.md. */
