/* Story pages (homepage and More Creek).
   One continuous alpine scene: the background video stays fixed and full-bleed while a few
   large plates enter, hold and leave within the viewport as the page scrolls natively.
   story.js drives --e (eased visibility), --y and --s on [data-plate]; without it every
   plate simply shows. Small text is sentence case (docs/website-structure-and-functionality.md). */

:root {
  --gutter: clamp(16px, 4vw, 76px);              /* matches the .site-header inline padding */
  --plate-max: 1320px;
  --plate-pad: clamp(24px, 3.4vw, 52px);
  --plate-bg: rgba(255, 255, 255, .88);
  --plate-border: rgba(0, 0, 0, .08);
  --plate-highlight: inset 0 1px 0 rgba(255, 255, 255, .9);
  --plate-shadow: 0 30px 70px rgba(8, 32, 38, .16), 0 2px 8px rgba(0, 0, 0, .05);
  --plate-sheen: linear-gradient(165deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 42%);
  --plate-caustic: radial-gradient(110% 90% at 0% 100%, rgba(33, 158, 170, .08), rgba(33, 158, 170, 0) 55%);
  --rule: rgba(0, 0, 0, .1);
  --meter-track: rgba(0, 110, 112, .1);
  --meter-tick: rgba(255, 255, 255, .9);
  --meter-glint: rgba(255, 255, 255, .75);
  --water-gradient: linear-gradient(90deg, #12647c 0%, #219eaa 42%, #58bacc 78%, #72c8c2 100%);
}
:root:not([data-theme="light"]) {
  --plate-bg: rgba(14, 18, 20, .86);
  --plate-border: rgba(255, 255, 255, .09);
  --plate-highlight: inset 0 1px 0 rgba(255, 255, 255, .07);
  --plate-shadow: 0 34px 90px rgba(0, 0, 0, .46), 0 2px 10px rgba(0, 0, 0, .28);
  --plate-sheen: linear-gradient(165deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 40%);
  --plate-caustic: radial-gradient(110% 90% at 0% 100%, rgba(62, 202, 195, .08), rgba(62, 202, 195, 0) 55%);
  --rule: rgba(255, 255, 255, .1);
  --meter-track: rgba(255, 255, 255, .075);
  --meter-tick: rgba(14, 18, 20, .8);
  --meter-glint: rgba(255, 255, 255, .6);
}

/* ---------- scene root: the interior-page fixed video, extended to a scrolling story */
/* isolation stays auto so the map's CSS-fullscreen fallback (z-index 60) can rise above the header. */
.page-landscape.story { height: auto; min-height: 100svh; overflow: visible; overflow-x: clip; isolation: auto; }
/* The large viewport height keeps the footage covering the screen while mobile toolbars collapse. */
.page-landscape.story > .landscape__art { height: 100lvh; }
/* style.css floats interior-page titles (.page-landscape h1) over the scene; story titles sit in their plates. */
.page-landscape.story h1 { position: static; z-index: auto; top: auto; left: auto; width: auto; transform: none; text-align: inherit; text-shadow: none; text-wrap: initial; }

.chapter {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100svh;
  padding: calc(var(--header-height) + 24px) var(--gutter) 24px;
}

/* ---------- plates (Liquid Glass-inspired, ~86-88% opaque so text always reads over the video) */
.plate, .hero__bg {
  color: var(--text-primary);
  background: var(--plate-caustic), var(--plate-sheen), var(--plate-bg);
  border: 1px solid var(--plate-border);
  box-shadow: var(--plate-highlight), var(--plate-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}
.plate {
  position: relative;
  width: 100%;
  max-width: var(--plate-max);
  margin-inline: auto;
  padding: var(--plate-pad);
  opacity: var(--e, 1);
  transform: translate3d(0, var(--y, 0px), 0) scale(var(--s, 1));
}
.plate--narrow { max-width: 820px; }
.plate--start { margin-inline: 0 auto; max-width: 720px; }
/* Fully faded plates skip the blur so off-stage glass costs nothing. */
.plate.is-dormant, .hero__card.is-dormant, .hero__bg.is-dormant { -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }

/* ---------- type */
.eyebrow { margin: 0 0 14px; color: var(--accent-turquoise); font-family: Onest, sans-serif; font-size: 15px; font-weight: 400; line-height: 1.35; letter-spacing: .005em; }
.display { margin: 0; font-family: 'Maven Pro', sans-serif; font-size: clamp(34px, 4.2vw, 64px); font-weight: 400; line-height: 1.06; letter-spacing: -.05em; text-wrap: balance; }
.lede { margin-top: 18px; max-width: 58ch; color: var(--text-secondary); font-size: clamp(16px, 1.2vw, 19px); line-height: 1.6; text-wrap: pretty; }
.fineprint { margin-top: clamp(22px, 2.4vw, 32px); color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* ---------- actions */
.action {
  display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 11px 18px;
  font: 400 15.5px/1.25 Onest, sans-serif; color: var(--accent-turquoise); text-decoration: none; cursor: pointer;
  background: var(--doc-row-bg); border: 1px solid var(--border-active);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.action svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
.action:hover, .action:focus-visible { color: var(--text-inverse); background: var(--accent-turquoise); border-color: transparent; }
.action:hover svg, .action:focus-visible svg { transform: translateX(3px); }
.action:focus-visible { outline: 2px solid var(--accent-turquoise); outline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 2.6vw, 34px); }

/* ---------- figures: large count-up numbers, each with its own water meter.
   The two meters have different textures and separate columns so MW and GWh/year never
   read as one scale: capacity is a steady charge, annual generation flows through 12 months. */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { min-width: 0; }
.stat:first-child { padding-right: clamp(28px, 4vw, 64px); }
.stat + .stat { padding-left: clamp(28px, 4vw, 64px); border-left: 1px solid var(--rule); }
.stat__value {
  display: flex; align-items: baseline; gap: .1em; margin: 0;
  font-family: 'Maven Pro', sans-serif; font-size: clamp(84px, 9.4vw, 150px); font-weight: 400;
  line-height: .92; letter-spacing: -.065em; white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* The hidden final value reserves the width so the unit never shifts during the count. */
.stat__number { display: inline-grid; }
.stat__number > * { grid-area: 1 / 1; text-align: right; }
.stat__ghost { visibility: hidden; }
.stat__unit { font-size: .3em; letter-spacing: -.02em; line-height: 1; color: var(--text-secondary); }
.stat__amount { display: inline-flex; align-items: baseline; }
.stat__value .figure__logo { width: .44em; height: .2em; margin-right: .02em; align-self: center; }
.stat__note { margin-top: 14px; color: var(--text-secondary); font-size: clamp(15px, 1.1vw, 17px); line-height: 1.5; }

.meter { position: relative; height: 10px; margin-top: clamp(20px, 2.2vw, 30px); overflow: hidden; background: var(--meter-track); }
.meter__fill { position: absolute; inset: 0; overflow: hidden; background: var(--water-gradient); }
.js-story .meter__fill { clip-path: inset(0 100% 0 0); transition: clip-path 1100ms cubic-bezier(.33, 1, .68, 1); }
.js-story .meter.is-filled .meter__fill { clip-path: inset(0 0 0 0); }
/* Capacity: a slow, steady light sweep. */
.meter--steady .meter__fill::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--meter-glint), rgba(255, 255, 255, 0));
  opacity: .5; transform: translateX(-100%);
  animation: meter-sweep 6.5s cubic-bezier(.45, 0, .25, 1) infinite;
}
/* Annual generation: twelve monthly segments with a continuous current flowing through them. */
.meter--flow::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 12 - 2px), var(--meter-tick) calc(100% / 12 - 2px) calc(100% / 12));
}
.meter--flow .meter__fill::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -64px; right: -64px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 18px, rgba(255, 255, 255, .42) 32px, rgba(255, 255, 255, 0) 46px 64px);
  animation: meter-flow 1.9s linear infinite;
}
.plate:not(.is-live) .meter__fill::after, .hero__card:not(.is-live) .meter__fill::after { animation-play-state: paused; }
@keyframes meter-sweep { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(270%); } }
@keyframes meter-flow { to { transform: translateX(64px); } }

