:root {
  --bg: #020204;
  --text: #f5f1ea;
  --muted: rgba(245, 241, 234, 0.68);
  --line: rgba(255, 255, 255, 0.1);
  --purple: rgba(218, 194, 255, 0.9);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  overflow-x: hidden;
}

html.viewer-lock-scroll,
body.viewer-lock-scroll {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* HERO */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-dark {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at center,
      rgba(0, 0, 0, 0.12) 0%,
      rgba(0, 0, 0, 0.62) 55%,
      #020204 100%
    ),
    linear-gradient(
      to bottom,
      rgba(2, 2, 4, 0.1) 0%,
      #020204 100%
    );
}

.hero-title {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.hero-title h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(54px, 7vw, 112px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: #fff;
  text-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
}

.hero-title p {
  margin: 18px 0 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(36px, 5vw, 78px);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.78);
}

/* GALLERY */

.gallery-section {
  position: relative;
  min-height: 100vh;
  padding: 42px 16px 96px;
  background: #000;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gallery-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(680px, calc(100% - 32px));
  margin: 0 auto 36px;
  padding: 1px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.7), rgba(255, 42, 109, 0.64), rgba(255, 216, 77, 0.58)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 70px rgba(0, 0, 0, 0.42),
    0 0 42px rgba(0, 229, 255, 0.08);
}

.gallery-search {
  flex: 1;
  min-width: 0;
}

.gallery-search input {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: rgba(4, 4, 7, 0.92);
  color: white;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.gallery-search input::placeholder {
  color: rgba(255, 255, 255, 0.48);
}

.gallery-edit {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: #07070a;
  color: white;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.gallery-edit svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.gallery-edit:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px) scale(1.03);
  background: #111116;
}

.masonry-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #050505;
  cursor: pointer;
  appearance: none;
  color: inherit;
  text-decoration: none;
  text-align: left;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-card:hover img {
  transform: scale(1.035);
}

.gallery-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 52px 16px 18px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.86) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    transparent 100%
  );
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.gallery-card:hover .gallery-card-content {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card-content h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 500;
  line-height: 1.15;
  color: #fff;
}

.gallery-card-content p {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
}

/* ERROR */

.gallery-error {
  color: white;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  font-family: "Inter", Arial, sans-serif;
}

.gallery-error h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.gallery-error p {
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.7);
}

/* ADMIN */

.admin-section {
  background: #000;
  padding: 0 20px 120px;
}

.admin-page {
  min-height: 100vh;
  background: #000;
}

.admin-section.standalone {
  min-height: 100vh;
  padding: 32px 20px 80px;
}

.admin-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #08080a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 55%),
    #0d0d10;
}

.admin-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.admin-header h1,
.admin-header h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  line-height: 1;
}

.admin-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.editor-field,
.editor-upload {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.editor-field label,
.editor-upload label {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.editor-field input,
.editor-upload input {
  width: 100%;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font: inherit;
  outline: none;
}

.editor-upload input {
  padding-top: 9px;
  font-size: 12px;
}

.editor-field input:focus,
.editor-upload input:focus {
  border-color: rgba(169, 231, 255, 0.55);
  background: rgba(255, 255, 255, 0.09);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.admin-search {
  display: grid;
  grid-template-columns: auto minmax(220px, 340px);
  align-items: center;
  gap: 10px;
}

.admin-search span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-search input {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font: inherit;
  outline: none;
}

.admin-search input:focus {
  border-color: rgba(169, 231, 255, 0.55);
  background: rgba(255, 255, 255, 0.09);
}

.admin-button,
.asset-button,
.icon-button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-decoration: none;
}

.admin-button:hover,
.asset-button:hover,
.icon-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.admin-button.primary {
  border-color: rgba(169, 231, 255, 0.42);
  background: rgba(70, 170, 210, 0.2);
}

.admin-button.danger,
.icon-button.danger {
  border-color: rgba(255, 96, 114, 0.32);
  color: #ffb7c0;
}

.admin-table-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: auto;
  scrollbar-color: rgba(160, 160, 170, 0.72) transparent;
  scrollbar-width: thin;
}

.admin-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.admin-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.admin-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(160, 160, 170, 0.72);
}

.admin-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(190, 190, 200, 0.85);
}

.admin-table {
  width: 100%;
  min-width: 1680px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
}

.admin-table td:nth-child(1),
.admin-table td:nth-child(2) {
  width: 42px;
}

