:root {
  --paper: #ece3d3;
  --paper-soft: #f4ecdd;
  --ink: #15130f;
  --ink-soft: #211d17;
  --stone: #b39a78;
  --stone-pale: #d2bd9e;
  --brick: #a87544;
  --red: #ba3627;
  --red-bright: #d84b35;
  --gold: #b88b52;
  --line: rgba(236, 227, 211, 0.14);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --en: "Times New Roman", Times, Georgia, serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background: #080705;
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
::selection { background: var(--red); color: #fff8ec; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  transform: translateY(-180%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

.tomb-stage {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background: #080705;
}

.tomb-webgl {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tomb-webgl canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.tomb-wash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 5, 3, 0.7) 0%, rgba(5, 5, 3, 0.28) 25%, transparent 47%, transparent 74%, rgba(5, 5, 3, 0.18) 100%),
    linear-gradient(180deg, rgba(5, 5, 3, 0.55) 0%, transparent 17%, transparent 66%, rgba(5, 5, 3, 0.72) 100%);
}

.tomb-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.19;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* Top bar ----------------------------------------------------------------- */

.tomb-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 clamp(18px, 3.2vw, 48px);
  border-bottom: 1px solid rgba(236, 227, 211, 0.12);
  background: rgba(8, 7, 5, 0.58);
  backdrop-filter: blur(18px);
}

.tomb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  color: var(--paper);
  text-decoration: none;
}

.tomb-brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--red);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 18px;
}

.tomb-brand-text { display: flex; align-items: baseline; gap: 8px; }
.tomb-brand-text b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
}
.tomb-brand-text small {
  color: rgba(236, 227, 211, 0.38);
  font-family: var(--en);
  font-size: 6px;
  letter-spacing: 0.14em;
}

.tomb-topbar-center {
  display: flex;
  align-items: baseline;
  gap: 9px;
  justify-self: center;
  color: rgba(236, 227, 211, 0.7);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.tomb-topbar-center em {
  color: rgba(236, 227, 211, 0.28);
  font-family: var(--en);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.12em;
}

.tomb-topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-self: end;
}

.tomb-ar-launch {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(184, 139, 82, 0.55);
  background: rgba(184, 139, 82, 0.1);
  color: var(--gold-pale);
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.tomb-ar-launch:hover {
  border-color: var(--gold-pale);
  background: rgba(184, 139, 82, 0.2);
}

.tomb-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(236, 227, 211, 0.62);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 0.25s;
}
.tomb-back:hover { color: var(--paper); }
.tomb-back span { color: var(--red-bright); font-size: 13px; }

.tomb-icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(236, 227, 211, 0.18);
  background: transparent;
  color: rgba(236, 227, 211, 0.7);
  cursor: pointer;
}
.tomb-icon-button:hover { border-color: rgba(236, 227, 211, 0.52); color: var(--paper); }
.tomb-icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.2; }

/* Intro ------------------------------------------------------------------- */

.tomb-intro {
  position: absolute;
  top: clamp(102px, 13vh, 150px);
  left: clamp(26px, 6vw, 92px);
  z-index: 8;
  width: min(400px, 36vw);
  pointer-events: none;
}

.tomb-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  color: rgba(236, 227, 211, 0.4);
  font-family: var(--en);
  font-size: 7px;
  letter-spacing: 0.15em;
}
.tomb-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.tomb-intro h1 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(48px, 5.8vw, 76px);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.02;
}
.tomb-intro h1 em { color: var(--gold-pale); font-style: normal; }

.tomb-en {
  margin: 17px 0 0;
  color: rgba(236, 227, 211, 0.35);
  font-family: var(--en);
  font-size: 7px;
  letter-spacing: 0.13em;
  line-height: 1.8;
}
.tomb-en em { color: rgba(184, 139, 82, 0.7); font-style: italic; }

.tomb-lede {
  max-width: 360px;
  margin: 20px 0 0;
  color: rgba(236, 227, 211, 0.56);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 2;
}

