/*
 * The Intro Page (components/intro-page.js, docs/intro-page.md). intro-page.js sets the look as custom properties on #introPage:
 *   --ip-overlay, --ip-panel, --ip-blur, --ip-radius, --ip-text, --ip-accent, --ip-button, --ip-button-text, --ip-title-font,
 *   --ip-body-font, --ip-image
 * and the layout as classes: ip-layout-{split|center|card-left|stack-top|stack-bottom}, ip-panel-{none|glass|solid}, ip-bg-{room-blur|room|image|color},
 * ip-align-{left|center|right}, ip-has-right, ip-still (the visitor's device asks for less motion).
 *
 * The alignment is --ip-justify (flex-start, center, flex-end), the page's on its words area (and on the stacked layouts' other area)
 * and a block's own on a block that has one (ip-al-{left|center|right}, Ben 2026-10-17: "Can all position options have left, center and
 * right as options"); the rows inside a block (logos, the eyebrow, buttons, links, facts, cards) follow it.
 *
 * It sits under the platform's start screen (#panoramr-splash, 99999) and over everything else of the player. The theme sets its font on
 * every element with !important, so the page's own fonts are set from #introPage with !important too.
 */
#introPage.ip {
  position: fixed;
  inset: 0;
  z-index: 99990;
  color: var(--ip-text, #fff);
  opacity: 1;
  transition: opacity 0.45s ease;
  -webkit-font-smoothing: antialiased;
}

#introPage[hidden] {
  display: none !important;
}

#introPage.ip-leaving {
  opacity: 0;
  pointer-events: none;
}

#introPage.ip-still,
#introPage.ip-still * {
  transition: none !important;
  animation: none !important;
}

#introPage,
#introPage * {
  box-sizing: border-box;
  font-family: var(--ip-body-font, inherit) !important;
}

#introPage .ip-title,
#introPage .ip-title *,
#introPage .ip-column-heading,
#introPage .ip-area-name {
  font-family: var(--ip-title-font, inherit) !important;
}

/* the background: the room behind it, blurred or not, a picture, or a colour, under the overlay */
#introPage .ip-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ip-overlay);
}

#introPage.ip-bg-room-blur .ip-backdrop {
  -webkit-backdrop-filter: blur(var(--ip-blur));
  backdrop-filter: blur(var(--ip-blur));
}

#introPage.ip-bg-image .ip-backdrop {
  background:
    linear-gradient(var(--ip-overlay), var(--ip-overlay)),
    var(--ip-image) center / cover no-repeat,
    #0b1220;
}

/* the page, which scrolls when it is taller than the screen */
#introPage .ip-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#introPage .ip-grid {
  display: grid;
  width: 100%;
  min-height: 100%;
  margin: auto;
  padding: clamp(28px, 6vw, 96px);
  gap: clamp(28px, 4.5vw, 72px);
  align-items: center;
}

#introPage.ip-layout-split.ip-has-right .ip-grid {
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

#introPage.ip-layout-split .ip-left {
  max-width: 640px;
}

#introPage.ip-layout-center .ip-grid {
  justify-items: center;
}

#introPage.ip-layout-center .ip-left {
  width: 100%;
  max-width: 580px;
}

#introPage.ip-layout-card-left .ip-grid {
  justify-items: start;
}

#introPage.ip-layout-card-left .ip-left {
  width: 100%;
  max-width: 500px;
}

/* stacked: one column in the middle, the words above the video or the cards (stack-top) or under them (stack-bottom); the second
   area as wide as the column, but no taller than about half the screen (a 16:9 video of 92vh is 52vh high) */
#introPage.ip-layout-stack-top .ip-grid,
#introPage.ip-layout-stack-bottom .ip-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(960px + 2 * clamp(28px, 6vw, 96px));
  justify-items: center;
  align-content: center;
  gap: clamp(24px, 3.5vw, 48px);
}

#introPage.ip-layout-stack-top .ip-left,
#introPage.ip-layout-stack-bottom .ip-left {
  width: 100%;
  max-width: 720px;
}

#introPage.ip-layout-stack-top .ip-right,
#introPage.ip-layout-stack-bottom .ip-right {
  width: 100%;
  max-width: min(960px, 92vh);
}

