:root {
  --bg: #07111f;
  --panel: rgba(9, 22, 40, 0.88);
  --panel-strong: #0f2340;
  --line: rgba(140, 185, 255, 0.18);
  --text: #e8f1ff;
  --muted: #97afcf;
  --accent: #5eead4;
  --accent-strong: #13b9ad;
  --warning: #ffd166;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(94, 234, 212, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 26%),
    linear-gradient(180deg, #06101d 0%, #0c1730 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 28px;
  padding: 32px;
}

.hero-card {
  border-radius: 28px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(19, 185, 173, 0.18), rgba(15, 35, 64, 0.95)),
    var(--panel);
}

.eyebrow,
.metric-label,
.card-label,
.result-label,
.log-panel,
.status-badge {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}

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

h1 {
  margin-bottom: 14px;
  max-width: 12ch;
  line-height: 0.98;
  font-size: clamp(2.4rem, 5vw, 4.9rem);
}

.hero-text {
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.hero-metrics div,
.result-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(140, 185, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.metric-label,
.card-label,
.result-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-card ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  border-radius: 24px;
  padding: 24px;
}

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

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.status-badge {
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-badge.pending {
  color: var(--warning);
  border-color: rgba(255, 209, 102, 0.28);
  background: rgba(255, 209, 102, 0.08);
}

.status-badge.ready {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(94, 234, 212, 0.08);
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border-radius: 24px;
  border: 1px dashed rgba(140, 185, 255, 0.35);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(13, 22, 44, 0.6)),
    var(--panel-strong);
  text-align: center;
  cursor: pointer;
}

.upload-zone input {
  display: none;
}

.upload-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.upload-subtitle {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.camera-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(94, 234, 212, 0.16);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(94, 234, 212, 0.08), rgba(15, 35, 64, 0.45));
}

.camera-copy h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.camera-copy p:last-child,
.camera-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

#camera-video {
  display: none;
  width: 100%;
  max-height: 220px;
  margin-top: 14px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  border-radius: 14px;
  background: #020814;
  object-fit: cover;
}

#camera-video.is-active {
  display: block;
}

.camera-actions {
  margin-top: 14px;
}

.camera-note {
  margin-top: 12px;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.primary-button {
  flex: 1;
  background: linear-gradient(135deg, var(--accent), #5ea4ff);
  color: #03121f;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.log-panel {
  min-height: 140px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(3, 8, 18, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #b7c7e2;
  line-height: 1.6;
  white-space: pre-line;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.result-card strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
  word-break: break-word;
}

.canvas-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 18px;
}

.canvas-card {
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.canvas-card figcaption {
  margin-bottom: 12px;
  color: var(--muted);
}

canvas {
  width: 100%;
  border-radius: 16px;
  background: linear-gradient(180deg, #071221, #111f3c);
}

@media (max-width: 980px) {
  .hero,
  .workspace,
  .canvas-grid,
  .result-strip,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    flex-direction: column;
  }
}
