/* Cleara Signature: unified palette for the combined film. */
:root {
  --ivory: #F4EFE3;
  --cream: #EFE6D2;
  --ink: #141912;      /* olive-black */
  --olive: #2F3B25;    /* deep olive */
  --gold: #C9A45C;
  --gold-hi: #E8CB86;
  --gold-ink: #8A6A2E; /* gold dark enough for text on ivory */
  --warm: #FFE7B0;
  --ink-soft: rgba(20, 25, 18, .74);
  --ivory-soft: rgba(244, 239, 227, .78);
  --fh: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --fb: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ivory); }
body {
  margin: 0; background: var(--ivory); color: var(--ink);
  font-family: var(--fb); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html.record, html.record body { overflow: hidden; scrollbar-width: none; }
html.record::-webkit-scrollbar { display: none; }
html.record *, html.record *::before, html.record *::after { transition: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; background: var(--ivory); }

/* ---------- no-WebGL fallback: a calm ivory page with every chapter in order ---------- */
.fallback { display: none; }
html.no-webgl #gl, html.no-webgl .sweep, html.no-webgl .labels, html.no-webgl .rail { display: none; }
html.no-webgl .fallback {
  display: block; position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(90% 70% at 50% 0%, rgba(232, 203, 134, .25), transparent 60%), linear-gradient(180deg, var(--ivory), var(--cream));
}
html.no-webgl .story { height: auto; padding: 90px 0 60px; }
html.no-webgl .ch {
  position: relative; inset: auto; opacity: 1 !important; visibility: visible !important; transform: none !important;
  min-height: 0; padding-top: 48px; padding-bottom: 48px; color: var(--ink);
}
html.no-webgl .ch h2, html.no-webgl .ch h2 em { color: var(--olive); }
html.no-webgl .ch .body { color: var(--ink-soft); }
html.no-webgl .ch.ch--dark h2 { color: var(--olive) !important; }
html.no-webgl .ch.ch--dark h2 em { color: var(--gold-ink) !important; }
html.no-webgl .ch.ch--dark .body { color: var(--ink-soft); }
html.no-webgl .ch.ch--dark .eyebrow { color: var(--gold-ink); }
html.no-webgl .ch::before { display: none; }
html.no-webgl .ch--hero .mark { position: static; }
html.no-webgl .photo__text > *, html.no-webgl .panel, html.no-webgl .card, html.no-webgl .cta { opacity: 1 !important; transform: none !important; }
html.no-webgl .svc__swap { opacity: 1 !important; }

.story { position: relative; z-index: 3; height: 1400vh; }

/* ---------- Act I gold light line ---------- */
.sweep {
  position: fixed; left: 50%; top: 50%; z-index: 2;
  width: 320vmax; height: 0; pointer-events: none; opacity: 0; will-change: transform, opacity;
}
.sweep > span { position: absolute; left: 0; right: 0; }
.sweep__glow {
  top: -90px; height: 180px;
  background: linear-gradient(180deg, transparent, rgba(232, 203, 134, .16) 38%, rgba(232, 203, 134, .34) 50%, rgba(232, 203, 134, .16) 62%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, #000 42%, #000 58%, transparent 82%);
  mask-image: linear-gradient(90deg, transparent 18%, #000 42%, #000 58%, transparent 82%);
}
.sweep__line {
  top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent 12%, rgba(201, 164, 92, .9) 32%, #FFF4D6 50%, rgba(201, 164, 92, .9) 68%, transparent 88%);
  box-shadow: 0 0 10px 1px rgba(232, 203, 134, .75), 0 0 34px 4px rgba(232, 203, 134, .35);
}
.sweep__glint {
  left: calc(50% + var(--g, 0px)) !important; right: auto !important;
  top: -70px; width: 140px; height: 140px; margin-left: -70px;
  background: radial-gradient(circle, rgba(255, 250, 235, 1) 0, rgba(255, 236, 190, .85) 6%, rgba(232, 203, 134, .35) 22%, transparent 60%);
}
.sweep__glint::after {
  content: ""; position: absolute; left: -110px; right: -110px; top: 69px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 214, .9), transparent);
}

/* ---------- top bar ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; padding: 0 clamp(16px, 3vw, 40px);
  color: var(--olive); border-bottom: 1px solid transparent;
  transition: color .6s ease, background-color .6s ease, border-color .6s ease;
}
.bar__logo {
  font-family: var(--fh); font-weight: 500; font-size: 23px; letter-spacing: .34em;
  text-decoration: none; color: inherit; padding-left: .02em;
}
.bar__nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.bar__link { font-size: 13px; letter-spacing: .04em; text-decoration: none; opacity: .85; }
.bar__link:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.bar .pill { transition: color .6s ease, border-color .6s ease, background-color .3s ease; }
.bar--dark { color: var(--ivory); background-color: rgba(20, 25, 18, .38); border-bottom-color: rgba(201, 164, 92, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bar--dark .pill { color: var(--gold-hi); border-color: var(--gold); }
html.record .bar--dark { backdrop-filter: none; background-color: rgba(20, 25, 18, .3); }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .7em;
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 14px 26px; color: var(--olive);
  font-family: var(--fb); font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: background-color .3s ease, color .3s ease;
}
.pill b { font-weight: 400; letter-spacing: 0; font-size: 15px; }
.pill:hover { background: var(--gold); color: var(--ink); }
.pill--small { padding: 9px 18px; font-size: 11px; letter-spacing: .14em; }
.pill--solid { background: var(--olive); border-color: var(--olive); color: var(--ivory); }
.pill--solid:hover { background: var(--ink); color: var(--gold-hi); }
.pill--light { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- side rail: progress line + act numerals ---------- */
.rail {
  position: fixed; z-index: 9; right: clamp(12px, 2.2vw, 30px); top: 50%; transform: translateY(-50%);
  display: flex; align-items: stretch; gap: 14px; color: var(--gold-ink);
  transition: color .6s ease;
}
.rail--dark { color: var(--gold-hi); }
.rail__track { position: relative; width: 1px; background: rgba(201, 164, 92, .3); }
.rail__fill { position: absolute; inset: 0; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); transform-origin: top; transform: scaleY(0); box-shadow: 0 0 6px rgba(232, 203, 134, .7); }
.rail__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.rail__n {
  display: block; font-family: var(--fh); font-style: italic; font-size: 15px; line-height: 1; min-width: 22px; text-align: left;
  opacity: .45; transition: opacity .4s ease, transform .4s ease;
}
.rail__n.is-on { opacity: 1; transform: translateX(-3px); }
.rail__n:hover { opacity: .9; }

