/* ============================================================
   BERUNDA — The Legend of the Gandaberunda (content sections)
   Chrome (announce/nav/cart) is the shared berunda-chrome.css.
   One continuous field: navy → navy → burgundy → espresso → navy.
   Ported verbatim from the design's legend.css (image paths flattened
   to the Shopify assets folder). Pinned chapters are laid out by media
   queries so the layout is correct at first paint; legend.js animates.
   ============================================================ */

.lg {
  background: #00091f;
  color: var(--ivory-200);
  overflow-x: clip;
}
.lg * { box-sizing: border-box; }

/* Dawn's base.css hides empty decorative divs (div:empty{display:none}).
   The dial's CSS-drawn coin face + glow are intentionally empty — restore them. */
.lg div:empty { display: revert; }

.lg-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: clamp(10px, 0.8vw, 12px);
  color: var(--gold-300);
  font-weight: 400;
}

/* ============================================================
   HERO — the overture. Half-screen lockup, scroll cue below.
   ============================================================ */
.lg-hero {
  position: relative;
  background: #00060f url("legend-hero-velvet-v3.webp") center center / cover no-repeat;
  min-height: calc(100vh - 74px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(40px, 7vh, 88px) clamp(24px, 6vw, 60px) clamp(96px, 13vh, 150px);
  overflow: hidden;
}
.lg-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(125% 95% at 50% 33%,
      rgba(0, 6, 15, 0.58) 0%,
      rgba(0, 6, 15, 0.34) 34%,
      rgba(0, 6, 15, 0) 60%);
}
.lg-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  height: 239px;
  transform: translateY(-16vh);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lg-hero-emblem {
  height: clamp(103px, 11.4vw, 149px);
  width: auto;
  filter: drop-shadow(0 16px 38px rgba(0, 0, 0, 0.5));
}
.lg-hero .lg-eyebrow { margin-top: clamp(22px, 3.4vh, 34px); }
.lg-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ivory-200);
  font-size: clamp(26px, 2.9vw, 38px);
  letter-spacing: 0.04em;
  line-height: 1.14;
  margin: clamp(14px, 1.8vh, 20px) 0 0;
  text-wrap: balance;
}
.lg-hero-title .em { color: var(--gold-400); font-size: 1.16em; }
.lg-hero-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.5;
  color: var(--ivory-200);
  margin: clamp(16px, 2vh, 22px) auto 0;
  max-width: 30em;
}
.lg-hero-div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(24px, 3.4vh, 36px);
}
.lg-hero-div-line {
  width: clamp(40px, 6vw, 66px);
  height: 1px;
  background: rgba(198, 135, 27, 0.45);
}
.lg-hero-div-gem {
  width: 6px;
  height: 6px;
  background: var(--gold-400);
  transform: rotate(45deg);
}

/* ---- Scroll cue ---- */
.lg-scrollcue {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(30px, 5vh, 52px) + 14px);
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 10px;
  transition: opacity 0.7s var(--ease-standard), transform 0.7s var(--ease-standard);
}
.lg-scrollcue-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 10px;
  color: var(--ivory-400);
  transition: color var(--dur-slow) var(--ease-standard);
}
.lg-scrollcue-line {
  width: 1px;
  height: 44px;
  background: rgba(198, 135, 27, 0.45);
  position: relative;
  overflow: hidden;
}
.lg-scrollcue-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 100%;
  height: 40%;
  background: var(--gold-300);
  animation: lg-cue-travel 2.4s var(--ease-standard) infinite;
}
@keyframes lg-cue-travel {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(250%); opacity: 0; }
}
.lg-scrollcue:hover .lg-scrollcue-label { color: var(--gold-300); }
.lg-scrollcue.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}

/* ============================================================
   THE SAGA — three acts on a single thread
   ============================================================ */
.lg-saga {
  --lg-field: #01143c;
  position: relative;
  background: #0a111d;
  overflow: hidden;
}

