:root {
  --black: #000;
  --ink: #f2f2ef;
  --dim: rgba(242, 242, 239, .58);
  --faint: rgba(242, 242, 239, .18);
  --hair: rgba(242, 242, 239, .12);
  --glow: #e9f1ff;
  --accent: #ff3b5c;
  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Jost", "Helvetica Neue", Arial, sans-serif;
  --track: .22em;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--black);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

#light {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
.grain {
  position: fixed; inset: -50%;
  z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--hair);
}
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border: 1px solid var(--ink); position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink);
  box-shadow: 0 0 14px 3px var(--glow);
  animation: pulse 3.2s ease-in-out infinite;
}
.logo-text {
  font-family: var(--display); font-weight: 700; font-size: 11px;
  letter-spacing: .3em; line-height: 1.25;
}
.nav { display: flex; gap: 34px; }
.nav-item {
  font-size: 12px; font-weight: 400; letter-spacing: var(--track); color: var(--dim);
  position: relative; transition: color .4s;
}
.nav-item.is-current { color: var(--ink); }
.nav-item.is-current::after {
  content: ""; position: absolute; left: 0; right: .22em; bottom: -6px; height: 1px; background: var(--ink);
}
.topbar-ticket {
  font-size: 11px; letter-spacing: var(--track); font-weight: 500;
  border: 1px solid var(--ink); padding: 9px 16px;
}

/* ---------- Scenes ---------- */
main {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(32px, 7vh, 88px) var(--gutter);
}
[tabindex="-1"]:focus { outline: none; }
.scene {
  max-width: 980px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  opacity: 0; visibility: hidden;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.1,1), filter .9s ease, visibility 0s .9s;
}
/* неактивные залы не занимают места в потоке */
.scene:not(.is-active) {
  position: absolute; top: clamp(32px, 7vh, 88px); left: var(--gutter); right: var(--gutter); width: auto;
  pointer-events: none;
}
.scene.is-active {
  opacity: 1; visibility: visible; transform: none; filter: none;
  transition: opacity 1.1s ease .15s, transform 1.1s cubic-bezier(.2,.7,.1,1) .15s, filter 1.1s ease .15s, visibility 0s;
}
.scene-wide {
  max-width: 1180px; width: 100%;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 80px);
  align-items: start; align-content: center;
}

.eyebrow {
  margin: 0 0 22px; font-size: 12px; font-weight: 400; letter-spacing: .3em; color: var(--dim);
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 36px; height: 1px; background: var(--dim); }

.title {
  margin: 0 0 28px;
  font-family: var(--display); font-weight: 300; text-transform: uppercase;
  font-size: clamp(26px, 8.2vw, 116px); line-height: .98; letter-spacing: -.01em;
}
.title .line { display: block; }
.title .line:nth-child(2) { font-weight: 700; text-shadow: 0 0 40px rgba(233, 241, 255, .35); }
.title-q { font-size: clamp(28px, 6.2vw, 84px); font-weight: 500; max-width: 15ch; }
.title-md { font-size: clamp(24px, 6.6vw, 60px); font-weight: 500; }

