:root {
  color-scheme: dark;
  --black: #000000;
  --text: #eef5f6;
  --muted: #9aa9ad;
  --dim: #73858b;
  --ice: #a7d7df;
  --amber: #d8ab70;
  --line: #26353a;
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  background: var(--black);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--black); }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--amber); outline-offset: 5px; }
button, select { min-height: 48px; }

#view { position: fixed; inset: 0; display: block; width: 100%; height: 100%; z-index: 0; }
#overlay { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 48px 48px 30px; }
.hero { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 22px; min-height: 382px; }
.hero-copy { padding: 12px 0 25px; }
h1 { margin: 0 0 27px; font-size: clamp(44px, 5.4vw, 70px); line-height: .95; font-weight: 350; letter-spacing: -.06em; }
.lead { margin: 0 0 20px; font-size: clamp(23px, 2.3vw, 29px); line-height: 1.37; font-weight: 360; letter-spacing: -.02em; }
.intro { max-width: 395px; margin: 0; font-size: 15px; line-height: 1.7; color: var(--muted); }
.mission-label { margin: 0 0 18px; color: var(--ice); font-size: 11px; letter-spacing: .16em; }
#briefing p { margin: 0 0 14px; }
#briefing .assignment { padding-left: 14px; border-left: 2px solid var(--amber); color: var(--text); }
.room-study { margin: -15px -28px 0 0; }
.room-study svg { display: block; width: 100%; height: auto; }
.room-study figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: -7px; font-size: 12px; color: var(--muted); }
.legend-dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--ice); }
.phantom-dot { background: var(--amber); margin-left: 18px; }

.setup { margin-top: 30px; }
.mode-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
h2 { margin: 0; font-size: 20px; font-weight: 450; letter-spacing: -.015em; }
.mode-heading p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-button { display: flex; align-items: center; gap: 20px; padding: 24px; text-align: left; background: var(--black); color: var(--text); border: 1px solid #3b555c; border-radius: 9px; }
.mode-button:not(:disabled):hover { background: #071013; border-color: var(--ice); }
.mode-button:not(:disabled):active { background: #102025; }
.mode-button svg { width: 29px; height: 29px; flex: 0 0 29px; fill: none; stroke: var(--ice); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.mode-button svg circle { fill: var(--ice); stroke: none; }
.mode-button strong { display: block; margin-bottom: 7px; font-size: 19px; font-weight: 500; }
.mode-button small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.preferences { display: flex; align-items: center; gap: 30px; margin-top: 24px; }
.preferences label { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.preferences select { padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--black); color: var(--text); font-size: 13px; }
.movement-choice { margin: 0 0 20px; flex-wrap: wrap; }
.first-use { margin: 19px 0 0; font-size: 12px; color: var(--dim); line-height: 1.6; }
.status-area { margin-top: 28px; font-size: 13px; line-height: 1.5; }
#status { margin: 0; color: var(--ice); overflow-wrap: anywhere; }
#capabilities { margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.desktop-option { display: flex; align-items: center; gap: 14px; }
.desktop-option span { color: var(--dim); font-size: 12px; }
.footer a { color: var(--muted); font-size: 12px; text-underline-offset: 4px; }
.footer a:hover { color: var(--text); }
.attribution { margin: 18px 0 0; color: var(--dim); font-size: 11px; line-height: 1.6; }
.attribution a { color: var(--muted); text-underline-offset: 3px; }

.runtime { display: none; }
.runtime-heading { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-bottom: 14px; }
.runtime-brand { font-size: 17px; font-weight: 450; letter-spacing: -.035em; }
.runtime-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.runtime-buttons button { min-height: 44px; padding: 10px 15px; color: var(--text); border: 1px solid #3b555c; background: #050b0d; border-radius: 6px; font-size: 13px; }
.runtime-buttons button:not(:disabled):hover { border-color: var(--ice); background: #122128; }
.runtime-buttons #exit { margin-left: auto; color: var(--muted); }
.runtime-help { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

#overlay.xr { position: fixed; top: auto; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; width: min(650px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; margin: 0; padding: 20px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .9); }
#overlay.xr .launch { display: none; }
#overlay.xr .runtime { display: block; }
#overlay.xr .status-area { margin-top: 12px; }
#overlay.xr #capabilities { display: none; }
#overlay.xr .runtime-help { display: none; }
#overlay.xr .runtime-heading { margin-bottom: 10px; }

@media (max-width: 760px) {
  #overlay { padding: 35px 24px 24px; }
  .hero { min-height: 0; grid-template-columns: 1fr .9fr; gap: 0; }
  h1 { font-size: 45px; margin-bottom: 24px; }
  .lead { font-size: 22px; }
  .intro { font-size: 13px; }
  .room-study { margin-right: -22px; }
  .mode-heading { display: block; }
  .mode-heading p { margin-top: 7px; }
  .mode-button { padding: 19px 16px; gap: 14px; }
  .mode-button strong { font-size: 16px; }
  .mode-button small { font-size: 12px; }
  .preferences { gap: 16px; }
  .preferences label { flex-direction: column; align-items: start; gap: 7px; }
  .desktop-option { display: block; }
  .desktop-option span { display: block; margin-top: -4px; }
}

@media (max-width: 540px) {
  #overlay { padding: 34px 20px 25px; }
  .hero { display: block; }
  .hero-copy { padding: 0; }
  h1 { font-size: 53px; }
  .lead { font-size: 25px; }
  .intro { font-size: 14px; max-width: 355px; }
  .room-study { width: min(100%, 350px); margin: 7px auto 0; }
  .room-study svg { max-height: 235px; }
  .room-study figcaption { margin-top: -5px; }
  .setup { margin-top: 36px; }
  .modes { grid-template-columns: 1fr; gap: 10px; }
  .mode-button { padding: 20px; gap: 20px; }
  .mode-button strong { font-size: 18px; }
  .preferences { align-items: start; justify-content: space-between; gap: 12px; }
  .preferences label { min-width: 0; font-size: 12px; }
  .preferences select { max-width: 100%; font-size: 12px; padding-left: 9px; padding-right: 22px; }
  .movement-choice { flex-direction: column; gap: 16px; }
  .movement-choice label, .movement-choice select { width: 100%; }
  .first-use { font-size: 12px; }
  .footer { align-items: end; gap: 15px; }
  .footer a { max-width: 100px; line-height: 1.5; }
  .desktop-option span { font-size: 11px; }
  #overlay.xr { padding: 16px; bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100% - 20px); }
  .runtime-buttons { gap: 7px; }
  .runtime-buttons button { padding: 9px 11px; font-size: 12px; }
  .runtime-buttons #exit { margin-left: 0; }
  .runtime-heading { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

[hidden] { display: none !important; }
