/* Ticket stub design system.
 *
 * The brief was that it must not look like the competition, which is generic
 * purple SaaS. So the whole interface is built around the physical object: card
 * stock, punched tear lines, stubs, and reference numbers in a typewriter face.
 *
 * The perforation is a real repeating radial-gradient of punched holes rather
 * than a dashed border. A dashed rule reads as a divider; punched holes read as
 * a ticket, and that difference is most of the effect.
 *
 * Hand-authored, no framework, no build step, matching every other site in this
 * account. */

:root {
  --paper: #f7f4ed;
  --paper-warm: #efe9dc;
  --card: #ffffff;
  --card-sunk: #faf7f1;

  --ink: #17181a;
  --ink-soft: #45484d;
  --ink-mute: #7a7e85;

  --signal: #c63a20;          /* stub vermilion */
  --signal-deep: #9a2a14;
  --signal-wash: #f7e7e2;

  --blue: #1d3557;
  --blue-wash: #e6ecf3;
  --green: #2c6e49;
  --green-wash: #e4efe8;
  --gold: #b5892e;

  --line: #ddd6c9;
  --shadow: 0 1px 0 rgba(23, 24, 26, .04), 0 8px 24px -18px rgba(23, 24, 26, .5);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;

  --r: 12px;
  --wrap: 60rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  /* Faint card-stock tooth. Two very cheap gradients, no image request. */
  background-image:
    radial-gradient(circle at 12% 8%, rgba(198, 58, 32, .045), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(29, 53, 87, .05), transparent 38%);
  background-attachment: fixed;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.wrap-wide { max-width: 74rem; }

h1, h2, h3 { line-height: 1.18; margin: 0 0 .5rem; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
a { color: var(--signal-deep); }

.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: var(--mono); letter-spacing: .04em; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; }
[hidden] { display: none !important; }   /* author rules otherwise beat it */

/* ------------------------------------------------------------- eyebrow -- */
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-mute);
}

/* --------------------------------------------------------------- header -- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 237, .88);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-head .wrap { display: flex; align-items: center; gap: 1rem; padding-block: .8rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 1.5rem; height: 1.1rem; border-radius: 3px;
  background: var(--signal); position: relative; flex: none;
}
/* The mark is itself a torn ticket. */
.brand-mark::after {
  content: ""; position: absolute; inset: 0 .38rem 0 auto; width: 2px;
  background-image: radial-gradient(circle at 1px 2px, var(--paper) 1.1px, transparent 1.3px);
  background-size: 2px 5px;
}
.site-nav { margin-left: auto; display: flex; gap: 1.1rem; font-size: .92rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--signal-deep); }

/* ---------------------------------------------------------------- ticket -- */
/* The core component. A body, a punched line, a stub. */
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 11.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ticket::before {                       /* the coloured spine */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--signal);
}
.ticket-body { padding: 1.35rem 1.5rem 1.35rem 1.75rem; min-width: 0; }
.ticket-stub {
  position: relative;
  padding: 1.35rem 1rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; text-align: center;
  background: var(--card-sunk);
}
/* The perforation. Punched holes, not a dashed rule. */
.ticket-stub::before {
  content: ""; position: absolute; inset: .55rem auto .55rem -1px; width: 2px;
  background-image: radial-gradient(circle at 1px 3px, var(--line) 1.6px, transparent 1.8px);
  background-size: 2px 8px;
}
/* The two half-circles bitten out of the edges at the tear line. */
.ticket-stub::after {
  content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--paper); box-shadow: 0 calc(100% + 14px) 0 var(--paper);
}
@media (max-width: 34rem) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-stub { border-top: 1px solid transparent; }
  .ticket-stub::before {
    inset: -1px .55rem auto .55rem; width: auto; height: 2px;
    background-image: radial-gradient(circle at 3px 1px, var(--line) 1.6px, transparent 1.8px);
    background-size: 8px 2px;
  }
  .ticket-stub::after {
    left: -7px; top: -7px; box-shadow: calc(100vw) 0 0 var(--paper);
  }
}

.ref {
  font-family: var(--mono); font-weight: 700; font-size: 1.3rem;
  color: var(--signal); letter-spacing: .06em;
}

/* ----------------------------------------------------------------- cards -- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.25rem; box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; }
.card-sunk { background: var(--card-sunk); }
.note {
  border-left: 4px solid var(--gold); background: #f7f0df;
  padding: .85rem 1rem; border-radius: 0 8px 8px 0; font-size: .92rem;
}
.note-bad { border-left-color: var(--signal); background: var(--signal-wash); }
.note-good { border-left-color: var(--green); background: var(--green-wash); }
.note-info { border-left-color: var(--blue); background: var(--blue-wash); }

/* --------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; line-height: 1;
  padding: .8rem 1.15rem; border-radius: 9px; border: 1px solid transparent;
  background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .06s ease, border-color .15s ease;
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-signal { background: var(--signal); }
.btn-signal:hover { background: var(--signal-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--card-sunk); }
.btn-block { width: 100%; }
.btn-lg { padding: .95rem 1.4rem; font-size: 1.05rem; }

/* ----------------------------------------------------------------- forms -- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select {
  width: 100%; font: inherit; padding: .7rem .8rem;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink);
}
input:focus-visible, select:focus-visible, .btn:focus-visible, .step:focus-visible {
  outline: 3px solid rgba(29, 53, 87, .35); outline-offset: 2px;
}
.field + .field { margin-top: .85rem; }

/* --------------------------------------------------------------- tiers -- */
.checkout-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr);
  align-items: start;
}

.tier {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center;
  padding: .95rem 0; border-bottom: 1px solid var(--line);
}
.tier:last-child { border-bottom: 0; }
.tier-name { font-weight: 650; }
.tier-price { font-family: var(--mono); color: var(--ink-soft); font-size: .92rem; }
.tier.sold-out { opacity: .5; }

.stepper { display: inline-flex; align-items: center; gap: .1rem; }
.step {
  width: 2.3rem; height: 2.3rem; border: 1px solid var(--line); background: var(--card);
  font: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.step:first-child { border-radius: 8px 0 0 8px; }
.step:last-child { border-radius: 0 8px 8px 0; }
.step:disabled { opacity: .35; cursor: not-allowed; }
.qty {
  width: 2.6rem; text-align: center; font-family: var(--mono); font-weight: 700;
  border-block: 1px solid var(--line); height: 2.3rem; line-height: 2.3rem;
}

@media (max-width: 46rem) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
}

.chip {
  display: inline-block; padding: .18rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.chip-good { background: var(--green-wash); color: var(--green); }
.chip-bad { background: var(--signal-wash); color: var(--signal-deep); }
.chip-info { background: var(--blue-wash); color: var(--blue); }

/* ----------------------------------------------------------------- misc -- */
.qr { background: #fff; padding: .6rem; border-radius: 8px; display: inline-block; }
.qr img { display: block; width: 100%; height: auto; max-width: 15rem; image-rendering: pixelated; }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-mute); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); }
.scroll-x { overflow-x: auto; }

.site-foot {
  margin-top: 3.5rem; border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem; font-size: .85rem; color: var(--ink-mute);
}

.spinner {
  width: 1rem; height: 1rem; border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Print one ticket, because somebody always will. */
@media print {
  .site-head, .site-foot, .no-print { display: none !important; }
  body { background: #fff; }
  .ticket { box-shadow: none; page-break-inside: avoid; }
}
