/* Royal Crest Media — HQ tour (mobile-first). Builds on ../css/styles.css tokens. */

.tour-body { background: #050403; }

/* Header: always solid-ish over the 3D scene */
.tour-header__links { display: flex; align-items: center; gap: 1rem; position: relative; z-index: 2; }
.tour-header__room {
  display: none;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold);
}
.tour-header__back {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ivory); padding: 0.7rem 0.9rem; border: 1px solid var(--line);
  transition: border-color 0.3s, color 0.3s;
}
.tour-header__back:hover { border-color: var(--gold); color: var(--gold-bright); }

/* Stage */
.stage { position: fixed; inset: 0; z-index: 0; background: #050403; }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.stage__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to bottom, rgba(5, 4, 3, 0.45), transparent 18%, transparent 62%, rgba(5, 4, 3, 0.7));
}
.stage__fallback { position: absolute; inset: 0; }
.stage__fallback[hidden] { display: none; }
.still { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease); }
.still.is-active { opacity: 1; }
.still img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 8s linear; }
.still.is-active img { transform: scale(1); }

/* Loader */
.loader {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-content: center; justify-items: center; gap: 1.1rem;
  background: radial-gradient(ellipse at 50% 60%, #15110c, #050403 70%);
  transition: opacity 1.2s var(--ease), visibility 0s linear 1.2s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }  /* never block taps while fading out */
.loader__crest { width: 4rem; height: auto; filter: drop-shadow(0 0 18px rgba(240, 200, 120, 0.4)); animation: crest-pulse 2.4s ease-in-out infinite alternate; }
@keyframes crest-pulse { from { opacity: 0.65; } to { opacity: 1; } }
.loader__label { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--ivory); }
.loader__bar { width: min(16rem, 60vw); height: 1px; background: rgba(241, 235, 224, 0.15); overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--gold-grad); transform-origin: left; transform: scaleX(0); transition: transform 0.4s var(--ease); }

/* Chapters */
.tour { position: relative; z-index: 2; }
.chapter {
  min-height: 160vh; min-height: 160svh;
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  pointer-events: none;
}
.chapter:first-child { min-height: 130vh; min-height: 130svh; }
.chapter:last-child { min-height: 150vh; min-height: 150svh; }
.chapter__card {
  position: sticky; bottom: calc(1.25rem + env(safe-area-inset-bottom));
  width: 100%; max-width: 30rem;
  padding: 1.4rem 1.3rem 1.5rem;
  background: linear-gradient(160deg, rgba(14, 12, 10, 0.78), rgba(8, 7, 6, 0.62));
  -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--line);
  pointer-events: auto;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.chapter.is-active .chapter__card { opacity: 1; transform: none; }
.chapter__title {
  margin-top: 0.75rem;
  font-family: var(--serif); font-weight: 500; line-height: 1.02;
  font-size: clamp(2rem, 8.5vw, 3.4rem);
}
.chapter__title em { font-style: italic; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chapter__text { margin-top: 0.8rem; color: var(--ivory-dim); font-size: 0.97rem; }
.chapter__hint {
  display: flex; align-items: center; gap: 0.75rem; margin-top: 1.1rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--gold-bright);
}
.chapter__hint-line { width: 1px; height: 1.6rem; background: var(--gold-bright); animation: hint 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.chapter__actions { display: grid; gap: 0.65rem; margin-top: 1.25rem; }
.chapter__next { margin-top: 1rem; font-size: 0.8rem; color: rgba(184, 175, 161, 0.75); font-style: italic; }

/* Progress rail */
.rail {
  position: fixed; z-index: 3; right: 0.75rem; top: 50%; transform: translateY(-50%);
  display: grid; gap: 0.6rem; pointer-events: none;
}
.rail li { width: 2px; height: 1.6rem; background: rgba(241, 235, 224, 0.18); transition: background-color 0.5s, height 0.5s var(--ease); }
.rail li.is-active { background: var(--gold); height: 2.6rem; }

.tour-note {
  position: fixed; z-index: 3; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top) + 0.5rem);
  transform: translateX(-50%); max-width: calc(100% - 2rem);
  padding: 0.5rem 0.9rem; font-size: 0.78rem; color: var(--ivory-dim);
  background: rgba(8, 7, 6, 0.7); border: 1px solid var(--line);
}

