:root {
  /* холодная ртутная смена — не натриевый янтарь */
  --bg: #0c1218;
  --desk: #121a22;
  --paper: #e2e8ee;
  --paper-2: #eef3f7;
  --ink: #12161c;
  --muted-ink: #5a6570;
  --text: #e8eef4;
  --muted: rgba(232, 238, 244, 0.55);
  --soft: rgba(232, 238, 244, 0.38);
  --line: rgba(232, 238, 244, 0.09);
  --sodium: #5eb8c9;
  --stop: #d45a4a;
  --ok: #3d8a6e;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --ui: "Onest", sans-serif;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.asphalt {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(94, 184, 201, 0.18), transparent 58%),
    radial-gradient(700px 380px at 8% 110%, rgba(212, 90, 74, 0.1), transparent 50%),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,0.018) 3px 4px);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus { left: 12px; z-index: 20; background: var(--paper); color: var(--ink); padding: 8px 12px; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.bar {
  position: relative;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 18, 24, 0.9);
}

.bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 22px;
}

.nav {
  display: flex;
  gap: 22px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav a:hover,
.nav a.is-on { color: var(--text); }

#app { position: relative; z-index: 1; min-height: 70vh; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 64px;
}

.kicker {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sodium);
  font-weight: 700;
}

h1, h2, .num {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.92;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  max-width: 11ch;
}

.deck {
  margin: 18px 0 28px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 17px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  background: var(--sodium);
  color: #0c1218;
  transition: transform 0.2s var(--ease);
}

.btn:hover { transform: translateY(-3px); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn:focus-visible,
.nav a:focus-visible,
.slip:focus-visible,
.opt:focus-visible {
  outline: 2px solid var(--sodium);
  outline-offset: 3px;
}

.hero-plate {
  position: relative;
  min-height: 420px;
}

.lamp {
  position: absolute;
  right: 8%;
  top: -20px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94,184,201,0.48), transparent 68%);
  filter: blur(8px);
}

.slip-hero {
  position: absolute;
  inset: 40px 20px auto auto;
  width: min(340px, 86%);
  background: var(--paper);
  color: var(--ink);
  padding: 28px 24px 32px;
  box-shadow: var(--shadow);
  transform: rotate(4deg);
}

.slip-hero .n {
  font-family: var(--display);
  font-size: 86px;
  line-height: 0.8;
  margin: 0;
}

.slip-hero p { margin: 12px 0 0; color: var(--muted-ink); font-size: 14px; }

.enamel {
  position: absolute;
  left: 8%;
  bottom: 24px;
  width: 120px;
  height: 120px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #152028;
  box-shadow: inset 0 0 0 4px var(--sodium);
}

.tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.tool {
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  padding: 28px 18px 26px;
  min-height: 140px;
}

.tool strong {
  display: block;
  font-family: var(--display);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 8px 0 10px;
}

.tool span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.tool.has-ink strong { color: var(--stop); }

.tool:hover { background: var(--desk); }

.slip.is-day { box-shadow: inset 0 0 0 3px var(--sodium); }

.opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.key {
  flex: 0 0 1.4em;
  font: 800 13px/1.4 var(--display);
  color: var(--muted-ink);
}

.qcard.dark .key,
.opt.is-ok .key,
.opt.is-bad .key { color: inherit; opacity: 0.7; }

.keys-hint {
  margin: 4px 0 0;
  color: var(--soft);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--desk);
  box-shadow: inset 3px 0 0 var(--sodium);
  color: var(--text);
  font-size: 14px;
}

.themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 16px 18px;
  background: var(--desk);
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.theme strong {
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 700;
}

.theme span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.theme:hover { box-shadow: inset 0 0 0 1px var(--sodium); }

.proto-list { display: grid; gap: 8px; }

