:root {
  color-scheme: dark;
  --ink: #0b0b0c;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --quiet: rgba(255, 255, 255, 0.42);
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(11, 11, 12, 0.72);
  font-family:
    "Helvetica Neue", Helvetica, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

#experience,
#canvas-mount {
  position: fixed;
  inset: 0;
}

#experience {
  isolation: isolate;
  background: var(--ink);
}

#canvas-mount {
  z-index: 0;
}

#canvas-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Client lockup: BinSentry logo with a quiet project line. */
.brand-lockup {
  position: fixed;
  z-index: 5;
  top: max(24px, env(safe-area-inset-top));
  left: max(28px, env(safe-area-inset-left));
  max-width: calc(100vw - 210px);
  padding: 14px 18px 13px;
  background: var(--panel);
  border-left: 3px solid #ffffff;
  pointer-events: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.client-logo {
  display: block;
  width: clamp(170px, 17vw, 250px);
  height: auto;
}

.project-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.project-line span + span::before {
  margin: 0 0.6em;
  color: var(--quiet);
  content: "·";
}

.reset-button {
  position: fixed;
  z-index: 6;
  left: max(28px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.reset-button:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(30, 30, 32, 0.85);
}

.reset-icon {
  display: block;
  font-size: 1rem;
  line-height: 1;
}

/* Southeast Exhibits mark: one only, small, top right. */
.se-mark {
  position: fixed;
  z-index: 5;
  top: max(30px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  width: 140px;
  height: auto;
  opacity: 0.92;
  pointer-events: none;
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--ink);
  color: var(--muted);
  transition:
    opacity 500ms ease,
    visibility 500ms ease;
}

.loading-screen.is-complete {
  visibility: hidden;
  opacity: 0;
}

.loading-client {
  width: min(300px, 68vw);
  height: auto;
}

.loading-se {
  width: min(150px, 38vw);
  height: auto;
  margin-bottom: 14px;
  opacity: 0.85;
}

.loading-screen p {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.loading-mark {
  position: relative;
  width: 120px;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.loading-mark::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: #ffffff;
  content: "";
  animation: sweep 1.1s ease-in-out infinite;
}

@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

.error-message {
  position: fixed;
  z-index: 200;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100vw - 40px));
  padding: 28px;
  border: 1px solid var(--line);
  background: #141415;
  text-align: center;
  transform: translate(-50%, -50%);
}

.error-message h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.error-message p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.noscript-message {
  display: block !important;
}

/* Phones: lockup, Southeast Exhibits mark and reset stay pinned. */
@media (max-width: 640px) {
  .brand-lockup {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    max-width: calc(100vw - 24px - 110px - 12px);
    padding: 10px 12px 9px;
  }

  .client-logo {
    width: 160px;
  }

  .project-line {
    margin-top: 6px;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
  }

  .project-line span + span::before {
    margin: 0 0.45em;
  }

  .reset-button {
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 54px;
    min-height: 54px;
    justify-content: center;
    padding: 0;
    font-size: 0;
    letter-spacing: 0;
  }

  /* Icon only on phones: drop the label entirely so nothing offsets the icon. */
  .reset-label {
    display: none;
  }

  .reset-icon {
    font-size: 1.35rem;
  }

  .se-mark {
    top: max(18px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-mark::after {
    animation: none;
  }

  .loading-screen,
  .reset-button {
    transition: none;
  }
}