.tomb-facts {
  display: flex;
  gap: 0;
  max-width: 390px;
  margin-top: 24px;
  border-top: 1px solid rgba(236, 227, 211, 0.13);
  border-bottom: 1px solid rgba(236, 227, 211, 0.13);
}
.tomb-facts div {
  flex: 1;
  padding: 10px 12px 9px 0;
  border-right: 1px solid rgba(236, 227, 211, 0.13);
}
.tomb-facts div:not(:first-child) { padding-left: 12px; }
.tomb-facts div:last-child { border-right: 0; }
.tomb-facts span {
  display: block;
  color: rgba(236, 227, 211, 0.28);
  font-size: 7px;
  letter-spacing: 0.08em;
}
.tomb-facts strong {
  display: block;
  margin-top: 4px;
  color: rgba(236, 227, 211, 0.78);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.tomb-hint {
  margin: 18px 0 0;
  color: rgba(236, 227, 211, 0.24);
  font-size: 7px;
  letter-spacing: 0.06em;
}

/* Spec -------------------------------------------------------------------- */

.tomb-spec {
  position: absolute;
  top: clamp(102px, 13vh, 150px);
  right: clamp(26px, 4vw, 62px);
  z-index: 7;
  width: 208px;
  padding-left: 14px;
  border-left: 1px solid rgba(184, 139, 82, 0.32);
  pointer-events: none;
}
.tomb-spec-index {
  margin: 0 0 13px;
  color: var(--gold);
  font-family: var(--en);
  font-size: 7px;
  letter-spacing: 0.13em;
}
.tomb-spec > p:not(.tomb-spec-index):not(.tomb-spec-note) {
  margin: 0;
  color: rgba(236, 227, 211, 0.42);
  font-size: 9px;
  line-height: 1.9;
}
.tomb-spec-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  margin-top: 12px;
  border-top: 1px solid rgba(236, 227, 211, 0.1);
  color: rgba(236, 227, 211, 0.28);
  font-size: 7px;
}
.tomb-spec-meta b {
  color: rgba(236, 227, 211, 0.55);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.tomb-spec-note {
  margin: 13px 0 0;
  color: rgba(236, 227, 211, 0.2);
  font-size: 6px;
  line-height: 1.8;
}
.tomb-research-link {
  display: inline-block;
  margin-top: 13px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(184, 139, 82, 0.35);
  color: rgba(211, 169, 104, 0.7);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-decoration: none;
  pointer-events: auto;
}
.tomb-research-link:hover { border-color: var(--gold); color: var(--paper); }

/* Hotspots ---------------------------------------------------------------- */

.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}
.hotspot::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(236, 227, 211, 0.8);
  border-radius: 50%;
  background: rgba(8, 7, 5, 0.5);
  content: "";
  transform: translate(-50%, -50%);
  transition: background 0.25s, border-color 0.25s, width 0.25s, height 0.25s;
}
.hotspot::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(184, 139, 82, 0.28);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}
.hotspot:hover::before,
.hotspot.is-active::before {
  width: 10px;
  height: 10px;
  border-color: var(--gold);
  background: var(--gold);
}
.hotspot span {
  position: absolute;
  top: 50%;
  left: 18px;
  display: block;
  padding: 5px 7px;
  background: rgba(8, 7, 5, 0.72);
  color: rgba(236, 227, 211, 0.76);
  font-size: 8px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
}
.hotspot:hover span,
.hotspot:focus-visible span,
.hotspot.is-active span { opacity: 1; transform: translateY(-50%) translateX(0); }
.hotspot--left span { right: 18px; left: auto; transform: translateY(-50%) translateX(4px); }
.hotspot--left:hover span,
.hotspot--left:focus-visible span,
.hotspot--left.is-active span { transform: translateY(-50%) translateX(0); }

body.labels-off .hotspot span { display: none; }

/* Part card --------------------------------------------------------------- */

