/* home.css — the home page and the public pages that borrow its pieces
 * (/about uses the scenery and the banded hero).
 *
 *   hero slider     .home-hero (.has-slider) > .hero-track > .hero-slide, .hero-controls
 *                   CSS scroll-snap does the sliding; home.js adds dots, arrows,
 *                   autoplay and pause. Without script the slides still swipe.
 *   scenery         components/scenery.html: .hero-scenery.scene-{ridges|dawn|waves|contours}
 *                   site.css draws "ridges"; the other scenes reshape the same layers.
 *   sections        .figures-note .ticker .featured-section/.stack-panel .cta-band
 *
 * Colours come from tokens.css only. Everything that moves animates transform
 * or opacity, and prefers-reduced-motion stops it (site.css + the end of this file).
 */

/* ---------- Hero: slides side by side, snapped ---------- */
.home-hero { align-items: stretch }
.hero-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none }
.hero-track::-webkit-scrollbar { display: none }
.hero-slide { position: relative; flex: 0 0 100%; height: 100%; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; scroll-snap-align: start; scroll-snap-stop: always }
.hero-media { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover }
.hero-slide .hero-content { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto }
.hero-eyebrow { margin-bottom: clamp(12px, 2vh, 20px) }
/* The hero is dark in both modes, so its eyebrow uses the on-dark tokens
   (--tint, behind .eyebrow-light, turns dark in dark mode). */
.home-hero .eyebrow-light { color: var(--on-dark-soft) }
.has-slider .hero-content { padding-bottom: calc(clamp(24px, 5vh, 48px) + var(--control-h) + clamp(28px, 5vh, 56px)) }

/* A slide's copy rises in as it becomes the current one (script only). */
.has-motion .home-hero[data-ready] .hero-slide .hero-copy { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity .8s var(--ease-out) .15s, transform .8s var(--ease-out) .15s }
.has-motion .home-hero[data-ready] .hero-slide.is-active .hero-copy { opacity: 1; transform: none }

/* ---------- Hero controls: progress dots, pause, arrows ---------- */
.hero-controls { position: absolute; left: 0; right: 0; bottom: clamp(24px, 5vh, 48px); z-index: 4; display: none; pointer-events: none }
.home-hero[data-ready] .hero-controls { display: block }
.hero-controls-row { display: flex; align-items: center; justify-content: space-between; gap: 24px }
.hero-controls-row > * { pointer-events: auto }
.hero-dots { display: flex; align-items: center; gap: 8px }
.hero-dot { position: relative; width: 44px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer }
.hero-dot::before, .hero-dot-fill { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 999px }
.hero-dot::before { background: var(--on-dark-line); transition: background-color .25s }
.hero-dot:hover::before, .hero-dot[aria-current="true"]::before { background: var(--on-dark-muted) }
.hero-dot-fill { background: var(--brand); transform: scaleX(0); transform-origin: left }
.hero-dot[aria-current="true"] .hero-dot-fill { transform: scaleX(1) }
.home-hero[data-autoplay] .hero-dot[aria-current="true"] .hero-dot-fill { animation: hero-progress var(--hero-delay, 8s) linear both }
.home-hero[data-autoplay][data-held] .hero-dot[aria-current="true"] .hero-dot-fill { animation-play-state: paused }
@keyframes hero-progress { from { transform: scaleX(0) } to { transform: scaleX(1) } }
.hero-dot:focus-visible, .hero-arrow:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 3px }
.hero-arrows { display: flex; gap: 8px }
.hero-arrow { display: grid; place-items: center; width: var(--control-h); height: var(--control-h); padding: 0; border: 2px solid var(--on-dark-line); border-radius: var(--radius-sm); background: transparent; color: var(--on-dark); cursor: pointer; transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease) }
.hero-arrow .i { font-size: 20px }
.hero-arrow:hover { background: var(--on-dark); border-color: var(--on-dark); color: var(--band) }
.hero-pause .i-play, .hero-pause[aria-pressed="true"] .i-pause { display: none }
.hero-pause[aria-pressed="true"] .i-play { display: inline-block }

/* ---------- Scenery: three more scenes over site.css's ridges ---------- */
.stack-panel > .hero-scenery, .cta-band > .hero-scenery, .page-hero > .hero-scenery { z-index: -1 }

