/* Homepage intro: the ring builds itself on a dark ground, then the page brightens into the hero.
   Loaded only on "/". The scroll position drives --dawn (0 dark to 1 linen), --bg and --fg from intro.js. */
:root { --atelier: #141012; --champagne: #EDE3D6; --champagne-soft: #B8ABA1; --bg: var(--atelier); --fg: var(--champagne); --head-top: 0px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ---------- the site header floats over the intro ---------- */
html:not(.static) body.home-intro .site-head { position: fixed; left: 0; right: 0; top: var(--head-top); background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: background-color .4s, border-color .4s; }
html:not(.static) body.home-intro .site-head :is(nav.main a, .head-tools a, .head-tools button, .menu-btn) { color: var(--fg); }
html:not(.static) body.home-intro .menu-btn svg { stroke: currentColor; }
html:not(.static) body.home-intro .brand { transition: opacity .5s var(--ease); }
html:not(.static) body.home-intro .brand img { transition: filter .5s var(--ease); }
html:not(.static) body.home-intro.night .brand img { filter: brightness(0) invert(.92); }
html:not(.static) body.home-intro.hero-on .brand { opacity: 0; }
html:not(.static) body.home-intro.head-solid .site-head,
html:not(.static) body.home-intro .site-head:has(.mobile-nav[data-open="true"]) { background: rgba(244, 238, 231, .94); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom-color: var(--line); --fg: var(--ink-soft); }
html:not(.static) body.home-intro .site-head:has(.mobile-nav[data-open="true"]) .brand { opacity: 1; }
html:not(.static) body.home-intro .site-head:has(.mobile-nav[data-open="true"]) .brand img { filter: none; }

/* ---------- the pinned stage ---------- */
.intro { position: relative; height: 760vh; }
html:not(.static) body.home-intro .announce { position: relative; z-index: 21; }
html:not(.static) body.home-intro .intro { margin-top: calc(-1 * var(--ann-h, 0px)); }
.stage { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
#gl.on { opacity: 1; }
.stage::after { /* warm vignette and fine grain, dark phase only */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: calc(1 - var(--dawn, 0));
  background:
    radial-gradient(120% 90% at 60% 45%, transparent 45%, rgba(8, 5, 6, .55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stage ::selection { background: var(--blush); color: var(--ink); }

/* Chapter lines */
.chapters { position: absolute; left: var(--gutter); top: 50%; translate: 0 -50%; width: min(30rem, 36vw); height: 14rem; margin: 0; padding: 0; list-style: none; z-index: 2; }
.ch { position: absolute; inset: 50% 0 auto 0; translate: 0 -50%; opacity: 0; visibility: hidden; will-change: opacity, transform, filter; }
.ch:first-child { opacity: 1; visibility: visible; }
.ch h2 { color: var(--champagne); font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.6rem); line-height: 1.06; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
.ch p { color: var(--champagne-soft); font-size: clamp(1rem, .95rem + .3vw, 1.2rem); line-height: 1.6; max-width: 30ch; margin: 1rem 0 0; }

/* Progress rail: names the part being added */
.rail { position: absolute; right: var(--gutter); top: 50%; translate: 0 -50%; margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; z-index: 2; opacity: calc(1 - var(--dawn, 0)); }
.rail li { display: flex; align-items: center; justify-content: flex-end; gap: 14px; font-weight: 500; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in oklab, var(--champagne) 38%, transparent); transition: color .5s var(--ease); }
.rail li::after { content: ""; width: 40px; height: 1px; background: currentColor; transform: scaleX(.35); transform-origin: right; transition: transform .6s var(--ease); }
.rail li.done { color: color-mix(in oklab, var(--champagne) 62%, transparent); }
.rail li[aria-current="step"] { color: var(--blush); }
.rail li[aria-current="step"]::after { transform: none; }

/* Skip link: bottom right of the stage, gone once the hero is up */
.skip { position: absolute; right: var(--gutter); bottom: calc(env(safe-area-inset-bottom) + 28px); z-index: 3; color: var(--champagne); text-decoration: none; font: 500 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; padding: 12px 0; border-bottom: 1px solid color-mix(in oklab, currentColor 40%, transparent); opacity: calc(1 - var(--dawn, 0)); }
.skip:hover { border-bottom-color: currentColor; }
.skip:focus-visible { outline: 2px solid var(--blush); outline-offset: 4px; }

/* The hero the build lands in */
.hero-copy { position: absolute; left: var(--gutter); top: 50%; translate: 0 -50%; width: min(34rem, 44vw); z-index: 3; opacity: 0; }
.hero-copy .wordmark { width: clamp(200px, 24vw, 360px); height: auto; margin: 0 0 clamp(18px, 2.4vw, 32px) -6px; }
.hero-copy h1 { font-size: clamp(2.3rem, 1.6rem + 2.4vw, 3.8rem); line-height: 1.08; letter-spacing: -0.015em; color: var(--ink); margin: 0; text-wrap: balance; }
.hero-copy .sub { margin: 1.1rem 0 0; max-width: 36ch; color: var(--ink-soft); font-size: clamp(1.02rem, .98rem + .25vw, 1.18rem); }
.hero-copy .ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 3vw, 36px); }
.hero-copy .btn { white-space: nowrap; }
.hero-still { display: none; }

/* ---------- the real piece ---------- */
.ring-real .rr-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(36px, 7vw, 110px); align-items: center; }
.ring-real .rr-mat { display: block; background: var(--blush-t); padding: clamp(18px, 3vw, 40px); }
.ring-real .rr-mat img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.ring-real h2 { font-size: clamp(2rem, 1.5rem + 2vw, 3.2rem); line-height: 1.1; letter-spacing: -0.01em; max-width: 16ch; margin: 0; }
.ring-real .lead { margin-top: 1.2rem; max-width: 42ch; color: var(--ink-soft); font-size: clamp(1.05rem, 1rem + .3vw, 1.22rem); }
.ring-real .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 32px; margin: clamp(28px, 4vw, 44px) 0; padding-top: 24px; border-top: 1px solid var(--line); max-width: 30rem; }
.ring-real .facts div { display: grid; gap: 2px; }
.ring-real .facts dt { font-weight: 500; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose-deep); }
.ring-real .facts dd { margin: 0; color: var(--ink); }

