﻿/* ============================================================
   HIMWAASI â€” Journey Hero (scroll-scrubbed video)
   Brand refresh: forest green / parchment / antique gold
   ============================================================ */

:root {
  --forest: #3E4A38;
  --forest-deep: #2B3427;
  --forest-ink: #232B20;
  --parchment: #F2EBDA;
  --parchment-2: #E9E0C9;
  --gold-on-parchment: #6F5508;  /* surface-locked, never flips - matches style.css */
  --pattern-red: #96372B;   /* never flips - journey card stays parchment */
  --red-ink: #96372B;
}

/* --- dark-mode mirrors of style.css so later-cascade does not
   clobber the theme overrides (journey.css loads after style.css) --- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1B211A;
  --bg2: #252C23;
  --forest: #46543F;
  --forest-deep: #1B211A;
  --forest-ink: #151A14;
  --parchment: #E9E2D0;
  --gold-ink: #E6C86B;
  --gold-mid: #E6C86B;
  --red-ink: #E08570;       /* flips light for text on dark surfaces */
}

/* â”€â”€ Scene: tall scroll runway, hero pinned inside â”€â”€ */
.journey-scene {
  --journey-intro-h: 55vh;
  --journey-chapter-h: 110vh;
  position: relative;
  height: calc(var(--journey-intro-h) + var(--journey-chapter-h) * 7);
  background: var(--forest-ink);
}
.journey-scene.journey-static { height: auto; }

.journey-hero {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: block;
  background: var(--forest-ink);
}
.journey-scene.journey-static .journey-hero { position: relative; height: 100svh; }

/* â”€â”€ Video â”€â”€ */
.journey-media { position: absolute; inset: 0; z-index: 0; background: var(--forest-ink) url('../assets/journey-poster.jpg') center / cover no-repeat; }
.journey-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: translateZ(0);
}
.journey-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(35,43,32,0.55) 0%, rgba(35,43,32,0) 30%, rgba(35,43,32,0) 55%, rgba(24,30,22,0.72) 100%);
  pointer-events: none;
  transition: opacity 0.45s ease, background 0.45s ease;
  opacity: 0;
}
.journey-hero.journey-text-on .journey-scrim {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(18,22,16,0.38) 0%, rgba(18,22,16,0.12) 30%, rgba(18,22,16,0.10) 55%, rgba(12,16,11,0.52) 100%);
}
.journey-scene.journey-static .journey-scrim { opacity: 1; }

/* â”€â”€ Intro overlay â”€â”€ */
.journey-intro {
  position: absolute;
  z-index: 3;
  left: 20px; right: 20px; bottom: 128px;
  max-width: 560px;
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: opacity, transform;
}
.journey-intro.journey-hidden { opacity: 0; transform: translateY(14px); pointer-events: none; }
.journey-badge {
  display: inline-block;
  background: rgba(35,43,32,0.55);
  border: 1px solid rgba(201,162,39,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  font-size: var(--fs-3xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 16px;
}
.journey-title {
  font-family: var(--font-serif);
  font-size: var(--fs-display-3xl);
  font-weight: 800;
  color: var(--parchment);
  line-height: 1.08;
  margin-bottom: 14px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.journey-sub {
  font-size: var(--fs-display-sm);
  color: rgba(242,235,218,0.92);
  font-weight: 500;
  line-height: 1.65;
  max-width: 420px;
  margin-bottom: 22px;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}
.journey-actions { display: flex; gap: 12px; }
.journey-shop-btn {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--forest-ink);
  font-weight: 800;
  padding: 13px 28px;
}
.journey-shop-btn:hover { background: var(--parchment); border-color: var(--parchment); color: var(--forest-ink); }

/* â”€â”€ Chapter caption â”€â”€ */
.journey-chapter {
  position: absolute;
  z-index: 3;
  bottom: calc(110px + min(78vw, 320px) * 4 / 3 + 18px);
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.journey-chapter.journey-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.journey-chapter-num {
  font-size: var(--fs-base);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--gold);
}
.journey-chapter-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-display-sm);
  color: rgba(242,235,218,0.95);
  text-shadow: 0 1px 10px rgba(0,0,0,0.55);
}

/* â”€â”€ Product showcase card â”€â”€ */
.journey-card {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 110px;
  width: min(78vw, 320px);
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: linear-gradient(165deg, rgba(242,235,218,0.22) 0%, rgba(35,43,32,0.42) 100%);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(242,235,218,0.38);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(15,19,13,0.45), 0 2px 8px rgba(15,19,13,0.3), inset 0 1px 0 rgba(255,255,255,0.25);
  opacity: 0;
  transform: translateX(-50%) translateY(22px) scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.journey-card.journey-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}
