:root {
  color-scheme: dark;
  --bg: #071016;
  --panel: rgba(13, 26, 36, 0.86);
  --panel-strong: rgba(17, 35, 48, 0.94);
  --text: #eef8ff;
  --muted: #9eb8c8;
  --line: rgba(146, 199, 228, 0.22);
  --accent: #69e4ff;
  --accent-2: #9dffbd;
  --shadow: rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(105, 228, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 80% 8%, rgba(157, 255, 189, 0.12), transparent 30rem),
    linear-gradient(145deg, #061018 0%, #0b1720 46%, #081116 100%);
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(14, 29, 41, 0.88), rgba(9, 20, 29, 0.72));
  box-shadow: 0 24px 70px var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.lede {
  margin: 14px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

.button.primary {
  color: #041014;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 34px rgba(105, 228, 255, 0.22);
}

.button.ghost { background: rgba(255, 255, 255, 0.04); }

.viewer-card {
  position: relative;
  min-height: min(74vh, 880px);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 24px 70px var(--shadow);
}

.viewer {
  width: 100%;
  height: calc(100% - 54px);
  min-height: 620px;
  position: relative;
  background:
    linear-gradient(rgba(105, 228, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 228, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(105, 228, 255, 0.12), transparent 34rem),
    #071016;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.viewer canvas { display: block; width: 100%; height: 100%; }

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.viewer-footer {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.92rem;
}

#status { color: var(--text); font-weight: 800; }

.hint { text-align: right; }

@media (max-width: 820px) {
  .shell { width: min(100vw - 18px, 1480px); padding: 9px 0; gap: 10px; }
  .hero { align-items: start; flex-direction: column; padding: 18px; border-radius: 20px; }
  .actions { width: 100%; justify-content: stretch; }
  .button { flex: 1 1 180px; }
  .viewer-card { border-radius: 20px; min-height: 70vh; }
  .viewer { min-height: 62vh; height: calc(100% - 72px); }
  .viewer-footer { min-height: 72px; align-items: start; flex-direction: column; gap: 4px; }
  .hint { text-align: left; }
}
