@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --ink: #f6f1e8;
  --muted: #c7c2b8;
  --panel: rgba(37, 34, 31, 0.74);
  --panel-strong: rgba(30, 28, 25, 0.9);
  --line: rgba(255, 255, 255, 0.18);
  --amber: #d7a04f;
  --jade: #80b995;
  --aqua: #9acfd2;
  --rose: #bf7a72;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  font-family: "Lora", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: #12110f;
  color: var(--ink);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.museum-stage {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.hero__backdrop,
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.hero__backdrop {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.15) 36%, rgba(0, 0, 0, 0.76)),
    radial-gradient(circle at 80% 17%, rgba(215, 160, 79, 0.34), transparent 20%),
    linear-gradient(115deg, #141311 0%, #30291f 48%, #111819 100%);
  background-size: cover;
  background-position: center;
  filter: saturate(1.02);
}

.hero__backdrop.has-photo {
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.25) 42%, rgba(0, 0, 0, 0.78)),
    var(--home-photo);
}

.hero__backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 100%) 8vw 9vh / 9.5vw 58vh no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 100%) 8vw 9vh / 47vw 9.6vh no-repeat,
    linear-gradient(90deg, transparent 0 61%, rgba(255, 221, 158, 0.2) 61% 62%, transparent 62% 100%) 0 0 / 100% 100%;
  opacity: 0.64;
}

.hero__backdrop::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 32vh;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.5));
}

.hero__shade {
  z-index: -2;
  background:
    radial-gradient(circle at center 50%, transparent 0 29%, rgba(0, 0, 0, 0.36) 56%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.74));
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
}

.brand,
.ghost-button {
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.brand {
  display: inline-grid;
  justify-content: center;
  color: var(--ink);
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  line-height: 1.02;
}

.brand::after {
  content: attr(data-subtitle);
  justify-self: end;
  margin-top: 4px;
  color: #f2c77d;
  font-size: 0.42em;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
}

.language-selector {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.language-selector select {
  min-height: 42px;
  min-width: 150px;
  max-width: 190px;
  padding: 0 38px 0 14px;
  border: 1px solid rgba(242, 199, 125, 0.44);
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #f2c77d 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, rgba(242, 199, 125, 0.16), rgba(255, 255, 255, 0.08)),
    rgba(18, 17, 15, 0.92);
  color: #fff8e8;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.language-selector option {
  background: #171511;
  color: #fff8e8;
}

.admin-page .language-selector option {
  background: #171511;
  color: #fff8e8;
}

.language-selector select:focus {
  border-color: rgba(242, 199, 125, 0.78);
  box-shadow: 0 0 0 3px rgba(242, 199, 125, 0.12);
}

.topbar .language-selector {
  margin-left: auto;
}

.topbar .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.artifact-header .language-selector {
  margin-left: 12px;
}

:root[dir="rtl"] .topbar .language-selector {
  margin-right: auto;
  margin-left: 0;
}

:root[dir="rtl"] .topbar .brand {
  right: 50%;
  left: auto;
  transform: translateX(50%);
}

:root[dir="rtl"] .artifact-header .language-selector {
  margin-right: 12px;
  margin-left: 0;
}

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

.ghost-button {
  display: inline-flex;
}

.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.icon-button,
.dock__button {
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ghost-button {
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.eyebrow {
  margin: 0 0 8px;
  color: #f2c77d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.92;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.72);
}

h2 {
  font-size: 1.35rem;
}

.carousel-shell {
  position: absolute;
  left: 50%;
  top: 51%;
  width: min(1150px, 100vw);
  height: min(56vh, 560px);
  transform: translate(-50%, -50%);
  perspective: 1200px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.carousel-shell.is-dragging {
  cursor: grabbing;
}

.museum-card {
  --x: 0px;
  --scale: 1;
  --rotate: 0deg;
  --opacity: 1;
  --z: 1;
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: var(--z);
  width: clamp(210px, 25vw, 350px);
  min-height: clamp(310px, 43vh, 472px);
  padding: 12px 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(47, 43, 38, 0.9) 72%);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  opacity: var(--opacity);
  transform: translateX(calc(-50% + var(--x))) rotateY(var(--rotate)) scale(var(--scale));
  transform-origin: center bottom;
  pointer-events: none;
  cursor: pointer;
  transition: transform 720ms cubic-bezier(0.16, 1, 0.3, 1), opacity 460ms ease, filter 460ms ease;
  overflow: hidden;
}

.carousel-shell.is-dragging .museum-card {
  transition: none;
}

.museum-card.is-visible {
  pointer-events: auto;
}

.museum-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -80px 95px rgba(0, 0, 0, 0.34);
}

.museum-card__image {
  display: grid;
  place-items: center;
  height: clamp(190px, 31vh, 325px);
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--tone), rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 14px);
}

.museum-card__image.has-photo {
  background-size: cover;
  background-position: center;
}

.museum-card__placeholder {
  width: 68%;
  max-width: 210px;
  aspect-ratio: 1.28;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 12px;
  position: relative;
  opacity: 0.8;
}

.museum-card__placeholder::before,
.museum-card__placeholder::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.48);
}

