@font-face {
  font-family: "Plex";
  src: url("../assets/fonts/ibm-plex-sans-variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --ink: #151817;
  --paper: #f2f1ec;
  --muted: #686c68;
  --line: rgba(21, 24, 23, .24);
  --signal: #315fff;
  --time-color: #7c95d8;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  min-width: 320px;
  overflow: hidden;
  background: #080a09;
  color: var(--ink);
  font-family: "Plex", Arial, sans-serif;
  font-size: 14px;
  text-rendering: optimizeLegibility;
}

button, a { color: inherit; font: inherit; }
a { text-underline-offset: 5px; text-decoration-thickness: 1px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 12px;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.world { width: 100%; height: 100%; }
.world-header {
  position: absolute;
  z-index: 20;
  top: calc(var(--room-top, 0px) + 12px);
  left: calc(var(--room-left, 0px) + 28px);
  width: calc(var(--room-width, 100%) - 56px);
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  pointer-events: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .78);
}
.world-header a,
.world-header button { pointer-events: auto; }
.primary-nav {
  min-width: 0;
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 24px);
}
.primary-nav button,
.contact-nav button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .96);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 150ms ease, opacity 150ms ease;
}
.primary-nav button:hover,
.primary-nav button:focus-visible,
.primary-nav button[aria-current="page"],
.contact-nav button:hover,
.contact-nav button:focus-visible,
.contact-nav button[aria-current="page"] { color: white; }
.primary-nav button::after,
.contact-nav button::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 3px;
  background: #8fa7ff;
  opacity: 0;
  transform: scaleX(.35);
  transition: opacity 150ms ease, transform 180ms ease;
}
.primary-nav button:hover::after,
.primary-nav button:focus-visible::after,
.primary-nav button[aria-current="page"]::after,
.contact-nav button:hover::after,
.contact-nav button:focus-visible::after,
.contact-nav button[aria-current="page"]::after {
  opacity: .72;
  transform: scaleX(1);
}
.identity {
  width: max-content;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.identity strong { font-size: 16px; font-weight: 660; }
.identity span { color: rgba(255, 255, 255, .82); font-size: 13px; }
.header-center {
  position: relative;
  justify-self: center;
  width: max-content;
  height: 48px;
  display: flex;
  align-items: center;
}
.contact-nav {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  justify-self: end;
}
.contact-nav::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fa7ff;
  box-shadow: 0 0 12px rgba(111, 140, 255, .78);
}
.contact-nav button { color: white; }

.viewport { position: relative; width: 100%; height: 100%; }
.viewport::after {
  content: "";
  position: absolute;
  z-index: 10;
  inset: 0;
  background: rgba(4, 7, 6, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}
.section-open .viewport::after { opacity: 1; }
.world-canvas { display: block; width: 100%; height: 100%; outline: 0; cursor: grab; }
.world-canvas.is-interactive { cursor: pointer; }

.room-markers { position: absolute; inset: 0; z-index: 9; pointer-events: none; }
.room-marker {
  position: absolute;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  font-size: 0;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 160ms ease;
  will-change: transform;
}
.room-marker::before,
.room-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
}
.room-marker::before {
  width: 9px;
  height: 9px;
  background: #6f8cff;
  box-shadow: 0 0 0 4px rgba(49, 95, 255, .22), 0 0 20px rgba(49, 95, 255, .82);
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.room-marker::after {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(123, 151, 255, .72);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.38);
  animation: signal-beacon 4.8s cubic-bezier(.2, .75, .35, 1) infinite;
  animation-delay: calc(var(--signal-index) * .48s + .5s);
}
.room-marker:hover::before,
.room-marker.is-hovered::before,
.room-marker:focus-visible::before,
.room-marker[aria-pressed="true"]::before {
  width: 12px;
  height: 12px;
  background: white;
  box-shadow: 0 0 0 4px rgba(49, 95, 255, .38), 0 0 28px rgba(49, 95, 255, 1);
}
.room-marker:hover::after,
.room-marker.is-hovered::after,
.room-marker:focus-visible::after,
.room-marker[aria-pressed="true"]::after {
  animation: none;
  opacity: .9;
  transform: translate(-50%, -50%) scale(1.16);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1);
}
.has-explored .room-marker:not(:hover):not(.is-hovered):not(:focus-visible):not([aria-pressed="true"])::after {
  animation: none;
  opacity: .3;
  transform: translate(-50%, -50%) scale(.82);
}
.room-marker > span {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(50% + 18px);
  min-height: 34px;
  width: max-content;
  padding: 8px 11px;
  border: 1px solid rgba(147, 165, 223, .42);
  border-radius: 2px;
  background: rgba(12, 15, 15, .92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8fa7ff;
  font-size: 10px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  transform: translate3d(-6px, -50%, 0) scale(.94);
  transform-origin: left center;
  transition: opacity 140ms ease, visibility 140ms ease, transform 190ms cubic-bezier(.2, .8, .2, 1);
}
.room-marker > span::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 8px;
  height: 1px;
  background: rgba(123, 151, 255, .72);
}
.room-marker > span::after {
  content: attr(data-label);
  color: white;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: -.01em;
}
.room-marker[data-bubble="left"] > span {
  right: calc(50% + 18px);
  left: auto;
  transform: translate3d(6px, -50%, 0) scale(.94);
  transform-origin: right center;
}
.room-marker[data-bubble="left"] > span::before {
  right: auto;
  left: 100%;
}
.room-marker:hover > span,
.room-marker.is-hovered > span,
.room-marker:focus-visible > span {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, -50%, 0) scale(1);
}
.room-marker:focus-visible {
  outline: 0;
}
.room-markers.is-dimmed .room-marker:not([aria-pressed="true"]) { opacity: .18; pointer-events: none; }

