/* ====================================================
   PAGE HERO  —  Premium Sub-Page Headers  v2.0
   Variants:
     .ph--parallax    — JS-driven background parallax
     .ph--scroll-over — fixed background, content lifts over
     .ph--split       — 50/50 text | image, clip-path reveal
     .ph--grain       — dark cinematic + animated film grain
     .ph--minimal     — light serif, no image
   ==================================================== */

/* ---- SHARED BASE ---- */

.ph {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.ph-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.ph-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Film grain noise — grain variant only */
.ph-noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .042;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  animation: ph-grain 1.6s steps(3) infinite;
}
@keyframes ph-grain {
  0%   { background-position:   0px   0px; }
  33%  { background-position:  90px  40px; }
  66%  { background-position: -40px  90px; }
  100% { background-position:  20px -20px; }
}

.ph-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3.5rem);
  position: relative;
  z-index: 2;
}

/* Breadcrumb */
.ph-breadcrumb {
  display: flex;
  align-items: center;
  gap: .48rem;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(196,163,115,.75);
  margin-bottom: 1.1rem;
  opacity: 0;
  animation: ph-fade .5s .1s ease forwards;
}
.ph-breadcrumb a {
  color: rgba(244,241,234,.4);
  text-decoration: none;
  transition: color .2s;
}
.ph-breadcrumb a:hover { color: rgba(196,163,115,.9); }
.ph-breadcrumb .sep { opacity: .28; font-size: .52rem; }

/* Eyebrow label */
.ph-eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .66rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--bronze-soft);
  margin-bottom: .85rem;
  opacity: 0;
  animation: ph-fade .5s .22s ease forwards;
}
.ph-eyebrow::before {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: var(--bronze-soft);
  animation: ph-ew-line .85s .48s ease forwards;
}
@keyframes ph-ew-line { to { width: 32px; } }

/* Headline */
.ph-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 4.8vw, 4.8rem);
  line-height: 1.05;
  max-width: 16ch;
  margin-bottom: 1.1rem;
  color: var(--paper);
  opacity: 0;
  transform: translateY(22px);
  animation: ph-rise .88s .3s cubic-bezier(.22,1,.36,1) forwards;
}
.ph-title em {
  font-style: italic;
  color: var(--bronze-soft);
}

/* Lead text */
.ph-lead {
  font-size: .97rem;
  color: rgba(244,241,234,.63);
  max-width: 46ch;
  line-height: 1.78;
  opacity: 0;
  transform: translateY(14px);
  animation: ph-rise .75s .5s cubic-bezier(.22,1,.36,1) forwards;
}

/* Shared keyframes */
@keyframes ph-fade { to { opacity: 1; } }
@keyframes ph-rise { to { opacity: 1; transform: translateY(0); } }
@keyframes ph-line-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ====================================================
   VARIANT A: PARALLAX
   Background image translates at 0.28× scroll speed (JS)
   ==================================================== */

.ph--parallax {
  height: clamp(440px, 63vh, 720px);
  color: var(--paper);
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(3rem, 6vh, 5rem);
}

.ph--parallax .ph-bg {
  inset: -28% 0 -28%;
  will-change: transform;
}

.ph--parallax .ph-overlay {
  background:
    radial-gradient(ellipse 80% 60% at 78% 105%, rgba(168,128,79,.07), transparent),
    linear-gradient(162deg,
      rgba(20,28,22,.1)  0%,
      rgba(20,28,22,.62) 50%,
      rgba(20,28,22,.95) 100%
    );
}

/* Bronze sweep line across bottom on load */
.ph--parallax::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1.5px;
  z-index: 3;
  background: linear-gradient(90deg, var(--bronze), var(--bronze-soft) 50%, var(--bronze));
  transform: scaleX(0);
  transform-origin: left center;
  animation: ph-line-draw 1.1s .55s cubic-bezier(.22,1,.36,1) forwards;
}

/* ====================================================
   VARIANT B: SCROLL-OVER
   background-attachment:fixed keeps image while
   scrollable content slides over it (white card)
   ==================================================== */

.ph--scroll-over {
  height: clamp(460px, 68vh, 760px);
  color: var(--paper);
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(3.5rem, 7vh, 5.5rem);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.ph--scroll-over .ph-overlay {
  background: linear-gradient(
    to top,
    rgba(20,28,22,.97) 0%,
    rgba(20,28,22,.54) 38%,
    rgba(20,28,22,.26) 100%
  );
}

.ph--scroll-over::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1.5px;
  z-index: 3;
  background: linear-gradient(90deg, var(--bronze), var(--bronze-soft) 50%, var(--bronze));
  transform: scaleX(0);
  transform-origin: left center;
  animation: ph-line-draw 1.1s .55s cubic-bezier(.22,1,.36,1) forwards;
}

/* White content card that lifts over the fixed hero */
.ph-content-start {
  position: relative;
  z-index: 1;
  background: var(--paper) !important;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -28px 80px rgba(20,28,22,.22);
  margin-top: -2rem;
}