/* ---------- chapters ---------- */
.ch { position: fixed; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.ch.is-on { visibility: visible; }
.ch.is-live a { pointer-events: auto; }
h1, h2, h3 { font-family: var(--fh); font-weight: 400; margin: 0; }
h2 em, h1 em { font-style: italic; }
.body { font-size: 15px; line-height: 1.7; color: var(--ink-soft); max-width: 30em; margin: 0; }
.body--center { margin: 0 auto; text-align: center; }

.eyebrow {
  display: flex; align-items: center; gap: 14px; margin: 0;
  font-size: 11px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-ink);
}
.eyebrow span { display: block; width: 40px; height: 1px; background: var(--gold); }
.eyebrow b { font-weight: 500; color: inherit; opacity: .8; margin-left: .6em; letter-spacing: .18em; }
.eyebrow--center { justify-content: center; }
.ch--dark .eyebrow { color: var(--gold-hi); }
.ch--dark h2 { color: var(--ivory) !important; }
.ch--dark h2 em { color: var(--gold-hi) !important; }
.ch--dark .body { color: var(--ivory-soft); }

/* hero */
.mark { position: absolute; left: 0; right: 0; bottom: 6vh; text-align: center; }
.wordmark {
  display: inline-block; position: relative;
  font-family: var(--fh); font-weight: 500; color: var(--olive);
  font-size: clamp(54px, 8.6vw, 128px); line-height: 1; letter-spacing: .17em; margin: 0 -.17em 0 0;
}
.wordmark__a { position: relative; display: inline-block; }
.swash {
  position: absolute; left: -.12em; top: .40em; width: 1.02em; height: .51em;
  fill: var(--gold); overflow: visible; filter: drop-shadow(0 0 3px rgba(232, 203, 134, .6));
}
.tagline {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  margin: 14px 0 0; font-family: var(--fh); font-weight: 500; color: #9C7A3A;
  font-size: clamp(17px, 2vw, 26px); letter-spacing: .2em;
}
.tagline span { display: block; width: clamp(40px, 7vw, 110px); height: 1px; background: var(--gold); }
.cue {
  position: absolute; left: clamp(16px, 3vw, 40px); bottom: 28px; margin: 0;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft); writing-mode: vertical-rl;
}
.cue::after { content: ""; display: block; width: 1px; height: 46px; margin: 12px auto 0; background: var(--gold); }

