/* Bay Diorama: Cleara 3D concept */
*, *::before, *::after { box-sizing: border-box; }
html { background: #EEF4F8; }
body {
  margin: 0; background: #EEF4F8; color: var(--c-emerald);
  font-family: var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.scroll-space { height: 720vh; }

/* top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 3vw, 40px);
}
.topbar__logo { position: relative; display: block; width: 132px; height: 32px; }
.logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; transition: opacity .6s; }
.logo--dark { opacity: 0; }
.is-night .logo--light { opacity: 0; }
.is-night .logo--dark { opacity: 1; }
.topbar__nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.topbar__link {
  color: var(--c-emerald); text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: .04em;
  transition: color .6s;
}
.topbar__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.is-night .topbar__link { color: var(--c-ivory); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 999px; border: 1px solid var(--c-emerald);
  background: var(--c-emerald); color: var(--c-ivory); text-decoration: none;
  font-family: var(--f-body); font-size: 14px; font-weight: 500; letter-spacing: .02em;
  transition: background .3s, color .3s, border-color .3s;
}
.btn:hover { background: var(--c-emerald-deep); }
.btn:focus-visible, .topbar__link:focus-visible, .topbar__logo:focus-visible { outline: 2px solid var(--c-gold); outline-offset: 3px; }
.btn--small { padding: 9px 18px; font-size: 13px; }
.is-night .btn--small { background: var(--c-ivory); color: var(--c-emerald); border-color: var(--c-ivory); }
.btn--ghost { background: transparent; color: var(--c-emerald); }
.btn--ghost:hover { background: rgba(13, 59, 46, .08); }

/* chapters */
.overlay { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.ch {
  position: absolute; opacity: 0; will-change: opacity, transform;
  max-width: 34rem; pointer-events: none;
}
.ch.is-active { pointer-events: auto; }
.ch--top { top: 13vh; left: 50%; width: min(92vw, 44rem); max-width: none; text-align: center; transform: translateX(-50%); }
.ch--left { left: clamp(20px, 7vw, 110px); top: 50%; width: min(86vw, 30rem); }
.ch--corner { left: clamp(20px, 5vw, 80px); bottom: clamp(28px, 8vh, 80px); width: min(86vw, 25rem); }
.ch::before {
  content: ""; position: absolute; inset: -60px -90px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(245, 249, 252, .72), rgba(245, 249, 252, 0));
}
.ch.is-light { color: var(--c-ivory); }
.ch.is-light::before { background: radial-gradient(closest-side, rgba(5, 18, 22, .7), rgba(5, 18, 22, 0)); }

.eyebrow {
  margin: 0 0 1rem; font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.ch--top .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.ch.is-light .eyebrow { color: var(--c-ivory-dark); }
.ch__title {
  font-family: var(--f-heading); font-weight: 500; line-height: 1.0; letter-spacing: -.01em;
  font-size: clamp(3rem, 7vw, 6.2rem); margin: 0 0 1rem;
}
.ch__title--md { font-size: clamp(2.3rem, 4.4vw, 3.9rem); line-height: 1.04; }
.ch__title--sm { font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.08; }
.ch__body { margin: 0; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.6; }
.ch__note {
  margin: 1.1rem auto 0; max-width: 28rem; font-family: var(--f-heading); font-style: italic;
  font-size: clamp(17px, 1.5vw, 20px); line-height: 1.45; opacity: .82;
}
.ch.is-light .ch__body { color: rgba(245, 249, 252, .88); }
.ch__cta { margin-top: 1.8rem; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ch--left .ch__cta { justify-content: flex-start; }

/* 3D-anchored labels */
.labels { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.label {
  position: absolute; left: 0; top: 0; opacity: 0; display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -100%); color: var(--c-emerald); text-align: center; will-change: transform, opacity;
}
.label__kicker { font-size: 10px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; opacity: .75; }
.label__name { font-family: var(--f-heading); font-style: italic; font-weight: 500; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; white-space: nowrap; }
.label__stem { display: block; width: 1px; height: 48px; margin-top: 8px; background: linear-gradient(var(--c-emerald), rgba(13, 59, 46, 0)); }
.label__stem::after { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--c-gold); border: 1px solid var(--c-emerald); transform: translate(-3px, 46px); }

/* scroll cue */
.scroll-cue {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--c-emerald);
}
.scroll-cue i { display: block; width: 1px; height: 36px; background: linear-gradient(var(--c-emerald), rgba(13, 59, 46, 0)); }

/* record mode: no scrollbar, overlays driven by p only */
html.record, html.record body { overflow: hidden; }
html.record .scroll-space { display: none; }

/* fallback without WebGL */
html.no-webgl, html.no-webgl body { background: var(--c-emerald); }
html.no-webgl #scene, html.no-webgl .labels { display: none; }
html.no-webgl .ch, html.no-webgl .topbar__link, html.no-webgl .scroll-cue { color: var(--c-ivory); }
html.no-webgl .ch::before { display: none; }
html.no-webgl .logo--light { opacity: 0; }
html.no-webgl .logo--dark { opacity: 1; }
html.no-webgl .btn { background: var(--c-ivory); color: var(--c-emerald); border-color: var(--c-ivory); }
html.no-webgl .btn--ghost { background: transparent; color: var(--c-ivory); }

@media (max-width: 720px) {
  .topbar { padding: 14px 16px; }
  .topbar__logo { width: 104px; height: 26px; }
  .topbar__link { display: none; }
  .ch--top { top: 11vh; }
  .ch--left, .ch--corner { left: 16px; right: 16px; width: auto; top: auto; bottom: 7vh; }
  .ch__title { font-size: clamp(2.6rem, 12vw, 3.4rem); }
  .ch__title--md { font-size: clamp(2rem, 9vw, 2.6rem); }
  .ch__title--sm { font-size: clamp(1.7rem, 7.4vw, 2.2rem); }
  .ch__note { font-size: 16px; }
  .label__name { font-size: 26px; }
  .label__stem { height: 34px; }
  .label__stem::after { transform: translate(-3px, 32px); }
}
html.record *, html.record *::before, html.record *::after { transition: none !important; }
@media (max-width: 720px) { .eyebrow { letter-spacing: .18em; } }
