:root {
  color-scheme: dark;
  --ink: #000;
  --ink-2: #050505;
  --paper: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --accent: #fff;
  --orange: #ff8a00;
  --green: #16a34a;
  --red: #dc2626;
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus,
button:focus-visible,
a:focus,
a:focus-visible,
input:focus,
input:focus-visible {
  outline: none;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--paper);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding: 28px;
  background: #000;
}

.landing__logo {
  width: min(78vw, 760px);
  max-height: 34vh;
  object-fit: contain;
  display: block;
}

.enter-button {
  min-width: 136px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 0 24px;
  background: transparent;
  color: var(--paper);
  font-weight: 900;
  text-transform: uppercase;
}

.enter-button:hover {
  border-color: var(--paper);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
}

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 64px);
  background: #000;
}

.quiz-header {
  position: fixed;
  top: 28px;
  left: 32px;
  z-index: 4;
}

.quiz-header__logo {
  width: clamp(160px, 20vw, 260px);
  height: auto;
  display: block;
}

.gate__panel {
  width: min(100%, 920px);
}

.gate h1 {
  margin: 0;
  font-size: clamp(4rem, 13vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
}

.gate__copy {
  max-width: 36rem;
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.question-check legend {
  display: block;
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.045);
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.1;
  text-align: center;
}

.choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check {
  display: grid;
  gap: 18px;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.text-check span {
  margin-bottom: 8px;
  color: var(--paper);
  font-size: 0.84rem;
  font-weight: 800;
}

.option {
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
  line-height: 1.35;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option:hover {
  background: rgba(255, 255, 255, 0.075);
}

.option__key {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  font-weight: 900;
}

.option__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.option.is-selected {
  border-color: var(--line);
  background: rgba(255, 138, 0, 0.2);
}

.option.is-correct {
  border-color: var(--line);
  background: rgba(22, 163, 74, 0.28);
}

.option.is-wrong {
  border-color: var(--line);
  background: rgba(220, 38, 38, 0.3);
}

.text-check {
  display: grid;
}

.text-check input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--paper);
  outline: none;
}

.text-check input:focus {
  border-color: var(--paper);
}

.primary,
.topbar__actions button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--paper);
  color: #000;
  font-weight: 900;
}

.primary:disabled {
  cursor: default;
  opacity: 0.62;
}

.topbar__actions button {
  min-height: 38px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.topbar__actions button:disabled {
  cursor: default;
  opacity: 0.42;
}

.topbar__actions .icon-button {
  width: 42px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.primary:hover,
.topbar__actions button:not(:disabled):hover {
  filter: brightness(1.06);
}

.error {
  min-height: 1.4em;
  margin: 0;
  color: var(--paper);
  font-size: 0.9rem;
}

.deck {
  min-height: 100vh;
  background: #000;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(16px);
}

.deck-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.deck-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--paper);
  transition: width 180ms ease;
}

.deck-logo {
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: none;
}

.deck-logo img {
  width: clamp(142px, 15vw, 220px);
  height: auto;
  display: block;
}

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

.contact-menu {
  position: relative;
  display: inline-flex;
}

.contact-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.94);
  box-shadow: var(--shadow);
}

.contact-menu.is-open .contact-menu__panel {
  display: grid;
  gap: 4px;
}

.contact-menu__panel a,
.contact-menu__panel button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.contact-menu__panel a:hover,
.contact-menu__panel button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.progress {
  min-width: 78px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.deck-status {
  display: block;
  padding: clamp(18px, 3vw, 30px) clamp(16px, 3vw, 36px) clamp(12px, 2vw, 18px);
}

.deck-status .eyebrow {
  margin-bottom: 0;
}

.viewer {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
  padding: 0 clamp(16px, 3vw, 36px) 42px;
}

.rail {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 4px;
}

.thumb {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  text-align: left;
  overflow: hidden;
  transition: background 160ms ease, filter 160ms ease;
}

.thumb.is-active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.16);
}

.thumb:hover {
  background: rgba(255, 255, 255, 0.1);
}

.thumb::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--paper);
  opacity: 0;
}

.thumb.is-active::before {
  opacity: 1;
}

.thumb span {
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
  transition: filter 160ms ease, opacity 160ms ease;
}

.thumb:hover img,
.thumb.is-active img {
  filter: brightness(1.22);
}

.slides {
  display: block;
}

.slide {
  display: none;
}

.slide.is-active {
  display: block;
}

.slide__frame {
  aspect-ratio: 16 / 9;
  width: min(100%, calc((100vh - 260px) * 16 / 9));
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink-2);
  box-shadow: var(--shadow);
}

.slide__frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  pointer-events: none;
}

.confetti-canvas.is-active {
  display: block;
}

@media (max-width: 980px) {
  .deck-status,
  .viewer {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding: 0 0 8px;
  }

  .thumb {
    min-width: 112px;
    grid-template-columns: 1fr;
  }

  .thumb span {
    display: none;
  }
}

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

  .gate {
    padding: 16px;
  }

  .quiz-header {
    top: 16px;
    left: 16px;
  }

  .quiz-header__logo {
    width: 154px;
  }

  .gate h1 {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar__actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar__actions button {
    padding: 0 9px;
    font-size: 0.86rem;
  }

  .topbar__actions .icon-button {
    flex: 0 0 42px;
    padding: 0;
  }

  .progress {
    flex: 1 0 72px;
    min-width: 72px;
  }

  .contact-menu {
    flex: 0 0 auto;
  }

  .deck-status {
    padding-top: 22px;
  }

  .slide__frame {
    width: 100%;
  }
}