/* side text chapters */
.ch--side {
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding: 0 0 0 clamp(16px, 7vw, 120px); transform: translateY(var(--ty, 0));
}
.ch--side::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: min(60vw, 820px); z-index: -1;
  background: radial-gradient(70% 55% at 22% 50%, rgba(244, 239, 227, .55), transparent 70%);
}
.ch--side.ch--dark::before { background: radial-gradient(70% 55% at 22% 50%, rgba(20, 25, 18, .62), transparent 72%); }
.ch--side h2 { font-size: clamp(42px, 5vw, 76px); line-height: 1.02; color: var(--olive); }
.ch--side h2 em { color: var(--gold-ink); }
.ch--side .body { max-width: 25em; }

/* the name */
.ch--name {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 0 16px 9vh; text-align: center; transform: translateY(var(--ty, 0));
}
.ch--name h2 { font-size: clamp(38px, 4.6vw, 68px); line-height: 1.04; color: var(--olive); }
.ch--name h2 em { color: var(--gold-ink); }

/* the bay */
.ch--bay {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 16px;
  padding: 0 0 9vh clamp(16px, 7vw, 120px); transform: translateY(var(--ty, 0));
}
.ch--bay::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52vh; z-index: -1;
  background: linear-gradient(0deg, rgba(244, 239, 227, .82), rgba(244, 239, 227, .5) 45%, transparent);
}
.ch--bay h2 { font-size: clamp(44px, 5.4vw, 82px); line-height: 1; color: var(--olive); }
.ch--bay h2 em { color: var(--gold-ink); }
.ch--bay .body { max-width: 30em; color: rgba(20, 25, 18, .8); }

/* area labels */
.labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.label {
  position: absolute; left: 0; top: 0; opacity: 0; text-align: center; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; gap: 4px; will-change: transform, opacity;
}
.label__kicker { font-size: 10px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-ink); }
.label__name { font-family: var(--fh); font-style: italic; font-size: clamp(26px, 2.6vw, 38px); line-height: 1; color: var(--ink); text-shadow: 0 0 18px rgba(244, 239, 227, .9), 0 0 4px rgba(244, 239, 227, .8); }
.label__stem { display: block; width: 1px; height: 46px; background: linear-gradient(180deg, var(--gold), rgba(201, 164, 92, 0)); margin-top: 4px; }
.label__stem::after { content: ""; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin: 44px 0 0 -2px; box-shadow: 0 0 8px rgba(232, 203, 134, .9); }