/* ---------- VERTICAL FALLBACK (mobile / reduced motion) ---------- */
.lg-saga-pin {
  position: relative;
  background: var(--lg-field) url("legend-saga-bg-v2.webp") center center / cover no-repeat;
}
.lg-saga-stage {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 8.5vh, 104px) clamp(24px, 6vw, 48px) clamp(40px, 6vh, 72px);
}
.lg-saga-track {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 9vh, 104px);
}
.lg-act { position: relative; }
.lg-act-card { position: relative; }
.lg-act-card::before {
  content: "";
  display: block;
  width: 38px;
  height: 1px;
  background: rgba(198, 135, 27, 0.42);
  margin-bottom: clamp(20px, 2.8vh, 32px);
}
.lg-numeral {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 4.6vw, 58px);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.3px rgba(214, 162, 63, 0.62);
  user-select: none;
  margin-bottom: clamp(14px, 2vh, 22px);
}
.lg-act-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: clamp(10px, 0.82vw, 12px);
  color: var(--gold-300);
}
.lg-act-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ivory-200);
  font-size: clamp(26px, 3.1vw, 42px);
  letter-spacing: 0.03em;
  line-height: 1.12;
  margin: 14px 0 0;
}
.lg-act-body {
  font-family: var(--font-body);
  font-size: clamp(18px, 1.45vw, 22px);
  line-height: 1.64;
  color: var(--ivory-200);
  margin: 18px 0 0;
  max-width: 34em;
}

.lg-saga-rail { display: none; }

/* ---------- VERTICAL CROSSFADE (wide viewport + motion-OK) ---------- */
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .lg-saga {
    overflow: visible;
    height: 300vh;
  }
  .lg-saga .lg-saga-pin {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: block;
  }
  .lg-saga .lg-saga-stage {
    position: relative;
    max-width: none;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  .lg-saga .lg-saga-track {
    position: absolute;
    inset: 0;
    display: block;
    width: auto;
    gap: 0;
  }
  .lg-saga .lg-act {
    position: absolute;
    inset: 0;
    width: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(88px, 13vh, 150px) clamp(72px, 12vw, 184px) clamp(96px, 13vh, 150px);
    box-sizing: border-box;
    will-change: opacity, transform;
  }
  .lg-saga .lg-act-card {
    width: min(600px, 100%);
    transition: none;
    transform-origin: center center;
  }
  .lg-saga .lg-act-card.lg-reveal {
    transition: none;
    opacity: 0;
    transform: none;
  }
  .lg-saga .lg-act--iii .lg-act-card { width: min(660px, 100%); }
  .lg-saga .lg-act-card::before { display: none; }
  .lg-saga .lg-numeral { font-size: clamp(48px, 5vw, 66px); }

  .lg-saga .lg-saga-rail {
    display: block;
    position: absolute;
    left: clamp(30px, 5vw, 78px);
    top: 50%;
    transform: translateY(-50%);
    height: min(320px, 46vh);
    width: 12px;
    z-index: 5;
  }
}
.lg-saga-rail-line {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom,
              var(--gold-400) var(--progress, 0%),
              rgba(198, 135, 27, 0.20) var(--progress, 0%));
}
.lg-saga-rail-fill { display: none; }
.lg-saga-rail-nodes {
  position: absolute;
  top: 0; left: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transform: translateX(-50%);
}
.lg-saga-dot {
  width: 8px; height: 8px;
  background: var(--lg-field);
  border: 1px solid rgba(214, 162, 63, 0.5);
  transform: rotate(45deg);
  cursor: pointer;
  transition: background-color 0.4s var(--ease-standard),
              border-color 0.4s var(--ease-standard),
              transform 0.4s var(--ease-standard);
}
.lg-saga-dot.is-on {
  background: var(--gold-400);
  border-color: var(--gold-200);
  transform: rotate(45deg) scale(1.3);
}

/* ---- Act III climax ---- */
.lg-climax {
  margin-top: clamp(34px, 5vh, 56px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.lg-climax-rule {
  width: 44px; height: 1px;
  background: rgba(198, 135, 27, 0.5);
  margin-bottom: clamp(20px, 2.6vh, 28px);
}
.lg-climax-coda {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.6;
  color: var(--ivory-300);
  margin: 0;
  max-width: 32em;
}

/* ============================================================
   FROM MYTH TO THRONE — timeline
   ============================================================ */
.lg-throne {
  --lg-field: #2c0103;
  position: relative;
  background: #09111f;
  padding: clamp(80px, 11vh, 130px) 0 clamp(80px, 11vh, 130px);
  overflow: hidden;
}
.lg-throne-head { text-align: center; max-width: 760px; margin: 0 auto clamp(46px, 6vh, 74px); }
.lg-throne-orn { height: 22px; width: auto; opacity: 0.82; margin-bottom: 14px; }
.lg-throne-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ivory-200);
  font-size: clamp(36px, 4.4vw, 41px);
  letter-spacing: 0.045em;
  line-height: 1.08;
  margin: 12px 0 0;
}

