/* Eloquentix 25th Anniversary Concert — Ateneul Român.
   Two identities, deliberately held together:
   the poster's world (warm near-black, engraved cream Didone caps, brass) and
   the Eloquentix brand (Source Code Pro, near-zero decoration). The Didone
   names the music; the monospace carries every number — seat, row, price,
   count — where tabular figures and alignment do real work. */

:root {
  /* Sampled from the poster. */
  --ink:        #0B0B0A;   /* the hall with the lights down */
  --ink-raised: #131311;
  --ink-edge:   #201F1B;
  --cream:      #E9E2D2;   /* the poster's title */
  --cream-dim:  #A29A89;
  --brass:      #C3A671;   /* the poster's date line */
  --brass-dim:  #6E5E3D;
  --oxblood:    #7A4032;   /* Beethoven's cravat — used once, on the stage */

  /* Seat states. Available seats glow because they are the offer; the seat you
     picked is the brightest thing on the page; everything unavailable recedes
     rather than shouting. */
  --seat-free:     #8C7440;
  --seat-free-ink: #C3A671;
  --seat-mine:     #E9E2D2;
  --seat-gone:     #1D1C19;
  --seat-held:     #2E2B24;
  --seat-elsewhere:#171613;

  --ok:     #7FA46B;
  --danger: #C4614C;

  --display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;

  --rail: 22rem;
  --radius: 3px;

  /* Names kept for the pages that predate this system (success, ticket, scan). */
  --bg: var(--ink);
  --panel: var(--ink-raised);
  --line: var(--ink-edge);
  --muted: var(--cream-dim);
  --brand: var(--brass);
  --brand-ink: var(--cream);
  --selected: var(--ok);
  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  /* A single warm bloom behind the hall, as if the house lights are up. */
  background-image: radial-gradient(120% 80% at 50% 8%, #16150F 0%, var(--ink) 62%);
  background-attachment: fixed;
}

::selection { background: var(--brass); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.stage-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "rail hall" "cart hall" "foot hall";
  min-height: 100vh;
}
.rail { grid-area: rail; }
.hall { grid-area: hall; }
.cart { grid-area: cart; }
.colophon { grid-area: foot; align-self: end; padding: 22px 26px 26px; }

.rail {
  padding: 28px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.hall {
  border-left: 1px solid var(--ink-edge);
  padding: 28px 30px 40px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── masthead ───────────────────────────────────────────────────────────── */
.mark {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.mark .wordmark { color: var(--cream); }
.mark .years { color: var(--brass); white-space: nowrap; }

/* The composers are the poster's headline, so they are the page's headline. */
.programme {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: .98;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--cream);
}
.programme span { display: block; }
.programme span + span { margin-top: .06em; }

/* The fleuron is lifted straight off the poster — the one ornament on the page. */
.fleuron {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--brass-dim);
  margin: 10px 0 0;
}
.fleuron::before, .fleuron::after {
  content: ""; height: 1px; background: currentColor;
}
.fleuron span { font-size: 17px; color: var(--brass); line-height: 1; }

.billing { margin: 0; display: grid; gap: 3px; }
.billing dt {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cream-dim);
}
.billing dd { margin: 0 0 10px; font-size: 13px; color: var(--cream); }
.billing dd.accent { color: var(--brass); }
.billing dd:last-child { margin-bottom: 0; }

.occasion {
  font-size: 11px; letter-spacing: .1em; color: var(--cream-dim);
  margin: 0; text-transform: uppercase;
}

/* ── the hall ───────────────────────────────────────────────────────────── */
.hall-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.tally { font-size: 12px; color: var(--cream-dim); margin: 0; }
.tally b { color: var(--brass); font-weight: 500; }
.hall-hint { font-size: 11px; color: var(--cream-dim); margin: 0; }

.map-frame { flex: 1; min-height: 0; }
#seatmap {
  display: block; width: 100%; height: auto;
  touch-action: none; user-select: none;
}

.seat { cursor: pointer; }
.seat rect {
  fill: var(--seat-free); stroke: none;
  transition: fill .12s ease;
}
.seat .seat-label {
  font-family: var(--mono); font-size: 6.5px; fill: #0B0B0A;
  pointer-events: none; text-anchor: middle; dominant-baseline: central;
  opacity: 0; transition: opacity .18s ease;
}
/* Numbers appear only once you are zoomed in far enough to read them. */
#seatmap.show-numbers .seat .seat-label { opacity: .8; }
.seat.available:hover rect { fill: var(--seat-free-ink); }
.seat.selected rect { fill: var(--seat-mine); }
.seat.selected .seat-label { fill: #0B0B0A; }
.seat.held rect { fill: var(--seat-held); cursor: not-allowed; }
.seat.sold rect { fill: var(--seat-gone); cursor: not-allowed; }
.seat.unavailable rect { fill: var(--seat-elsewhere); cursor: not-allowed; }
#seatmap.show-numbers .seat.held .seat-label,
#seatmap.show-numbers .seat.sold .seat-label,
#seatmap.show-numbers .seat.unavailable .seat-label { fill: var(--cream); opacity: .22; }

/* The loge boxes: hairlines only, so the ring reads as architecture and the
   seats inside it stay the brightest thing. */
.loge-boxes polygon {
  fill: none; stroke: var(--brass-dim); stroke-width: 1.1; stroke-opacity: .5;
}

/* The stage is the only oxblood on the page: the warm source the hall faces. */
.stage-mark rect { fill: none; stroke: var(--oxblood); stroke-width: 1.5; }
.stage-mark text {
  font-family: var(--display); font-size: 20px; letter-spacing: .34em;
  text-anchor: middle; dominant-baseline: central; fill: var(--oxblood);
}
.section-label {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em;
  text-transform: uppercase; text-anchor: middle;
  fill: var(--cream-dim); opacity: .55; pointer-events: none;
}

/* Page-load reveal: the hall fills outward from the stage. */
.seat { animation: seat-in .5s ease-out both; }
@keyframes seat-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .seat { animation: none; }
}