#introPage .ip-area {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

#introPage .ip-area {
  --ip-justify: flex-start;
}

#introPage.ip-align-center .ip-left,
#introPage.ip-align-center.ip-layout-stack-top .ip-right,
#introPage.ip-align-center.ip-layout-stack-bottom .ip-right {
  --ip-justify: center;
  text-align: center;
}

#introPage.ip-align-center .ip-left {
  align-items: center;
}

#introPage.ip-align-right .ip-left,
#introPage.ip-align-right.ip-layout-stack-top .ip-right,
#introPage.ip-align-right.ip-layout-stack-bottom .ip-right {
  --ip-justify: flex-end;
  text-align: right;
}

#introPage.ip-align-right .ip-left {
  align-items: flex-end;
}

/* a block's own alignment: the whole width of its area (an auto margin alone would shrink it to its content, and a row of cards to
   nothing), its words and its rows to its side, and a block narrower than that (the text's 62ch) to that side by its margins */
#introPage .ip-block.ip-al-left,
#introPage .ip-block.ip-al-center,
#introPage .ip-block.ip-al-right {
  box-sizing: border-box;
  width: 100%;
  align-self: stretch;
}

#introPage .ip-block.ip-al-left {
  --ip-justify: flex-start;
  margin-right: auto;
  text-align: left;
}

#introPage .ip-block.ip-al-center {
  --ip-justify: center;
  margin-inline: auto;
  text-align: center;
}

#introPage .ip-block.ip-al-right {
  --ip-justify: flex-end;
  margin-left: auto;
  text-align: right;
}

#introPage .ip-card {
  padding: clamp(22px, 3vw, 44px);
  border-radius: var(--ip-radius);
}

#introPage.ip-panel-solid .ip-card {
  background: var(--ip-panel);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

#introPage.ip-panel-glass .ip-card {
  background: var(--ip-panel);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

#introPage .ip-block {
  margin: 0;
}

/* logos */
#introPage .ip-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

#introPage .ip-logos {
  justify-content: var(--ip-justify);
}

#introPage .ip-logo {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* small words above the title */
#introPage .ip-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ip-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#introPage .ip-eyebrow.ip-rule::after {
  content: '';
  width: 64px;
  height: 1px;
  flex: none;
  background: currentColor;
  opacity: 0.75;
}

#introPage .ip-eyebrow {
  justify-content: var(--ip-justify);
}

#introPage .ip-badge {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--ip-accent);
  color: var(--ip-button-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#introPage .ip-badge,
#introPage .ip-block.ip-badge {
  width: auto;
  margin-inline: 0;
  align-self: var(--ip-justify);
}

#introPage .ip-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

#introPage .ip-size-s {
  font-size: clamp(26px, 3vw, 34px);
}

#introPage .ip-size-m {
  font-size: clamp(32px, 4.2vw, 50px);
}

#introPage .ip-size-l {
  font-size: clamp(38px, 5.6vw, 72px);
}

#introPage .ip-size-xl {
  font-size: clamp(44px, 7.6vw, 104px);
}

#introPage .ip-title-line2 {
  display: block;
  margin-top: 0.22em;
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.92;
}

#introPage .ip-subtitle {
  font-size: clamp(16px, 1.6vw, 21px);
  line-height: 1.4;
  opacity: 0.94;
}

#introPage .ip-subtitle-italic {
  font-style: italic;
}

#introPage .ip-subtitle-caps {
  color: var(--ip-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#introPage .ip-text {
  max-width: 62ch;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.6;
  opacity: 0.92;
}

/* facts: a list with small squares, or one line with dots */
#introPage .ip-facts {
  padding: 0;
  list-style: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.88;
}

#introPage .ip-facts-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}

#introPage .ip-facts-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  background: var(--ip-accent);
}

#introPage .ip-facts-list li {
  justify-content: var(--ip-justify);
}

#introPage .ip-facts-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}

#introPage .ip-facts-line {
  justify-content: var(--ip-justify);
}

#introPage .ip-facts-line li + li::before {
  content: '•';
  margin: 0 12px;
  color: var(--ip-accent);
}

