:root {
  color-scheme: dark;
  --gallery-build: "20260612-visual-data-trim-1";
  --bg: #020303;
  --panel: rgba(8, 10, 10, 0.62);
  --panel-strong: rgba(246, 247, 238, 0.95);
  --line: rgba(255, 255, 255, 0.17);
  --line-hot: rgba(184, 200, 145, 0.56);
  --text: #f7f8f2;
  --muted: rgba(247, 248, 242, 0.62);
  --ink: #080909;
  --accent: #b8c891;
  --warm: #bd7658;
}

* {
  box-sizing: border-box;
}

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

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.gallery-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 44%, rgba(184, 200, 145, 0.11), transparent 32%),
    radial-gradient(circle at 76% 22%, rgba(189, 118, 88, 0.14), transparent 26%),
    radial-gradient(circle at 20% 78%, rgba(92, 139, 154, 0.12), transparent 30%),
    #000;
}

.gallery-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.86)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.58), transparent 42%, rgba(0, 0, 0, 0.78)),
    url("/assets/background-DWZ8orkr.png") center / cover no-repeat;
  filter: saturate(1.04) contrast(1.12) brightness(0.58);
  opacity: 0.78;
  transform: scale(1.035);
}

#sphere-gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.is-dragging #sphere-gallery {
  cursor: grabbing;
}

.gallery-shell::before,
.gallery-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.gallery-shell::before {
  background:
    linear-gradient(rgba(184, 200, 145, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 200, 145, 0.012) 1px, transparent 1px),
    linear-gradient(105deg, transparent 0%, transparent 42%, rgba(184, 200, 145, 0.09) 49%, transparent 56%, transparent 100%);
  background-size: 9.6vw 100%, 100% 15vh, 220% 100%;
  background-position: 0 0, 0 0, -120% 0;
  opacity: 0.16;
  animation: archive-scan 13s linear infinite;
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 54%, transparent 76%);
}

.gallery-shell::after {
  background:
    radial-gradient(circle at 50% 50%, transparent 0%, transparent 50%, rgba(0, 0, 0, 0.58) 82%, #000 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.78), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.78)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.74), transparent 22%, transparent 76%, rgba(0, 0, 0, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(184, 200, 145, 0.08),
    inset 0 0 80px rgba(92, 139, 154, 0.08);
}

@keyframes archive-scan {
  0% {
    background-position: 0 0, 0 0, -120% 0;
  }

  100% {
    background-position: 0 0, 0 0, 120% 0;
  }
}

.gallery-topbar,
.gallery-hud,
.sound-pill,
.depth-mode-toggle,
.expand-view {
  position: absolute;
  z-index: 4;
}

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

.brand,
.gallery-topbar nav {
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.42);
  box-shadow:
    0 0 30px rgba(255, 255, 255, 0.12),
    0 0 34px rgba(184, 200, 145, 0.14);
}