.journey-card-inner { position: absolute; inset: 0; display: block; }
.journey-card-img {
  width: 100%; height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0;
  background: rgba(35,43,32,0.35);
}
.journey-card-body { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; padding: 38px 14px 14px; overflow: hidden; background: linear-gradient(180deg, rgba(12,16,11,0) 0%, rgba(12,16,11,0.82) 55%); }
.journey-card-eyebrow {
  font-size: var(--fs-3xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.journey-card-name {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: var(--fs-sm);
  line-height: 1.25;
  color: var(--parchment);
  text-shadow: 0 1px 10px rgba(0,0,0,0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.journey-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.journey-card-price { font-weight: 800; font-size: var(--fs-sm); color: var(--parchment); text-shadow: 0 1px 8px rgba(0,0,0,0.5); }
.journey-card-cta {
  font-size: var(--fs-3xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.journey-card-cta i { font-style: normal; display: inline-block; transition: transform 0.25s ease; }
.journey-card:hover .journey-card-cta i { transform: translateX(4px); }

/* â”€â”€ Progress rail â”€â”€ */
.journey-progress {
  position: absolute;
  z-index: 3;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 34vh;
  border-radius: var(--radius-sm);
  background: rgba(242,235,218,0.22);
  overflow: hidden;
}
.journey-progress-fill {
  display: block;
  width: 100%;
  height: 0%;
  background: var(--gold);
  border-radius: var(--radius-sm);
}

/* â”€â”€ Scroll cue â”€â”€ */
.journey-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.journey-cue span {
  font-size: var(--fs-3xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgba(242,235,218,0.85);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.journey-cue i {
  font-style: normal;
  color: var(--gold);
  font-size: var(--fs-sm);
  animation: journeyCueBob 1.6s ease-in-out infinite;
}
@keyframes journeyCueBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
.journey-cue.journey-hidden { opacity: 0; }

/* â”€â”€ Region slider below scene â”€â”€ */
.journey-region-slider { background: var(--parchment); }
.journey-region-slider .region-card { color: #FFF; }

/* â”€â”€ Static fallback (reduced motion / no video) â”€â”€ */
.journey-scene.journey-static .journey-chapter,
.journey-scene.journey-static .journey-card,
.journey-scene.journey-static .journey-progress { display: none; }
.journey-scene.journey-static .journey-intro { bottom: 72px; }
.journey-scene.journey-static .journey-cue { display: none; }
.journey-scene.journey-static .journey-loader { display: none; }

/* ── Loader veil: branded cover while frames stream in ── */
.journey-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--forest-ink);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.journey-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.journey-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 32px;
  text-align: center;
}
.journey-loader-mark { width: 64px; height: 64px; object-fit: contain; }
.journey-loader-text {
  font-size: var(--fs-3xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--parchment);
}
.journey-loader-bar {
  width: 200px;
  height: 3px;
  border-radius: 3px;
  background: rgba(242,235,218,0.18);
  overflow: hidden;
}
.journey-loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.journey-loader-pct {
  font-size: var(--fs-3xs);
  font-weight: 700;
  color: rgba(242,235,218,0.7);
  letter-spacing: 0.12em;
}
.journey-loader-patti {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 14px;
  background: var(--patti-bg);
}

/* ── Stepper skip: visible only while the journey owns input ── */
.journey-skip {
  position: absolute;
  z-index: 5;
  right: 16px;
  bottom: 18px;
  display: none;
  background: rgba(18,22,16,0.55);
  color: var(--parchment);
  border: 1px solid rgba(242,235,218,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: var(--fs-3xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-sans);
}
.journey-owning .journey-skip { display: block; }

/* â”€â”€ Small screens â”€â”€ */
@media (max-width: 480px) {
  .journey-intro { bottom: 88px; }
  .journey-chapter { bottom: calc(100px + min(84vw, 320px) * 4 / 3 + 16px); }
  .journey-card { left: 50%; bottom: 100px; width: min(84vw, 320px); }
  .journey-progress { right: 6px; height: 30vh; }
}

/* â”€â”€ Desktop: portrait window stays full-bleed for now (landscape master coming) â”€â”€ */
@media (min-width: 1024px) {
  .journey-intro { left: 64px; bottom: 140px; }
  .journey-chapter { left: 50%; bottom: calc(120px + 360px * 4 / 3 + 20px); }
  .journey-card { left: 50%; bottom: 120px; width: 360px; }
  .journey-progress { right: 24px; }
}

/* ============================================================
   TRAIL ECHO ï¿½ looping journey video behind the store below hero
   ============================================================ */
.trail-echo-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.trail-echo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px) brightness(0.92);
  transform: scale(1.07);
}
.trail-echo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(35, 43, 32, 0.6) 0%,
    rgba(35, 43, 32, 0.3) 35%,
    rgba(35, 43, 32, 0.18) 60%,
    rgba(242, 235, 218, 0.82) 100%);
}

/* Hero stays above the echo */
.journey-scene { position: relative; z-index: 2; }

/* -- Echo zone: sections floating over the looping video -- */
.journey-region-slider,
.categories-section,
.him-fact {
  position: relative;
  z-index: 1;
  background: transparent !important;
}
.journey-region-slider {
  background: linear-gradient(0deg, rgba(242, 235, 218, 0) 0%, rgba(35, 43, 32, 0.35) 100%) !important;
}
.echo-zone .section-eyebrow,
.categories-section .section-eyebrow { color: var(--gold); text-shadow: 0 1px 10px rgba(0,0,0,0.5); }
.categories-section .section-title { text-shadow: 0 2px 18px rgba(0,0,0,0.45); }

/* -- Featured products: normal solid bg, no video behind -- */
.featured-section {
  position: relative;
  z-index: 1;
  background: var(--bg) !important;
}

/* -- Solid sheet returns at the story + stop sections -- */
.stop-section,
.trust-section {
  position: relative;
  z-index: 1;
  background: var(--bg);
}

/* Reduced-motion / static: no echo at all */
.journey-scene.journey-static ~ .trail-echo-wrap,
.trail-echo-wrap.trail-echo-off { display: none; }

/* ── Segmented engine: canvas underlay masks segment swaps ── */
.journey-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
