:root {
  --bg: #100e0c;
  --bg-2: #1a1613;
  --ink: #f6f1e7;
  --muted: #b7aa9c;
  --line: rgba(246, 241, 231, 0.12);
  --red: #e23d2b;
  --gold: #e2b657;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(226, 61, 43, 0.18), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(226, 182, 87, 0.12), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
}

body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 40px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 22px;
}

.mark {
  margin: 0 0 6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gold);
}

h1, h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  letter-spacing: -0.03em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.95;
  max-width: 12ch;
}

.lede {
  margin: 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.stage {
  position: relative;
  background: #070605;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

#view {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: #070605;
}

.gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(7, 6, 5, 0.2), rgba(7, 6, 5, 0.88)),
    repeating-linear-gradient(135deg, rgba(226, 182, 87, 0.07) 0 2px, transparent 2px 14px);
}

.gate[hidden] { display: none; }

.gate-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

.gate h2 {
  margin: 0 0 8px;
  font-size: 2.2rem;
}

.gate p { margin: 0; color: var(--muted); max-width: 36ch; }

.primary, .ghost, .chip, .swatch {
  font: inherit;
  cursor: pointer;
}

.primary {
  margin-top: 18px;
  align-self: flex-start;
  border: 0;
  background: var(--red);
  color: white;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
}

.primary:hover { filter: brightness(1.08); }

.stage-actions, .row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
}

.ghost:hover { border-color: rgba(246, 241, 231, 0.35); }

.ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ghost[aria-pressed="true"] {
  background: var(--ink);
  color: #161311;
  border-color: transparent;
}

.status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(12, 10, 8, 0.72);
  color: var(--ink);
  font-size: 0.82rem;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.status[hidden] { display: none; }

.panel {
  background: rgba(26, 22, 19, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px 16px 16px;
}

.panel section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.panel section:last-child { border-bottom: 0; padding-bottom: 0; }

.panel h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: #241f1b;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 11px;
}

.chip[aria-pressed="true"] {
  background: var(--red);
  border-color: transparent;
  color: white;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.swatch.is-on { outline: 2px solid var(--ink); outline-offset: 2px; }

.swatch.custom {
  display: grid;
  place-items: center;
  background: conic-gradient(from 20deg, #e23d2b, #e2b657, #2f9e6b, #3b6fe0, #e23d2b);
}

.swatch input {
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.size {
  display: grid;
  gap: 6px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.size strong { color: var(--ink); font-weight: 600; }

.size input { width: 100%; accent-color: var(--red); }

footer {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.88rem;
}

footer a { color: var(--gold); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 860px) {
  body { padding: 18px 14px 32px; }
  .top, .layout { display: block; }
  .lede { margin-top: 12px; }
  .panel { margin-top: 16px; }
  h1 { max-width: none; }
}