/* buttons: the first stands out; or every one a row with a line under its words */
#introPage .ip-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#introPage .ip-buttons {
  justify-content: var(--ip-justify);
}

#introPage .ip-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  /* in em, so a bigger Text size is a bigger button too: 14px by 22px at the 16px of M, as it always was */
  padding: 0.875em 1.375em;
  border: 0;
  border-radius: max(6px, calc(var(--ip-radius) * 0.6));
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--ip-text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: start;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    background-color 0.15s ease;
}

/* Text size (the Buttons block): M is the 16px a page made before the choice has */
#introPage .ip-button-size-s .ip-button {
  font-size: 14px;
}
#introPage .ip-button-size-l .ip-button {
  font-size: 20px;
}
#introPage .ip-button-size-xl .ip-button {
  font-size: 24px;
}

/* a button that opens an address is a link to the browser (intro-page.js: control) */
#introPage a.ip-button {
  text-decoration: none;
}

#introPage .ip-button:hover {
  background-color: rgba(127, 127, 127, 0.16);
  transform: translateY(-1px);
}

#introPage .ip-buttons-rows {
  flex-direction: column;
  align-items: stretch;
}

#introPage .ip-buttons-rows .ip-button {
  width: 100%;
  padding: 0.875em 1.125em;
  background: rgba(127, 127, 127, 0.14);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.35);
}

/* after the rows, which it fills too */
#introPage .ip-buttons-filled .ip-primary,
#introPage .ip-buttons-rows .ip-primary {
  background: var(--ip-button);
  box-shadow: none;
  color: var(--ip-button-text);
}

#introPage .ip-buttons-filled .ip-primary:hover,
#introPage .ip-buttons-rows .ip-primary:hover {
  filter: brightness(1.08);
}

#introPage .ip-button:focus-visible,
#introPage .ip-link:focus-visible,
#introPage .ip-area-card:focus-visible {
  outline: 3px solid var(--ip-accent);
  outline-offset: 3px;
}

#introPage .ip-icon {
  display: inline-flex;
  flex: none;
}

#introPage .ip-buttons-rows .ip-icon {
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

#introPage .ip-button-words {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#introPage .ip-button-sub {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.85;
}

/* small links */
#introPage .ip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

#introPage .ip-links {
  justify-content: var(--ip-justify);
}

#introPage .ip-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.92;
}

/* columns of a heading and a few words */
#introPage .ip-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(127, 127, 127, 0.4);
  text-align: start;
}

#introPage .ip-columns-1 {
  grid-template-columns: minmax(0, 1fr);
}

#introPage .ip-columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#introPage .ip-column-heading {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

#introPage .ip-column-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.86;
}

#introPage .ip-note {
  padding: 14px 16px;
  border-radius: max(6px, calc(var(--ip-radius) * 0.6));
  background: rgba(127, 127, 127, 0.2);
  font-size: 13px;
  line-height: 1.55;
  text-align: start;
}

#introPage .ip-credit {
  font-size: 12px;
  opacity: 0.75;
}

/* the video */
#introPage .ip-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--ip-radius);
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

#introPage .ip-video-file,
#introPage .ip-video-embed,
#introPage .ip-video .embed-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: contain;
}

/* the cards that lead to an area of the tour */
#introPage .ip-areas-heading {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* each card a share of its block's width by its size (ip-cards-{small|medium|large}, Ben 2026-10-17: "an option to change the size of
   the thumbnails, current size should be small"): four, three or two to a row (a phone: two), and a row with fewer to the block's side */
#introPage .ip-areas {
  box-sizing: border-box;
  width: 100%;
  align-self: stretch;
}

#introPage .ip-area-grid {
  --ip-card-w: calc((100% - 3 * 12px) / 4);
  display: flex;
  flex-wrap: wrap;
  justify-content: var(--ip-justify);
  gap: 12px;
}

#introPage .ip-cards-medium {
  --ip-card-w: calc((100% - 2 * 12px) / 3);
}

#introPage .ip-cards-large {
  --ip-card-w: calc((100% - 12px) / 2);
}

#introPage .ip-area-card {
  position: relative;
  display: block;
  flex: 0 0 var(--ip-card-w);
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: max(6px, calc(var(--ip-radius) * 0.6));
  background: #1f2937;
  color: #fff;
  cursor: pointer;
  text-align: start;
}