/* Dawn: a low sun behind rolling hills. */
.scene-dawn { background: radial-gradient(80% 70% at 50% 92%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%), linear-gradient(180deg, var(--scene-3) 0%, var(--hero) 80%) }
.scene-dawn .hero-glow--one { width: 26vmax; height: 26vmax; left: 50%; right: auto; top: auto; bottom: 18%; margin-left: -13vmax; filter: blur(2px); opacity: .95; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 80%, var(--on-dark)) 0 30%, color-mix(in srgb, var(--accent) 40%, transparent) 33%, transparent 68%); animation: sun-rise 26s ease-in-out infinite alternate }
.scene-dawn .hero-glow--two { width: 70vw; height: 40vw; left: 15vw; top: auto; bottom: 0; background: radial-gradient(closest-side, var(--scene-glow-warm), transparent); animation: drift-b 30s ease-in-out infinite alternate }
.scene-dawn .hero-ridge { clip-path: none; border-radius: 50% 50% 0 0 / 100% 100% 0 0 }
.scene-dawn .hero-ridge--far { height: 36%; left: -30%; right: 25%; opacity: .85 }
.scene-dawn .hero-ridge--mid { height: 28%; left: 20%; right: -40%; opacity: .95 }
.scene-dawn .hero-ridge--near { height: 17%; left: -20%; right: -20% }
@keyframes sun-rise { from { transform: translate3d(0, 6vh, 0) } to { transform: translate3d(0, -2vh, 0) } }

/* Waves: three swells rolling sideways (each layer is two screens wide and
   holds four whole waves, so sliding it by half loops without a seam). */
.scene-waves { background: radial-gradient(70% 60% at 80% 0%, var(--scene-1), transparent 60%), linear-gradient(180deg, var(--scene-2) 0%, var(--scene-3) 50%, var(--hero) 100%) }
.scene-waves .hero-ridge { left: 0; right: auto; width: 200% }
.scene-waves .hero-ridge--far { height: 58%; opacity: .55; clip-path: polygon(0% 30.0%, 2.08% 34.5%, 4.17% 37.8%, 6.25% 39.0%, 8.33% 37.8%, 10.42% 34.5%, 12.50% 30.0%, 14.58% 25.5%, 16.67% 22.2%, 18.75% 21.0%, 20.83% 22.2%, 22.92% 25.5%, 25% 30.0%, 27.08% 34.5%, 29.17% 37.8%, 31.25% 39.0%, 33.33% 37.8%, 35.42% 34.5%, 37.50% 30.0%, 39.58% 25.5%, 41.67% 22.2%, 43.75% 21.0%, 45.83% 22.2%, 47.92% 25.5%, 50% 30.0%, 52.08% 34.5%, 54.17% 37.8%, 56.25% 39.0%, 58.33% 37.8%, 60.42% 34.5%, 62.50% 30.0%, 64.58% 25.5%, 66.67% 22.2%, 68.75% 21.0%, 70.83% 22.2%, 72.92% 25.5%, 75% 30.0%, 77.08% 34.5%, 79.17% 37.8%, 81.25% 39.0%, 83.33% 37.8%, 85.42% 34.5%, 87.50% 30.0%, 89.58% 25.5%, 91.67% 22.2%, 93.75% 21.0%, 95.83% 22.2%, 97.92% 25.5%, 100% 30.0%, 100% 100%, 0 100%); animation: wave-roll 46s linear infinite }
.scene-waves .hero-ridge--mid { height: 44%; opacity: .8; clip-path: polygon(0% 45.5%, 2.08% 41.4%, 4.17% 35.9%, 6.25% 30.4%, 8.33% 26.4%, 10.42% 25.0%, 12.50% 26.5%, 14.58% 30.6%, 16.67% 36.1%, 18.75% 41.6%, 20.83% 45.6%, 22.92% 47.0%, 25% 45.5%, 27.08% 41.4%, 29.17% 35.9%, 31.25% 30.4%, 33.33% 26.4%, 35.42% 25.0%, 37.50% 26.5%, 39.58% 30.6%, 41.67% 36.1%, 43.75% 41.6%, 45.83% 45.6%, 47.92% 47.0%, 50% 45.5%, 52.08% 41.4%, 54.17% 35.9%, 56.25% 30.4%, 58.33% 26.4%, 60.42% 25.0%, 62.50% 26.5%, 64.58% 30.6%, 66.67% 36.1%, 68.75% 41.6%, 70.83% 45.6%, 72.92% 47.0%, 75% 45.5%, 77.08% 41.4%, 79.17% 35.9%, 81.25% 30.4%, 83.33% 26.4%, 85.42% 25.0%, 87.50% 26.5%, 89.58% 30.6%, 91.67% 36.1%, 93.75% 41.6%, 95.83% 45.6%, 97.92% 47.0%, 100% 45.5%, 100% 100%, 0 100%); animation: wave-roll 34s linear infinite reverse }
.scene-waves .hero-ridge--near { height: 28%; clip-path: polygon(0% 28.7%, 2.08% 27.0%, 4.17% 28.8%, 6.25% 33.6%, 8.33% 40.1%, 10.42% 46.6%, 12.50% 51.3%, 14.58% 53.0%, 16.67% 51.2%, 18.75% 46.4%, 20.83% 39.9%, 22.92% 33.4%, 25% 28.7%, 27.08% 27.0%, 29.17% 28.8%, 31.25% 33.6%, 33.33% 40.1%, 35.42% 46.6%, 37.50% 51.3%, 39.58% 53.0%, 41.67% 51.2%, 43.75% 46.4%, 45.83% 39.9%, 47.92% 33.4%, 50% 28.7%, 52.08% 27.0%, 54.17% 28.8%, 56.25% 33.6%, 58.33% 40.1%, 60.42% 46.6%, 62.50% 51.3%, 64.58% 53.0%, 66.67% 51.2%, 68.75% 46.4%, 70.83% 39.9%, 72.92% 33.4%, 75% 28.7%, 77.08% 27.0%, 79.17% 28.8%, 81.25% 33.6%, 83.33% 40.1%, 85.42% 46.6%, 87.50% 51.3%, 89.58% 53.0%, 91.67% 51.2%, 93.75% 46.4%, 95.83% 39.9%, 97.92% 33.4%, 100% 28.7%, 100% 100%, 0 100%); animation: wave-roll 24s linear infinite }
@keyframes wave-roll { from { transform: translate3d(0, 0, 0) } to { transform: translate3d(-50%, 0, 0) } }

