:root {
  --bg: #070707;
  --ink: #f4f0e8;
  --muted: #9c968c;
  --line: rgba(244, 240, 232, 0.14);
  --panel: rgba(18, 17, 15, 0.72);
  --accent: #ff5a1f;
  --accent-ink: #1a100c;
  color-scheme: dark;
  font-family: "elza", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

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

#app {
  position: relative;
}

body {
  overflow: hidden;
}

html.light {
  --bg: #e7e2d8;
  --ink: #1c1915;
  --muted: #6b655c;
  --line: rgba(28, 25, 21, 0.16);
  --panel: rgba(255, 252, 247, 0.82);
  color-scheme: light;
}

html.light header {
  background: linear-gradient(to bottom, rgba(231, 226, 216, 0.94), transparent);
}

#viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

header,
#toolbar,
#look,
#hint,
#status {
  position: absolute;
  z-index: 2;
}

header {
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 22px 28px 18px;
  background: transparent;
  pointer-events: none;
}

header > * {
  pointer-events: auto;
}

.title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-self: start;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: 400 16px "elza", ui-sans-serif, sans-serif;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
}

.title svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

#moments {
  display: flex;
  gap: 12px;
  justify-self: center;
}

#moments button {
  min-width: 148px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: transparent;
  color: #fff;
  font: 700 12px "elza", ui-sans-serif, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

#moments button[aria-current="true"] {
  border-color: #fffb59;
  color: #fffb59;
}

#moments button:disabled {
  cursor: default;
}

#intro {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 120px 32px 72px;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  opacity: 1;
  transition: opacity 1.2s ease;
}

#intro.is-out {
  opacity: 0;
}

#intro.is-out #intro-start {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #intro {
    transition: none;
  }
}

.intro-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 34em;
}

#intro[hidden] {
  display: none;
}

#intro p {
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

#intro-start {
  pointer-events: auto;
  height: 42px;
  padding: 0 18px;
  border: 1px solid #fffb59;
  background: transparent;
  color: #fffb59;
  font: 700 12px "elza", ui-sans-serif, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

#filename {
  margin-top: 2px;
  color: var(--muted);
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

#stats {
  display: flex;
  gap: 22px;
  margin: 0;
  justify-self: end;
}

#stats[hidden] {
  display: none;
}

#stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 14px;
}

#toolbar button,
#toolbar a,
#look button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  backdrop-filter: blur(16px);
  font: inherit;
  cursor: pointer;
}

#toolbar button:hover,
#toolbar a:hover,
#look button:hover {
  filter: brightness(1.08);
}

#look {
  top: 92px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(460px, calc(100% - 40px));
}

#look .group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#look .group p {
  width: 100%;
  text-align: right;
  color: var(--muted);
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#look button {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

#look button[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(255, 90, 31, 0.7);
  background: rgba(255, 90, 31, 0.16);
}

[hidden] {
  display: none !important;
}

#toolbar {
  left: 20px;
  bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(640px, calc(100% - 40px));
}

#toolbar button,
#toolbar a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

#toolbar button[aria-pressed="true"] {
  color: var(--ink);
  border-color: rgba(255, 90, 31, 0.7);
  background: rgba(255, 90, 31, 0.16);
}

#hint,
#status {
  right: 22px;
  color: var(--muted);
  font-size: 12px;
  font-family: "elza", ui-sans-serif, sans-serif;
}

#hint {
  bottom: 22px;
}

#status {
  bottom: 100px;
  color: var(--ink);
}

#status:empty {
  display: none;
}

#camera-readout {
  position: absolute;
  z-index: 3;
  top: 168px;
  left: 22px;
  margin: 0;
  color: var(--ink);
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  user-select: text;
}

#camera-readout p {
  margin: 0;
}

#camera-readout p:first-child {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#shadow-controls,
#data-controls {
  position: absolute;
  z-index: 3;
  top: 268px;
  left: 22px;
  display: grid;
  gap: 8px;
  width: 168px;
  margin: 0;
  color: var(--ink);
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#data-controls {
  top: 168px;
  right: 22px;
  left: auto;
  width: 210px;
  max-height: calc(100% - 220px);
  overflow: auto;
}