.part-card {
  position: absolute;
  right: clamp(26px, 4vw, 62px);
  bottom: 112px;
  z-index: 20;
  width: 300px;
  padding: 19px 21px 17px;
  border: 1px solid rgba(184, 139, 82, 0.32);
  background: rgba(10, 9, 7, 0.86);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  backdrop-filter: blur(18px);
  transition: opacity 0.25s, transform 0.25s;
}
.part-card.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.part-close {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(236, 227, 211, 0.45);
  font-size: 17px;
  cursor: pointer;
}
.part-close:hover { color: var(--paper); }
.part-index {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: var(--en);
  font-size: 7px;
  letter-spacing: 0.12em;
}
.part-card h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.part-card > p:not(.part-index) {
  margin: 11px 0 0;
  color: rgba(236, 227, 211, 0.48);
  font-size: 9px;
  line-height: 1.9;
}
.part-meta {
  padding-top: 10px;
  border-top: 1px solid rgba(236, 227, 211, 0.1);
  color: rgba(236, 227, 211, 0.24) !important;
  font-size: 7px !important;
  letter-spacing: 0.04em;
}

/* Dock -------------------------------------------------------------------- */

.tomb-dock {
  position: absolute;
  bottom: 22px;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(236, 227, 211, 0.16);
  background: rgba(8, 7, 5, 0.72);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.dock-views { display: flex; }
.dock-view {
  min-width: 62px;
  height: 45px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid rgba(236, 227, 211, 0.1);
  background: transparent;
  color: rgba(236, 227, 211, 0.4);
  font-size: 8px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}
.dock-view span {
  display: block;
  margin-bottom: 3px;
  color: rgba(236, 227, 211, 0.2);
  font-family: var(--en);
  font-size: 6px;
}
.dock-view:hover { color: var(--paper); }
.dock-view.is-active { background: rgba(184, 139, 82, 0.1); color: var(--paper); }
.dock-view.is-active span { color: var(--gold); }

.dock-tools { display: flex; border-left: 1px solid rgba(236, 227, 211, 0.1); }
.dock-tool {
  display: flex;
  width: 51px;
  height: 45px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-right: 1px solid rgba(236, 227, 211, 0.08);
  background: transparent;
  color: rgba(236, 227, 211, 0.38);
  cursor: pointer;
}
.dock-tool:last-child { border-right: 0; }
.dock-tool:hover { color: var(--paper); }
.dock-tool.is-on { color: var(--gold); }
.dock-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.dock-tool span { font-size: 6px; letter-spacing: 0.04em; }

/* Footnote ---------------------------------------------------------------- */

.tomb-footnote {
  position: absolute;
  right: clamp(22px, 4vw, 62px);
  bottom: 8px;
  left: clamp(22px, 6vw, 92px);
  z-index: 6;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(236, 227, 211, 0.18);
  font-family: var(--en);
  font-size: 6px;
  letter-spacing: 0.1em;
  pointer-events: none;
}

/* Loader ------------------------------------------------------------------ */

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(184, 139, 82, 0.08), transparent 54%),
    #080705;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { width: min(330px, calc(100vw - 56px)); }
.loader-kicker {
  margin: 0 0 9px;
  color: var(--gold);
  font-family: var(--en);
  font-size: 7px;
  letter-spacing: 0.15em;
}
.loader-title {
  margin: 0;
  color: rgba(236, 227, 211, 0.8);
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.06em;
}
.loader-track {
  height: 1px;
  margin: 26px 0 10px;
  background: rgba(236, 227, 211, 0.12);
}
.loader-track span {
  display: block;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.25s;
}
.loader-sub {
  margin: 0;
  color: rgba(236, 227, 211, 0.25);
  font-size: 8px;
  letter-spacing: 0.03em;
}

/* Embed ------------------------------------------------------------------- */

