:root {
  --rov-ink: #0c0906;
  --rov-line: rgba(255, 255, 255, 0.28);
  --rov-line-bright: rgba(255, 255, 255, 0.75);
  --rov-text: #f4ede4;
  --rov-text-dim: rgba(244, 237, 228, 0.62);
  --rov-amber: #d98d3f;
  /* Shared by the header scrim and its mirror at the bottom, so the two
     stay in step if either is retuned. */
  --rov-scrim: rgba(8, 5, 3, 0.66);
  --rov-scrim-fade: rgba(8, 5, 3, 0);
  --rov-scrim-bottom-height: 170px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--rov-ink);
  color: var(--rov-text);
  font-family: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
}

#renderCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  touch-action: none;
}

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

#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at 50% 45%, #241408 0%, #0c0906 75%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

#loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--rov-line);
  border-top-color: var(--rov-line-bright);
  animation: rov-spin 1.4s linear infinite;
}

.loader-text {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--rov-text-dim);
}

@keyframes rov-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Header ---------- */

#siteHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: linear-gradient(to bottom, var(--rov-scrim) 0%, var(--rov-scrim-fade) 100%);
  pointer-events: none;
}

#siteHeader a {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--rov-text);
}

.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--rov-text);
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.86rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-links a {
  color: rgba(244, 237, 228, 0.85);
  display: inline-flex;
  width: 18px;
  height: 18px;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.social-links svg {
  width: 100%;
  height: 100%;
}

/* ---------- Bottom scrim ---------- */

/* Mirrors the header scrim so the XR pill and its hint sit on the same
   contrast footing as the brand and social row when the dome behind them
   is bright. A pseudo-element keeps it out of the markup; z-index 10 puts
   it over the canvas but under the controls it is there to support. */
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--rov-scrim-bottom-height);
  z-index: 10;
  background: linear-gradient(to top, var(--rov-scrim) 0%, var(--rov-scrim-fade) 100%);
  pointer-events: none;
}

/* ---------- XR entry control ---------- */

.xr-button-host {
  position: fixed;
  left: 50%;
  bottom: 6.5vh;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.xr-button-host[hidden] { display: none; }

.xr-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid var(--rov-line);
  background: rgba(20, 15, 10, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--rov-text);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.xr-pill:hover {
  border-color: var(--rov-line-bright);
  background: rgba(30, 22, 14, 0.5);
  transform: translateY(-2px);
}

.xr-pill:active {
  transform: translateY(0);
}

.xr-pill svg {
  width: 26px;
  height: 16px;
  flex-shrink: 0;
}

.xr-hint {
  pointer-events: none;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rov-text-dim);
}

@media (max-width: 640px) {
  #siteHeader { padding: 16px 18px; }
  .brand-name { font-size: 0.68rem; letter-spacing: 0.2em; }
  .social-links { gap: 14px; }
  .social-links a { width: 16px; height: 16px; }
  .xr-button-host { bottom: 4.5vh; }
  :root { --rov-scrim-bottom-height: 140px; }
  .xr-pill { padding: 12px 20px; font-size: 0.64rem; }
}
