:root {
  color-scheme: light;
  --ink: #1c2026;
  --muted: #68717f;
  --line: #d9dee7;
  --panel: #ffffff;
  --bg: #eef2f5;
  --accent: #0c6b58;
  --accent-dark: #084b3f;
  --warm: #c98243;
  --blue: #2c6c9f;
  --shadow: 0 24px 70px rgba(26, 36, 48, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(12, 107, 88, 0.10), transparent 34%),
    linear-gradient(315deg, rgba(201, 130, 67, 0.12), transparent 30%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
video {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 36px;
  display: grid;
  place-items: center;
}

.workspace {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  gap: 22px;
  align-items: stretch;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 30px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-mark {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 8px 8px 0 var(--warm);
}

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

.form-panel h1 {
  margin: 36px 0 12px;
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 28px;
}

.upload-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(12, 107, 88, 0.13);
}

.mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.mode-control label {
  cursor: pointer;
}

.mode-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.mode-control span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.mode-control input:checked + span {
  color: #fff;
  background: var(--accent);
}

.dropzone {
  min-height: 160px;
  border: 1.5px dashed #aeb7c4;
  border-radius: 8px;
  background: #f8fafb;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  cursor: pointer;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: inset 0 0 0 3px rgba(12, 107, 88, 0.12);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone-title {
  font-size: 1.08rem;
  font-weight: 800;
}

.dropzone-hint,
.selected-files,
.message {
  color: var(--muted);
  font-size: 0.92rem;
}

.selected-files {
  min-height: 22px;
  display: grid;
  gap: 10px;
}

.selected-files p {
  margin: 0;
}

.selected-file-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: grab;
}

.selected-file-card.is-moving {
  opacity: 0.55;
}

.selected-file-card img,
.selected-file-card video {
  width: 72px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: #d6dde2;
}

.selected-video-card {
  cursor: default;
}

.selected-file-card strong,
.selected-file-card span {
  display: block;
  overflow-wrap: anywhere;
}

.selected-file-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.primary-button,
.secondary-button,
.danger-button,
.primary-link,
.secondary-link {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button,
.primary-link {
  min-height: 52px;
  color: #fff;
  background: var(--accent);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  text-decoration: none;
}

.primary-button:hover,
.primary-link:hover {
  background: var(--accent-dark);
}

.secondary-button {
  color: var(--accent-dark);
  background: #e5f1ee;
  padding: 10px 14px;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.secondary-link {
  color: var(--accent-dark);
  background: #e5f1ee;
  padding: 10px 14px;
  text-decoration: none;
}

.danger-button {
  color: #8b1f1f;
  background: #f8e8e8;
  padding: 10px 14px;
}

.result {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #bfd7d1;
  border-radius: 8px;
  background: #f3faf8;
  display: grid;
  gap: 10px;
}

.result a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

.preview-panel {
  padding: 16px;
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  gap: 16px;
  overflow: hidden;
}

.mock-browser {
  height: 34px;
  border-bottom: 1px solid var(--line);
}

.browser-dots {
  display: flex;
  gap: 7px;
  padding: 9px 0 0 4px;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccd3dc;
}

.preview-hero {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #18232a;
  min-height: 420px;
}

.preview-image {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(44, 108, 159, 0.78), rgba(12, 107, 88, 0.62)),
    repeating-linear-gradient(45deg, #33414d 0 10px, #3f4f5f 10px 20px);
}

.preview-copy {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  color: #fff;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.42);
}

.preview-kicker,
.share-label,
.section-heading span {
  display: block;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-copy h2 {
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.preview-copy p {
  max-width: 30rem;
  margin-bottom: 0;
  line-height: 1.55;
}

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

.preview-grid span {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: linear-gradient(135deg, #dfe6ea, #b7c4cb);
}

.project-page {
  background: #f5f6f3;
}

.share-hero {
  min-height: 88vh;
  display: grid;
  grid-template-columns: 1.28fr 0.72fr;
  align-items: stretch;
}

.share-media {
  min-height: 520px;
  background: #20262d;
}

.share-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.share-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.public-entry .form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-login {
  width: min(520px, 100%);
  padding: 30px;
}

.admin-login h1 {
  margin: 36px 0 20px;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.96;
}

.admin-workspace {
  width: min(1180px, 100%);
  display: grid;
  gap: 20px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-topbar h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.96;
}

.admin-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
}

.form-panel h2,
.project-list-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.project-list-panel {
  padding: 24px;
}

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

.project-list {
  display: grid;
  gap: 12px;
}

.project-list-item,
.user-list-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.project-list-item img,
.project-list-item video {
  width: 86px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: #d6dde2;
}

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

.project-list-item h3,
.user-list-item h3 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
}

.project-list-item a,
.user-list-item a {
  display: block;
  color: var(--accent-dark);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.project-list-item span,
.user-list-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-pill,
.quality-pill {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f5;
}

.quality-pill {
  background: #fff4e8;
  color: #8a4c18;
}

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

.share-copy {
  padding: clamp(28px, 7vw, 78px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.share-label {
  color: var(--warm);
}

.share-copy h1 {
  margin: 16px 0 18px;
  font-size: clamp(2.8rem, 8vw, 6.75rem);
  line-height: 0.92;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.share-copy p {
  color: var(--muted);
  font-size: 1.12rem;
}

.gallery-section {
  padding: clamp(28px, 6vw, 72px);
}

.splat-section {
  padding: clamp(28px, 6vw, 72px) clamp(28px, 6vw, 72px) 0;
}

.splat-viewer {
  position: relative;
  min-height: min(72vh, 720px);
  border-radius: 8px;
  overflow: hidden;
  background: #111820;
}

.splat-viewer canvas {
  width: 100%;
  height: min(72vh, 720px);
  display: block;
  cursor: grab;
  outline: none;
  touch-action: none;
}

.splat-viewer canvas:active {
  cursor: grabbing;
}

.splat-viewer canvas:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.76);
}

.splat-status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(520px, calc(100% - 236px));
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  background: rgba(17, 24, 32, 0.78);
  font-weight: 800;
  white-space: pre-line;
}

.viewer-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewer-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: rgba(17, 24, 32, 0.78);
  font-weight: 800;
  cursor: pointer;
}

.viewer-button:hover,
.viewer-pad-button:hover {
  background: rgba(17, 24, 32, 0.94);
}

.viewer-direction-pad {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 42px);
  grid-template-areas:
    ". up zoomin"
    "left down right"
    ". zoomout .";
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(17, 24, 32, 0.62);
  backdrop-filter: blur(12px);
}

.viewer-pad-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: rgba(17, 24, 32, 0.78);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}

.viewer-pad-button[data-control="up"] {
  grid-area: up;
}

.viewer-pad-button[data-control="down"] {
  grid-area: down;
}

.viewer-pad-button[data-control="left"] {
  grid-area: left;
}

.viewer-pad-button[data-control="right"] {
  grid-area: right;
}

.viewer-pad-button[data-control="zoom-in"] {
  grid-area: zoomin;
}

.viewer-pad-button[data-control="zoom-out"] {
  grid-area: zoomout;
}

.splat-viewer.is-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.splat-viewer.is-empty canvas {
  display: none;
}

.splat-viewer.is-empty .viewer-controls,
.splat-viewer.is-empty .viewer-direction-pad {
  display: none;
}

.splat-viewer.is-empty .splat-status {
  position: static;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading span {
  color: var(--accent);
}

.section-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3.5rem);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery figure {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #d6dde2;
  aspect-ratio: 4 / 3;
}

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

@media (max-width: 860px) {
  .app-shell {
    padding: 18px;
  }

  .splat-viewer,
  .splat-viewer canvas {
    min-height: 62vh;
    height: 62vh;
  }

  .splat-status {
    left: 10px;
    right: 10px;
    bottom: auto;
    top: 10px;
    max-width: none;
    font-size: 0.82rem;
  }

  .viewer-controls {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 118px;
    justify-content: center;
  }

  .viewer-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .viewer-direction-pad {
    right: 10px;
    bottom: 10px;
    grid-template-columns: repeat(3, 38px);
  }

  .viewer-pad-button {
    width: 38px;
    height: 38px;
  }

  .workspace,
  .share-hero {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    grid-template-rows: auto auto auto;
  }

  .share-copy {
    min-height: 42vh;
  }

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

  .admin-topbar,
  .list-heading,
  .selected-file-card,
  .project-list-item,
  .user-list-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .selected-file-card img,
  .selected-file-card video {
    width: 100%;
  }

  .admin-topbar {
    flex-direction: column;
  }

  .project-list-item img,
  .project-list-item video {
    width: 100%;
  }
}