html.is-embed .tomb-topbar,
html.is-embed .tomb-intro,
html.is-embed .tomb-spec,
html.is-embed .tomb-footnote {
  display: none !important;
}
html.is-embed .tomb-dock { bottom: 18px; }
html.is-embed .part-card { bottom: 88px; }
html.is-inline .tomb-topbar,
html.is-inline .tomb-intro,
html.is-inline .tomb-spec,
html.is-inline .tomb-dock,
html.is-inline .tomb-footnote,
html.is-inline .hotspot-layer,
html.is-inline .part-card,
html.is-inline .tomb-ar,
html.is-inline .loader { display: none !important; }
html.is-inline .tomb-stage { min-height: 0; height: 100%; background: #080705; }
html.is-inline .tomb-wash {
  background: linear-gradient(180deg, rgba(5, 5, 3, 0.12) 0%, transparent 18%, transparent 76%, rgba(5, 5, 3, 0.32) 100%);
}
html.is-embed .tomb-wash {
  background: linear-gradient(180deg, rgba(5, 5, 3, 0.28) 0%, transparent 16%, transparent 75%, rgba(5, 5, 3, 0.42) 100%);
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1100px) {
  .tomb-intro { width: 330px; }
  .tomb-intro h1 { font-size: clamp(44px, 6vw, 64px); }
  .tomb-spec { display: none; }
  .tomb-lede { font-size: 11px; }
}

@media (max-width: 820px) {
  .tomb-stage { min-height: 700px; }
  .tomb-topbar {
    height: 58px;
    grid-template-columns: 1fr auto;
    padding: 0 15px;
  }
  .tomb-topbar-center { display: none; }
  .tomb-brand-text small { display: none; }
  .tomb-back { font-size: 8px; }
  .tomb-icon-button { width: 29px; height: 29px; }

  .tomb-intro {
    top: 82px;
    left: 18px;
    width: min(300px, calc(100vw - 36px));
  }
  .tomb-kicker { margin-bottom: 13px; }
  .tomb-intro h1 { font-size: clamp(39px, 10.5vw, 56px); }
  .tomb-en { margin-top: 12px; }
  .tomb-lede {
    max-width: 310px;
    margin-top: 14px;
    font-size: 10px;
    line-height: 1.85;
  }
  .tomb-facts { max-width: 310px; margin-top: 16px; }
  .tomb-facts div { padding-top: 8px; padding-bottom: 8px; }
  .tomb-hint { margin-top: 13px; }

  .tomb-dock {
    bottom: 13px;
    width: calc(100vw - 24px);
    justify-content: space-between;
    overflow-x: auto;
  }
  .dock-views { flex: 1; }
  .dock-view { flex: 1; min-width: 47px; height: 42px; padding: 0 4px; font-size: 7px; }
  .dock-tools { flex: 0 0 auto; }
  .dock-tool { width: 43px; height: 42px; }
  .dock-tool svg { width: 15px; height: 15px; }
  .dock-tool span { font-size: 5px; }
  .tomb-footnote { display: none; }
  .part-card {
    right: 15px;
    bottom: 68px;
    width: min(280px, calc(100vw - 30px));
    padding: 16px 18px 14px;
  }
  .part-card h2 { font-size: 20px; }
  .hotspot span { font-size: 7px; }
  html.is-embed .tomb-dock { bottom: 12px; }
  html.is-embed .part-card { bottom: 66px; }
}

@media (max-width: 480px) {
  .tomb-intro { top: 76px; }
  .tomb-kicker { font-size: 6px; }
  .tomb-intro h1 { font-size: clamp(37px, 11.5vw, 50px); }
  .tomb-lede { max-width: 285px; font-size: 9px; }
  .tomb-facts { max-width: 285px; }
  .tomb-facts div { padding-right: 7px; }
  .tomb-facts div:not(:first-child) { padding-left: 7px; }
  .tomb-facts strong { font-size: 11px; }
  .tomb-hint { font-size: 6px; }
  .dock-view { min-width: 43px; font-size: 6px; }
  .dock-tool { width: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
