/* Obsidian, film home (test page after the Ombra model). Same ink, bone and gold as the maison pages. */

/* ---------- the film: a pinned WebGL scene, words laid over it ---------- */
.film { position: relative; height: 760vh; }
.film__stick { position: sticky; top: 0; height: 100vh; overflow: hidden; }
#film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 2s var(--ease); }
#film.is-ready { opacity: 1; }
.film__veil { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(6,6,7,.75) 100%), linear-gradient(180deg, rgba(6,6,7,.55), transparent 22%, transparent 50%, rgba(6,6,7,.9)); }

.film__intro { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 22px; padding: 0 var(--pad); pointer-events: none; will-change: transform, opacity; }
.film__word { font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: .2em; margin-right: -.2em; font-size: clamp(54px, 11vw, 200px); line-height: .9; animation: wordIn 2.4s var(--slow) both .2s; }
.film__sub { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2vw, 30px); color: #cfcdc6; animation: wordIn 2.4s var(--slow) both .5s; }
.film__intro .eyebrow { animation: wordIn 2s var(--slow) both; }
.film__cue { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--mute); }
.film__cue::after { content: ""; display: block; width: 1px; height: 46px; margin: 14px auto 0; background: linear-gradient(var(--bone), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes wordIn { from { opacity: 0; transform: translateY(30px); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* a chapter: the caviar's name, very large, its tin, one line and the way in */
.ch { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; align-items: end; gap: 0 4vw; padding: 0 var(--pad) 16vh; opacity: 0; pointer-events: none; }
.ch.is-on { pointer-events: auto; }
.ch__n { position: absolute; top: 15vh; left: var(--pad); }
.ch__t { grid-column: 1; font-family: var(--serif); font-weight: 400; line-height: .86; margin: 0; transform: translate3d(0, calc(var(--d, 0) * -60px), 0); }
.ch__t span { display: block; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(56px, 12.5vw, 230px); }
.ch__t em { display: block; font-size: clamp(34px, 5.4vw, 98px); color: var(--gold); margin: .12em 0 0 .08em; letter-spacing: 0; }
.ch__tin { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: clamp(200px, 26vw, 440px);
  transform: translate3d(0, calc(var(--d, 0) * -120px), 0) rotate(calc(var(--d, 0) * -10deg)) scale(calc(1 - (var(--d, 0) * var(--d, 0)) * .08)); }
.ch__foot { grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px 40px; margin-top: 4vh; transform: translate3d(0, calc(var(--d, 0) * -30px), 0); }
.ch__line { font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.4vw, 21px); color: #d8d6cf; max-width: 26em; }
.ch__meta { font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--mute); display: flex; align-items: center; gap: 12px; }
.ch__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.film__rail { position: absolute; left: 0; right: 0; bottom: 30px; display: flex; justify-content: center; gap: clamp(16px, 3vw, 46px); opacity: 0; transition: opacity .8s var(--ease); }
.film.is-chapters .film__rail { opacity: 1; }
.film__rail button { font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); padding: 6px 0; border-bottom: 1px solid transparent; transition: color .5s, border-color .5s; }
.film__rail button span { color: inherit; }
.film__rail button.is-on, .film__rail button:hover { color: var(--bone); border-color: var(--gold); }

/* ---------- the art of serving: circles that open as you pass ---------- */
.rituals { padding: 18vh var(--pad) 10vh; }
.rituals__head { display: grid; gap: 22px; margin-bottom: 10vh; }
.rit { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6vw; min-height: 90vh; }
.rit--r .rit__c { order: 2; }
.rit__c { margin: 0; aspect-ratio: 1; width: min(100%, 620px); justify-self: center; overflow: hidden;
  clip-path: circle(calc(16% + min(calc(var(--p, 0) * 1.9), 1) * 34%) at 50% 50%); }
.rit__c img { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.35 - min(calc(var(--p, 0) * 1.9), 1) * .3)); }
.rit__txt { display: grid; gap: 22px; max-width: 30em; }
.rit__txt .t { font-style: italic; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .film { height: 680vh; }
  .ch { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-content: end; padding-bottom: 13vh; }
  .ch__tin { grid-column: 1; grid-row: 1; width: 62vw; justify-self: end; margin-bottom: 2vh; }
  .ch__t span { font-size: clamp(46px, 15vw, 90px); }
  .ch__foot { gap: 12px 24px; }
  .film__rail { display: none; }
  .film__veil { background: radial-gradient(120% 90% at 50% 40%, transparent 35%, rgba(6,6,7,.7) 100%), linear-gradient(180deg, rgba(6,6,7,.6), transparent 20%, transparent 38%, rgba(6,6,7,.92) 78%); }
  .rit, .rit--r { grid-template-columns: 1fr; min-height: auto; gap: 30px; margin-bottom: 12vh; }
  .rit--r .rit__c { order: 0; }
}
@media (prefers-reduced-motion: reduce) { .film__word, .film__sub, .film__intro .eyebrow { animation: none; } .film__cue::after { animation: none; } }

