@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100;300&display=swap");

:root {
  --bg: #121416;
  --bg-soft: #1a1d20;
  --panel: rgba(24, 28, 32, 0.86);
  --panel-strong: rgba(30, 34, 38, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(230, 196, 139, 0.26);
  --text: #f3eee5;
  --muted: #c1b8aa;
  --accent: #d6a35d;
  --accent-strong: #eecc8f;
  --danger: #f1a28b;
  --success: #98d7b5;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-sm: 12px;
  --page-max: 1320px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Roboto", sans-serif;
  font-weight: 300;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(210, 135, 72, 0.18), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(218, 177, 116, 0.12), transparent 24%),
    linear-gradient(180deg, #171a1d 0%, #101214 100%);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.page {
  position: relative;
  min-height: 100vh;
}

.page-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(214, 163, 93, 0.12), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(146, 115, 76, 0.16), transparent 20%);
  pointer-events: none;
}

.site-header {
  width: min(calc(100% - 2rem), var(--page-max));
  margin: 0 auto;
  padding: 1.2rem 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-mark {
  font-family: "Roboto", sans-serif;
  font-weight: 100;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-nav a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 23, 27, 0.68);
  backdrop-filter: blur(12px);
}

.lang-switch-button {
  min-width: 2.55rem;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.lang-switch-button[aria-pressed="true"] {
  background: rgba(214, 163, 93, 0.18);
  color: var(--text);
}

.lang-switch-overlay {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  z-index: 4;
}

.shell {
  width: min(calc(100% - 2rem), var(--page-max));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  position: relative;
  z-index: 1;
}

.shell-home {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.8fr;
  gap: 1.25rem;
  align-items: start;
}

.shell-admin,
.shell-museum {
  display: grid;
  gap: 1.25rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel,
.form-panel,
.preview-panel,
.admin-head,
.viewer-panel {
  padding: 1.4rem;
}

.shell-museum {
  width: min(calc(100% - 2rem), 1560px);
}

.page-museum .shell-museum {
  width: 100vw;
  max-width: none;
  padding: 0;
}

.viewer-panel {
  padding: 0;
}

.page-home .hero-panel {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: 1.55rem 1.55rem 1.35rem;
  background:
    radial-gradient(circle at top right, rgba(214, 163, 93, 0.14), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%),
    var(--panel-strong);
}

.page-home .hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -5% -22% auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(214, 163, 93, 0.18), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.74rem;
  color: var(--accent-strong);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Roboto", sans-serif;
  font-weight: 100;
  line-height: 0.96;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 5rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}

.lede,
.preview-caption,
.artifact-description,
.viewer-description,
.viewer-meta-line,
.viewer-meta-state,
.confirmation-card p,
.hero-note span {
  color: var(--muted);
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.hero-note span,
.stat-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
}

.page-home .shell-home {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.submit-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  grid-template-areas:
    "title title"
    "lede figure";
  gap: 1rem 1rem;
  align-items: stretch;
}

.submit-hero-title {
  grid-area: title;
  max-width: none;
  margin-bottom: 0.35rem;
  font-size: clamp(2.2rem, 4.2vw, 3.85rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.page-home h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
}

.submit-hero-lede {
  grid-area: lede;
  max-width: none;
  width: 100%;
  margin: 0;
  font-size: clamp(1.02rem, 1.5vw, 1.34rem);
  line-height: 1.14;
}

.submit-hero-figure {
  grid-area: figure;
  position: relative;
  margin: 0;
  align-self: end;
  justify-self: center;
  width: 75%;
  max-width: 330px;
  padding: 0.85rem;
  border-radius: 28px;
  border: 1px solid rgba(214, 163, 93, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    rgba(11, 13, 15, 0.64);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.24);
  transform-origin: 50% 78%;
  animation: submit-float 6.2s ease-in-out infinite;
}

.submit-hero-figure::before {
  content: "";
  position: absolute;
  inset: auto 14% -10% 14%;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  filter: blur(12px);
  animation: submit-shadow 6.2s ease-in-out infinite;
}

.submit-hero-figure img {
  position: relative;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.24));
}