@media (min-width: 640px) {
  .chapter__actions { display: flex; }
  .tour-header__room { display: inline; }
}
@media (min-width: 900px) {
  .chapter { padding-left: 4vw; align-items: center; }
  .chapter__card { position: sticky; top: 30vh; bottom: auto; padding: 2rem 2.1rem 2.2rem; }
  .rail { right: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .still img, .still.is-active img { transform: none; transition: none; }
  .loader__crest, .chapter__hint-line { animation: none; }
}

/* ------------------------------------------------------------------ Story cards (company narrative)
   Gold hairline + corner marks, numbered eyebrow, lines that rise in one after another, service tags. */
.chapter__card {
  border-color: rgba(212, 175, 105, 0.22);
  background: linear-gradient(165deg, rgba(16, 13, 10, 0.82), rgba(7, 6, 5, 0.66));
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.chapter__card::before {               /* gold hairline across the top */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 205, 135, 0.9) 30%, rgba(240, 205, 135, 0.9) 70%, transparent);
  transform: scaleX(0); transition: transform 1.2s var(--ease) 0.15s;
}
.chapter__card::after {                /* small corner marks */
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  background:
    linear-gradient(var(--gold), var(--gold)) left top / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left top / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 1px 14px no-repeat;
  opacity: 0; transition: opacity 1s var(--ease) 0.5s;
}
.chapter.is-active .chapter__card::before { transform: scaleX(1); }
.chapter.is-active .chapter__card::after { opacity: 0.55; }

.chapter__card > * { opacity: 0; transform: translateY(12px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.chapter.is-active .chapter__card > * { opacity: 1; transform: none; }
.chapter.is-active .chapter__card > :nth-child(1) { transition-delay: 0.1s; }
.chapter.is-active .chapter__card > :nth-child(2) { transition-delay: 0.22s; }
.chapter.is-active .chapter__card > :nth-child(3) { transition-delay: 0.36s; }
.chapter.is-active .chapter__card > :nth-child(4) { transition-delay: 0.5s; }
.chapter.is-active .chapter__card > :nth-child(5) { transition-delay: 0.62s; }

.chapter__card .eyebrow { display: flex; align-items: center; gap: 0.8rem; }
.chapter__num {
  font-family: var(--serif); font-style: italic; font-size: 1.15rem; letter-spacing: 0.02em; text-transform: none;
  color: var(--gold-bright); line-height: 1;
}
.chapter__num::after { content: ""; display: inline-block; width: 1.6rem; height: 1px; margin-left: 0.8rem; vertical-align: middle; background: var(--gold); opacity: 0.7; }
.chapter__title { letter-spacing: -0.01em; }
.chapter__text { line-height: 1.65; max-width: 34ch; }
@media (min-width: 900px) { .chapter__text { max-width: 40ch; font-size: 1.02rem; } }

.chapter__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.05rem; padding: 0; list-style: none; }
.chapter__tags li {
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ivory);
  padding: 0.42rem 0.65rem; border: 1px solid rgba(212, 175, 105, 0.35); background: rgba(212, 175, 105, 0.06);
}
.chapter__link {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-bright);
  border-bottom: 1px solid rgba(240, 205, 135, 0.4); padding-bottom: 0.25rem; transition: border-color 0.3s, gap 0.3s var(--ease);
}
.chapter__link:hover { border-color: var(--gold-bright); gap: 0.8rem; }

/* Cinematic finish: very fine film grain over the 3D view */
.stage::after {
  content: ""; position: absolute; inset: -50%; pointer-events: none; z-index: 1; opacity: 0.07; mix-blend-mode: overlay;
  background-image: 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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); } }

