:root {
  --page-bg: #f4f6fb;
  --panel-bg: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(15, 23, 42, 0.08);
  --text-main: #13203a;
  --text-muted: #52607a;
  --accent: #2458d3;
  --accent-strong: #173c93;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(36, 88, 211, 0.12), transparent 32%),
    linear-gradient(180deg, #f8faff 0%, var(--page-bg) 100%);
}

body {
  line-height: 1.6;
}

a {
  color: inherit;
}

.page-shell {
  max-width: 1720px;
  margin: 0 auto;
  padding: 40px 28px 56px;
}

.project-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  max-width: 100%;
  margin-bottom: 28px;
}

.project-header .eyebrow {
  align-self: center;
  margin-top: 60px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  background: rgba(36, 88, 211, 0.08);
}

.back-link:hover {
  background: rgba(36, 88, 211, 0.14);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
}

.project-intro,
.viewer-note {
  max-width: 720px;
  margin: 14px 0 0;
  font-size: 18px;
  color: var(--text-muted);
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 120px;
  gap: 24px;
}

.scene-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scene-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.scene-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8edf8;
}

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

.scene-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 132px;
  padding: 20px 22px 22px;
}

.scene-card-body h2 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.2;
}

.scene-card-body p {
  margin: 8px 0 16px;
  color: var(--text-muted);
}

.scene-card-link {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.viewer-page {
  overflow: hidden;
  background: #050816;
  color: #fff;
}

.viewer-header {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.viewer-header .back-link,
.viewer-copy {
  pointer-events: auto;
}

.viewer-header .back-link {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(14px);
}

.viewer-header .back-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.viewer-copy {
  max-width: min(620px, calc(100vw - 180px));
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(10, 16, 34, 0.58);
  backdrop-filter: blur(18px);
}

.viewer-copy .eyebrow {
  color: #8eb2ff;
}

.viewer-copy h1 {
  font-size: clamp(26px, 4vw, 40px);
}

.viewer-copy .viewer-note {
  margin-top: 10px;
  font-size: 17px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

.progress-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: #fff;
  background: rgba(10, 16, 34, 0.82);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.progress-dialog::backdrop {
  background: rgba(5, 8, 22, 0.36);
}

.progress-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.progress-note {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

#progress-indicator {
  width: 100%;
  height: 10px;
}

#canvas,
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

@media (max-width: 900px) {
  .scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .viewer-header {
    position: absolute;
    right: 16px;
    left: 16px;
    flex-direction: column;
  }

  .viewer-copy {
    max-width: 100%;
  }
}

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

@media (max-width: 640px) {
  .page-shell {
    padding: 24px 18px 40px;
  }

  .scene-card-body {
    padding: 18px;
  }

  .project-intro {
    font-size: 16px;
  }
}