#shadow-controls p,
#data-controls p {
  margin: 0 0 2px;
  color: var(--muted);
}

#shadow-controls label,
#data-controls label {
  display: grid;
  gap: 4px;
}

#shadow-controls label span,
#data-controls label span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#shadow-controls output,
#data-controls output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

#shadow-controls input,
#data-controls input {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

#latitude-readout {
  position: absolute;
  z-index: 4;
  margin: 0;
  color: #fffb59;
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  transform: translate(calc(-100% - 10px), -50%);
}

#data-overlay {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  max-width: none;
  opacity: 0;
  pointer-events: none;
  transform-origin: 0 0;
  user-select: none;
}

#scene-nav {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 12px 20px max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}

#scene-nav button,
#scene-dots {
  pointer-events: auto;
}

#scene-nav button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f4f0e8;
  cursor: pointer;
}

#scene-nav button:disabled {
  opacity: 0.28;
  cursor: default;
}

#scene-nav svg {
  display: block;
  width: 26px;
  height: 26px;
  margin: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#scene-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

#scene-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(244, 240, 232, 0.35);
  cursor: pointer;
}

#scene-dots button[aria-current="true"] {
  width: 8px;
  height: 8px;
  background: #f4f0e8;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.vr #look {
  position: fixed;
  z-index: 10000;
  top: 18px;
  right: 18px;
}

body.vr .vr-back,
body.vr #vr-status,
body.vr #vr-hint {
  position: fixed;
  z-index: 10000;
  font-family: "elza", ui-sans-serif, sans-serif;
}

body.vr .vr-back {
  top: 18px;
  left: 18px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  backdrop-filter: blur(16px);
  font-size: 13px;
}

body.vr #vr-status,
body.vr #vr-hint {
  left: 20px;
  color: var(--muted);
  font-size: 12px;
}

body.vr #vr-status {
  top: 64px;
  color: var(--ink);
}

body.vr #vr-status:empty {
  display: none;
}

body.vr #vr-hint {
  bottom: 22px;
  max-width: min(520px, calc(100% - 140px));
}

#tutorial {
  position: absolute;
  z-index: 4;
  left: 6%;
  bottom: 12%;
  width: min(460px, calc(100% - 12%));
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
  transition: left 0.9s ease, bottom 0.9s ease;
}

#tutorial[hidden] {
  display: none !important;
}

#tutorial-piece,
#tutorial-kicker {
  margin: 0;
  color: rgba(244, 240, 232, 0.62);
  font-family: "elza", ui-sans-serif, sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.65);
}

#tutorial-kicker {
  margin-top: 6px;
}

#tutorial h2 {
  margin: 10px 0 0;
  max-width: 11ch;
  color: #fff;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

#tutorial-body {
  margin-top: 16px;
  max-width: 36ch;
  color: rgba(244, 240, 232, 0.72);
  font-size: 16px;
  line-height: 1.45;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);
}

.tutorial-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  pointer-events: auto;
}

.tutorial-nav button {
  border: 0;
  background: none;
  padding: 0;
  color: rgba(244, 240, 232, 0.7);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

.tutorial-nav button[data-tutorial="next"] {
  margin-left: auto;
  color: #fff;
}

#tutorial-dots {
  display: flex;
  gap: 6px;
}

#tutorial-dots span {
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: rgba(244, 240, 232, 0.35);
}

#tutorial-dots span[data-on="true"] {
  background: #fff;
}

@media (max-width: 980px) {
  #moments button {
    min-width: 0;
    padding: 0 12px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 720px) {
  header {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
  }

  #moments {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #moments button {
    height: 36px;
    padding: 0 10px;
  }

  #stats {
    width: auto;
  }

  #hint {
    display: none;
  }

  #filename {
    max-width: 52vw;
  }

  #look {
    top: auto;
    right: 16px;
    bottom: 72px;
    left: 16px;
    max-width: none;
  }

  #look .group {
    justify-content: flex-start;
  }

  #look .group p {
    text-align: left;
  }

  #tutorial {
    left: 8% !important;
    bottom: 22% !important;
    width: min(460px, calc(100% - 16%));
  }
}