/* ---------- no WebGL (or the 3D library could not load): the chapters become a still page ---------- */
.film.is-static { height: auto; }
.film.is-static .film__stick { position: relative; height: auto; overflow: visible; }
.film.is-static #film, .film.is-static .film__rail, .film.is-static .film__cue { display: none; }
.film.is-static .film__veil { display: none; }
.film.is-static .film__intro { position: relative; min-height: 100vh; opacity: 1 !important; transform: none !important;
  background: linear-gradient(rgba(6,6,7,.55), rgba(6,6,7,.85)), url(../scenes/tins-on-ice.webp) center / cover; }
.film.is-static .ch { position: relative; inset: auto; opacity: 1 !important; pointer-events: auto; min-height: 80vh; padding: 14vh var(--pad); border-top: 1px solid var(--line); }
.film.is-static .ch__n { position: static; grid-column: 1; margin-bottom: 4vh; }
.film.is-static .ch > * { transform: none !important; }

/* ---------- gold lettering over the film, so the words stand out from the grains ---------- */
.film__word, .ch__t span, .ch__t em {
  background: linear-gradient(176deg, #fbecc4 0%, #e6c27a 32%, #b8893e 58%, #f1d796 78%, #a87b34 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.ch__t em { background: linear-gradient(176deg, #f6e2b0 0%, #d6b06a 50%, #b08440 100%); -webkit-background-clip: text; background-clip: text; }
.film__sub, .ch__line { color: #f0dcae; text-shadow: 0 1px 2px rgba(0,0,0,.8), 0 0 24px rgba(0,0,0,.7); }
.ch__meta, .ch__n, .film__intro .eyebrow { color: #d9bd83; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.ch .link { color: #f0dcae; background-image: linear-gradient(#c9a45c, #c9a45c); text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.film__rail button.is-on, .film__rail button:hover { color: #f0dcae; }
.film.is-static .ch__t span, .film.is-static .ch__t em, .film.is-static .film__word { filter: none; }
.ch__t, .ch__tin, .ch__foot, .film__intro { will-change: transform; }

/* lettering over the film: a soft dark halo painted once behind the words (no live filters, which cost a lot in Safari) */
.film__intro::before, .ch::before { content: ""; position: absolute; pointer-events: none; z-index: -1; }
.film__intro { isolation: isolate; }
.film__intro::before { left: 50%; top: 50%; width: min(1100px, 96vw); height: 60vh; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(6,6,7,.62), rgba(6,6,7,.25) 60%, transparent); }
.ch { isolation: isolate; }
.ch::before { left: 0; bottom: 0; width: 78%; height: 70%; background: radial-gradient(70% 60% at 25% 75%, rgba(6,6,7,.7), rgba(6,6,7,.3) 55%, transparent 85%); }