/* ============================================================
   THE CENTURY DIAL
   ============================================================ */
.lg-dial-pin {
  position: relative; z-index: 2;
  background: var(--lg-field) url("legend-throne-bg-v2.webp") center center / cover no-repeat;
}
.lg-dial-stage {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(24px, 6vw, 60px);
}
.lg-dial-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(40px, 6vh, 64px);
}
.lg-dial {
  --d: clamp(248px, 30vw, 372px);
  position: relative;
  width: var(--d);
  height: var(--d);
  flex: none;
}
.lg-dial-face {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, #3a0608 0%, #240103 68%, #1b0102 100%);
  border: 1px solid rgba(214, 162, 63, 0.5);
  box-shadow: inset 0 0 0 7px rgba(198, 135, 27, 0.10), inset 0 0 44px rgba(0, 0, 0, 0.6);
}
.lg-dial-face::after {
  content: ""; position: absolute; inset: clamp(18px, 4vw, 30px);
  border-radius: 50%; border: 1px solid rgba(198, 135, 27, 0.28);
}
.lg-dial-glow {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--gold-300);
  box-shadow: 0 0 24px rgba(227, 189, 110, 0.32);
  opacity: 0;
  pointer-events: none;
}
.lg-dial-ring {
  position: absolute; inset: 0;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.lg-dial-notch {
  position: absolute;
  left: 50%; top: 0;
  width: 14px; height: 14px;
  margin-left: -7px; margin-top: -7px;
  transform-origin: 50% calc(var(--d) / 2 + 7px);
  transform: rotate(var(--a));
}
.lg-dial-notch i {
  display: block; width: 100%; height: 100%;
  background: var(--lg-field);
  border: 1px solid rgba(214, 162, 63, 0.55);
  transform: rotate(45deg);
  transition: background-color 0.4s var(--ease-standard),
              border-color 0.4s var(--ease-standard),
              box-shadow 0.4s var(--ease-standard);
}
.lg-dial-notch.is-active i {
  background: var(--gold-300);
  border-color: var(--gold-200);
  box-shadow: 0 0 11px rgba(227, 189, 110, 0.7);
}
.lg-dial-hub {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46%;
}
.lg-dial-hub img { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55)); }
.lg-dial-pointer {
  position: absolute; left: 50%; top: -3px;
  transform: translate(-50%, -100%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 11px solid var(--gold-300);
}

.lg-dial-info { position: relative; width: 100%; max-width: 560px; text-align: center; }
.lg-era-no {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: clamp(11px, 0.9vw, 13px);
  color: var(--gold-400);
  margin-bottom: 14px;
}
.lg-era-heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(17px, 1.6vw, 23px);
  color: var(--gold-300);
  margin: 0;
  line-height: 1.2;
}
.lg-era-body {
  font-family: var(--font-body);
  font-size: clamp(18px, 1.6vw, 19px);
  line-height: 1.62;
  color: var(--ivory-200);
  margin: 16px 0 0;
}
.lg-era + .lg-era { margin-top: clamp(30px, 4.5vh, 46px); }

.lg-dial-pips { display: flex; gap: 14px; justify-content: center; }
.lg-dial-pip {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: transparent;
  border: 1px solid rgba(214, 162, 63, 0.5);
  transition: background-color 0.4s var(--ease-standard), border-color 0.4s var(--ease-standard);
  cursor: pointer;
}
.lg-dial-pip.is-on { background: var(--gold-400); border-color: var(--gold-200); }