@keyframes submit-float {
  0% {
    transform: translateY(0) rotate(3.2deg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  }

  50% {
    transform: translateY(-12px) rotate(5.4deg);
    box-shadow: 0 34px 68px rgba(0, 0, 0, 0.28);
  }

  100% {
    transform: translateY(0) rotate(3.2deg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  }
}

@keyframes submit-shadow {
  0% {
    opacity: 0.44;
    transform: scaleX(0.92);
  }

  50% {
    opacity: 0.22;
    transform: scaleX(0.8);
  }

  100% {
    opacity: 0.44;
    transform: scaleX(0.92);
  }
}

.panel-heading {
  margin-bottom: 1rem;
}

.artifact-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.95rem;
}

.field.compact span {
  font-size: 0.85rem;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 12, 14, 0.42);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(214, 163, 93, 0.4);
  border-color: rgba(214, 163, 93, 0.35);
}

.field textarea {
  resize: vertical;
  min-height: 8rem;
}

.button,
.nav-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d39b53 0%, #f0c884 100%);
  color: #18140f;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  font-weight: 300;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 14px 34px rgba(214, 163, 93, 0.24);
}

.button:hover,
.nav-button:hover {
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.button.secondary.danger {
  color: #ffd7cd;
  border-color: rgba(241, 162, 139, 0.38);
}

strong,
b {
  font-weight: 300;
}

.button:disabled,
.nav-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.status {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.status[data-state="error"] {
  color: #ffd7cd;
  border-color: rgba(241, 162, 139, 0.38);
  background: rgba(126, 43, 22, 0.22);
}

.status[data-state="success"] {
  color: #ddf8ea;
  border-color: rgba(152, 215, 181, 0.38);
  background: rgba(33, 72, 58, 0.22);
}

.status.compact {
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
}

.confirmation-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(20, 70, 52, 0.26);
  border: 1px solid rgba(152, 215, 181, 0.35);
}

.text-link {
  color: var(--accent-strong);
  text-decoration: none;
}

.preview-frame {
  min-height: 340px;
  background:
    linear-gradient(160deg, rgba(214, 163, 93, 0.08), transparent 55%),
    rgba(7, 8, 9, 0.6);
  border: 1px dashed rgba(214, 163, 93, 0.24);
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.preview-stack {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

.preview-stack[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.stat-chip {
  display: grid;
  gap: 0.15rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(295px, 1fr));
  gap: 1rem;
}

.artifact-card {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.artifact-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.artifact-image-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
}

.artifact-image-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.artifact-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artifact-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(14, 18, 22, 0.75);
  border: 1px solid var(--line);
}

.artifact-card-topline,
.artifact-links,
.model-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.artifact-card-body {
  display: grid;
  gap: 0.75rem;
}

.artifact-code {
  color: var(--accent-strong);
  font-size: 0.9rem;
}

.artifact-date,
.artifact-author {
  margin: 0;
}

.artifact-description,
.viewer-description {
  white-space: pre-line;
}

.model-form {
  align-items: end;
}

.model-form .field {
  flex: 1 1 220px;
}

.viewer-stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(180deg, #4b4f55 0%, #23272c 24%, #181b1f 60%, #121417 100%);
  touch-action: pan-y;
}

.viewer-canvas,
.viewer-canvas canvas {
  width: 100%;
  height: 100%;
}

.viewer-canvas {
  min-height: inherit;
  height: 100%;
}

.viewer-loading {
  position: absolute;
  inset: 1rem auto auto 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 23, 27, 0.72);
  z-index: 3;
}

.viewer-object-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 4.5rem;
  height: 4.5rem;
  margin-left: -2.25rem;
  margin-top: -2.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(18, 20, 24, 0.48);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.viewer-spinner {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent-strong);
  animation: museum-spin 0.82s linear infinite;
}