.admin-table td:nth-child(3) {
  width: 190px;
}

.admin-table td:nth-child(4),
.admin-table td:nth-child(5) {
  width: 150px;
}

.admin-table td:nth-child(6) {
  width: 190px;
}

.admin-table td:nth-child(7) {
  width: 160px;
}

.admin-table td:nth-child(8) {
  width: 250px;
}

.admin-table td:nth-child(9) {
  width: 170px;
}

.admin-table td:nth-child(10),
.admin-table td:nth-child(11) {
  width: 220px;
}

.admin-table td:nth-child(12) {
  width: 190px;
}

.empty-table {
  height: 92px;
  color: rgba(255, 255, 255, 0.52);
  text-align: center !important;
}

.admin-input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font: inherit;
  outline: none;
}

.admin-input:focus {
  border-color: rgba(169, 231, 255, 0.55);
  background: rgba(255, 255, 255, 0.09);
}

.asset-cell {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.select-column,
.drag-column {
  text-align: center !important;
}

.row-select,
#selectAllRows {
  width: 15px;
  height: 15px;
  accent-color: #fff;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  cursor: grab;
}

.drag-handle:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.drag-handle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.is-dragging {
  opacity: 0.45;
}

.is-drop-target td {
  background: rgba(255, 255, 255, 0.06) !important;
}

.asset-cell img {
  display: block;
  width: 82px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  background: #111;
}

.panorama-cell img {
  height: 48px;
}

.asset-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-button,
.icon-button {
  padding: 0 8px;
}

.row-actions {
  min-width: 270px;
}

.table-title,
.table-path {
  display: block;
}

.table-title {
  margin-bottom: 6px;
  font-size: 14px;
}

.table-path {
  max-width: 190px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-workspace {
  width: 100%;
  min-height: 100vh;
  max-width: none;
  margin: 0 auto;
  padding: 0 16px 64px;
  background: #000;
}

.admin-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000;
  padding: 28px 0 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.admin-back-link {
  display: inline-block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.admin-back-link:hover {
  color: rgba(255, 255, 255, 0.85);
}

.admin-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 20px;
}

.admin-topbar h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(38px, 5.5vw, 72px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.02em;
}

.admin-commandbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-search-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.admin-search-group .admin-search.gradient {
  width: min(300px, 100%);
  flex-shrink: 0;
}

.admin-refresh-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.4s ease;
  flex-shrink: 0;
}

.admin-refresh-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-refresh-btn:hover {
  color: white;
  transform: rotate(180deg);
}

.admin-search.gradient {
  display: block;
  padding: 1px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(0, 229, 255, 0.72), rgba(255, 42, 109, 0.62), rgba(255, 216, 77, 0.58)),
    rgba(255, 255, 255, 0.08);
}

.admin-search.gradient input {
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: #07070a;
  color: white;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-actions .icon-only {
  width: 38px;
  padding: 0;
}

.admin-actions .icon-only svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.view-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.view-button.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.view-button:hover:not(.is-active) {
  color: rgba(255, 255, 255, 0.82);
}

.view-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.admin-view {
  display: none;
  position: relative;
  z-index: 1;
}

.admin-view.is-active {
  display: block;
}

.notion-table {
  min-width: 1660px;
  background: transparent;
}

.notion-table th,
.notion-table td {
  padding: 8px;
}

.notion-table th {
  background: #050506;
  position: sticky;
  top: 0;
  z-index: 2;
}

.notion-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.is-draft-row td {
  background: rgba(70, 170, 210, 0.08);
}

.table-input {
  width: 100%;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 0 8px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  -webkit-text-fill-color: #fff;
}

.table-input:hover,
.table-input:focus {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.table-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.35);
}

.table-input.small {
  height: 30px;
  font-size: 12px;
}

.table-textarea {
  min-height: 54px;
  padding-top: 8px;
  resize: vertical;
  line-height: 1.35;
}

.inline-asset {
  position: relative;
  display: block;
  width: 68px;
}

.asset-preview {
  position: relative;
  width: 68px;
  height: 52px;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
}

.inline-asset img,
.asset-empty {
  width: 68px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: #111;
  display: block;
}

.asset-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.asset-empty svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.asset-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  transition: opacity 0.15s ease;
  border-radius: 6px;
}

.asset-overlay svg {
  width: 18px;
  height: 18px;
  fill: white;
  stroke: none;
}