.stats__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px;
  margin-top: clamp(26px, 3vw, 40px); padding-top: clamp(18px, 2vw, 24px); border-top: 1px solid var(--rule);
}
.stats__foot .fineprint { margin: 0; }
.canada-line { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--text-primary); font-size: clamp(15px, 1.1vw, 17px); }

/* ---------- maple leaf (the image is shimmered by logo-shimmer.js via .introduction__canada) */
.maple, .maple-slot { display: inline-block; flex: none; width: 30px; height: 30px; }
.maple .introduction__canada { width: 100%; height: 100%; }
.maple--flying { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform; opacity: var(--exit-e, 1); }
.hero.is-morph .maple--static { display: none; }

/* ---------- homepage hero: title card that opens into the figures plate */
.hero { position: relative; }
.hero__bg { display: none; }
.hero__slot {
  position: relative; display: flex; min-height: 100svh;
  padding: calc(var(--header-height) + 24px) var(--gutter) clamp(20px, 6svh, 64px);
}
.hero__slot--arrival { align-items: flex-end; justify-content: flex-start; }
.hero__slot--figures { align-items: center; justify-content: center; }
.hero__card { position: relative; width: 100%; padding: var(--plate-pad); }
.hero__arrival { max-width: min(680px, 100%); padding: clamp(26px, 3vw, 40px) clamp(26px, 3.2vw, 44px) clamp(24px, 2.8vw, 36px); }
.hero__figures { max-width: var(--plate-max); }
/* Without the morph (no JS, reduced motion, short screens) each card is an ordinary plate. */
.hero:not(.is-morph) .hero__card {
  color: var(--text-primary);
  background: var(--plate-caustic), var(--plate-sheen), var(--plate-bg);
  border: 1px solid var(--plate-border);
  box-shadow: var(--plate-highlight), var(--plate-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  opacity: var(--e, 1);
  transform: translate3d(0, var(--y, 0px), 0) scale(var(--s, 1));
}
.hero.is-morph { height: calc(100svh + var(--morph-distance, 105svh)); }
.hero.is-morph .hero__stage { position: sticky; top: 0; height: 100svh; }
.hero.is-morph .hero__bg { display: block; position: absolute; z-index: 0; opacity: var(--exit-e, 1); transform: translate3d(0, var(--exit-y, 0px), 0); }
.hero.is-morph .hero__slot { position: absolute; inset: 0; z-index: 1; min-height: 0; pointer-events: none; }
.hero.is-morph .hero__card { opacity: calc(var(--op, 1) * var(--exit-e, 1)); transform: translate3d(0, calc(var(--ty, 0px) + var(--exit-y, 0px)), 0); }
.hero.is-morph .hero__card.is-active { pointer-events: auto; }

.hero__mark { width: 56px; height: 22px; margin: 0 0 6px -3px; }
.story .hero__title { margin: 0; font-family: 'Maven Pro', sans-serif; font-size: clamp(60px, 7.4vw, 120px); font-weight: 400; line-height: .95; letter-spacing: -.067em; }
.hero__place { display: flex; align-items: center; gap: 14px; margin-top: clamp(16px, 1.8vw, 24px); color: var(--text-primary); font-size: clamp(16px, 1.25vw, 19px); letter-spacing: .04em; }
.hero__arrival .maple { animation: maple-arrive 1400ms cubic-bezier(.16, .8, .2, 1) 250ms both; }
@keyframes maple-arrive { from { opacity: 0; transform: translateY(-10px) rotate(-24deg) scale(.8); } }
.hero__arrival { animation: plate-arrive 900ms cubic-bezier(.16, .8, .2, 1) both; }
.hero.is-morph .hero__arrival { animation: none; }
.hero.is-morph .hero__bg { animation: plate-arrive 900ms cubic-bezier(.16, .8, .2, 1) both; }
@keyframes plate-arrive { from { opacity: 0; transform: translate3d(0, 18px, 0); } }

.scroll-cue {
  position: absolute; right: var(--gutter); bottom: clamp(20px, 6svh, 64px); z-index: 2;
  display: none; align-items: center; gap: 14px; margin: 0;
  color: #fff; font-size: 14px; letter-spacing: .01em; text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
  opacity: var(--cue, 1); pointer-events: none;
}
.scroll-cue::after {
  content: ''; width: 1px; height: 46px;
  background: linear-gradient(rgba(255, 255, 255, 0) 0%, #fff 50%, rgba(255, 255, 255, 0) 100%) 0 0 / 1px 200% no-repeat, rgba(255, 255, 255, .28);
  animation: cue-drop 2.2s cubic-bezier(.45, 0, .25, 1) infinite;
}
@keyframes cue-drop { from { background-position: 0 -46px, 0 0; } to { background-position: 0 46px, 0 0; } }
@media (min-width: 900px) and (min-height: 620px) { .scroll-cue { display: flex; } }

/* ---------- value of storage: the tagline reads across three columns */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.6vw, 56px); margin-top: clamp(18px, 2.2vw, 30px); }
.pillar { position: relative; padding-top: clamp(20px, 2vw, 28px); }
.pillar::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
  background: var(--water-gradient); transform-origin: left center;
}
.js-story .pillar::before { transform: scaleX(0); transition: transform 1000ms cubic-bezier(.22, .61, .36, 1); }
.js-story .plate.is-in .pillar::before { transform: scaleX(1); }
.js-story .plate.is-in .pillar:nth-child(2)::before { transition-delay: 180ms; }
.js-story .plate.is-in .pillar:nth-child(3)::before { transition-delay: 360ms; }
.pillar__title { margin: 0 0 14px; font-family: 'Maven Pro', sans-serif; font-size: clamp(32px, 3.3vw, 52px); font-weight: 400; line-height: 1.04; letter-spacing: -.05em; }
.pillar p { color: var(--text-secondary); font-size: clamp(15.5px, 1.12vw, 17.5px); line-height: 1.6; text-wrap: pretty; }