.gallery-topbar nav {
  display: inline-flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 8, 8, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.gallery-topbar nav a,
.sound-pill,
.depth-mode-toggle,
.close-expand,
.gallery-launch-button {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.gallery-topbar nav a {
  padding: 10px 16px;
}

.gallery-topbar nav a:hover,
.sound-pill:hover,
.depth-mode-toggle:hover,
.close-expand:hover {
  background: var(--panel-strong);
  color: var(--ink);
}

.gallery-hud span,
.expand-card span {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-hud {
  bottom: 24px;
  width: 240px;
  padding: 16px;
  border: 1px solid rgba(184, 200, 145, 0.23);
  border-radius: 8px;
  background: var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 20px 50px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.gallery-hud-left {
  left: 26px;
}

.gallery-hud-right {
  display: none;
  right: 26px;
  text-align: right;
}

.gallery-hud strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.15;
}

.gallery-hud small {
  display: block;
  margin-top: 8px;
  color: rgba(247, 248, 242, 0.48);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sound-pill {
  top: 86px;
  right: 28px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.depth-mode-toggle {
  left: 50%;
  bottom: 24px;
  padding: 13px 20px;
  border: 1px solid rgba(184, 200, 145, 0.36);
  background: rgba(3, 6, 5, 0.54);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 34px rgba(184, 200, 145, 0.11);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.depth-mode-toggle[aria-pressed="true"] {
  border-color: rgba(189, 118, 88, 0.72);
  background: rgba(64, 35, 25, 0.64);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 38px rgba(189, 118, 88, 0.18);
}

.sound-pill[aria-pressed="true"] {
  border-color: rgba(184, 200, 145, 0.48);
  color: #f8f9ed;
  background: rgba(50, 64, 42, 0.54);
  box-shadow: 0 0 26px rgba(184, 200, 145, 0.13);
}

.expand-view {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 88px 24px 28px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
}

.expand-view[aria-hidden="true"] {
  visibility: hidden;
}

.expand-view.is-open {
  pointer-events: auto;
}

.close-expand {
  position: absolute;
  top: 26px;
  right: 28px;
  padding: 14px 20px;
  background: var(--panel-strong);
  color: var(--ink);
}

.modal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 200, 145, 0.32);
  border-radius: 8px;
  background: rgba(8, 10, 10, 0.58);
  color: var(--text);
  cursor: pointer;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
}

.modal-prev {
  left: max(22px, calc((100vw - 1120px) / 2));
}

.modal-next {
  right: max(22px, calc((100vw - 1120px) / 2));
}

.modal-nav:hover,
.modal-nav:focus-visible {
  border-color: rgba(184, 200, 145, 0.72);
  background: var(--panel-strong);
  color: var(--ink);
  outline: 0;
}

.expand-card {
  position: relative;
  width: min(1040px, 92vw);
  max-height: min(760px, 84vh);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 20px;
  padding: 18px;
  border: 1px solid rgba(184, 200, 145, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(184, 200, 145, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(12, 18, 18, 0.93), rgba(5, 7, 7, 0.88));
  box-shadow:
    0 34px 120px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 0 56px rgba(92, 139, 154, 0.1);
  backdrop-filter: blur(24px);
  overflow: auto;
  transform: scale(0.86);
}

.expand-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  pointer-events: none;
}

.expand-card img {
  width: 100%;
  height: min(68vh, 680px);
  object-fit: contain;
  border-radius: 6px;
  background: #050606;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 18px 60px rgba(0, 0, 0, 0.46);
}

.expand-view.is-media-only .expand-card {
  grid-template-columns: minmax(0, 1fr);
  width: min(1040px, 92vw);
}

.expand-view.is-media-only .expand-card > div {
  display: none;
}

.expand-view.is-media-only .expand-card img {
  height: min(78vh, 760px);
}

.expand-card h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 2.75vw, 48px);
  line-height: 0.98;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.expanded-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
}

.expanded-meta span {
  margin: 0;
  border: 1px solid rgba(184, 200, 145, 0.28);
  border-radius: 999px;
  padding: 6px 8px;
  color: rgba(247, 248, 242, 0.78);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.expanded-journal {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: rgba(247, 248, 242, 0.74);
}

.expanded-journal:empty {
  display: none;
}

.expanded-journal span {
  margin: 0;
}

.expanded-journal p {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(184, 200, 145, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 840px) {
  .gallery-topbar {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .brand span:last-child,
  .gallery-hud-left {
    display: none;
  }

  .gallery-topbar nav a {
    padding: 9px 12px;
  }

  .sound-pill {
    top: 70px;
    right: 12px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .depth-mode-toggle {
    right: auto;
    bottom: 16px;
    left: 50%;
    padding: 10px 12px;
    font-size: 13px;
    transform: translateX(-50%);
  }

  .gallery-hud-right {
    left: 12px;
    right: 12px;
    bottom: 70px;
    width: auto;
    text-align: left;
  }

  .expand-card {
    grid-template-columns: 1fr;
  }

  .modal-nav {
    width: 42px;
    height: 52px;
    font-size: 28px;
  }

  .modal-prev {
    left: 12px;
  }

  .modal-next {
    right: 12px;
  }
}