#introPage .ip-area-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

#introPage .ip-area-card:hover .ip-area-thumb {
  transform: scale(1.04);
}

#introPage .ip-area-words {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 32px 14px 12px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.78));
}

#introPage .ip-area-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

#introPage .ip-area-count {
  font-size: 12px;
  opacity: 0.88;
}

#introPage .ip-area-bars .ip-area-card::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  inset-inline-start: 0;
  height: 4px;
  background: var(--ip-hue);
}

#introPage .ip-area-hue-0 {
  --ip-hue: #f59e0b;
}
#introPage .ip-area-hue-1 {
  --ip-hue: #3b82f6;
}
#introPage .ip-area-hue-2 {
  --ip-hue: #8b5cf6;
}
#introPage .ip-area-hue-3 {
  --ip-hue: #ec4899;
}
#introPage .ip-area-hue-4 {
  --ip-hue: #10b981;
}
#introPage .ip-area-hue-5 {
  --ip-hue: #ef4444;
}

/* a thin bar along the top while the first room loads behind the page */
#introPage .ip-progress {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  inset-inline-start: 0;
  height: 3px;
  overflow: hidden;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#introPage .ip-progress::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: var(--ip-accent);
  animation: ip-loading 1.4s ease-in-out infinite;
}

#introPage .ip-progress.ip-done {
  opacity: 0;
}

@keyframes ip-loading {
  0% {
    inset-inline-start: -30%;
  }
  100% {
    inset-inline-start: 100%;
  }
}

/* a phone, or a narrow window: one column that scrolls, the right area under the left */
@media (max-width: 767px) {
  #introPage .ip-grid,
  #introPage.ip-layout-split.ip-has-right .ip-grid {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    align-items: start;
    gap: 28px;
    padding: 28px 18px 36px;
  }

  #introPage.ip-layout-center .ip-grid,
  #introPage.ip-layout-card-left .ip-grid {
    align-content: center;
  }

  #introPage.ip-layout-split .ip-left,
  #introPage.ip-layout-center .ip-left,
  #introPage.ip-layout-card-left .ip-left {
    max-width: none;
  }

  #introPage .ip-columns,
  #introPage .ip-columns-2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  #introPage .ip-buttons-filled .ip-button,
  #introPage .ip-buttons-outline .ip-button {
    flex: 1 1 auto;
    justify-content: center;
  }

  #introPage .ip-area-grid {
    --ip-card-w: calc((100% - 10px) / 2);
    gap: 10px;
  }

  #introPage .ip-area-name {
    font-size: 15px;
  }
}

/* "How to use this tour" (components/tour-help.js), over the Intro Page */
#tourHelp {
  position: fixed;
  inset: 0;
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.45);
}

#tourHelp,
#tourHelp * {
  box-sizing: border-box;
  font-family: var(--ip-body-font, inherit) !important;
}

#tourHelp .th-box {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 26px 22px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  color: #111827;
}

#tourHelp .th-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
}

#tourHelp .th-tips {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.45;
}

#tourHelp .th-tips li {
  display: flex;
  align-items: center;
  gap: 14px;
}

#tourHelp .th-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef2f7;
  color: #1f2937;
}

#tourHelp .th-button {
  width: 100%;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ip-button, #111827);
  color: var(--ip-button-text, #ffffff);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

#tourHelp .th-button:focus-visible {
  outline: 3px solid var(--ip-accent, #3b82f6);
  outline-offset: 3px;
}

/* the editor's preview: a logo or a video not chosen yet (App\Support\IntroPage, placeholders), a box to click that opens it in the panel */
#introPage .ip-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed currentColor;
  border-radius: var(--ip-radius);
  background: rgba(127, 127, 127, 0.12);
  box-shadow: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.75;
}

#introPage .ip-empty-cards {
  min-height: 120px;
  padding: 18px;
  text-align: center;
}

#introPage .ip-empty-block {
  min-height: 44px;
  padding: 10px 16px;
}

#introPage .ip-empty-logo {
  min-width: 120px;
  padding: 0 18px;
}