@keyframes museum-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.viewer-titleblock {
  position: absolute;
  top: 1.35rem;
  left: 1.35rem;
  z-index: 2;
  width: min(100% - 7rem, 840px);
  pointer-events: none;
}

.viewer-titleblock h1 {
  margin-bottom: 0;
  max-width: 12ch;
  text-wrap: balance;
}

.viewer-meta {
  position: absolute;
  left: 1.35rem;
  bottom: 1.35rem;
  width: min(100% - 2.7rem, 390px);
  padding: 0;
  z-index: 2;
  background: transparent;
}

.viewer-meta h2 {
  font-size: clamp(2.1rem, 4vw, 3rem);
  margin-bottom: 0.65rem;
}

.viewer-meta-line,
.viewer-meta-state {
  margin-bottom: 0.3rem;
}

.viewer-meta .eyebrow,
.viewer-meta h2,
.viewer-meta-line,
.viewer-meta-state,
.viewer-description {
  max-width: 28rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.nav-button {
  min-width: 138px;
}

.nav-button-edge {
  position: absolute;
  top: 50%;
  z-index: 3;
  min-width: 0;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  line-height: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  color: var(--text);
}

.nav-button-core {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(18, 20, 24, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(214, 163, 93, 0.24);
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.nav-button-edge:hover .nav-button-core {
  transform: scale(1.25);
}

.nav-button-icon {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
}

.nav-button-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.nav-button-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button-prev {
  left: 1.35rem;
}

.nav-button-next {
  right: 1.35rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1120px) {
  .shell-home {
    grid-template-columns: 1fr 1fr;
  }

  .page-home .shell-home {
    grid-template-columns: 1fr 1fr;
  }

  .submit-hero-layout {
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.2rem;
  }

  .preview-panel {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .site-header,
  .admin-head {
    flex-direction: column;
    align-items: stretch;
  }

  .shell-home {
    grid-template-columns: 1fr;
  }

  .page-home .shell-home {
    grid-template-columns: 1fr;
  }

  .submit-hero-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "lede"
      "figure";
    gap: 1rem;
  }

  .submit-hero-figure {
    justify-self: start;
    width: min(100%, 320px);
  }

  .preview-panel {
    grid-column: span 1;
  }

  .viewer-titleblock {
    width: min(100% - 2rem, 560px);
  }

  .viewer-meta,
  .nav-button-edge {
    position: static;
    width: auto;
    margin: 1rem;
  }

  .viewer-meta {
    padding: 0;
  }

  .nav-button-edge {
    transform: none;
  }

  .viewer-stage {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    height: 100dvh;
  }

  .viewer-canvas {
    min-height: 56vh;
    flex: 1 1 auto;
  }

  .viewer-loading {
    inset: 1rem 1rem auto 1rem;
  }
}

@media (max-width: 560px) {
  .shell,
  .site-header {
    width: min(calc(100% - 1rem), var(--page-max));
  }

  .hero-panel,
  .form-panel,
  .preview-panel,
  .admin-head,
  .viewer-panel {
    padding: 1rem;
  }

  .submit-hero-title {
    max-width: none;
    font-size: clamp(2rem, 8.5vw, 3.15rem);
  }

  .page-home h2 {
    font-size: clamp(1.5rem, 7vw, 2.05rem);
  }

  .submit-hero-lede {
    max-width: none;
    font-size: 0.96rem;
  }

  .nav-button,
  .button {
    width: 100%;
  }

  .admin-toolbar,
  .artifact-card-topline,
  .artifact-links,
  .model-form {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-button-edge {
    width: 100%;
    height: auto;
    min-height: 3rem;
  }

  .nav-button-core {
    min-height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .submit-hero-figure,
  .submit-hero-figure::before {
    animation: none;
  }

  .submit-hero-figure {
    transform: translateY(0) rotate(3.2deg);
  }

  .viewer-spinner {
    animation: none;
  }
}