@keyframes signal-beacon {
  0%, 68%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.38); }
  76% { opacity: .76; }
  92% { opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}

.room-panel {
  position: absolute;
  z-index: 15;
  top: calc(var(--room-top, 0px) + 70px);
  left: calc(var(--room-left, 0px) + 28px);
  width: min(430px, calc(100vw - 52px));
  max-height: calc(var(--room-bottom, 100dvh) - var(--room-top, 0px) - 92px);
  border: 1px solid rgba(21, 24, 23, .34);
  background: rgba(242, 241, 236, .98);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}
.room-panel[data-side="right"] { right: calc(100% - var(--room-right, 100%) + 28px); left: auto; }
.room-panel[hidden] { display: none; }
.room-panel > header {
  min-height: 52px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.room-panel > header span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.room-panel button {
  min-width: 48px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}
.room-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.room-panel-copy {
  width: auto;
  margin: 0;
  padding: 28px 24px 24px;
  display: block;
}
.room-kind { margin: 0 0 12px; color: var(--signal); font-size: 11px; font-weight: 620; letter-spacing: .06em; text-transform: uppercase; }
.room-portrait {
  display: block;
  width: 92px;
  height: 112px;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  object-fit: cover;
  object-position: 50% 31%;
}
.room-portrait[hidden] { display: none; }
.room-panel h1 { max-width: 100%; margin: 0; font-size: clamp(40px, 4vw, 54px); font-weight: 450; letter-spacing: -.055em; line-height: .94; }
.room-description { max-width: 38em; margin: 20px 0 0; color: #3f433f; font-size: 15px; line-height: 1.55; }
.room-facts { margin: 24px 0 0; border-top: 1px solid var(--ink); }
.room-facts > div { padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 94px 1fr; gap: 12px; }
.room-facts dt { color: var(--muted); font-size: 12px; }
.room-facts dd { margin: 0; font-size: 13px; font-weight: 560; }
.room-primary-link {
  width: max-content;
  min-height: 44px;
  margin-top: 22px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.room-primary-link[hidden] { display: none; }
.room-more {
  margin: 0 24px 22px;
  border-top: 1px solid var(--ink);
}
.room-more summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
}
.room-more summary::-webkit-details-marker { display: none; }
.room-more summary i { font-size: 20px; font-style: normal; font-weight: 350; transition: transform 180ms ease; }
.room-more[open] summary i { transform: rotate(45deg); }
.room-detail {
  width: auto;
  margin: 0;
  border: 0;
  display: block;
}
.detail-entry {
  min-height: 0;
  padding: 19px 0 21px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 11px;
}
.detail-entry > span { color: var(--signal); font-size: 11px; font-variant-numeric: tabular-nums; }
.detail-entry-meta { margin: 0 0 9px; color: var(--muted); font-size: 11px; font-weight: 580; letter-spacing: .055em; text-transform: uppercase; }
.detail-entry h2 { margin: 0; font-size: 20px; font-weight: 520; letter-spacing: -.025em; line-height: 1.08; }
.detail-entry-copy { max-width: 34em; margin: 12px 0 0; color: #494d49; font-size: 14px; line-height: 1.57; }
.room-panel-scroll > footer {
  width: auto;
  min-height: 60px;
  margin: 0;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}
.room-panel-scroll > footer a { color: var(--ink); }

.world-controls {
  position: absolute;
  z-index: 8;
  right: calc(100% - var(--room-right, 100%) + 28px);
  bottom: calc(100% - var(--room-bottom, 100%) + 24px);
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 2px;
  background: rgba(8, 10, 9, .56);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  backdrop-filter: blur(10px) saturate(1.08);
  gap: 16px;
  color: #f1f3ef;
  font-size: 12px;
  font-weight: 560;
}
.interaction-help { white-space: nowrap; transition: opacity 180ms ease; }
.has-explored .interaction-help { opacity: .56; }
.local-status {
  padding-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, .24);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d1d5d0;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.local-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--time-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--time-color) 78%, transparent);
  transition: background-color 900ms ease, box-shadow 900ms ease;
}
.local-status b { color: #f4f4ef; font-size: 11px; font-weight: 600; }
.local-status time { min-width: 38px; color: #aeb4ae; font-variant-numeric: tabular-nums; }
.world-controls button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(10, 12, 11, .76);
  color: white;
  cursor: pointer;
}
.webgl-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
}
.webgl-fallback p { margin: 0; color: #d7dbd6; font-size: 15px; }
.webgl-fallback nav { display: flex; justify-content: center; gap: 10px; }
.webgl-fallback a {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .34);
  display: inline-flex;
  align-items: center;
  color: white;
  text-decoration: none;
}
.webgl-fallback a:first-child { border-color: #8fa7ff; background: rgba(49, 95, 255, .18); }
.webgl-ready .webgl-fallback { display: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

@media (min-width: 761px) and (max-width: 1080px) {
  .world-header {
    grid-template-columns: auto 1fr auto;
    gap: 16px;
  }
  .primary-nav { gap: 8px; }
  .primary-nav button,
  .contact-nav button { font-size: 13px; }
  .identity strong { font-size: 15px; }
  .identity span { display: none; }
}

@media (max-width: 760px) {
  .world-header {
    height: 58px;
    top: calc(var(--room-top, 0px) + 6px);
    left: calc(var(--room-left, 0px) + 12px);
    width: calc(var(--room-width, 100%) - 24px);
    padding: 0;
    grid-template-columns: 1fr auto;
    grid-template-rows: 58px;
    gap: 0 16px;
  }
  .primary-nav {
    display: none;
  }
  .identity { display: grid; gap: 0; }
  .identity span { display: none; }
  .header-center { grid-column: 1; grid-row: 1; justify-self: start; }
  .contact-nav { grid-column: 2; grid-row: 1; }
  .room-markers {
    top: auto;
    right: calc(100% - var(--room-right, 100%) + 12px);
    bottom: calc(100% - var(--room-bottom, 100%) + 14px);
    left: calc(var(--room-left, 0px) + 12px);
    padding: 0 12px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .room-marker {
    position: static;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid rgba(21, 24, 23, .34);
    border-radius: 0;
    background: rgba(242, 241, 236, .94);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    opacity: 1;
    text-align: left;
    transform: none !important;
  }
  .room-marker::before,
  .room-marker::after { display: none; }
  .room-marker > span {
    position: static;
    min-height: 0;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .room-marker > span::before,
  .room-marker > span::after { display: none; }
  .room-marker:hover,
  .room-marker:focus-visible,
  .room-marker[aria-pressed="true"] { border-color: var(--signal); background: var(--ink); color: white; }
  .room-marker[aria-pressed="true"] span,
  .room-marker:hover span { color: #aeb5cb; }
  .room-markers.is-dimmed { opacity: 0; pointer-events: none; }
  .room-panel,
  .room-panel[data-side="right"] {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(74dvh, 660px);
    border-width: 1px 0 0;
  }
  .room-panel > header { min-height: 54px; padding: 0 16px; }
  .room-panel-copy {
    width: auto;
    padding: 26px 20px 22px;
    display: block;
  }
  .room-panel h1 { font-size: clamp(40px, 12vw, 54px); }
  .room-portrait { width: 82px; height: 100px; margin-bottom: 18px; }
  .room-description { margin-top: 18px; font-size: 14px; }
  .room-facts { margin-top: 22px; }
  .room-more { margin: 0 20px 20px; }
  .detail-entry { min-height: 0; padding: 18px 0 20px; }
  .room-panel-scroll > footer { width: auto; min-height: 68px; padding: 0 20px; align-items: flex-start; justify-content: center; flex-direction: column; }
  .world-controls { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