/* services */
.ch--svc {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 22px;
  padding: 0 0 0 clamp(16px, 7vw, 120px); transform: translateY(var(--ty, 0));
}
.ch--svc::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 52vw; z-index: -1;
  background: linear-gradient(90deg, rgba(20, 25, 18, .55), transparent);
}
.svc__swap { display: flex; flex-direction: column; gap: 16px; min-height: 9.5em; justify-content: flex-start; }
.ch--svc h2 { font-size: clamp(38px, 4.2vw, 62px); line-height: 1.04; max-width: 8em; }
.ch--svc .body { max-width: 22em; }
.svc__track { display: block; width: 180px; height: 1px; background: rgba(232, 203, 134, .25); }
.svc__bar { display: block; height: 100%; width: 0; background: var(--gold-hi); }

/* finale: photo chapters in tall gold frames */
.ch--photo { overflow: hidden; }
.photo__grid {
  position: relative; height: 100%;
  display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: clamp(24px, 6vw, 110px);
  padding: 68px clamp(56px, 8vw, 140px) 0 clamp(16px, 7vw, 120px);
}
.ch--flip .photo__grid { grid-template-columns: 1.05fr 1fr; }
.ch--flip .panel { order: 2; }
.photo__text { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.photo__text > * { opacity: var(--e, 0); transform: translateY(calc((1 - var(--e, 0)) * 26px - var(--x, 0) * 20px)); }
.photo__text > *:last-child { opacity: calc(var(--e, 0) - var(--x, 0)); }
.photo__text h2 { font-size: clamp(38px, 4.5vw, 70px); line-height: 1.03; color: var(--olive); }
.photo__text h2 em { color: var(--gold-ink); }
.photo__text .eyebrow, .photo__text h2 { opacity: calc(var(--e, 0) - var(--x, 0)); }
.panel {
  --dir: 1;
  position: relative; margin: 0; justify-self: center;
  height: min(72vh, 640px); aspect-ratio: 3 / 4.1;
  transform-style: preserve-3d;
  transform:
    perspective(1500px)
    translateY(calc((1 - var(--e, 0)) * 16vh - var(--x, 0) * 10vh))
    rotateY(calc(((1 - var(--e, 0)) * 32deg - var(--x, 0) * 16deg) * var(--dir)))
    rotateX(calc((1 - var(--e, 0)) * 9deg - var(--x, 0) * 4deg))
    scale(calc(.9 + var(--e, 0) * .1));
  opacity: calc(var(--e, 0) * 1.4 - var(--x, 0));
  box-shadow: 0 50px 90px -40px rgba(60, 45, 15, .55);
}
.ch--flip .panel { --dir: -1; }
.panel::before { content: ""; position: absolute; inset: -14px; border: 1px solid rgba(201, 164, 92, .55); pointer-events: none; }
.panel::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--gold); pointer-events: none; }
.panel__img { position: absolute; inset: 0; overflow: hidden; background: #2a2418; }
.panel__img img {
  position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover; display: block;
  transform: translateY(calc((var(--k, 0) - .5) * -9%)) scale(calc(1.04 + var(--k, 0) * .14));
  filter: saturate(.92) contrast(1.04);
}
.panel__img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(30, 24, 12, .45)); }
.panel__sweep { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.panel__sweep::after {
  content: ""; position: absolute; top: -30%; left: -70%; width: 55%; height: 160%;
  background: linear-gradient(90deg, transparent, rgba(232, 203, 134, .10) 35%, rgba(255, 240, 205, .75) 50%, rgba(232, 203, 134, .10) 65%, transparent);
  mix-blend-mode: screen; transform: translateX(calc(var(--s, 0) * 330%)) rotate(18deg);
}

/* promises + CTA */
.ch--promise {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: 80px clamp(56px, 7vw, 110px) 40px; text-align: center;
}
.ch--promise h2 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.05; color: var(--olive); }
.ch--promise h2 em { color: var(--gold-ink); }
.cards {
  list-style: none; margin: 8px 0 0; padding: 0; width: 100%; max-width: 1180px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: left;
}
.card {
  position: relative; padding: 28px 24px 30px;
  border: 1px solid rgba(201, 164, 92, .6);
  background: linear-gradient(180deg, rgba(255, 252, 244, .75), rgba(244, 239, 227, .4));
  opacity: var(--c, 0); transform: translateY(calc((1 - var(--c, 0)) * 36px));
}
.card::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-hi), var(--gold)); }
.card__n { display: block; font-family: var(--fh); font-style: italic; font-size: 26px; color: var(--gold); margin-bottom: 18px; }
.card h3 { font-size: 25px; line-height: 1.12; color: var(--olive); margin-bottom: 12px; font-weight: 500; }
.card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.cta { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; opacity: var(--c5, 0); transform: translateY(calc((1 - var(--c5, 0)) * 20px)); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .bar { height: 58px; }
  .bar__logo { font-size: 19px; letter-spacing: .28em; }
  .bar__link { display: none; }
  .rail { right: 8px; gap: 8px; }
  .rail__list { gap: 12px; }
  .rail__n { font-size: 12px; min-width: 16px; }
  .mark { bottom: 8vh; }
  .wordmark { font-size: 15vw; letter-spacing: .14em; margin-right: -.14em; }
  .cue { display: none; }
  .eyebrow { font-size: 10px; letter-spacing: .2em; }
  .eyebrow span { width: 26px; }
  .ch--side { justify-content: flex-start; padding: 15vh 44px 0 20px; gap: 14px; }
  .ch--side::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: min(60vw, 820px); z-index: -1;
  background: radial-gradient(70% 55% at 22% 50%, rgba(244, 239, 227, .55), transparent 70%);
}
.ch--side.ch--dark::before { background: radial-gradient(70% 55% at 22% 50%, rgba(20, 25, 18, .62), transparent 72%); }
.ch--side h2 { font-size: 38px; }
  .ch--side .body { font-size: 14px; }
  .ch--name { padding-bottom: 12vh; }
  .ch--name h2 { font-size: 36px; }
  .ch--bay { padding: 0 44px 7vh 20px; }
  .ch--bay h2 { font-size: 46px; }
  .ch--bay .body { font-size: 14px; }
  .label__name { font-size: 24px; }
  .label__stem { height: 30px; }
  .label__stem::after { margin-top: 28px; }
  .ch--svc { justify-content: flex-start; padding: 13vh 44px 0 20px; gap: 14px; }
  .ch--svc::before { width: 100%; height: 50vh; inset: 0 0 auto 0; background: linear-gradient(180deg, rgba(20, 25, 18, .7), transparent); }
  .ch--svc h2 { font-size: 36px; }
  .svc__swap { min-height: 7.5em; gap: 10px; }
  .photo__grid, .ch--flip .photo__grid { grid-template-columns: 1fr; align-content: start; gap: 30px; padding: 84px 40px 0 20px; }
  .panel, .ch--flip .panel { order: -1; height: 42vh; width: calc(100vw - 80px); aspect-ratio: auto; }
  .panel::before { inset: -8px; }
  .photo__text { gap: 14px; }
  .photo__text h2 { font-size: 34px; }
  .photo__text .body { font-size: 13.5px; line-height: 1.6; }
  .ch--promise { justify-content: flex-start; gap: 16px; padding: 72px 36px 24px 16px; }
  .ch--promise h2 { font-size: 29px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px 13px 16px; }
  .card__n { font-size: 18px; margin-bottom: 6px; }
  .card h3 { font-size: 18px; margin-bottom: 6px; }
  .card p { font-size: 12px; line-height: 1.45; }
  .cta { flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
  .cta .pill { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transform: none; }
  .panel__img img { transform: scale(1.06); }
  .sweep__glint { display: none; }
  .bar, .rail, .rail__n { transition: none; }
}
.bar { transition: background-color .5s ease, color .5s ease, border-color .5s ease; }