.museum-card__placeholder::before {
  width: 72%;
  height: 2px;
  left: 14%;
  top: 32%;
  box-shadow: 0 26px 0 rgba(255, 255, 255, 0.34), 0 52px 0 rgba(255, 255, 255, 0.24);
}

.museum-card__placeholder::after {
  width: 48px;
  height: 48px;
  right: 16px;
  bottom: 16px;
  border-radius: 50%;
}

.museum-card__body {
  position: relative;
  z-index: 1;
  text-align: center;
}

.museum-card__body h3 {
  margin: 18px auto 8px;
  max-width: 95%;
  color: #fffaf2;
  font-size: clamp(1.2rem, 2vw, 1.72rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.museum-card__body p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
}

.museum-card__body .museum-card__note {
  max-width: 92%;
  max-height: 0;
  margin: 0 auto;
  overflow: hidden;
  color: #efe4d0;
  font-size: clamp(0.78rem, 1vw, 0.92rem);
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height 260ms ease, margin 260ms ease, opacity 220ms ease, transform 260ms ease;
}

.museum-card:hover .museum-card__note,
.museum-card:focus-visible .museum-card__note {
  max-height: 96px;
  margin-top: 12px;
  opacity: 1;
  transform: translateY(0);
}

.dock {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 6vh, 48px);
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(2, 46px);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(42, 41, 39, 0.72);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.dock__button,
.icon-button {
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
}

.dock__button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.dock__button svg,
.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock__button.is-active {
  background: rgba(128, 185, 149, 0.34);
  border-color: rgba(161, 230, 184, 0.65);
  color: #c9ffc9;
}

.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover,
.danger-button:hover,
.icon-button:hover,
.dock__button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
}