/* ---------- PINNED DIAL MODE (wide viewport + motion-OK) ---------- */
@media (min-width: 861px) and (prefers-reduced-motion: no-preference) {
  .lg-throne {
    overflow: visible;
    padding-top: 0;
    padding-bottom: 0;
    height: 340vh;
  }
  .lg-throne .lg-dial-pin {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
  }
  .lg-throne .lg-throne-head { margin-bottom: clamp(26px, 4vh, 46px); }
  .lg-throne .lg-dial-wrap {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
  }
  .lg-throne .lg-dial-info { text-align: left; min-height: 230px; flex: none; }
  .lg-throne .lg-dial-ring { transition: none; }
  .lg-throne .lg-era {
    position: absolute; left: 0; right: 0; top: 0; bottom: 0;
    margin: 0;
    display: flex; flex-direction: column; justify-content: center;
    will-change: opacity, transform;
    opacity: 0;
  }
  .lg-throne .lg-era[data-era="0"] { opacity: 1; }
  .lg-throne .lg-dial-pips { margin-top: clamp(34px, 5vh, 58px); }
}

/* ============================================================
   THE SEAL — ceremonial close
   ============================================================ */
.lg-seal {
  position: relative;
  background: linear-gradient(180deg, var(--parchment) 0, var(--ivory-200) 100%);
  text-align: center;
  padding: clamp(78px, 11vh, 138px) 24px clamp(96px, 14vh, 168px);
  overflow: hidden;
}
.lg-seal::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--hairline-light);
}
.lg-seal-inner { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.lg-seal-div { height: 16px; width: auto; margin: 28px auto; opacity: 0.82; }
.lg-seal-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.5;
  color: var(--espresso-brown);
  margin: 0;
}
.lg-seal-text .accent { color: var(--gold-600); font-weight: 700; font-style: normal; }
.lg-seal .lg-btn { color: var(--parchment); border-color: var(--regal-gold); }
.lg-seal .lg-btn:hover { color: var(--parchment); border-color: var(--regal-gold); }
.lg-seal-div { filter: brightness(0.55) sepia(1) saturate(2.2) hue-rotate(2deg); }
.lg-seal-cta { margin-top: clamp(40px, 6vh, 60px); }

.lg-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 12px;
  color: var(--navy-900);
  background: transparent;
  border: 1px solid var(--regal-gold);
  padding: 18px 44px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: color var(--dur-slow) var(--ease-standard), border-color var(--dur-slow) var(--ease-standard);
}
.lg-btn span { position: relative; z-index: 1; }
.lg-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--regal-gold);
  transform: scaleX(1);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-entrance);
  z-index: 0;
}
.lg-btn:hover { color: var(--navy-900); border-color: var(--regal-gold); }
.lg-btn:hover::before { transform: scaleX(1); }
.lg-btn .arrow { font-size: 1.05em; }

/* ============================================================
   Scroll-reveal primitives — visible by default; hidden only once
   JS marks the root with .lg-js (set by the pre-paint script).
   ============================================================ */
.lg-js .lg-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.05s var(--ease-entrance), transform 1.05s var(--ease-entrance);
  will-change: opacity, transform;
}
.lg-js .lg-reveal.in { opacity: 1; transform: none; }
.lg-js .lg-reveal.d1 { transition-delay: 0.1s; }
.lg-js .lg-reveal.d2 { transition-delay: 0.2s; }
.lg-js .lg-reveal.d3 { transition-delay: 0.3s; }

.lg-js .lg-reveal-fade {
  opacity: 0;
  transition: opacity 1.25s var(--ease-entrance);
  will-change: opacity;
}
.lg-js .lg-reveal-fade.in { opacity: 1; }
.lg-js .lg-reveal-fade.d2 { transition-delay: 0.22s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .lg-numeral { font-size: clamp(34px, 11vw, 50px); }
}

@media (prefers-reduced-motion: reduce) {
  .lg-js .lg-reveal,
  .lg-js .lg-reveal-fade { opacity: 1 !important; transform: none !important; transition: none !important; }
  .lg-scrollcue-line::after { animation: none; opacity: 0.6; }
}

/* ============================================================
   Non-animated fallbacks (mobile / narrow / reduced-motion):
   these decorations only make sense WITH the pinned-scroll animation,
   so hide them wherever that animation is off. Desktop pinned views
   (saga ≥761px, dial ≥861px, motion-OK) keep them.
   ============================================================ */
/* Saga vertical fallback: drop the small tick above each act card. */
@media (max-width: 760px), (prefers-reduced-motion: reduce) {
  .lg-act-card::before { display: none; }
}
/* Static dial: drop the golden pointer arrow and the navigation diamonds. */
@media (max-width: 860px), (prefers-reduced-motion: reduce) {
  .lg-dial-pointer,
  .lg-dial-pips { display: none; }
}