@media (prefers-reduced-motion: reduce) {
  .stage::after { animation: none; }
  .chapter__card > *, .chapter__card::before, .chapter__card::after { transition: none; }
}
.chapter__card .eyebrow:has(.chapter__num)::before { display: none; }
@media (max-width: 639px) {
  .chapter__tags li { font-size: 0.56rem; padding: 0.36rem 0.5rem; letter-spacing: 0.16em; }
  .chapter__text { font-size: 0.93rem; line-height: 1.55; }
}

/* ------------------------------------------------------------------ Phones: compact story cards
   Keep the card to roughly the bottom quarter of the screen so the walkthrough stays visible. */
@media (max-width: 639px) {
  .chapter { padding-bottom: calc(0.6rem + env(safe-area-inset-bottom)); }
  .chapter__card {
    bottom: calc(0.6rem + env(safe-area-inset-bottom));
    padding: 0.85rem 0.95rem 0.95rem;
    background: linear-gradient(165deg, rgba(14, 11, 9, 0.72), rgba(7, 6, 5, 0.5));
    -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1);
  }
  .chapter__card::after { inset: 5px; }
  .chapter__card .eyebrow { font-size: 0.55rem; gap: 0.55rem; }
  .chapter__num { font-size: 0.92rem; }
  .chapter__num::after { width: 1rem; margin-left: 0.55rem; }
  .chapter__title { margin-top: 0.4rem; font-size: clamp(1.4rem, 6.6vw, 1.85rem); line-height: 1.05; }
  .chapter__text { margin-top: 0.45rem; font-size: 0.8rem; line-height: 1.45; max-width: none; }
  .chapter__tags { margin-top: 0.55rem; gap: 0.3rem; }
  .chapter__tags li { font-size: 0.5rem; padding: 0.26rem 0.4rem; letter-spacing: 0.14em; }
  .chapter__link { margin-top: 0.55rem; font-size: 0.6rem; }
  .chapter__hint { margin-top: 0.6rem; font-size: 0.58rem; }
  .chapter__hint-line { height: 1.1rem; }
  .chapter__actions { margin-top: 0.75rem; gap: 0.45rem; }
  .chapter__actions .btn { padding-block: 0.75rem; font-size: 0.66rem; }
  .rail { gap: 0.4rem; right: 0.45rem; }
  .rail li { height: 1.1rem; }
  .rail li.is-active { height: 1.8rem; }
}

/* ------------------------------------------------------------------ As seen in: running across the walkthrough
   Desktop: a slim band along the bottom. Phones: just under the header, because the story card lives at the bottom. */
