@font-face {
  font-family: "Unbounded";
  src: url("fonts/unbounded-cyrillic.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  src: url("fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --velvet: #241552;
  --velvet-soft: #3a2a78;
  --ink: #1c1534;
  --red: #d9302b;
  --red-deep: #b0201c;
  --brass: #efb233;
  --paper: #ffffff;
  --mist: #efecf7;
  --line: #dcd7ea;
  --muted: #625c80;
  --sold: #b9b3cc;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
}

button, input { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

/* ---------- Hero: velvet tent with a scalloped valance ---------- */

.hero {
  position: relative;
  background: var(--velvet);
  color: #fff;
  padding: clamp(32px, 6vw, 60px) var(--gutter) clamp(52px, 7vw, 76px);
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.35rem, 7vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 11ch;
  text-wrap: balance;
}

.lede {
  margin: 1rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: #d9d3f2;
}

.valance {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 44px;
  --s: 44px;
  background:
    radial-gradient(circle at 50% 0, var(--red) 0 calc(var(--s) / 2 - 0.5px), transparent calc(var(--s) / 2)) 0 0 / var(--s) var(--s) repeat-x;
  pointer-events: none;
}
.valance::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: var(--red);
}
.valance::after {
  content: "";
  position: absolute;
  left: calc(var(--s) / 2);
  right: 0;
  top: 0;
  height: 14px;
  background:
    radial-gradient(circle at 50% 0, var(--brass) 0 6px, transparent 6.5px) 0 0 / var(--s) 14px repeat-x;
}

@media (min-width: 900px) {
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
    gap: 32px;
    align-items: end;
  }
  .lede { margin: 0; }
}

/* ---------- Layout ---------- */

.layout {
  max-width: calc(1120px + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(48px, 7vw, 72px) var(--gutter) 32px;
  display: grid;
  gap: 24px;
  align-items: start;
}

@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 32px; }
  .day { position: sticky; top: 24px; }
}

/* ---------- Calendar ---------- */

.calendar {
  background: var(--paper);
  border-radius: 20px;
  padding: clamp(16px, 3vw, 28px);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(36, 21, 82, 0.45);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.cal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  letter-spacing: -0.01em;
}