/* Contours: the lines of a relief map, turning slowly. */
.scene-contours { background: radial-gradient(90% 80% at 85% 10%, var(--scene-1), transparent 60%), radial-gradient(60% 60% at 0% 100%, var(--scene-2), transparent 70%), var(--hero) }
.scene-contours .hero-glow { filter: none; border-radius: 50% }
.scene-contours .hero-glow--one { width: 130vmax; height: 130vmax; right: -55vmax; left: auto; top: -60vmax; opacity: .5; background: repeating-radial-gradient(circle at 46% 54%, transparent 0 26px, var(--on-dark-hairline) 26px 27px); animation: contour-turn 120s linear infinite }
.scene-contours .hero-glow--two { width: 90vmax; height: 90vmax; left: -45vmax; top: 30%; opacity: .35; background: repeating-radial-gradient(circle at 55% 45%, transparent 0 20px, var(--on-dark-hairline) 20px 21px); animation: contour-turn 160s linear infinite reverse }
.scene-contours .hero-ridge--mid, .scene-contours .hero-ridge--near { display: none }
.scene-contours .hero-ridge--far { inset: auto 0 0 0; height: 70%; clip-path: none; opacity: .9; background: radial-gradient(60% 70% at 30% 100%, var(--scene-glow), transparent 70%); animation: none }
@keyframes contour-turn { to { transform: rotate(360deg) } }

/* ---------- At a glance ---------- */
.figures-note { display: flex; align-items: flex-start; gap: 10px; margin: 32px 0 0; font-size: var(--text-sm); color: var(--text-muted) }
.figures-note .i { margin-top: 3px; color: var(--ink) }