.asset-preview:hover .asset-overlay {
  opacity: 1;
}

.asset-menu {
  position: absolute;
  top: 58px;
  left: 0;
  z-index: 50;
  width: auto;
  min-width: 160px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px;
  background: #0e0e12;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.asset-menu[hidden] {
  display: none;
}

.asset-menu-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.asset-icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.asset-icon-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.asset-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.asset-icon-btn.is-active {
  background: rgba(70, 170, 210, 0.2);
  border-color: rgba(169, 231, 255, 0.4);
  color: rgba(169, 231, 255, 0.9);
}

.asset-icon-btn.accent {
  border-color: rgba(169, 231, 255, 0.25);
  color: rgba(169, 231, 255, 0.75);
}

.asset-icon-btn.accent:hover {
  background: rgba(70, 170, 210, 0.2);
  border-color: rgba(169, 231, 255, 0.5);
  color: rgba(169, 231, 255, 1);
}

.asset-icon-btn.danger {
  color: rgba(255, 120, 130, 0.75);
  border-color: rgba(255, 96, 114, 0.2);
}

.asset-icon-btn.danger:hover {
  background: rgba(255, 96, 114, 0.12);
  border-color: rgba(255, 96, 114, 0.35);
  color: #ffb7c0;
}

.asset-icon-btn input[type="file"] {
  display: none;
}

.asset-url-field {
  display: block;
  width: 100%;
  height: 30px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font: inherit;
  font-size: 11px;
  outline: none;
}

.asset-url-field:focus {
  border-color: rgba(169, 231, 255, 0.45);
  background: rgba(255, 255, 255, 0.09);
}

.asset-url-field[hidden] {
  display: none;
}

.notion-actions {
  min-width: 170px;
}

.icon-button.primary {
  border-color: rgba(169, 231, 255, 0.42);
  background: rgba(70, 170, 210, 0.18);
}

.admin-gallery-view.is-active {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.admin-gallery-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  overflow: hidden;
  background: #07070a;
}

.admin-gallery-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.admin-gallery-card div {
  padding: 10px;
}

.admin-gallery-card h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.admin-gallery-card p {
  margin: 5px 0 10px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.admin-gallery-card a {
  color: white;
  font-size: 12px;
  text-decoration: none;
}

.admin-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 10px 10px 10px 16px;
  background: rgba(255, 255, 255, 0.94);
  color: #101014;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.admin-toast[hidden] {
  display: none;
}

.admin-toast p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.admin-toast button {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #101014;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.admin-toast button:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* VIEWER */

.viewer-modal {
  --viewer-edge: 22px;
  --viewer-panel-bottom: 24px;
  --viewer-panel-width: min(580px, calc(100vw - 32px));
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: #000;
}

.viewer-modal.is-open {
  display: block;
}

.viewer-modal.is-fallback-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
}

.panorama {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* HUD controls */

.viewer-hud {
  position: absolute;
  z-index: 130;
}

.viewer-hud-left {
  top: calc(var(--viewer-edge) + env(safe-area-inset-top));
  left: calc(var(--viewer-edge) + env(safe-area-inset-left));
}

.viewer-hud-right {
  top: calc(var(--viewer-edge) + env(safe-area-inset-top));
  right: calc(var(--viewer-edge) + env(safe-area-inset-right));
}

.viewer-hud-bottom-left {
  bottom: calc(var(--viewer-panel-bottom) + env(safe-area-inset-bottom));
  left: calc(var(--viewer-edge) + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Back button ─ top-left */

.viewer-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.62);
  color: rgba(255, 255, 255, 0.78);
  font: 500 13px/1 inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.viewer-back-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.viewer-back-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Info button ─ top-right, shown when panel is dismissed */

.viewer-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.62);
  color: rgba(255, 255, 255, 0.78);
  font: 500 13px/1 inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  animation: vfadein 0.28s ease both;
}