/* ---------- explore: geography and the Explore More Creek menu (navigation.js) */
.chapter--explore .plate { text-align: center; }
.chapter--explore .lede { margin-inline: auto; }
.explore__toggle {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 14px; margin-top: clamp(26px, 3vw, 38px); padding: 10px 16px 10px 32px;
  font: 400 17px/1.5 Onest, sans-serif; color: #fff; text-align: left; cursor: pointer;
  background: #1c2023; border: 2px solid #2e3639;
  transition: border-color 180ms ease;
}
.explore__toggle:hover { border-color: #4b5256; }
.explore__toggle:focus-visible { outline: 2px solid var(--accent-turquoise); outline-offset: 4px; }
.explore__toggle .closing__arrow { width: 24px; font-size: 26px; line-height: 1; text-align: center; }
.explore__toggle > .director-indicator { display: none; position: absolute; inset: 0 auto 0 0; width: 24px; overflow: hidden; isolation: isolate; background: #72c8c2; pointer-events: none; }
.explore__toggle[aria-expanded="true"] > .director-indicator { display: block; }

/* ---------- More Creek: stored water to the grid (schematic, not to scale) */
.flowpath { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); margin: clamp(30px, 3.4vw, 46px) 0 0; padding: 0; list-style: none; }
.flowpath::before, .flowpath::after {
  content: ''; position: absolute; top: 27px; left: 28px; right: calc((100% - 2 * clamp(24px, 3vw, 48px)) / 3 - 28px); height: 2px;
}
.flowpath::before { background: var(--meter-track); }
.flowpath::after {
  background: repeating-linear-gradient(90deg, rgba(114, 200, 194, 0) 0 18px, #58bacc 34px, rgba(114, 200, 194, 0) 50px 72px);
  background-size: 72px 2px; animation: path-flow 2.4s linear infinite;
}
.plate:not(.is-live) .flowpath::after { animation-play-state: paused; }
@keyframes path-flow { to { background-position: 72px 0; } }
/* Headings stay first in the DOM for screen readers; the figure leads visually. */
.flowpath__step { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.flowpath__value { order: 1; }
.flowpath__title { order: 2; }
.flowpath__step > p:last-child { order: 3; }
.flowpath__icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 22px;
  color: var(--accent-turquoise); background: var(--page-bg); border: 1.5px solid var(--border-active); border-radius: 50%;
}
.flowpath__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.flowpath__value { margin: 0; font-family: 'Maven Pro', sans-serif; font-size: clamp(34px, 3.4vw, 54px); line-height: 1; letter-spacing: -.055em; white-space: nowrap; }
.flowpath__value small { font-size: .5em; letter-spacing: -.02em; color: var(--text-secondary); }
.flowpath__title { margin: 12px 0 8px; font-family: Onest, sans-serif; font-size: 17px; font-weight: 400; color: var(--accent-turquoise); }
.flowpath__step p:last-child { color: var(--text-secondary); font-size: clamp(15px, 1.08vw, 17px); line-height: 1.55; }

.chapter--closing .plate { text-align: center; }
.chapter--closing .lede { margin-inline: auto; }
.chapter--closing .actions { justify-content: center; }
.display--statement { font-size: clamp(38px, 5.4vw, 86px); }

/* ---------- More Creek map panel: the deep-charcoal container that frames the map */
.chapter--map { display: block; min-height: 0; padding: calc(var(--header-height) + var(--panel-gap)) var(--panel-gutter) 0; --panel-gap: clamp(12px, 1.6vw, 20px); --panel-gutter: clamp(10px, 2.6vw, 40px); --panel-peek: clamp(44px, 8svh, 96px); }

@media (max-width: 900px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat:first-child { padding-right: 0; padding-bottom: clamp(26px, 5vw, 36px); }
  .stat + .stat { padding-left: 0; padding-top: clamp(26px, 5vw, 36px); border-left: 0; border-top: 1px solid var(--rule); }
  .pillars { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  /* Vertical schematic: each step draws its own connector down to the next icon. */
  .flowpath { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-left: 78px; }
  .flowpath::before, .flowpath::after { content: none; }
  .flowpath__step:not(:last-child)::before, .flowpath__step:not(:last-child)::after {
    content: ''; position: absolute; z-index: -1; left: -51px; top: 28px; width: 2px; height: calc(100% + 30px);
  }
  .flowpath__step:not(:last-child)::before { background: var(--meter-track); }
  .flowpath__step:not(:last-child)::after {
    background: repeating-linear-gradient(180deg, rgba(114, 200, 194, 0) 0 18px, #58bacc 34px, rgba(114, 200, 194, 0) 50px 72px);
    background-size: 2px 72px; animation: path-flow-down 2.4s linear infinite;
  }
  .plate:not(.is-live) .flowpath__step::after { animation-play-state: paused; }
  .flowpath__icon { position: absolute; left: -78px; top: 0; margin: 0; }
}
@keyframes path-flow-down { to { background-position: 0 72px; } }
@media (max-width: 640px) {
  :root { --plate-pad: 24px; }
  .chapter { padding-top: calc(var(--header-height) + 16px); padding-bottom: 16px; }
  .stat__value { font-size: clamp(72px, 22vw, 112px); }
  .hero__slot { padding-bottom: 16px; }
  .story .hero__title { font-size: clamp(54px, 17vw, 76px); }
  .hero__place { font-size: 15.5px; letter-spacing: .03em; }
  .chapter--explore .plate, .chapter--closing .plate { text-align: left; }
  .chapter--explore .lede, .chapter--closing .lede { margin-inline: 0; }
  .chapter--closing .actions { justify-content: flex-start; }
  .explore__toggle { width: 100%; justify-content: space-between; }
  .stats__foot { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .meter__fill::after, .flowpath::after, .flowpath__step::after, .scroll-cue::after { animation: none !important; }
  .js-story .meter__fill, .js-story .pillar::before { transition: none; }
  .hero__arrival, .hero__arrival .maple, .hero.is-morph .hero__bg { animation: none; }
  .action, .action svg, .explore__toggle { transition: none; }
}
@media print {
  .plate, .hero__card { opacity: 1 !important; transform: none !important; }
  .chapter, .hero__slot { min-height: 0; padding-block: 24px; }
  .scroll-cue { display: none; }
}
