/*
 * Site design layer: spinning collection cards on the homepage and one page per stone with the
 * scroll-driven journey on top. Loaded on the homepage and stone pages after the live preview
 * styles, before site.css.
 */

/* ---- homepage first fold: headline + spinning cards (sized so the first row fits a laptop screen) */
.stone-cards { padding: 128px 7% 72px; background: #000; }
.stone-cards-heading { margin-bottom: 34px; }
.stone-cards-heading h1 { font: 400 clamp(40px, 4vw, 62px)/1.02 var(--serif); letter-spacing: -.03em; margin: 0; }
.stone-cards-heading h1 em { color: #b8c4b7; }
.stone-cards .collection-grid { gap: 22px; }
.stone-cards .collection-grid .card-visual { background: #000; aspect-ratio: 1.55; }
.stone-cards .card-film { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stone-cards .card-bottom { display: block; margin-top: 16px; }
.stone-cards .card-bottom > span { display: block; margin-top: 6px; font-size: 13px !important; letter-spacing: .14em; }
.stone-cards .card-bottom h2 { font: 400 clamp(22px, 2vw, 30px)/1.15 var(--serif); letter-spacing: -.01em; margin: 0; }
.stone-cards .gem-card > p { font-size: 15px !important; line-height: 1.6; margin-top: 6px; }
.stone-cards .gem-card:hover .card-film { filter: brightness(1.08); }
@media (max-height: 820px) and (min-width: 701px) {
  .stone-cards { padding-top: 116px; }
  .stone-cards .collection-grid .card-visual { aspect-ratio: 1.75; }
}
@media (max-width: 700px) {
  .stone-cards { padding: 108px 6% 56px; }
  .stone-cards-heading { display: block; margin-bottom: 24px; }
  .stone-cards-heading h1 { font-size: 40px; }
  .stone-cards-heading > p { display: block; margin-top: 10px; }
  .stone-cards .collection-grid { grid-template-columns: 1fr; gap: 34px; }
  .stone-cards .collection-grid .card-visual { aspect-ratio: 1.45; }
  .stone-cards .card-bottom h2 { font-size: 26px; }
}

/* ---- "A spectrum of possibility": gallery button + master grading set (no tabs) ---------- */
.home-cards .collections-explore { border-top: 1px solid var(--line); }
.collections-explore .section-heading { margin-bottom: 40px; }
.collections-explore .explore-text { font-size: 16px; color: #8f998d; margin-top: 18px; max-width: 520px; }
.collections-explore .gallery-open { margin-top: 26px; min-height: 54px; padding: 14px 30px; font-size: 17px; }
.explore-grading .grading-layout { padding-top: 10px; }

/* ---- full-screen gallery viewer ------------------------------------------------------------- */
dialog.gallery-viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--gv-bg, #050505); transition: background .4s; overflow: hidden; }
.gallery-viewer::backdrop { background: #000; }
.gv-top { display: flex; align-items: center; gap: 28px; padding: 18px 4vw; border-bottom: 1px solid #ffffff14; background: #000c; }
.gv-top .eyebrow { color: var(--gold); white-space: nowrap; font-size: 14px !important; }
.gv-filters { display: flex; gap: 8px 22px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.gv-filters button { white-space: nowrap; color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent; }
.gv-filters button[aria-pressed="true"] { color: var(--ink); border-color: var(--gold); }
.gv-close { width: 44px; height: 44px; font-size: 20px; flex: none; }
.gv-stage { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; min-height: 0; padding: 14px 2vw; }
.gv-stage figure { margin: 0; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.gv-image { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.gv-stage figcaption { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; justify-content: center; padding-top: 12px; font-size: 15px; color: #b9bab1; }
.gv-stage figcaption .gv-count { color: var(--muted); }
.gv-stage figcaption .text-link { padding: 4px 0; }
.gv-prev, .gv-next { width: 48px; height: 48px; border: 1px solid #ffffff30; border-radius: 50%; font-size: 20px; justify-self: center; background: #0008; }
.gv-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 4vw 16px; background: #000c; border-top: 1px solid #ffffff14; scroll-snap-type: x proximity; scrollbar-color: #555 transparent; }
.gv-thumb { flex: 0 0 auto; width: 112px; height: 76px; padding: 0; border: 1px solid transparent; opacity: .6; scroll-snap-align: center; transition: opacity .2s, border-color .2s; }
.gv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-thumb:hover { opacity: .9; }
.gv-thumb[aria-selected="true"] { opacity: 1; border-color: var(--gold); }
@media (max-width: 700px) {
  .gv-top { gap: 12px; padding: 10px 4vw; }
  .gv-top .eyebrow { display: none; }
  .gv-stage { grid-template-columns: minmax(0, 1fr); padding: 8px 0; }
  .gv-prev, .gv-next { position: absolute; top: 45%; z-index: 2; }
  .gv-prev { left: 8px; } .gv-next { right: 8px; }
  .gv-thumb { width: 84px; height: 58px; }
}

/* ---- card → stone page transition ------------------------------------------------------
   Browsers cross-fade the two snapshots with an additive blend by default, which blew the
   bright facets out to white mid-flight. Use a normal blend and keep the stone's proportions. */
html { background: #000; }
.stone-cards .card-film, .stone-page-journey .scroll-journey .render-stage { view-transition-class: stone; }
::view-transition-old(*), ::view-transition-new(*) { mix-blend-mode: normal; }
::view-transition-old(*.stone), ::view-transition-new(*.stone) { width: 100%; height: 100%; object-fit: contain; }
::view-transition-old(*.stone) { animation-duration: .25s; }
::view-transition-new(*.stone) { animation-duration: .45s; }

/* ---- stone page: scroll-driven journey under a sticky section bar --------------------------
   The section is one screen plus a band of scroll per chapter; its stage is pinned below the bar.
   --dl-header-h / --dl-subnav-h are measured by stone-journey.js. */
.stone-page-journey main { padding-top: 0; }
.stone-page-journey .scroll-journey.integrated-journey { height: calc(100svh + var(--chapters, 6) * 62svh); min-height: 0; touch-action: auto; }
.stone-page-journey .scroll-journey .journey-sticky { position: sticky; top: var(--dl-subnav-h, 58px); height: calc(100svh - var(--dl-subnav-h, 58px)); min-height: 520px; overflow: hidden; touch-action: auto; grid-template-rows: auto minmax(240px, 1fr) auto auto auto auto; }
.scroll-journey .render-stage { touch-action: auto; cursor: default; }
.scroll-journey .render-stage:active { cursor: default; }
.scroll-journey .journey-top h1.eyebrow { font: 500 16px/1.8 var(--sans); letter-spacing: .2em; color: #929c8f; margin: 0; }
.scroll-journey #film-poster, .scroll-journey .render-stage img.hold-layer { position: absolute; object-fit: contain; pointer-events: none; }
.scroll-journey #film-poster[hidden] { display: none; }
.scroll-journey .render-stage img.hold-layer {
  width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); left: 50%; top: 50%; transform: translate(-50%, -50%); background: #000;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}
.scroll-journey .journey-text { will-change: opacity, transform; }
.scroll-journey #journey-skip { display: inline-flex; margin: 22px 0 12px; pointer-events: auto; font-weight: 600; }
.scroll-journey #journey-enquire { display: inline-flex; margin-left: 22px; pointer-events: auto; }
.scroll-journey .journey-hint { grid-column: 1; grid-row: 4; justify-self: start; text-align: left; margin: 0; font-size: 15px; letter-spacing: .08em; color: #8f978c; transition: opacity .4s; }
.scroll-journey .journey-hint span { display: inline-block; margin-left: 6px; animation: dl-nudge 1.8s ease-in-out infinite; }
.scroll-journey .journey-hint.is-gone { opacity: 0; }
@keyframes dl-nudge { 50% { transform: translateY(4px); } }
.scroll-journey .journey-progress { grid-column: 1 / -1; grid-row: 6; height: 1px; background: #ffffff1c; }
.scroll-journey .journey-progress i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }

/* Section bar: sticky at the very top while the journey fills the screen (header hidden),
   then just below the header. */
.stone-page-journey .stone-subnav { position: sticky; top: 0; z-index: 31; display: flex; align-items: center; gap: 40px; padding: 0 6%; background: #000; border-bottom: 1px solid #ffffff1f; border-top: 0; overflow: visible; white-space: nowrap; }
.stone-page-journey .stone-subnav .subnav-links { display: flex; gap: 34px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stone-page-journey .stone-subnav .label-short { display: none; }
.stone-page-journey .stone-subnav .subnav-back { color: var(--ink); font-size: 15px; letter-spacing: .04em; text-transform: none; padding: 18px 24px 17px 0; border-right: 1px solid #ffffff1f; }
.stone-page-journey .stone-subnav .subnav-back span { display: inline-block; transition: transform .2s; }
.stone-page-journey .stone-subnav .subnav-back:hover span { transform: translateX(-3px); }
.stone-page-journey .stone-subnav .subnav-enquire { flex: none; min-height: 40px; padding: 8px 20px; font-size: 15px; font-weight: 700; letter-spacing: .02em; transition: opacity .3s, visibility .3s; }

.stone-page-journey .stone-subnav .subnav-links a { position: relative; padding: 18px 0 17px; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: #8c8f87; white-space: nowrap; }
.stone-page-journey .stone-subnav a:hover { color: var(--ink); }
.stone-page-journey .stone-subnav a[aria-current] { color: var(--ink); }
.stone-page-journey .stone-subnav a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); }
html:has(body.stone-page-journey) { scroll-padding-top: 0; } /* offsets come from scroll-margin below */
.stone-page-journey #stone-overview { scroll-margin-top: 0; }
.stone-page-journey #stone-gallery, .stone-page-journey .stone-section { scroll-margin-top: calc(var(--dl-subnav-h, 58px) - 1px); }

/* Stone pages have no logo header: the section bar (Back · sections · Enquire) is the page's only
   bar and stays at the top throughout, so the floating contact bar isn't needed either.
   (stone-journey.js measures the header as 0, so offsets and scroll-margins follow.) */
.stone-page-journey .stone-contact-bar { display: none; }
/* The header itself is kept only for its menu panel, which the bar's ☰ button opens as a drawer
   over the top of everything (bar included). */
.stone-page-journey .header { position: fixed; top: 0; left: 0; right: 0; height: 0; min-height: 0; padding: 0; border: 0; background: none; display: block; z-index: 60; overflow: visible; }
.stone-page-journey .header > :not(nav) { display: none; }
.stone-page-journey .header nav { position: fixed; top: 0; right: 0; left: auto; bottom: 0; width: min(420px, 100vw); max-height: none; height: 100dvh; padding: 76px 36px 36px; gap: 4px; background: #0b0d0b; border: 0; border-left: 1px solid #ffffff1f; overflow-y: auto; }
.stone-page-journey .header nav a { padding: 12px 0; font-size: 17px; border-bottom: 1px solid #ffffff12; }
.stone-page-journey .header nav a.menu-enquiry { margin-top: 18px; padding: 12px 18px; border: 0; }
.stone-page-journey .header.menu-open::before { content: ''; position: fixed; inset: 0; background: #000b; }
.menu-close { display: none; }
.stone-page-journey .menu-close { display: block; position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; font-size: 20px; color: var(--ink); }
body.stone-page-journey.menu-is-open { overflow: hidden; }
.stone-page-journey .subnav-menu { position: relative; flex: none; width: 40px; height: 40px; margin-left: -22px; color: #e1d9c9; }
.stone-page-journey .subnav-menu i { position: absolute; left: 9px; right: 9px; height: 1px; background: currentColor; }
.stone-page-journey .subnav-menu i:first-child { top: 16px; } .stone-page-journey .subnav-menu i:last-child { top: 24px; }
.stone-page-journey .subnav-menu:focus-visible, .stone-page-journey .menu-close:focus-visible { outline: 1px solid #d3c5a7; outline-offset: 2px; }

@media (max-width: 700px) {
  /* The stone title is the page's H1: keep it visible on phones, on its own line. */
  .scroll-journey .journey-top { flex-wrap: wrap; }
  .scroll-journey .journey-top #selected-stone { display: block; order: 3; flex-basis: 100%; text-align: center; font-size: 12px !important; letter-spacing: .14em; line-height: 1.4; margin-top: -4px; }
  .scroll-journey #journey-skip { margin: 12px 0 8px; padding: 10px 16px; }
  .scroll-journey #journey-enquire { margin-left: 18px; }
  .stone-page-journey .scroll-journey .journey-sticky { grid-template-rows: auto auto minmax(200px, 1fr) auto auto auto auto; align-content: stretch; overscroll-behavior: auto; }
  .stone-page-journey .scroll-journey .render-stage, .stone-page-journey .scroll-journey.showing-science .render-stage, .stone-page-journey .scroll-journey.showing-colours .render-stage { height: auto; min-height: 200px; }
  .scroll-journey .journey-hint { font-size: 13px; text-align: center; grid-column: 1; grid-row: 4; justify-self: center; }
  .scroll-journey .journey-progress { grid-column: 1; grid-row: 7; }
  .stone-page-journey .stone-subnav { gap: 6px; padding: 0 3%; }
  .stone-page-journey .stone-subnav .subnav-links { gap: 9px; -webkit-mask-image: linear-gradient(to left, transparent, #000 14px); mask-image: linear-gradient(to left, transparent, #000 14px); padding-right: 2px; }
  .stone-page-journey .stone-subnav .subnav-links a { font-size: 12.5px; letter-spacing: 0; text-transform: none; padding: 15px 0 14px; }
  .stone-page-journey .stone-subnav .label-long { display: none; }
  .stone-page-journey .stone-subnav .label-short { display: inline; }
  .stone-page-journey .stone-subnav .subnav-back { font-size: 0; padding: 12px 8px 12px 0; }
  .stone-page-journey .stone-subnav .subnav-back span { font-size: 18px; }
  .stone-page-journey .stone-subnav .subnav-enquire { min-height: 34px; padding: 6px 9px; font-size: 13px; }
  .stone-page-journey .stone-subnav .subnav-enquire span { display: none; }
  .stone-page-journey .subnav-menu { margin-left: 0; width: 34px; }
  .stone-page-journey .subnav-menu i { left: 8px; right: 8px; }
  .stone-page-journey .header nav { padding: 68px 24px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .stone-page-journey .stone-subnav { transition: none; }
  .scroll-journey .journey-hint span { animation: none; }
}
@media (max-width: 375px) {
  .stone-page-journey .stone-subnav .subnav-links { gap: 7px; }
  .stone-page-journey .stone-subnav .subnav-links a { font-size: 11.5px; }
}