.legend {
  display: flex; gap: 18px; flex-wrap: wrap; list-style: none;
  padding: 16px 0 0; margin: 0; font-size: 11px; color: var(--cream-dim);
  letter-spacing: .04em;
}
.legend li { display: flex; align-items: center; gap: 7px; }
.swatch { width: 11px; height: 9px; border-radius: 1px; display: inline-block; }
.swatch.s-available   { background: var(--seat-free); }
.swatch.s-selected    { background: var(--seat-mine); }
.swatch.s-held        { background: var(--seat-held); }
.swatch.s-sold        { background: var(--seat-gone); }
.swatch.s-unavailable { background: var(--seat-elsewhere); }

/* ── cart ───────────────────────────────────────────────────────────────── */
.cart {
  display: flex; flex-direction: column; gap: 14px;
  padding: 0 26px 26px;
}
.cart h2 {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--cream-dim);
  margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--ink-edge);
}
.selection-list { list-style: none; margin: 0; padding: 0; }
.selection-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--ink-edge); font-size: 12.5px;
}
.selection-list .seat-remove {
  background: none; border: 0; color: var(--cream-dim); cursor: pointer;
  font-family: var(--mono); font-size: 12px; padding: 0 0 0 8px;
}
.selection-list .seat-remove:hover { color: var(--danger); }

.hint { font-size: 12px; color: var(--cream-dim); margin: 0; }

.totals { margin: 4px 0 0; font-size: 12.5px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .row.discount { color: var(--ok); }
.totals .row.total {
  border-top: 1px solid var(--ink-edge); margin-top: 8px; padding-top: 10px;
  font-size: 15px; color: var(--brass);
}

.btn {
  display: block; width: 100%; padding: 12px 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.btn.primary { background: var(--brass); color: #14120C; }
.btn.primary:hover:not(:disabled) { background: var(--cream); }
.btn.primary:disabled {
  background: transparent; color: #4B463B; border-color: var(--ink-edge);
  cursor: not-allowed; letter-spacing: .14em;
}
.btn.ghost {
  background: transparent; color: var(--cream); border-color: var(--ink-edge);
  width: auto; padding: 9px 13px; letter-spacing: .1em;
}
.btn.ghost:hover { border-color: var(--brass); color: var(--brass); }
.btn.quiet {
  background: none; border: 0; color: var(--cream-dim); width: auto;
  padding: 6px 0; letter-spacing: .1em; text-transform: none;
}
.btn.quiet:hover { color: var(--cream); }

.field { display: block; margin: 0 0 12px; }
.field span {
  display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cream-dim); margin-bottom: 5px;
}
.field input {
  width: 100%; padding: 10px 11px; background: #0E0D0B; color: var(--cream);
  border: 1px solid var(--ink-edge); border-radius: var(--radius);
  font-family: var(--mono); font-size: 13px;
}
.field input::placeholder { color: #4B463B; }
.field input:focus { outline: none; border-color: var(--brass); }

.code-row { display: flex; gap: 8px; align-items: flex-end; }
.code-row .grow { flex: 1; min-width: 0; }
.code-msg { font-size: 11px; margin: 4px 0 0; min-height: 1.2em; color: var(--cream-dim); }
.code-msg.ok { color: var(--ok); }
.code-msg.bad { color: var(--danger); }

.held-for {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cream-dim); margin: 0;
}
.held-for b { color: var(--brass); font-weight: 500; }

.notice {
  font-size: 11.5px; line-height: 1.5; padding: 9px 11px;
  border: 1px solid var(--brass-dim); border-left-width: 2px;
  border-radius: var(--radius); color: var(--brass); margin: 0;
}
.error {
  font-size: 12px; padding: 10px 12px; margin: 0;
  border: 1px solid #4A2620; border-left-width: 2px;
  border-radius: var(--radius); color: var(--danger);
}

.colophon {
  margin: 0; font-size: 10px; line-height: 1.7;
  letter-spacing: .06em; color: #55503F;
}
.colophon a { color: #6E6753; }
.colophon a:hover { color: var(--brass); }

/* ── narrow ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stage-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "rail" "hall" "cart" "foot";
  }
  .hall { border-left: 0; }
  .rail { border-bottom: 1px solid var(--ink-edge); }
  .rail { padding: 20px 20px 16px; gap: 14px; }
  .hall { padding: 4px 20px 24px; }
  .cart { padding: 0 20px 36px; }
  .programme { font-size: clamp(2.1rem, 11vw, 3rem); }

  /* The poster compresses to a header so the hall is reachable in one thumb. */
  .billing {
    grid-template-columns: max-content 1fr;
    column-gap: 14px; row-gap: 2px; align-items: baseline;
  }
  .billing dt { grid-column: 1; }
  .billing dd { grid-column: 2; margin: 0; }
  .fleuron { margin-top: 6px; }
  .colophon { padding: 0 20px 34px; }
  /* The hint matters most here — the hall is 778 seats on a phone. */
  .hall-head { margin-bottom: 8px; }
  .legend { padding-top: 10px; gap: 12px 16px; }
}