/* Short landscape screens (a phone on its side): keep side by side, just smaller */
@media (max-height: 560px) and (orientation: landscape) {
  .ch h2 { font-size: 1.9rem; }
  .ch p { font-size: 0.95rem; margin-top: .5rem; }
  .hero-copy .wordmark { width: 130px; margin-bottom: 8px; }
  .hero-copy h1 { font-size: 1.8rem; }
  .hero-copy .sub { font-size: .95rem; margin-top: .5rem; }
  .hero-copy .ctas { margin-top: 16px; }
}
/* Phones upright: ring up top, words underneath */
@media (max-width: 767px) and (orientation: portrait) {
  .rail { display: none; }
  .chapters { left: 20px; right: 20px; top: auto; bottom: calc(env(safe-area-inset-bottom) + 12vh); translate: none; width: auto; height: 11rem; }
  .ch { inset: auto 0 0 0; translate: none; }
  .ch h2 { font-size: clamp(1.9rem, 1.4rem + 3vw, 2.4rem); }
  .ch p { font-size: 1rem; margin-top: .6rem; }
  .skip { right: auto; left: 20px; bottom: calc(env(safe-area-inset-bottom) + 18px); }
  .hero-copy { left: 20px; right: 20px; top: auto; bottom: calc(env(safe-area-inset-bottom) + 5vh); translate: none; width: auto; }
  .hero-copy .wordmark { width: 150px; margin-bottom: 14px; }
  .hero-copy h1 { font-size: 2.2rem; }
  .hero-copy .sub { font-size: 1rem; margin-top: .7rem; }
  .hero-copy .ctas { margin-top: 20px; }
  .hero-copy .ctas .btn { flex: 1 1 auto; padding-inline: 20px; }
}
@media (max-width: 860px) { .ring-real .rr-inner { grid-template-columns: 1fr; } }

/* Still version: reduced motion, no WebGL, or the 3D libraries failed to load */
html.static { --bg: var(--linen); --dawn: 1; }
html.static .intro { height: auto; }
html.static .stage { position: relative; height: auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 6vw, 96px); padding: clamp(40px, 6vw, 88px) var(--gutter); max-width: 1240px; margin-inline: auto; }
html.static .stage::after, html.static #gl, html.static .chapters, html.static .rail, html.static .skip { display: none; }
html.static .hero-copy { position: static; translate: none; width: auto; opacity: 1; }
html.static .hero-still { display: block; margin: 0; background: var(--blush-t); padding: clamp(18px, 3vw, 36px); }
html.static .hero-still img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
@media (max-width: 767px) { html.static .stage { grid-template-columns: 1fr; } html.static .hero-still { order: -1; } html.static .hero-still img { max-height: 44vh; } }