.tour-seen {
  position: fixed; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 1.2rem;
  height: 2.9rem; padding-left: 1.5rem;
  background: linear-gradient(to top, rgba(6, 5, 4, 0.86), rgba(6, 5, 4, 0.6));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(198, 164, 106, 0.2);
}
.tour-seen__label { flex: none; font-size: 0.56rem; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.tour-seen__viewport { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.tour-seen__track { display: flex; align-items: center; gap: 2.6rem; width: max-content; zoom: 0.62; animation: tour-seen 38s linear infinite; }
.tour-seen__dup { display: contents; }
.tour-seen .press-mark { color: rgba(244, 239, 230, 0.72); white-space: nowrap; line-height: 1; transition: color 0.3s; }
.tour-seen .press-mark:hover { color: #fff; }
.tour-seen:hover .tour-seen__track { animation-play-state: paused; }
@keyframes tour-seen { to { transform: translateX(calc(-50% - 1.3rem)); } }
@media (min-width: 900px) {
  .chapter__card { margin-bottom: 3rem; }
  .rail { top: calc(50% - 1.5rem); }
}
@media (max-width: 899px) {
  .tour-seen { top: calc(var(--header-h) + env(safe-area-inset-top)); bottom: auto; height: 2.3rem; padding-left: 1rem; gap: 0.8rem;
    background: linear-gradient(rgba(6, 5, 4, 0.78), rgba(6, 5, 4, 0.5)); border-top: 0; border-bottom: 1px solid rgba(198, 164, 106, 0.16); }
  .tour-seen__label { font-size: 0.5rem; letter-spacing: 0.26em; }
  .tour-seen__track { zoom: 0.5; gap: 2.4rem; }
  .tour-note { top: calc(var(--header-h) + env(safe-area-inset-top) + 2.8rem); }
}
@media (prefers-reduced-motion: reduce) { .tour-seen__track { animation-duration: 120s; } }

/* ---------- Official press logos (../assets/press; one tone via mask) ---------- */
.press-mark--logo { display: inline-flex; align-items: center; gap: 0.4em; }
.press-mark--logo::before { content: none; }
.press-logo { display: inline-block; height: 1.5rem; background: currentColor; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.press-logo--forbes { --logo: url("../../assets/press/forbes.svg"); height: 1.6rem; aspect-ratio: 200 / 54; }
.press-logo--usatoday { --logo: url("../../assets/press/usatoday.svg"); height: 1.2rem; aspect-ratio: 158.75 / 23.77; }
.press-logo--laweekly { --logo: url("../../assets/press/laweekly-mono.svg"); height: 1.55rem; aspect-ratio: 300 / 77; }
.press-mark--forbes.press-mark--logo small { font-family: var(--sans); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 0 -0.15em; align-self: flex-start; }
.press-logo--ibt { --logo: url("../../assets/press/ibt.svg"); height: 0.72rem; aspect-ratio: 620 / 28; }
.press-logo--hype { --logo: url("../../assets/press/hype.png"); height: 2.7rem; aspect-ratio: 329 / 141; }
.press-logo--disrupt { --logo: url("../../assets/press/disrupt.png"); height: 1.15rem; aspect-ratio: 968 / 176; }
.press-logo--celebmix { --logo: url("../../assets/press/celebmix.png"); height: 2.2rem; aspect-ratio: 226 / 170; }

/* ---------- Maison wordmark (matches the main site) ---------- */
.brand__name--maison { display: grid; justify-items: start; gap: 0.28rem; line-height: 1; }
.brand__word { font-family: "Bodoni Moda", Didot, "Bodoni 72", Georgia, serif; font-weight: 400; font-size: 1.02rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ivory, #f1ebe0); margin-right: -0.32em; }
.brand__sub { display: flex; align-items: center; gap: 0.5rem; width: 100%; font-size: 0.5rem; font-weight: 600; letter-spacing: 0.62em; text-transform: uppercase; color: var(--gold, #cfa95a); }
.brand__sub::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(207, 169, 90, 0.7), transparent); }
.brand__mark { height: 2.6rem; width: auto; }

/* ---------- Press logos in their own colours (white reverse for black wordmarks, as the outlets use on dark) ---------- */
.press-logo { background: #fff; opacity: 0.92; transition: opacity 0.4s; }
.press-mark--logo:hover .press-logo { opacity: 1; }
.press-mark--forbes.press-mark--logo small { color: rgba(255, 255, 255, 0.85); }
.press-logo--usatoday { -webkit-mask: none; mask: none; background: url("../../assets/press/usatoday-reverse.svg") center / contain no-repeat; }
.press-logo--celebmix { -webkit-mask: none; mask: none; background: url("../../assets/press/celebmix-box.png") center / contain no-repeat; height: 2.5rem; aspect-ratio: 1 / 1; border-radius: 1px; }
.press-logo--nbc { -webkit-mask: none; mask: none; background: url("../../assets/press/nbcnews-reverse.svg") center / contain no-repeat; height: 2.35rem; aspect-ratio: 264.58 / 200.94; }
.press-logo--yahoo { -webkit-mask: none; mask: none; background: url("../../assets/press/yahoofinance-reverse.svg") center / contain no-repeat; height: 1.15rem; aspect-ratio: 1284.1 / 181.3; }
.press-logo--ok { -webkit-mask: none; mask: none; background: url("../../assets/press/okmagazine.png") center / contain no-repeat; height: 1.9rem; aspect-ratio: 376 / 240; }