/* ====================================================
   VARIANT C: SPLIT  (left text, right image reveal)
   ==================================================== */

.ph--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: clamp(420px, 60vh, 680px);
  color: var(--paper);
}

.ph-split-text {
  background: var(--forest-deep);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(6rem, 12vh, 8.5rem) clamp(2rem, 4vw, 4.5rem) clamp(3rem, 6vh, 4.5rem);
  position: relative;
  z-index: 2;
}

.ph-split-text::after {
  content: '';
  position: absolute;
  top: 0; right: -1px; bottom: 0; width: 50px;
  background: linear-gradient(to right, var(--forest-deep), transparent);
  z-index: 1;
  pointer-events: none;
}

.ph-split-img {
  position: relative;
  overflow: hidden;
  clip-path: inset(0 100% 0 0);
  animation: ph-split-reveal 1.1s .05s cubic-bezier(.76,0,.18,1) forwards;
}
@keyframes ph-split-reveal {
  to { clip-path: inset(0 0% 0 0); }
}

.ph-split-img .ph-bg {
  transition: transform .75s cubic-bezier(.22,1,.36,1);
}
.ph-split-img:hover .ph-bg {
  transform: scale(1.04);
}

.ph--split .ph-inner {
  padding: 0;
  max-width: none;
}
.ph--split .ph-breadcrumb {
  color: rgba(196,163,115,.62);
}
.ph--split .ph-breadcrumb a { color: rgba(244,241,234,.35); }
.ph--split .ph-title {
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  max-width: 14ch;
}

/* ====================================================
   VARIANT D: GRAIN  (dark cinematic + film grain)
   ==================================================== */

.ph--grain {
  background: #0e1411;
  height: clamp(460px, 66vh, 760px);
  color: var(--paper);
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(3rem, 6vh, 5rem);
}

.ph--grain .ph-bg   { opacity: .2; }
.ph--grain .ph-noise { z-index: 1; }

.ph--grain .ph-overlay {
  z-index: 2;
  background:
    radial-gradient(ellipse 55% 70% at 12% 88%, rgba(168,128,79,.18), transparent 65%),
    linear-gradient(165deg, rgba(14,20,17,.5) 0%, rgba(14,20,17,.9) 100%);
}

.ph--grain .ph-inner { z-index: 3; }

.ph--grain .ph-title {
  font-size: clamp(2.4rem, 5vw, 5.4rem);
  max-width: 14ch;
}

.ph--grain::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 1.5px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, var(--bronze) 25%, var(--bronze-soft) 75%, transparent);
  transform: scaleX(0);
  transform-origin: left center;
  animation: ph-line-draw 1.3s .6s cubic-bezier(.22,1,.36,1) forwards;
}

/* ====================================================
   VARIANT E: MINIMAL  (light, no image, legal/info)
   ==================================================== */

.ph--minimal {
  background: var(--paper);
  color: var(--forest-deep);
  padding: clamp(6rem, 13vh, 9rem) clamp(1rem, 4vw, 3.5rem) clamp(2.5rem, 5vh, 3.5rem);
  border-bottom: 1px solid rgba(168,128,79,.18);
}
.ph--minimal .ph-inner { padding: 0; }
.ph--minimal .ph-breadcrumb { color: var(--bronze); }
.ph--minimal .ph-breadcrumb a { color: var(--moss); opacity: .65; }
.ph--minimal .ph-eyebrow { color: var(--bronze); }
.ph--minimal .ph-eyebrow::before { background: var(--bronze); }
.ph--minimal .ph-title { color: var(--forest-deep); }
.ph--minimal .ph-lead { color: var(--moss); }

/* ====================================================
   SCROLL PROGRESS BAR — thin bronze line at top
   ==================================================== */

.ph-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--bronze), var(--bronze-soft));
  z-index: 9999;
  pointer-events: none;
  transition: width .1s linear;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */

@media (max-width: 800px) {
  .ph--parallax { height: clamp(360px, 56vh, 520px); }

  .ph--scroll-over {
    background-attachment: scroll;
    height: clamp(380px, 56vh, 520px);
  }
  .ph-content-start {
    border-radius: 12px 12px 0 0;
    margin-top: -1.5rem;
  }

  .ph--split {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .ph-split-text {
    padding: 7rem 1.5rem 2.5rem;
    order: 1;
  }
  .ph-split-text::after { display: none; }
  .ph-split-img {
    order: 0;
    height: 260px;
    clip-path: inset(0 0 100% 0);
    animation: ph-split-reveal-mob 1.1s .05s cubic-bezier(.76,0,.18,1) forwards;
  }
  @keyframes ph-split-reveal-mob {
    to { clip-path: inset(0 0 0% 0); }
  }
  .ph--split .ph-title {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  .ph--grain { height: clamp(380px, 56vh, 520px); }
  .ph--minimal { padding-top: 5.5rem; }
}

@media (max-width: 480px) {
  .ph-inner { padding: 0 1rem; }
}
