/* ==========================================================================
   QVINTO — award build layer
   Additions only. Palette, type and register are inherited from
   homepage.css and Qvinto.css; nothing here invents a colour or a font.
   ========================================================================== */

/* ==========================================================================
   ENTRY — the Maison opens
   Static markup, but display-gated behind html.lzbg (set only when JS
   runs), so a no-JS visit never sees a curtain it cannot lift. GSAP
   removes the element entirely when the entrance completes; the non-award
   path removes it immediately.
   ========================================================================== */
.q-loader { display: none; }
html.lzbg .q-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #060706;
}
.q-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.9rem;
}
.q-loader__mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(3.6rem, 7vw, 5.6rem);
  line-height: 1;
  color: var(--gold-soft);
}
.q-loader__bar {
  position: relative;
  width: 148px;
  height: 1px;
  background: rgba(236, 230, 216, 0.14);
  overflow: hidden;
}
.q-loader__bar i {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--gold-deep), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
}
.q-loader__caption {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (prefers-reduced-motion: reduce) {
  html.lzbg .q-loader { display: none; }
}

/* ---- Hero video ----
   Sits above the WebGL layer and the photograph; fades in only once it is
   actually playing. Autoplay refused, video missing, reduced motion — the
   gem-lit still beneath simply remains. 720p source for now; the grain and
   vignette overlays flatter it at display size. */
.qhero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
}
.qhero__video.is-playing { opacity: 1; }

/* Hero media controls: the shared v-hero-media component (hero-media.css).
   Qvinto's values ARE that component's defaults, so this page sets no overrides. */

/* ---- Kinetic interlude — the hero line drifts past, ghosted ---- */
.q-kinetic {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4.5rem, 11vh, 8.5rem);
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}
.q-kinetic__track {
  display: inline-flex;
  align-items: baseline;
  gap: 3.2vw;
  white-space: nowrap;
  will-change: transform;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.9rem, 4.2vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: rgba(203, 183, 131, 0.17);
}
.q-kinetic__dot {
  font-size: 0.35em;
  color: rgba(46, 168, 130, 0.4);
}

/* ---- Pinned chapters need full-height stages ---- */
html.award .q-boutique { min-height: 100svh; }
html.award .q-legacy {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}
html.award .q-legacy .container { width: 100%; }
html.award .q-boutique__media {
  will-change: transform;
  transform-origin: 50% 42%;
}

/* ---- Hero WebGL light layer ----
   Sits inside .qhero__scene, above the photograph it was cut from and
   beneath the scrim. Fades in only once the first frame has rendered, so
   a machine without WebGL never knows it existed. */
.qhero__gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.8s ease;
  pointer-events: none;
}
.qhero__gl.is-live { opacity: 1; }

/* ---- Lazy heavy backgrounds ----
   html.lzbg is set inline in <head> only when JS is running. Until a
   plate is near the viewport its multi-megabyte texture stays unfetched;
   the veils and base colours beneath keep every word legible meanwhile. */
html.lzbg .q-marble__bg:not(.bg-in),
html.lzbg .q-origin__bleed:not(.bg-in) {
  background-image: none !important;
}
.q-marble__bg,
.q-origin__bleed {
  transition: opacity 1.2s ease;
}
html.lzbg .q-marble__bg:not(.bg-in) { opacity: 0; }
html.lzbg .q-marble__bg.bg-in { opacity: 1; }

/* ---- Masked line rises (award mode only) ----
   The same overflow-hidden treatment as the house .reveal-line, with room
   for italic descenders. Initial offsets are set from JS so that without
   GSAP the markup renders exactly as before. */
html.award .awl {
  display: block;
  overflow: hidden;
  /* line-height on the hero title is 0.96, so the line box sits inside the em
     box and clips ascenders (the italic Q swash, the dot of the i). Pad the
     top and pull it back with a negative margin: the box grows upward only,
     so letters waiting below the baseline stay hidden. */
  padding: 0.24em 0.06em 0.14em;
  margin: -0.24em -0.06em -0.14em;
}
html.award .awl__in {
  display: block;
  will-change: transform;
}
html.award .awc {
  display: inline-block;
  will-change: transform;
  transform-origin: 50% 100%;
}

/* GSAP owns transform on the gem-lit figures in award mode; the CSS
   transform transition would otherwise smear every scrubbed frame. The
   magnetic drift eases itself in JS, so nothing is lost. */
html.award .q-figure {
  transition: box-shadow 0.85s var(--ease-out), border-color 0.85s var(--ease-out);
}

/* Origin figure opens from a clipped frame — promote cheap compositing */
html.award .q-origin .q-figure { will-change: clip-path, transform; }
html.award .q-origin .q-figure__bg { will-change: transform; }

/* Plates: the inner slot is overscaled slightly so its slow drift never
   reveals an edge. Overflow is already hidden by .q-figure. */
html.award .q-plate image-slot { will-change: transform; }

