:root {
  color-scheme: dark;
  --background: #0b0f17;
  --panel: #111824;
  --border: #253040;
  --muted: #b8c0cc;
  --text: #f8fafc;
  --amber: #f59e0b;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid #ffcf7d; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wrap { width: min(100% - 3rem, 76rem); margin-inline: auto; }
.app { min-height: 100vh; min-height: 100dvh; }

.header { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand img { width: 8.2rem; height: auto; }
.brand span { padding-left: .9rem; border-left: 1px solid var(--border); color: var(--muted); white-space: nowrap; font-size: .875rem; }
.website { color: var(--muted); font-size: .875rem; text-decoration: none; }
.website:hover, .back:hover { color: var(--text); text-decoration: underline; text-underline-offset: .25rem; }

.catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
.tour-card {
  position: relative; isolation: isolate; display: flex; align-items: center;
  min-height: 25rem; overflow: hidden; background: #141a24;
  border: 1px solid var(--border); border-radius: 1.125rem;
}
.tour-card:first-child { grid-column: 1 / -1; min-height: clamp(29rem, 65vh, 38rem); }
.cover { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 82%; height: 100%; object-fit: cover; object-position: 56% 48%; }
.tour-card::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(90deg, #101622 7%, #101622 22%, rgba(16,22,34,.97) 31%, rgba(16,22,34,.7) 47%, rgba(16,22,34,.22) 68%, rgba(16,22,34,.06) 100%);
}
.tour-copy { max-width: 31rem; padding: clamp(1.4rem, 5.1vw, 4rem); }
.tour-copy h2 {
  margin: 0; font: 400 clamp(2.45rem, 5.2vw, 4.65rem)/1.02 Georgia, 'Times New Roman', serif;
  letter-spacing: -.047em; text-wrap: balance;
}
.tour-card:not(:first-child) h2 { font-size: clamp(2rem, 3vw, 3.2rem); }
.tour-copy p { color: #d1d7df; line-height: 1.65; margin: 1.15rem 0 1.6rem; max-width: 27ch; }
.button {
  min-height: 2.85rem; display: inline-flex; justify-content: center; align-items: center;
  border: 1px solid transparent; border-radius: .55rem; padding: .65rem 1.1rem;
  text-decoration: none; font-weight: 650; cursor: pointer; line-height: 1.25;
}
.primary { background: var(--amber); color: #171107; }
.primary:hover { background: #ffb632; }
.secondary { color: var(--text); background: #182232; border-color: #364254; }
.secondary:hover { background: #222f43; }

.install-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.15rem; padding: 1.2rem 1.4rem;
  border: 1px solid var(--border); background: var(--panel); border-radius: .9rem;
}
.install-copy { display: flex; gap: .95rem; align-items: center; }
.install-copy h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.install-copy p { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.install-icon { flex: 0 0 2.65rem; height: 2.65rem; display: grid; place-items: center; border-radius: .55rem; color: #ffb73c; background: #2c2419; }
.install-icon span { width: .9rem; height: 1.35rem; border: 1.5px solid currentColor; border-radius: .2rem; display: grid; place-items: end center; padding-bottom: .16rem; }
.install-icon span::after { content: ''; width: .2rem; height: .12rem; border-radius: .1rem; background: currentColor; }
.footer { display: flex; gap: .5rem 1rem; justify-content: space-between; flex-wrap: wrap; padding-block: 1.6rem; color: var(--muted); font-size: .8125rem; }

.offline { border: 1px solid #765d36; background: #291f16; padding: .7rem 1rem; margin: 0 0 1rem; border-radius: .55rem; }
.viewer {
  height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
}
.viewer-header {
  min-height: 3.75rem; display: flex; gap: .85rem; align-items: center;
  padding: .55rem 1.15rem; border-bottom: 1px solid var(--border);
}
.viewer-header h1 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.back { color: var(--muted); font-size: .9rem; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; min-height: 2.5rem; padding-right: .85rem; border-right: 1px solid var(--border); }
.viewport { position: relative; background: #111824; }
.viewport iframe, .viewer-status { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.viewer-status { z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .8rem; text-align: center; background: var(--background); padding: 1rem; }
.viewer-status p { margin: 0; color: var(--muted); }
.standalone { color: var(--muted); text-underline-offset: .2rem; }

dialog { color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: .9rem; padding: clamp(1.25rem, 5vw, 2rem); width: min(100% - 2rem, 29rem); }
dialog::backdrop { background: rgba(6,9,14,.82); }
dialog h2 { font-size: 1.4rem; margin: 0; }
.instructions { margin: 1.2rem 0; }
.instructions > div + div { margin-top: .85rem; }
.instructions dt { font-weight: 650; }
.instructions dd { margin: .24rem 0 0; color: var(--muted); line-height: 1.5; }

@media (max-width: 44rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .header { min-height: 4.35rem; }
  .brand { gap: .6rem; }
  .brand img { width: 6.25rem; }
  .brand span { padding-left: .6rem; font-size: .8rem; }
  .website { font-size: .8rem; }
  .catalog { grid-template-columns: 1fr; }
  .tour-card, .tour-card:first-child { align-items: flex-end; min-height: 29rem; }
  .cover { width: 100%; height: 81%; object-position: 50% 41%; }
  .tour-card::after { background: linear-gradient(0deg, #101622 9%, #101622 21%, rgba(16,22,34,.91) 36%, rgba(16,22,34,.26) 65%, transparent 88%); }
  .tour-copy { padding: 1.25rem; }
  .tour-copy h2 { font-size: clamp(2.35rem, 9vw, 3.75rem); }
  .tour-copy p { margin: .75rem 0 1rem; max-width: 32ch; }
  .install-panel { padding: 1rem; align-items: flex-start; flex-direction: column; }
  .viewer-header { padding-inline: .75rem; }
}