.proto {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.proto .idx {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.proto strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.proto small {
  display: block;
  margin-top: 6px;
  color: var(--muted-ink);
  font-size: 12px;
}

.section { padding: 56px 0 72px; }
.section h2 { font-size: 36px; margin: 0 0 8px; }
.lead { margin: 0 0 28px; color: var(--muted); }

.grid-tickets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.slip {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  min-height: 132px;
  padding: 16px 14px 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.2s var(--ease);
}

.slip:hover { transform: rotate(0deg) translateY(-4px); }

.slip .idx {
  font-family: var(--display);
  font-size: 42px;
  line-height: 0.85;
  font-weight: 800;
}

.slip small {
  display: block;
  margin-top: 10px;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 600;
}

.slip.is-done { box-shadow: inset 0 0 0 3px var(--ok); }
.slip.is-bad { box-shadow: inset 0 0 0 3px var(--stop); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.qcard {
  background: var(--paper);
  color: var(--ink);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow);
}

.qcard.dark {
  background: var(--desk);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.qmeta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-ink);
  font-weight: 700;
}

.qcard.dark .qmeta { color: var(--soft); }

.qcard h2 {
  font-family: var(--ui);
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.35;
  font-weight: 700;
  margin: 14px 0 18px;
}

.shot {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #d0d8e0;
  margin: 0 0 18px;
}

.opts { display: grid; gap: 8px; }

.opt {
  text-align: left;
  background: var(--paper-2);
  border: 1px solid rgba(22,20,24,0.08);
  color: var(--ink);
  padding: 12px 14px;
  font: 600 15px/1.4 var(--ui);
  cursor: pointer;
}

.qcard.dark .opt {
  background: #1a2430;
  color: var(--text);
  border-color: var(--line);
}

.opt.is-ok { background: var(--ok); color: #f6fff8; border-color: transparent; }
.opt.is-bad { background: var(--stop); color: #fff6f4; border-color: transparent; }
.opt:disabled { cursor: default; }

.tip {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(22,20,24,0.12);
  color: var(--muted-ink);
  font-size: 15px;
}

.qcard.dark .tip { color: var(--muted); border-color: var(--line); }

.flip-wrap { min-height: 0; }

.flip { position: relative; }

.face.back { display: none; }

.flip.is-back .face:not(.back) { display: none; }

.flip.is-back .face.back {
  display: block;
  animation: turn 0.42s var(--ease);
}

@keyframes turn {
  from {
    transform: rotateX(10deg) translateY(10px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.dots button {
  width: 28px;
  height: 28px;
  border: 0;
  background: #1a2430;
  color: var(--soft);
  font: 700 11px var(--ui);
  cursor: pointer;
}

.dots button.is-now { background: var(--sodium); color: #0c1218; }
.dots button.is-ok { background: var(--ok); color: #fff; }
.dots button.is-bad { background: var(--stop); color: #fff; }

.hud {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.result {
  background: var(--paper);
  color: var(--ink);
  padding: 36px 28px;
  box-shadow: var(--shadow);
}

.result h2 { font-size: 56px; margin: 0 0 8px; }
.result.fail h2 { color: var(--stop); }
.result.pass h2 { color: var(--ok); }

.foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--soft);
  font-size: 13px;
}

.foot p { margin: 0 0 8px; max-width: 62ch; }

.foot-req {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  max-width: 62ch;
}

.req-label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sodium);
}

.foot-req p { margin: 0 0 4px; }

.foot-req p:last-child { margin-bottom: 0; }

.foot-req a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(94, 184, 201, 0.35);
}

.foot-req a:hover,
.foot-req a:focus-visible {
  color: var(--text);
  text-decoration-color: var(--sodium);
  outline: none;
}

.foot-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
}

.legal-page {
  position: relative;
  z-index: 1;
  padding: 48px 0 80px;
  max-width: 62ch;
}

.legal-page h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
  margin: 8px 0 20px;
}

.legal-page p {
  color: var(--muted);
  margin: 0 0 14px;
}

.legal-page a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(94, 184, 201, 0.45);
}

.legal-page a:hover,
.legal-page a:focus-visible {
  color: var(--sodium);
  outline: none;
}

.busy, .err {
  padding: 80px 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-plate { min-height: 280px; }
  .grid-tickets { grid-template-columns: repeat(4, 1fr); }
  .tools { grid-template-columns: 1fr 1fr; }
  .themes { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .grid-tickets { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: 42px; }
  .qcard { padding: 20px 16px; }
  .keys-hint { display: none; }
  .tool strong { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .flip.is-back .face.back { animation: none; }
  .btn:hover, .slip:hover { transform: none; }
}