.cal-nav, .icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper);
  cursor: pointer;
}
.cal-nav svg, .icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--velvet);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cal-nav:hover:not(:disabled), .icon-btn:hover { border-color: var(--velvet); }
.cal-nav:disabled { opacity: 0.35; cursor: default; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-wd {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 6px;
}

.cal-day {
  position: relative;
  min-height: 56px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: none;
  padding: 6px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.cal-day .num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cal-day.is-empty { min-height: 36px; }
.cal-day.is-empty .num { color: #b2adc6; font-weight: 400; }
.cal-day.is-today .num { text-decoration: underline 2px var(--red); text-underline-offset: 4px; }

button.cal-day {
  cursor: pointer;
  background: var(--mist);
}
button.cal-day:hover { border-color: var(--velvet-soft); }
button.cal-day.is-selected {
  background: var(--velvet);
  color: #fff;
  border-color: var(--velvet);
}
button.cal-day.is-done { background: none; }
button.cal-day.is-done .num { color: var(--muted); }

.marks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.mark {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--velvet);
}
.mark.few { background: var(--brass); }
.mark.soldout, .mark.closed, .mark.past { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sold); }
.is-selected .mark.open { background: #fff; }
.is-selected .mark.soldout, .is-selected .mark.closed, .is-selected .mark.past { box-shadow: inset 0 0 0 1.5px #8f86b8; }

.mark-time { display: none; }

@media (min-width: 640px) {
  .cal-grid { gap: 6px; }
  .cal-day { min-height: 84px; align-items: stretch; padding: 8px 6px; }

  .cal-day .num { text-align: left; padding-left: 2px; }
  .marks { flex-direction: column; align-items: stretch; gap: 3px; }
  .mark {
    width: auto;
    height: auto;
    border-radius: 6px;
    padding: 1px 0;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fff;
    line-height: 1.5;
  }
  .mark.few { color: var(--ink); }
  .mark.soldout, .mark.closed, .mark.past { color: var(--muted); text-decoration: line-through; }
  .is-selected .mark.open { color: var(--velvet); }
  .is-selected .mark.soldout, .is-selected .mark.closed, .is-selected .mark.past { color: #c9c2e6; }
  .mark-time { display: inline; }
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 18px 0 0;
  padding: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .mark { width: 10px; height: 10px; padding: 0; border-radius: 50%; }

/* ---------- Day panel ---------- */

.day {
  background: var(--paper);
  border-radius: 20px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(36, 21, 82, 0.45);
  outline: none;
}

.day h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  letter-spacing: -0.01em;
}

.day-empty { margin: 0; color: var(--muted); }

.shows {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.show {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 20px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.show:first-child { border-top: 0; }

.show-time {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  grid-row: span 2;
}
.show.is-off .show-time { color: var(--sold); }

.seat-arc { display: block; width: 156px; height: 34px; }
.seat-arc .free { fill: var(--brass); stroke: var(--velvet); stroke-width: 1.5; }
.seat-arc .taken { fill: var(--mist); stroke: var(--sold); stroke-width: 1.5; }

.show-avail { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.show-avail strong { color: var(--ink); }

.show .btn { grid-column: 1 / -1; margin-top: 10px; }

@media (min-width: 600px) {
  .show { grid-template-columns: auto 1fr auto; }
  .show .btn { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
}
@media (min-width: 900px) {
  .show { grid-template-columns: auto 1fr; }
  .show .btn { grid-column: 1 / -1; grid-row: auto; margin-top: 10px; }
}

/* ---------- Buttons & form ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-deep); }
.btn-primary:disabled { background: var(--sold); cursor: progress; }
.btn-block { width: 100%; }

.sheet {
  width: min(480px, 100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(20, 10, 50, 0.6);
  overflow: auto;
}
.sheet::backdrop { background: rgba(28, 16, 66, 0.62); }

@media (max-width: 520px) {
  .sheet {
    width: 100vw;
    max-width: 100vw;
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    max-height: 94dvh;
  }
}

.sheet-body { padding: 22px clamp(18px, 4vw, 28px) 26px; }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sheet-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
}

.sheet-when {
  margin: 6px 0 18px;
  font-weight: 600;
  color: var(--velvet-soft);
}

form { display: grid; gap: 14px; }

.seats-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.seats-field legend, .field > span { font-weight: 600; font-size: 0.9375rem; margin-bottom: 6px; padding: 0; }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
}
.seg input:checked + span { background: var(--velvet); border-color: var(--velvet); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--brass); outline-offset: 2px; }
.seg input:disabled + span { color: var(--sold); background: var(--mist); border-color: var(--mist); text-decoration: line-through; }
.seg input:disabled { cursor: not-allowed; }

.field { display: grid; }
.field input {
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 1.0625rem;
}
.field input:focus { border-color: var(--velvet); outline: none; box-shadow: 0 0 0 3px rgba(239, 178, 51, 0.55); }
.field input[aria-invalid="true"] { border-color: var(--red); }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--velvet); flex: none; }

/* One block per place; place 1 also holds the contact details. */
.guests { display: grid; gap: 10px; }
.guest {
  border: 0;
  margin: 0;
  padding: 12px 14px 14px;
  min-width: 0;
  border-radius: 14px;
  background: var(--mist);
}
.guest legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
}
.guest legend span { font-family: var(--text); font-weight: 500; font-size: 0.85rem; color: var(--muted); margin-left: 6px; }
.guest legend + * { clear: both; }
.guest .field + .field { margin-top: 10px; }
.guest .hint { margin-top: 8px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.hint { margin: 6px 0 0; font-size: 0.875rem; color: var(--muted); }
.hint.center { text-align: center; margin: 0; }

.form-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fde9e8;
  color: var(--red-deep);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ---------- Ticket ---------- */

.ticket {
  --notch: 14px;
  display: grid;
  grid-template-rows: auto auto;
  background: var(--velvet);
  color: #fff;
  border-radius: 18px;
  margin: 4px 0 18px;
  overflow: hidden;
}

.ticket-main { padding: 22px 22px 20px; }
.ticket-title { margin: 0 0 10px; color: var(--brass); font-weight: 700; }
.ticket-when {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.ticket-seats { margin: 8px 0 0; color: #d9d3f2; }

.ticket-stub {
  position: relative;
  padding: 14px 22px 16px;
  border-top: 2px dashed rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--red);
}
.ticket-stub span { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Punched notches on both ends of the perforation, in the surface colour behind the ticket. */
.ticket-stub::before, .ticket-stub::after {
  content: "";
  position: absolute;
  top: calc(var(--notch) * -1 - 1px);
  width: calc(var(--notch) * 2);
  height: calc(var(--notch) * 2);
  border-radius: 50%;
  background: var(--paper);
}
.ticket-stub::before { left: calc(var(--notch) * -1); }
.ticket-stub::after { right: calc(var(--notch) * -1); }
.ticket-stub strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: 0.08em;
}

.done-note { margin: 0 0 18px; }

@media (prefers-reduced-motion: no-preference) {
  .ticket.is-printing { animation: print 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  @keyframes print {
    from { clip-path: inset(0 0 100% 0); transform: translateY(-16px); }
    to   { clip-path: inset(0 0 0 0); transform: none; }
  }
}

/* ---------- Footer ---------- */

.foot {
  max-width: calc(1120px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 8px var(--gutter) 48px;
  font-size: 0.875rem;
  color: var(--muted);
}
.foot p { margin: 0 0 6px; max-width: 70ch; }

/* ---------- Visitor booking page ---------- */

.hero-slim { padding-top: clamp(28px, 5vw, 48px); padding-bottom: clamp(44px, 6vw, 64px); }
.hero-slim h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); max-width: none; }
.layout.single { max-width: calc(560px + 2 * var(--gutter)); grid-template-columns: minmax(0, 1fr); }
.layout.single .day { position: static; }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: #e7f6ec; color: #17603a; font-weight: 600; }
.ticket.is-void { filter: grayscale(1); opacity: 0.6; }
.cancel-form { display: grid; gap: 14px; margin-top: 8px; }
.btn-outline { background: var(--paper); color: var(--red-deep); box-shadow: inset 0 0 0 1.5px var(--red); }
.btn-outline:hover { background: #fde9e8; }
.manage-list { list-style: none; padding: 0; margin: 0 0 16px; }
.manage-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.manage-list li:first-child { border-top: 0; }
.manage-list form { margin: 0; }
.muted { color: var(--muted); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