.museum-grid,
.search {
  position: absolute;
  left: 50%;
  z-index: 6;
  width: min(920px, calc(100% - 32px));
  border: 1px solid var(--line);
  background: rgba(28, 27, 25, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.museum-grid {
  bottom: 120px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  max-height: 42vh;
  padding: 14px;
  border-radius: 20px;
  overflow: auto;
}

.museum-grid.is-open,
.search.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.grid-item {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.grid-item strong,
.grid-item span {
  display: block;
}

.grid-item strong {
  margin-bottom: 7px;
  font-size: 0.98rem;
}

.grid-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.search {
  bottom: 120px;
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
}

.search label {
  color: var(--muted);
  font-size: 0.85rem;
}

.search input,
.admin-page input,
.admin-page select,
.admin-page textarea,
.admin input,
.admin select,
.admin textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  outline: none;
}

.search input {
  min-height: 46px;
  padding: 0 14px;
}

.admin {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.admin.is-open {
  opacity: 1;
  pointer-events: auto;
}

.admin__surface {
  width: min(460px, 100%);
  height: 100%;
  padding: 24px;
  background: linear-gradient(180deg, rgba(41, 37, 33, 0.98), rgba(19, 18, 17, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 80px rgba(0, 0, 0, 0.42);
  overflow: auto;
  transform: translateX(24px);
  transition: transform 220ms ease;
}

.admin.is-open .admin__surface {
  transform: translateX(0);
}

.admin__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.icon-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.admin__form,
.admin__form label {
  display: grid;
  gap: 8px;
}

.admin__form {
  gap: 16px;
}

.admin__form label {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin input,
.admin-page input,
.admin-page select,
.admin-page textarea,
.admin select,
.admin textarea {
  min-height: 44px;
  padding: 10px 12px;
}

.admin-page textarea,
.admin textarea {
  resize: vertical;
}

.admin-page option,
.admin option {
  color: #171512;
}

.preview {
  min-height: 160px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(154, 207, 210, 0.32), rgba(215, 160, 79, 0.22)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 13px);
  background-size: cover;
  background-position: center;
}

.photo-previews {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 14px;
}

.photo-previews figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.photo-previews figcaption {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.photo-previews .preview {
  min-height: 132px;
}

.preview--wide {
  min-height: 180px;
}

.admin__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  border-radius: 8px;
}

.primary-button {
  background: linear-gradient(135deg, var(--amber), #e8bf78);
  color: #21180f;
  font-weight: 800;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.ar-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.08);
}

.danger-button {
  background: rgba(150, 62, 49, 0.18);
  color: #f3d2ca;
}

.artifact-page {
  min-height: 100%;
  overflow: auto;
  background:
    linear-gradient(120deg, rgba(7, 7, 6, 0.94), rgba(35, 30, 23, 0.86)),
    radial-gradient(circle at 24% 18%, rgba(128, 185, 149, 0.18), transparent 24%),
    radial-gradient(circle at 82% 8%, rgba(215, 160, 79, 0.22), transparent 22%),
    #100f0d;
}

.artifact-layout {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.artifact-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-bottom: 28px;
}

.artifact-header .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.artifact-header .back-link {
  margin-left: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.artifact-hero {
  max-width: 760px;
  padding: 38px 0 30px;
}

.artifact-hero h1 {
  font-size: clamp(1.625rem, 3.9vw, 3.77rem);
}

.artifact-hero p:last-child {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.artifact-content {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 20px;
}

.artifact-browser,
.artifact-viewer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 29, 26, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.artifact-browser {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.artifact-search {
  display: grid;
  gap: 8px;
}

.artifact-search span {
  color: #f2c77d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.artifact-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  outline: none;
  padding: 0 14px;
}

.artifact-search input:focus {
  border-color: rgba(242, 199, 125, 0.78);
  box-shadow: 0 0 0 3px rgba(242, 199, 125, 0.12);
}

.artifact-list {
  display: grid;
  align-content: start;
  gap: 12px;
}

.artifact-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 86px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.artifact-card.is-active {
  border-color: rgba(242, 199, 125, 0.74);
  background: rgba(215, 160, 79, 0.16);
}

.artifact-card__model {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(154, 207, 210, 0.34), rgba(215, 160, 79, 0.22)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 10px);
  color: #fff5dc;
  font-weight: 850;
}

.artifact-card strong,
.artifact-card small {
  display: block;
}

.artifact-card small {
  margin-top: 6px;
  color: var(--muted);
}

.artifact-card__description {
  display: -webkit-box;
  margin: 10px 0 0;
  max-width: 100%;
  overflow: hidden;
  color: rgba(249, 244, 234, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.artifact-viewer {
  min-height: 620px;
  padding: 18px;
}

.artifact-viewer__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.model-viewer {
  display: block;
  width: 100%;
  height: min(62vh, 620px);
  min-height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.26)),
    radial-gradient(circle at center, rgba(154, 207, 210, 0.14), transparent 42%);
  overflow: hidden;
}

.ar-button {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 132px;
  padding: 0 18px;
  border: 1px solid rgba(240, 230, 200, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  color: #f0e6c8;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  text-decoration: none;
}

.ar-button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(240, 230, 200, 0.54);
  transform: translateY(-1px);
}

.ar-button svg {
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ar-button__quicklook-image {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ar-failure {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 10px 16px;
  border: 1px solid rgba(180, 60, 60, 0.5);
  border-radius: 8px;
  background: rgba(180, 60, 60, 0.25);
  color: #f5c6c6;
  font-size: 0.82rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.artifact-viewer__details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 14px;
  margin-top: 16px;
}

.artifact-description-box,
.artifact-copyright-box,
.artifact-qr-front {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.artifact-description-box {
  grid-row: span 2;
  padding: 16px;
}

.artifact-copyright-box {
  padding: 14px;
}

.artifact-description-box h3,
.artifact-copyright-box h3 {
  margin: 0 0 8px;
  color: #f2c77d;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.artifact-description-box p,
.artifact-copyright-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.artifact-qr-front {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-items: start;
  padding: 12px;
}

.artifact-qr-front strong {
  justify-self: stretch;
  text-align: center;
}

.artifact-qr-front img {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #fff;
}

.artifact-qr-front strong,
.artifact-qr-front span,
.artifact-qr-front a {
  display: block;
}

.artifact-qr-front span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.artifact-qr-front a {
  margin-top: 8px;
  color: #f2c77d;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.empty-state--large {
  min-height: 420px;
  place-content: center;
  text-align: center;
}

.empty-state--model {
  position: absolute;
  inset: auto 18px 18px;
  max-width: 360px;
  background: rgba(20, 19, 17, 0.74);
}

.empty-state--model::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(45deg, rgba(35, 24, 9, 0.28) 0 8px, transparent 8px 16px),
    linear-gradient(90deg, #d99a35, #f2c77d, #d99a35);
  background-size: 34px 34px, 100% 100%;
  box-shadow: 0 0 18px rgba(242, 199, 125, 0.42);
  animation: loading-stripes 900ms linear infinite;
}

@keyframes loading-stripes {
  to {
    background-position: 34px 0, 0 0;
  }
}

.model-viewer.is-loaded .empty-state--model {
  display: none;
}

.info-page {
  min-height: 100%;
  overflow: auto;
  background:
    linear-gradient(120deg, rgba(7, 7, 6, 0.94), rgba(35, 30, 23, 0.86)),
    radial-gradient(circle at 76% 12%, rgba(215, 160, 79, 0.22), transparent 24%),
    #100f0d;
}

.info-layout {
  width: min(980px, calc(100% - 40px));
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  padding: 28px 0 52px;
}

.info-panel {
  max-width: 780px;
  margin-top: min(12vh, 120px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 29, 26, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.info-panel h1 {
  font-size: clamp(2.6rem, 6vw, 5.4rem);
}

.info-panel p:last-child {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.3rem);
  line-height: 1.65;
}

.site-footer {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.site-footer__brand {
  display: grid;
  gap: 10px;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer p {
  grid-column: 2;
  margin: 0;
  text-align: center;
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
}

.site-footer a:hover {
  color: #f2c77d;
}

.admin-page {
  min-height: 100%;
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(7, 7, 6, 0.9), rgba(39, 32, 24, 0.88)),
    radial-gradient(circle at 72% 10%, rgba(215, 160, 79, 0.2), transparent 25%),
    #11100e;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(280px, 1fr);
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0;
}

.admin-console,
.admin-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 29, 26, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.admin-console {
  padding: 24px;
}

.admin-console__head {
  display: grid;
  gap: 28px;
  margin-bottom: 24px;
}

.admin-console__head .brand {
  justify-self: center;
}

.admin-console__head h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

[hidden] {
  display: none !important;
}

.admin-mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-mode__button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-mode__button.is-active {
  background: linear-gradient(135deg, var(--amber), #e8bf78);
  color: #20170f;
}

.admin-layout.is-artifact-mode {
  grid-template-columns: minmax(320px, 900px);
  justify-content: center;
}

.admin-layout.is-artifact-mode .admin-console {
  width: 100%;
}

.admin-section {
  display: grid;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.admin-mode + .admin-section {
  padding-top: 0;
  border-top: 0;
}

.admin-section + .admin-section {
  margin-top: 28px;
}

.admin-section__head,
.admin-qr {
  display: grid;
}

.admin-section__head {
  gap: 4px;
}

.admin-section__head h2 {
  font-size: 1.1rem;
}

.admin-artifacts__layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1fr);
  gap: 14px;
}

.admin-artifact-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.admin-artifact-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.admin-artifact-item.is-active {
  border-color: rgba(242, 199, 125, 0.74);
  background: rgba(215, 160, 79, 0.16);
}

.admin-artifact-item .artifact-card__model {
  width: 52px;
  height: 52px;
}

.admin-artifact-item strong,
.admin-artifact-item small {
  display: block;
}

.admin-artifact-item small {
  margin-top: 4px;
  color: var(--muted);
}

.admin__actions--two {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.admin-qr {
  gap: 16px;
}

.admin-qr__head {
  display: grid;
  gap: 4px;
}

.admin-qr__head h2 {
  font-size: 1.1rem;
}

.admin-qr__grid {
  display: grid;
  gap: 12px;
}

.qr-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.qr-card img {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #fff;
}

.qr-card strong,
.qr-card span,
.qr-card a {
  display: block;
}

.qr-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.qr-card a {
  margin-top: 10px;
  color: #f2c77d;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-list {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: calc(100vh - 64px);
  padding: 18px;
  overflow: auto;
}

.ar-launch-page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(215, 160, 79, 0.18), transparent 34%),
    linear-gradient(135deg, #080807, #1c1813 58%, #101716);
}

.ar-launch {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 29, 26, 0.82);
  box-shadow: var(--shadow);
}

.ar-launch h1 {
  font-size: clamp(2rem, 10vw, 3.8rem);
}

.ar-launch p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.ar-launch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.admin-list__item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.admin-list__item.is-active {
  border-color: rgba(242, 199, 125, 0.74);
  background: rgba(215, 160, 79, 0.16);
}

.admin-list__thumb {
  width: 82px;
  aspect-ratio: 1.2;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(154, 207, 210, 0.3), rgba(215, 160, 79, 0.18)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 10px);
  background-size: cover;
  background-position: center;
}

.admin-list__item strong,
.admin-list__item span {
  display: block;
}

.admin-list__item strong {
  margin-bottom: 6px;
}

.admin-list__item span {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .hero {
    min-height: 100dvh;
  }

  .topbar {
    width: calc(100% - 28px);
    min-height: 124px;
    padding: 16px 0 64px;
  }

  .topbar .language-selector {
    position: absolute;
    right: 0;
    bottom: 8px;
  }

  :root[dir="rtl"] .topbar .language-selector {
    right: auto;
    left: 0;
  }

  .brand {
    font-size: clamp(1.2rem, 7vw, 1.72rem);
  }

  .carousel-shell {
    top: 53%;
    width: 100%;
    height: min(62dvh, 510px);
  }

  .museum-card {
    width: min(74vw, 292px);
    min-height: min(54dvh, 382px);
    padding: 10px 10px 16px;
    border-radius: 22px;
  }

  .museum-card__image {
    height: min(33dvh, 232px);
    border-radius: 18px;
  }

  .museum-card__body h3 {
    margin-top: 14px;
    font-size: clamp(1.08rem, 5vw, 1.36rem);
  }

  .museum-card__body p {
    font-size: 0.9rem;
  }

  .dock {
    bottom: max(14px, env(safe-area-inset-bottom));
    grid-template-columns: repeat(2, 42px);
    gap: 7px;
    padding: 8px;
  }

  .dock__button {
    width: 42px;
    height: 42px;
  }

  .museum-grid,
  .search {
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
  }

  .museum-grid {
    grid-template-columns: 1fr;
    max-height: 48dvh;
    padding: 10px;
  }

  .admin__surface {
    padding: 20px;
  }

  .admin__actions {
    grid-template-columns: 1fr;
  }

  .photo-previews {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    width: calc(100% - 28px);
    padding: 18px 0;
  }

  .admin-list {
    max-height: none;
  }

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

  .artifact-layout {
    width: calc(100% - 28px);
    padding: 16px 0 30px;
  }

  .artifact-header,
  .artifact-viewer__head {
    align-items: stretch;
    flex-direction: column;
  }

  .artifact-header {
    align-items: center;
  }

  .artifact-header .brand {
    position: static;
    transform: none;
  }

  .artifact-header .back-link {
    margin-left: 0;
    width: 100%;
  }

  .artifact-header .language-selector {
    margin-left: 0;
    width: 100%;
  }

  .artifact-header .language-selector select {
    width: 100%;
    max-width: none;
  }

  .artifact-viewer__head {
    gap: 12px;
  }

  .artifact-hero {
    padding: 18px 0 20px;
  }

  .artifact-hero h1 {
    font-size: clamp(1.35rem, 7vw, 2.1rem);
    line-height: 1;
  }

  .artifact-hero p:last-child {
    font-size: 0.98rem;
  }

  .artifact-content {
    grid-template-columns: 1fr;
  }

  .artifact-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 82vw);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
  }

  .artifact-card {
    scroll-snap-align: start;
  }

  .artifact-card small {
    display: none;
  }

  .artifact-viewer {
    min-height: auto;
    padding: 12px;
  }

  .artifact-viewer__details {
    grid-template-columns: 1fr;
  }

  .artifact-description-box {
    grid-row: auto;
  }

  .model-viewer {
    height: min(56dvh, 430px);
    min-height: 320px;
  }

  .empty-state--model {
    inset: auto 12px 12px;
    max-width: calc(100% - 24px);
    padding: 12px;
    font-size: 0.9rem;
  }

  .ar-button {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
  }

  .ar-failure {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }

  .artifact-qr-front,
  .qr-card {
    grid-template-columns: 132px 1fr;
  }

  .artifact-qr-front {
    grid-template-columns: 1fr;
  }

  .artifact-qr-front img,
  .qr-card img {
    width: 132px;
  }

  .info-layout {
    width: calc(100% - 28px);
    min-height: auto;
  }

  .info-panel {
    padding: 22px;
    margin-top: 26px;
  }

  .info-panel h1 {
    font-size: clamp(2.2rem, 12vw, 3.6rem);
  }

  .site-footer {
    grid-template-columns: 1fr;
    width: calc(100% - 28px);
    text-align: center;
    gap: 14px;
    padding: 22px 0 max(24px, calc(18px + env(safe-area-inset-bottom)));
  }

  .site-footer__brand,
  .site-footer nav {
    justify-content: center;
  }

  .site-footer p {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .ghost-button {
    min-height: 40px;
    padding: 0 12px;
  }

  .museum-card {
    width: min(80vw, 276px);
  }

  .artifact-card {
    grid-template-columns: 52px 1fr;
  }

  .artifact-card__model {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 380px) {
  .topbar {
    width: calc(100% - 20px);
  }

  .brand {
    font-size: 1.12rem;
  }

  .museum-card {
    width: min(84vw, 266px);
    min-height: min(55dvh, 360px);
  }

  .museum-card__image {
    height: min(31dvh, 210px);
  }

  .dock__button {
    width: 40px;
    height: 40px;
  }

  .artifact-layout,
  .info-layout,
  .site-footer {
    width: calc(100% - 20px);
  }
}