.viewer-info-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.viewer-info-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@keyframes vfadein {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Panel ─ floating bottom-center */

.viewer-panel {
  position: absolute;
  left: 50%;
  bottom: calc(var(--viewer-panel-bottom) + env(safe-area-inset-bottom));
  z-index: 120;
  width: min(660px, var(--viewer-panel-width));
  max-height: min(420px, calc(100dvh - 132px));
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  color: #fff;
  transform: translateX(-50%);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.viewer-panel.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(18px);
  pointer-events: none;
}

.viewer-panel-inner {
  border-radius: 17px;
  /* base fallback; JS overwrites with artwork gradient */
  background:
    linear-gradient(135deg, rgba(36, 30, 24, 0.7), rgba(12, 12, 15, 0.64)),
    rgba(8, 8, 10, 0.68);
  backdrop-filter: blur(30px) saturate(1.45);
  -webkit-backdrop-filter: blur(30px) saturate(1.45);
  display: flex;
  flex-direction: column;
  max-height: inherit;
  overflow: hidden;
  transition: background 1s ease;
}

/* Expand handle */

.viewer-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  flex-shrink: 0;
}

.viewer-handle-bar {
  display: block;
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: background 0.2s, width 0.2s;
}

.viewer-handle:hover .viewer-handle-bar {
  background: rgba(255, 255, 255, 0.6);
  width: 52px;
}

/* Title row */

.viewer-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 5px 16px 10px;
  flex-shrink: 0;
}

.viewer-copy {
  flex: 1;
  min-width: 0;
}

.viewer-copy h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 500;
  line-height: 1.02;
  color: #fff;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-copy p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Close (×) button — plain icon, no circle */

.viewer-panel-close {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: color 0.18s, transform 0.18s;
}

.viewer-panel-close:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.15);
}

.viewer-panel-close svg {
  width: 16px;
  height: 16px;
}

/* Description — always visible */

.viewer-desc {
  margin: 0;
  padding: 0 16px 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

/* Stats row: Year · Style · Medium — slides in when expanded */

.viewer-meta {
  display: grid;
  grid-template-columns: minmax(72px, 0.45fr) minmax(180px, 1.55fr) minmax(150px, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.34s ease, opacity 0.28s ease;
}

.viewer-panel.is-expanded .viewer-meta {
  max-height: 96px;
  opacity: 1;
}

.viewer-stat {
  padding: 10px 16px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  min-width: 0;
}

.viewer-stat:last-child {
  border-right: 0;
}

.viewer-stat dt {
  margin: 0 0 3px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.viewer-stat dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.32;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Artworks toggle button (top-right) ─────────────────────────────────── */

.viewer-artworks-toggle,
.viewer-vr-toggle,
.viewer-motion-toggle,
.viewer-fullscreen-toggle,
.viewer-recenter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.62);
  color: rgba(255, 255, 255, 0.78);
  font: 500 13px/1 inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.viewer-artworks-toggle:hover,
.viewer-artworks-toggle[aria-expanded="true"],
.viewer-vr-toggle:hover,
.viewer-vr-toggle.is-active,
.viewer-motion-toggle:hover,
.viewer-motion-toggle.is-active,
.viewer-fullscreen-toggle:hover,
.viewer-recenter-toggle:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

.viewer-vr-toggle[aria-disabled="true"] {
  opacity: 0.58;
}

.viewer-artworks-toggle svg,
.viewer-vr-toggle svg,
.viewer-motion-toggle svg,
.viewer-fullscreen-toggle svg,
.viewer-recenter-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.viewer-fullscreen-toggle svg[hidden] {
  display: none;
}

/* ── Artworks sidebar ────────────────────────────────────────────────────── */

.artworks-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  width: min(340px, calc(100vw - 20px));
  display: flex;
  flex-direction: column;
  background: rgba(8, 7, 12, 0.72);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.artworks-sidebar.is-open {
  transform: translateX(0);
}

.artworks-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.artworks-sidebar-head h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  color: rgba(255, 255, 255, 0.94);
  letter-spacing: 0;
}

.artworks-sidebar-close {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}

.artworks-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.artworks-sidebar-close svg {
  width: 16px;
  height: 16px;
}

/* Search bar */

.artworks-sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.artworks-sidebar-search svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.38);
}

.artworks-sidebar-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.88);
  font: 400 13px/1 inherit;
  caret-color: rgba(255, 255, 255, 0.7);
}

.artworks-sidebar-search input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

/* Player controls */

.sidebar-player {
  padding: 12px 14px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.sidebar-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sidebar-player-head span:last-child {
  color: rgba(255, 255, 255, 0.74);
  text-align: right;
}

.sidebar-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}

.sidebar-player-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(8, 8, 12, 0.72);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
  flex-shrink: 0;
}

.sidebar-player-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.sidebar-player-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.sidebar-player-btn svg {
  width: 14px;
  height: 14px;
}