.lead { text-shadow: 0 0 14px #000, 0 0 4px #000; max-width: 52ch; margin: 0 0 36px; font-size: clamp(17px, 1.5vw, 20px); color: var(--dim); }
.lead.small { font-size: 16px; margin-bottom: 28px; }

.facts {
  display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 44px; padding: 0;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.facts div { padding: 16px 32px 16px 0; margin-right: 32px; border-right: 1px solid var(--hair); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: 10px; letter-spacing: .3em; color: var(--dim); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  font: 500 13px/1 var(--body); letter-spacing: var(--track);
  padding: 18px 34px; cursor: pointer; border-radius: 0;
  transition: background .3s, color .3s, box-shadow .4s, transform .4s cubic-bezier(.2,.8,.2,1), opacity .3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-solid { background: var(--ink); color: var(--black); border: 1px solid var(--ink); }
.btn-solid:hover:not(:disabled) { box-shadow: 0 0 36px 4px rgba(233, 241, 255, .45); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--faint); }
.btn-ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn:focus-visible, .cal-day:focus-visible, .chip input:focus-visible + span, textarea:focus-visible, .cal-nav:focus-visible {
  outline: 1px solid var(--ink); outline-offset: 4px;
}
.btn-block { width: 100%; }

/* ---------- Question ---------- */
.answers {
  position: relative; display: flex; gap: 18px; align-items: center; min-height: 72px;
}
.btn-yes {
  transform-origin: left center;
  transform: scale(var(--grow, 1));
}
.btn-yes.is-glowing { animation: glow 1.6s ease-in-out infinite; }
.btn-no { position: relative; z-index: 4; white-space: nowrap; }
.btn-no.is-loose { position: fixed; margin: 0; transition: left .35s cubic-bezier(.2,.8,.2,1), top .35s cubic-bezier(.2,.8,.2,1), opacity .3s, transform .3s; }
.btn-no.is-gone { opacity: 0; transform: scale(.4); pointer-events: none; }
.caption {
  min-height: 1.5em; margin: 26px 0 0; font-size: 14px; letter-spacing: .08em; color: var(--dim);
}

/* ---------- Calendar ---------- */
.calendar { width: 100%; max-width: 520px; border: 1px solid var(--hair); background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--hair);
}
.cal-title { font-family: var(--display); font-weight: 500; font-size: 14px; letter-spacing: .18em; text-transform: uppercase; }
.cal-nav {
  background: none; border: 0; color: var(--ink); font-size: 18px; width: 56px; height: 56px; cursor: pointer;
  transition: background .3s;
}
.cal-nav:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.cal-nav:disabled { opacity: .2; cursor: default; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow span { text-align: center; font-size: 10px; letter-spacing: .2em; color: var(--dim); padding: 12px 0 8px; }
.cal-day {
  aspect-ratio: 1; border: 0; background: none; color: var(--ink);
  font: 400 15px var(--body); cursor: pointer; position: relative;
  transition: background .25s, color .25s;
}
.cal-day:hover:not(:disabled):not(.is-selected) { background: rgba(255,255,255,.07); }
.cal-day:disabled { color: rgba(242,242,239,.16); cursor: default; }
.cal-day.is-closed:not(.is-past) { text-decoration: line-through; text-decoration-color: rgba(242,242,239,.25); }
.cal-day.is-today::after {
  content: ""; position: absolute; left: 50%; bottom: 18%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--dim);
}
.cal-day.is-selected {
  background: var(--ink); color: var(--black); font-weight: 500;
  box-shadow: 0 0 30px 2px rgba(233, 241, 255, .5); z-index: 1;
}
.cal-empty { aspect-ratio: 1; }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 26px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 10px; border: 0; margin: 0; padding: 0; min-width: 0; position: relative; }
.label { font-size: 11px; letter-spacing: .3em; color: var(--dim); padding: 0; }
.picked {
  font-family: var(--display); font-weight: 500; font-size: clamp(20px, 2.4vw, 28px);
  text-transform: uppercase; letter-spacing: .02em; padding-bottom: 14px; border-bottom: 1px solid var(--hair);
}
.picked.is-empty { color: var(--faint); }
.hours { font-size: 13px; color: var(--dim); letter-spacing: .06em; min-height: 1.2em; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 12px 16px; border: 1px solid var(--faint);
  font-size: 11px; letter-spacing: .2em; cursor: pointer; transition: all .25s;
}
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: var(--black); border-color: var(--ink); }
textarea {
  background: rgba(0,0,0,.55); color: var(--ink); border: 1px solid var(--hair); border-radius: 0;
  font: 300 16px/1.55 var(--body); padding: 16px; resize: vertical; min-height: 130px;
  transition: border-color .3s;
}
textarea::placeholder { color: rgba(242,242,239,.32); }
textarea:focus { border-color: var(--dim); outline: none; }
.counter { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--faint); letter-spacing: .1em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#form-msg.is-error { color: var(--accent); }