/* ---------- Ticker ---------- */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink) 8%, var(--ink) 92%, transparent); mask-image: linear-gradient(90deg, transparent, var(--ink) 8%, var(--ink) 92%, transparent) }
.ticker-track { display: flex; width: max-content; list-style: none; margin: 0; padding: 22px 0; animation: ticker 50s linear infinite }
.ticker:hover .ticker-track { animation-play-state: paused }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding-right: 48px; white-space: nowrap; font: 500 var(--text-lg)/1 var(--font-heading); color: var(--text-muted) }
.ticker-item b { font: 700 var(--text-sm)/1 var(--font-sans); letter-spacing: .08em; color: var(--ink) }
.ticker-item::after { content: ""; width: 6px; height: 6px; margin-left: 38px; border-radius: 50%; background: var(--accent) }
@keyframes ticker { to { transform: translate3d(-50%, 0, 0) } }

/* ---------- Featured stories: panels that stack as you scroll ---------- */
.featured-section { padding-top: var(--section); background: var(--surface) }
.featured-intro .split-head { margin-bottom: 56px }
.project-stack { position: relative }
.stack-panel { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 560px; max-height: 860px; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; color: var(--on-dark); background: var(--hero); box-shadow: 0 -24px 48px color-mix(in srgb, var(--band) 30%, transparent) }
.stack-media { position: absolute; inset: -40px 0; z-index: -1; width: 100%; height: calc(100% + 80px); object-fit: cover }
.stack-shade { position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, transparent 30%, var(--hero-shade) 100%) }
.stack-content { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; padding-block: 28px 64px; border-top: 1px solid var(--on-dark-line) }
.stack-index { margin: 0 0 16px; font: 600 var(--text-sm)/1 var(--font-sans); letter-spacing: .08em; color: var(--on-dark-muted) }
.stack-number { color: var(--on-dark) }
.public-site .stack-title { max-width: 22ch; margin: 0 0 20px; font-size: var(--text-3xl); line-height: 1.08; letter-spacing: -.02em; color: var(--on-dark) }
.stack-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 }
.stack-aside { display: grid; gap: 22px; justify-items: start }
.stack-summary { margin: 0; color: var(--on-dark); line-height: 1.6 }
.stack-facts { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 28px; margin: 0 }
.stack-facts dt { font: 600 .6875rem/1.2 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brand) }
.stack-facts dd { margin: 6px 0 0; font: 600 var(--text-base)/1.2 var(--font-sans); color: var(--on-dark); white-space: nowrap }
.stack-panel .btn-secondary { background: var(--on-dark); border-color: var(--on-dark); color: var(--band) !important }
.stack-panel .btn-secondary:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand) !important }

/* ---------- News without photos ---------- */
.news-media .media-placeholder { min-height: 0 }

/* ---------- Contact band over a scene ---------- */
.cta-band .cta-layout { position: relative; z-index: 1 }
.cta-card .cta-actions .text-link { word-break: break-word }

/* ---------- Inner page hero over a scene (/about) ---------- */
.page-hero--band .page-hero-inner { position: relative; z-index: 1 }

/* ---------- Smaller screens ---------- */
@media (max-width: 1024px) {
  .stack-content { grid-template-columns: 1fr; gap: 20px; padding-bottom: 48px }
  .stack-panel { min-height: 620px }
  .stack-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px }
  .stack-facts dd { font-size: var(--text-sm); white-space: normal }
}
@media (max-width: 760px) {
  .hero-controls-row { gap: 12px }
  .hero-dot { width: 32px }
  .stack-panel { position: relative; top: auto; height: auto; min-height: 560px; max-height: none; box-shadow: none }
  .stack-content { padding-top: 160px }
  .stack-facts { grid-template-columns: 1fr 1fr; row-gap: 16px }
  .ticker-item { font-size: var(--text-base); padding-right: 32px }
  .ticker-item::after { margin-left: 22px }
}
@media (hover: none) and (pointer: coarse) {
  .hero-arrow[data-hero-prev], .hero-arrow[data-hero-next] { display: none }
}

/* ---------- Reduced motion: nothing drifts, rolls or ticks ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-track { scroll-behavior: auto }
  .hero-scenery *, .hero-scenery { animation: none !important }
  .ticker-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; row-gap: 12px; padding-inline: 16px }
  .ticker-item[aria-hidden="true"] { display: none }
  .ticker { -webkit-mask-image: none; mask-image: none }
}
@media print {
  .hero-controls, .ticker { display: none !important }
  .stack-panel { position: relative; height: auto; min-height: 0 }
}