.sidebar-player-playbtn {
  width: 46px;
  height: 46px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-player-playbtn svg {
  width: 17px;
  height: 17px;
}

.sidebar-player-playbtn svg[hidden] {
  display: none;
}

.sidebar-player-playbtn[aria-pressed="true"] {
  background:
    linear-gradient(145deg, rgba(169, 231, 255, 0.36), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(169, 231, 255, 0.48);
}

.sidebar-player-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.sidebar-player-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(169, 231, 255, 0.95), rgba(255, 255, 255, 0.72));
}

.sidebar-player-count {
  min-height: 14px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scrollable artwork list */

.artworks-sidebar-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.artworks-sidebar-list::-webkit-scrollbar {
  display: none;
}

.sidebar-empty {
  padding: 16px 14px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 13px;
  margin: 0;
}

/* Sidebar artwork card */

.sidebar-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.18s;
}

.sidebar-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card.is-active {
  background: rgba(255, 255, 255, 0.09);
}

.sidebar-card-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-card-info {
  min-width: 0;
  flex: 1;
}

.sidebar-card-title {
  margin: 0 0 3px;
  font-family: "Playfair Display", serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-card-artist {
  margin: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.44);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Backdrop — closes sidebar on outside click */

.artworks-sidebar-backdrop {
  position: absolute;
  inset: 0;
  z-index: 135;
  display: none;
}

.artworks-sidebar-backdrop.is-visible {
  display: block;
}

/* PANNELLUM CLEANUP */

.pnlm-container {
  background: #000 !important;
}

.pnlm-load-box {
  display: none !important;
}

.viewer-vr-status {
  position: absolute;
  left: 50%;
  top: 88px;
  z-index: 180;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(5, 5, 8, 0.72);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.viewer-vr-canvas {
  position: absolute;
  inset: 0;
  z-index: 110;
  width: 100%;
  height: 100%;
  background: #000;
}

.viewer-cardboard {
  position: absolute;
  inset: 0;
  z-index: 175;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 48px;
  background: #000;
  overflow: hidden;
  touch-action: none;
}

.viewer-cardboard[hidden] {
  display: none;
}

.viewer-cardboard-eye {
  position: relative;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  border-radius: 25% / 35%;
  transform: translateZ(0);
}

.viewer-cardboard-eye::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: inset 0 0 100px 30px rgba(0, 0, 0, 1);
  pointer-events: none;
  z-index: 10;
}

.viewer-cardboard-eye .pnlm-container {
  width: 100% !important;
  height: 100% !important;
}

.viewer-cardboard-eye canvas {
  display: block;
}

.viewer-cardboard-eye .pnlm-controls-container,
.viewer-cardboard-eye .pnlm-orientation-button,
.viewer-cardboard-eye .pnlm-about-msg {
  display: none !important;
}

.viewer-cardboard-divider {
  display: none;
}

.viewer-cardboard-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.74);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
}

.viewer-cardboard-hint svg {
  width: 44px;
  height: 44px;
}

.viewer-cardboard-hint svg.phone-rotate-icon {
  animation: phone-rotate-landscape 2s ease-in-out infinite;
}

@keyframes phone-rotate-landscape {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-90deg); }
  50% { transform: rotate(-90deg); }
  75% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.viewer-cardboard::before,
