:root {
  --sand: #f3ede4;
  --paper: #fffdf8;
  --ink: #0f1721;
  --teal: #0f766e;
  --teal-deep: #0d4f58;
  --amber: #f4a40d;
  --muted: #52616e;
  --line: #d9d0c2;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(140deg, #faf6ef 0%, #f2ebe0 100%);
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(1px);
  z-index: 0;
}

.shape-a {
  width: 340px;
  height: 340px;
  left: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.2), transparent 70%);
}

.shape-b {
  width: 430px;
  height: 430px;
  right: -180px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(244, 164, 13, 0.22), transparent 70%);
}

.page {
  position: relative;
  z-index: 1;
  width: min(980px, 94vw);
  margin: 30px auto 40px;
}

.hero,
.experience,
.fallback {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.09);
}

.hero {
  padding: 32px;
  animation: liftIn 600ms ease;
}

.kicker {
  display: inline-block;
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--teal-deep);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 7vw, 4.3rem);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 0.95;
}

.lead {
  margin: 16px 0 0;
  max-width: 70ch;
  color: #1f2a34;
  font-size: 1.04rem;
}

.device-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8f6f3;
  border: 1px solid #b6d9d3;
  color: #0d4f58;
  font-size: 0.86rem;
  font-weight: 700;
}

.device-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 16px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(120deg, var(--teal), #148e83);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  color: var(--teal-deep);
  border-color: #9fbdc1;
}

.btn.tiny {
  background: #fff;
  color: #23313f;
  border: 1px solid #9cadbf;
  padding: 6px 10px;
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.debug-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: #13212f;
  border: 1px solid #284154;
  color: #e8f5ff;
}

.debug-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.debug-head h2 {
  margin: 0;
  font-size: 1rem;
}

.debug-head p {
  margin: 0;
  color: #b8d4e6;
  font-size: 0.84rem;
}

.debug-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.debug-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.debug-item dt {
  margin: 0 0 6px;
  color: #8cc6e6;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.debug-item dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

.experience,
.fallback {
  margin-top: 16px;
  padding: 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 4px 4px 10px;
}

.status-row p {
  margin: 0;
  color: #29485d;
  font-weight: 500;
  font-size: 0.94rem;
}

.stage {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #c9d3db;
  min-height: min(70vh, 560px);
  background: #0f1721;
}

.camera {
  width: 100%;
  height: min(70vh, 560px);
  object-fit: cover;
  display: block;
}

.overlay-card {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(360px, 82vw);
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  background: rgba(12, 20, 32, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 14px;
  backdrop-filter: blur(5px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
  touch-action: none;
  user-select: none;
}

.drag-handle {
  padding: 8px 10px;
  text-align: center;
  color: #d8f5ef;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.promo {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.overlay-note {
  margin: 8px 0 10px;
  text-align: center;
  color: #cce6e3;
  font-size: 0.78rem;
}

.controls {
  margin: 12px 6px 0;
}

.controls label {
  display: block;
  margin-bottom: 8px;
  color: #23313f;
  font-size: 0.88rem;
  font-weight: 700;
}

.controls input {
  width: 100%;
}

.fallback h2 {
  margin: 6px 0 12px;
  font-size: 1.3rem;
  color: #13222f;
}

.full-video {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #cdd5dc;
  background: #000;
}

.hidden {
  display: none;
}

.device-hidden {
  display: none !important;
}

@keyframes liftIn {
  from {
    transform: translateY(14px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .page {
    width: 95vw;
    margin-top: 18px;
  }

  .hero {
    padding: 24px 18px;
  }

  .lead {
    font-size: 0.98rem;
  }

  .stage,
  .camera {
    min-height: 62vh;
    height: 62vh;
  }
}