/* ---- Lapidary reel: counter and progress hairline ---- */
.q-reel__meta {
  position: absolute;
  left: 1.35rem;
  bottom: 1.2rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  pointer-events: none;
}
.q-reel__count {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  color: rgba(236, 230, 216, 0.62);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}
.q-reel__count em {
  font-style: normal;
  color: var(--gold-soft);
}
.q-reel__bar {
  position: relative;
  width: 62px;
  height: 1px;
  background: rgba(236, 230, 216, 0.16);
  overflow: hidden;
}
.q-reel__bar i {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--gold), var(--gold-soft));
  transform: scaleX(0);
  transform-origin: left center;
}
.q-reel__bar.run i {
  transform: scaleX(1);
  transition: transform var(--reel-delay, 5000ms) linear;
}

/* ==========================================================================
   THE COLLECTIONS VIEWER
   A plate opens, shared-element style, into a full-screen viewing state:
   one piece at a time on a deep emerald ground. Every colour below is
   sampled from the existing sheets.
   ========================================================================== */

/* The invitation: the whole plate is a button; a quiet mono cue appears */
.q-plate__open {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1.15rem 1.25rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.q-plate__open:focus-visible {
  outline: 1px solid var(--emerald-line);
  outline-offset: -1px;
}
.q-plate__cue {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(236, 230, 216, 0.72);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.q-plate__open:hover .q-plate__cue,
.q-plate__open:focus-visible .q-plate__cue {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .q-plate__cue { opacity: 1; transform: none; }
}

/* The lapidary reel carries the same invitation, bottom-right so the
   progress hairline keeps the bottom-left. Arrows sit above it. */
.q-reel__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1.15rem 1.25rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.q-reel__open:focus-visible {
  outline: 1px solid var(--emerald-line);
  outline-offset: -1px;
}
.q-reel__open:hover .q-plate__cue,
.q-reel__open:focus-visible .q-plate__cue {
  opacity: 1;
  transform: none;
}

/* The room */
.q-viewer {
  position: fixed;
  inset: 0;
  z-index: 9000;
}
.q-viewer[hidden] { display: none; }
.q-viewer__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 28%, rgba(46, 168, 130, 0.10), transparent 62%),
    radial-gradient(135% 130% at 50% 40%, #0A231A 0%, #060D0A 58%, #050807 100%);
}
/* CSS drives the veil only when GSAP does not */
html:not(.award) .q-viewer__veil {
  opacity: 0;
  transition: opacity 0.6s ease;
}
html:not(.award) .q-viewer.is-open .q-viewer__veil { opacity: 1; }

.q-viewer__stage {
  position: absolute;
  inset: clamp(3.2rem, 8vh, 5.5rem) clamp(4.5rem, 10vw, 10rem);
  margin: 0;
  opacity: 0;
  transition: opacity 0.6s ease 0.05s;
  pointer-events: none;
}
.q-viewer.is-open .q-viewer__stage { opacity: 1; }
.q-viewer__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 0.85s var(--ease-out), transform 1s var(--ease-out);
}
.q-viewer__img.is-active { opacity: 1; transform: none; }

/* Transient morph element */
.q-viewer__ghost {
  position: fixed;
  z-index: 4;
  object-fit: cover;
  pointer-events: none;
}

.q-viewer__close {
  position: absolute;
  top: clamp(1.4rem, 3.5vh, 2.2rem);
  right: var(--margin);
  z-index: 5;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(236, 230, 216, 0.35);
  padding: 0 0 0.35em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s ease 0.25s, color 0.4s ease, border-color 0.4s ease;
}
.q-viewer.is-open .q-viewer__close { opacity: 1; }
.q-viewer__close:hover,
.q-viewer__close:focus-visible {
  color: var(--emerald);
  border-color: var(--emerald-line);
}

.q-viewer__arrow {
  z-index: 5;
  transition-delay: 0.3s;
}
.q-viewer.is-open .q-viewer__arrow { opacity: 1; }
.q-viewer__arrow--prev { left: clamp(1rem, 3vw, 2.6rem); }
.q-viewer__arrow--next { right: clamp(1rem, 3vw, 2.6rem); }

.q-viewer__meta {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(1.3rem, 4vh, 2.4rem);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  opacity: 0;
  transition: opacity 0.5s ease 0.3s;
}
.q-viewer.is-open .q-viewer__meta { opacity: 1; }
.q-viewer .q-reel__bar { width: 92px; }

/* Pause control inside the viewer — same glass circle as the hero */
.q-viewer__pause { width: 34px; height: 34px; }
.q-viewer__pause .v-hero-media__ic--play { display: none; }
.q-viewer__pause[aria-pressed="false"] .v-hero-media__ic--pause { display: none; }
.q-viewer__pause[aria-pressed="false"] .v-hero-media__ic--play { display: block; }

/* Page cannot scroll behind the room */
html.q-viewer-open,
html.q-viewer-open body { overflow: hidden; }

@media (max-width: 680px) {
  .q-viewer__stage { inset: clamp(3rem, 7vh, 4rem) 1rem; }
  .q-viewer__arrow--prev { left: 0.6rem; }
  .q-viewer__arrow--next { right: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .qhero__gl { display: none; }
  .q-reel__bar { display: none; }
  .q-viewer__pause { display: none; }
  .q-viewer__img { transition: opacity 0.3s ease; transform: none; }
}