/* ---------- Ticket ---------- */
.ticket {
  display: flex; width: min(100%, 640px); margin: 0 0 32px;
  border: 1px solid var(--ink); background: rgba(0,0,0,.6);
  box-shadow: 0 0 80px rgba(233, 241, 255, .14);
}
.ticket-main { flex: 1; padding: 28px 30px; display: flex; flex-direction: column; gap: 8px; }
.ticket-brand { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .3em; }
.ticket-kind, .ticket-names { font-size: 11px; letter-spacing: .26em; color: var(--dim); }
.ticket-date {
  font-family: var(--display); font-weight: 500; text-transform: uppercase;
  font-size: clamp(22px, 3.4vw, 36px); line-height: 1.1; margin: 14px 0 2px;
}
.ticket-slot { font-size: 15px; margin-bottom: 14px; }
.ticket-stub {
  width: 110px; border-left: 1px dashed var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 24px 0; font-size: 11px; letter-spacing: .2em;
}
.barcode {
  width: 44px; height: 120px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px);
}

.countdown { margin: 4px 0 16px; }
.cd-label { display: block; font-size: 10px; letter-spacing: .3em; color: var(--dim); margin-bottom: 8px; }
.cd-cells { display: flex; gap: 6px; }
.cd-cell {
  display: flex; flex-direction: column; align-items: center; min-width: 58px;
  padding: 8px 6px 6px; border: 1px solid var(--hair);
}
.cd-cell b {
  font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(233, 241, 255, .45);
}
.cd-cell i { font-style: normal; font-size: 9px; letter-spacing: .2em; color: var(--dim); margin-top: 6px; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ticket-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- Световой корги ---------- */
#corgi { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; }
.btn-no.is-carried { transition: none !important; z-index: 9; pointer-events: none; }
.woof {
  position: fixed; z-index: 10; pointer-events: none;
  font-family: var(--display); font-weight: 700; font-size: clamp(18px, 4vw, 28px); letter-spacing: .08em;
  color: #ffd29a; text-shadow: 0 0 10px #ffae55, 0 0 26px #ff8c2e;
  animation: woof 1s cubic-bezier(.2,.9,.2,1) forwards;
}
@keyframes woof {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.4) rotate(-8deg); }
  25% { opacity: 1; transform: translate(-50%, -18px) scale(1.15) rotate(4deg); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1) rotate(0); }
}

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px var(--gutter); border-top: 1px solid var(--hair);
  font-size: 10px; letter-spacing: .3em; color: var(--dim);
}

/* ---------- Hearts burst ---------- */
.spark {
  position: fixed; z-index: 10; pointer-events: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 12px 2px var(--glow);
  animation: spark 1.4s cubic-bezier(.1,.7,.2,1) forwards;
}

@keyframes pulse { 50% { opacity: .45; box-shadow: 0 0 4px 1px var(--glow); } }
@keyframes glow { 50% { box-shadow: 0 0 50px 10px rgba(233, 241, 255, .55); } }
@keyframes spark {
  to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; }
}

/* ---------- Responsive ---------- */
/* На узких экранах имя из света показывается на пустой сцене, билет проявляется после */
@media (max-width: 1000px) {
  .scene[data-step="3"].is-active { transition-delay: 3.4s; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .scene-wide { grid-template-columns: 1fr; }
  .calendar { max-width: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar { padding-top: 16px; padding-bottom: 16px; }
  .topbar-ticket { font-size: 9px; padding: 7px 10px; letter-spacing: .16em; }
  .facts { flex-direction: column; }
  .facts div { border-right: 0; border-bottom: 1px solid var(--hair); margin-right: 0; padding-right: 0; }
  .facts div:last-child { border-bottom: 0; }
  .btn { padding: 16px 24px; }
  .ticket { flex-direction: column; }
  .cd-cell { min-width: 0; flex: 1; }
  .cd-cell b { font-size: 19px; }
  .ticket-actions .btn { flex: 1 1 100%; justify-content: center; }
  .ticket-stub { width: auto; flex-direction: row; border-left: 0; border-top: 1px dashed var(--faint); padding: 14px 24px; }
  .barcode { width: 120px; height: 28px; background: repeating-linear-gradient(to right, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 9px, var(--ink) 9px 12px, transparent 12px 14px); }
  .footer { font-size: 9px; letter-spacing: .2em; }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .scene.is-active { transition: opacity .3s; transform: none; filter: none; }
  .logo-mark::after, .btn-yes.is-glowing { animation: none; }
  .scene[data-step="3"].is-active { transition-delay: 0s; }
}
