:root {
  color-scheme: dark;
  --bg: #07070a;
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.64);
  --line: rgba(245, 241, 232, 0.14);
  --glass: rgba(10, 10, 13, 0.58);
  --glass-strong: rgba(8, 8, 10, 0.88);
  --focus: #e8c36a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.experience {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 255, 255, 0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 26%, rgba(232, 195, 106, 0.13) 0 1px, transparent 2px),
    radial-gradient(circle at 58% 72%, rgba(255, 255, 255, 0.1) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 48%, rgba(232, 195, 106, 0.08), transparent 26%),
    linear-gradient(120deg, rgba(15, 22, 30, 0.82), rgba(8, 7, 12, 0.94) 44%, rgba(20, 8, 17, 0.9)),
    #07070a;
  background-size: 360px 280px, 620px 460px, 480px 340px, auto, auto, auto;
}

#space {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#space:active {
  cursor: grabbing;
}

#world {
  --grid-x: 0px;
  --grid-y: 0px;
  --grid-size: 320px;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#world::before {
  content: "";
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-position: var(--grid-x) var(--grid-y);
  background-size: var(--grid-size) var(--grid-size);
  opacity: 0.14;
  pointer-events: none;
}

.photo-card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  padding: 0;
  border: 1px solid rgba(245, 241, 232, 0.22);
  border-radius: 4px;
  background: rgba(245, 241, 232, 0.06);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform-origin: 50% 50%;
  transition: opacity 160ms ease, filter 160ms ease, box-shadow 160ms ease;
  will-change: transform, opacity, filter;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 34%, rgba(0, 0, 0, 0.18));
  opacity: 0.58;
  pointer-events: none;
}

.photo-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.photo-card.is-loaded:hover,
.photo-card.is-loaded:focus-visible {
  outline: 2px solid rgba(232, 195, 106, 0.86);
  outline-offset: 5px;
  filter: saturate(1.08) brightness(1.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.hud,
.counter,
.hint {
  position: absolute;
  z-index: 50;
  color: var(--text);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hud {
  top: 22px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.brand,
.actions,
.counter,
.hint {
  border: 1px solid var(--line);
  background: var(--glass);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border: 2px solid var(--focus);
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(232, 195, 106, 0.82);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  pointer-events: auto;
}

.icon-button,
.pill-button {
  border: 0;
  color: var(--text);
  background: rgba(245, 241, 232, 0.1);
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button {
  font-size: 23px;
  line-height: 1;
}

.pill-button {
  min-width: 58px;
  padding: 0 13px;
  font-size: 13px;
}

.pill-button[aria-pressed="false"] {
  color: var(--muted);
  background: transparent;
}

.icon-button:hover,
.pill-button:hover,
.icon-button:focus-visible,
.pill-button:focus-visible {
  outline: 2px solid rgba(232, 195, 106, 0.72);
  outline-offset: 2px;
  background: rgba(245, 241, 232, 0.16);
}

.import-button input {
  position: fixed;
  inset: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 320ms ease, visibility 320ms ease;
}

.enter-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-panel {
  text-align: center;
  color: var(--text);
}

.enter-kicker {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.26em;
}

.enter-panel h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 86px);
  font-weight: 500;
  letter-spacing: 0;
}

.enter-panel p {
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.enter-button {
  min-width: 128px;
  height: 44px;
  border: 1px solid rgba(245, 241, 232, 0.24);
  border-radius: 999px;
  color: var(--text);
  background: rgba(245, 241, 232, 0.12);
  cursor: pointer;
}

.enter-button:hover,
.enter-button:focus-visible {
  outline: 2px solid rgba(232, 195, 106, 0.72);
  outline-offset: 3px;
  background: rgba(245, 241, 232, 0.18);
}

.counter {
  left: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.counter span:first-child {
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
}

.hint {
  right: 22px;
  bottom: 22px;
  max-width: min(430px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 72px 32px 38px;
  background: rgba(0, 0, 0, 0.76);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox img {
  display: block;
  max-width: min(92vw, 1280px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.78);
}

.caption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.close-button {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--glass-strong);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.close-button:hover,
.close-button:focus-visible {
  outline: 2px solid rgba(232, 195, 106, 0.72);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .experience {
    min-height: 100vh;
  }

  .hud {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .brand {
    max-width: calc(100vw - 160px);
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .actions {
    gap: 5px;
    padding: 5px;
  }

  .icon-button,
  .pill-button {
    min-width: 34px;
    height: 34px;
  }

  .pill-button {
    min-width: 52px;
    padding: 0 10px;
  }

  .counter {
    left: 12px;
    bottom: 12px;
  }

  .hint {
    right: 12px;
    bottom: 64px;
    font-size: 12px;
    white-space: normal;
    border-radius: 18px;
  }

  .lightbox {
    padding: 72px 14px 28px;
  }
}