.viewer-cardboard::after {
  content: "";
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.viewer-cardboard::before {
  left: calc(25% + 4px);
}

.viewer-cardboard::after {
  left: calc(75% - 4px);
}

.viewer-cardboard-exit {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 180;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.viewer-cardboard-exit svg {
  width: 24px;
  height: 24px;
}

.viewer-cardboard-exit:hover {
  background: transparent;
  color: #fff;
  transform: scale(1.1);
}

.viewer-modal.is-vr-active .viewer-panel,
.viewer-modal.is-vr-active .viewer-hud-left,
.viewer-modal.is-vr-active .artworks-sidebar,
.viewer-modal.is-vr-active .artworks-sidebar-backdrop {
  opacity: 0;
  pointer-events: none;
}

.viewer-modal.is-vr-active .viewer-artworks-toggle {
  display: none;
}

.viewer-modal.is-cardboard-active .viewer-panel,
.viewer-modal.is-cardboard-active .viewer-hud-left,
.viewer-modal.is-cardboard-active .artworks-sidebar,
.viewer-modal.is-cardboard-active .artworks-sidebar-backdrop,
.viewer-modal.is-cardboard-active .viewer-artworks-toggle {
  opacity: 0;
  pointer-events: none;
}

.viewer-modal.is-cardboard-active .viewer-hud-bottom-left,
.viewer-modal.is-vr-active .viewer-hud-bottom-left {
  z-index: 190;
  bottom: calc(14px + env(safe-area-inset-bottom));
}

.viewer-modal.is-cardboard-active .viewer-info-btn,
.viewer-modal.is-cardboard-active .viewer-vr-toggle,
.viewer-modal.is-cardboard-active .viewer-motion-toggle,
.viewer-modal.is-cardboard-active .viewer-fullscreen-toggle,
.viewer-modal.is-vr-active .viewer-info-btn,
.viewer-modal.is-vr-active .viewer-vr-toggle,
.viewer-modal.is-vr-active .viewer-motion-toggle,
.viewer-modal.is-vr-active .viewer-fullscreen-toggle {
  display: none;
}

.viewer-modal.is-motion-active .viewer-info-btn,
.viewer-modal.is-motion-active .viewer-vr-toggle {
  display: none;
}

.viewer-modal.is-cardboard-active .viewer-recenter-toggle,
.viewer-modal.is-vr-active .viewer-recenter-toggle {
  width: 48px;
  height: 48px;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: rgba(255, 255, 255, 0.7);
}

.viewer-modal.is-cardboard-active .viewer-recenter-toggle:hover,
.viewer-modal.is-vr-active .viewer-recenter-toggle:hover {
  background: transparent;
  color: #fff;
  transform: scale(1.1);
}

.viewer-modal.is-cardboard-active .viewer-recenter-toggle svg,
.viewer-modal.is-vr-active .viewer-recenter-toggle svg {
  width: 24px;
  height: 24px;
}

.viewer-modal.is-cardboard-active .viewer-recenter-toggle span,
.viewer-modal.is-vr-active .viewer-recenter-toggle span {
  display: none;
}

/* RESPONSIVE */

@media (max-width: 1400px) {
  .masonry-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .viewer-modal {
    --viewer-edge: 16px;
    --viewer-panel-bottom: 18px;
    --viewer-panel-width: min(560px, calc(100vw - 28px));
  }

  .gallery-section {
    padding: 28px 12px 72px;
  }

  .admin-section {
    padding: 0 16px 88px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-editor {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-tools {
    margin-bottom: 24px;
  }

  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-search {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .viewer-panel {
    max-height: min(390px, calc(100dvh - 120px));
  }

  .viewer-meta {
    grid-template-columns: minmax(64px, 0.42fr) minmax(150px, 1.45fr) minmax(128px, 1fr);
  }

  .viewer-copy h1 {
    font-size: 24px;
  }

  .artworks-sidebar {
    width: min(360px, calc(100vw - 16px));
  }
}

@media (max-width: 560px) {
  .viewer-modal {
    --viewer-edge: 14px;
    --viewer-panel-bottom: 14px;
    --viewer-panel-width: calc(100vw - 24px);
  }

  .hero {
    min-height: 620px;
    min-height: 100svh;
  }

  .hero-title h1 {
    font-size: 50px;
  }

  .hero-title p {
    font-size: 36px;
  }

  .gallery-section {
    padding: 22px 10px 56px;
  }

  .admin-section {
    padding: 0 12px 72px;
  }

  .admin-header {
    padding: 18px;
  }

  .admin-editor {
    grid-template-columns: 1fr;
    padding: 16px 18px;
  }

  .admin-button {
    flex: 1 1 calc(50% - 4px);
    padding: 0 10px;
  }

  .admin-workspace {
    padding: 22px 16px 48px;
  }

  .admin-commandbar .admin-search.gradient {
    width: min(260px, 100%);
  }

  .admin-topbar h1 {
    font-size: 32px;
  }

  .admin-toast {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .admin-toolbar {
    padding: 14px 18px;
  }

  .gallery-tools {
    gap: 8px;
  }

  .gallery-search input {
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
  }

  .gallery-edit {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .viewer-panel {
    border-radius: 18px;
    max-height: min(58dvh, calc(100dvh - 108px));
  }

  .viewer-panel-inner {
    border-radius: 17px;
  }

  .viewer-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .viewer-vr-toggle span,
  .viewer-motion-toggle span,
  .viewer-fullscreen-toggle span,
  .viewer-recenter-toggle span,
  .viewer-artworks-toggle span,
  .viewer-info-btn span,
  .viewer-back-btn span {
    display: none;
  }

  .viewer-vr-toggle,
  .viewer-motion-toggle,
  .viewer-fullscreen-toggle,
  .viewer-recenter-toggle,
  .viewer-artworks-toggle,
  .viewer-info-btn,
  .viewer-back-btn {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .viewer-copy h1 {
    font-size: 20px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .viewer-copy p {
    font-size: 12px;
  }

  .viewer-panel-head {
    padding: 4px 14px 9px;
  }

  .viewer-desc {
    padding: 0 14px 14px;
    font-size: 12px;
    line-height: 1.55;
  }

  .viewer-panel.is-expanded .viewer-meta {
    max-height: 180px;
  }

  .viewer-meta {
    grid-template-columns: minmax(58px, 0.62fr) minmax(0, 1.38fr);
  }

  .viewer-stat {
    padding: 9px 14px 10px;
  }

  .viewer-stat:nth-child(2n),
  .viewer-stat:last-child {
    border-right: 0;
  }

  .viewer-stat:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  .viewer-stat dd {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .artworks-sidebar {
    width: 100vw;
    background: rgba(8, 7, 12, 0.86);
  }

  .artworks-sidebar-head {
    padding: calc(16px + env(safe-area-inset-top)) 14px 11px;
  }

  .artworks-sidebar-head h2 {
    font-size: 24px;
  }

  .artworks-sidebar-close {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .sidebar-player {
    padding: 10px 14px;
  }

  .sidebar-player-controls {
    gap: 12px;
  }

  .sidebar-player-btn {
    width: 40px;
    height: 40px;
  }

  .sidebar-player-playbtn {
    width: 48px;
    height: 48px;
  }

  .sidebar-card {
    padding: 9px 14px;
  }

  .sidebar-card-thumb {
    width: 72px;
    height: 54px;
  }
}

@media (max-width: 380px) {
  .masonry-grid {
    grid-template-columns: 1fr;
  }

  .viewer-panel {
    max-height: min(62dvh, calc(100dvh - 96px));
  }

  .sidebar-player-controls {
    gap: 8px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .viewer-modal {
    --viewer-edge: 10px;
    --viewer-panel-bottom: 10px;
  }

  .viewer-panel {
    width: min(520px, calc(100vw - 112px));
    max-height: calc(100dvh - 72px);
  }

  .viewer-panel-head {
    padding-bottom: 6px;
  }

  .viewer-desc {
    padding-bottom: 10px;
    line-height: 1.45;
  }

  .viewer-handle {
    height: 16px;
  }

  .viewer-back-btn,
  .viewer-vr-toggle,
  .viewer-motion-toggle,
  .viewer-fullscreen-toggle,
  .viewer-recenter-toggle,
  .viewer-artworks-toggle,
  .viewer-info-btn {
    min-width: 40px;
    min-height: 40px;
  }

  .artworks-sidebar {
    width: min(340px, 52vw);
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  .viewer-modal.is-cardboard-active .viewer-cardboard {
    grid-template-columns: 1fr;
  }

  .viewer-modal.is-cardboard-active .viewer-cardboard-eye {
    height: 100dvh;
  }

  .viewer-modal.is-cardboard-active #cardboardRight,
  .viewer-modal.is-cardboard-active .viewer-cardboard-divider,
  .viewer-modal.is-cardboard-active .viewer-cardboard::before,
  .viewer-modal.is-cardboard-active .viewer-cardboard::after {
    display: none;
  }

  .viewer-modal.is-cardboard-active .viewer-cardboard-hint {
    display: grid;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .viewer-modal.is-cardboard-active .viewer-cardboard {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .viewer-modal.is-cardboard-active .viewer-cardboard-eye {
    height: 100vh;
    height: 100dvh;
  }

  .viewer-modal.is-cardboard-active .viewer-hud-bottom-left {
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 6px;
  }

  .viewer-modal.is-cardboard-active .viewer-recenter-toggle,
  .viewer-modal.is-cardboard-active .viewer-fullscreen-toggle {
    width: 38px;
    height: 38px;
  }

  .viewer-modal.is-cardboard-active .viewer-cardboard-exit {
    top: calc(10px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
    width: 38px;
    height: 38px;
  }
}
