/* Mise — back of house.
   Every reservation product looks front-of-house: cream, serif, warm. This is
   the kitchen instead. Steel, ticket rails, the pass. Mise en place is a line
   cook's term, and the tool behaves like one: standing ready, calling out the
   moment something lands. */

:root {
  /* Steel, cool graphite — deliberately not black, not warm. */
  --steel-950: #101419;
  --steel-900: #161c23;
  --steel-850: #1b222b;
  --steel-800: #222b35;
  --steel-700: #2f3a46;
  --steel-600: #445362;

  --ink: #e8edf2;
  --ink-2: #9fb0c0;
  --ink-3: #6d8092;

  /* Induction blue: modern ranges burn blue. Cold, electric, precise —
     and unclaimed in a category that defaults to warm. */
  --induction: #4da3ff;
  --induction-dim: #2b6fb8;

  /* Paper, used only on chits. Restraint: small areas, high impact. */
  --chit: #f4f1e8;
  --chit-ink: #1a1a18;

  --fire: #ff8f4d;
  --danger: #ff6b6b;
  --service: #8fd94a;

  --r: 6px;
  --display: "Instrument Serif", ui-serif, Georgia, serif;
  --ui: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --steel-950: #eef1f4; --steel-900: #f6f8fa; --steel-850: #ffffff;
    --steel-800: #e9edf1; --steel-700: #d5dde5; --steel-600: #a9b8c6;
    --ink: #131920; --ink-2: #4a5a69; --ink-3: #74858f;
    --induction: #1568c4; --induction-dim: #4da3ff;
    --chit: #fffdf7; --chit-ink: #1a1a18;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--steel-950);
  color: var(--ink);
  font: 400 15px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  /* Faint brushed-steel grain. Barely there; you notice it only if you look. */
  background-image:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,.014) 0 1px, transparent 1px 3px);
}

.wrap { max-width: 660px; margin: 0 auto; padding: 22px 16px 72px; }

/* --- header: the pass ------------------------------------------------- */
header.top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 14px; margin-bottom: 20px;
  border-bottom: 1px solid var(--steel-700);
}
header.top h1 {
  font: 400 26px/1 var(--display);
  margin: 0; letter-spacing: .01em;
}
header.top h1 .dot { color: var(--induction); }
/* The tagline earns its place on desktop and gets out of the way on a phone,
   where the countdown is the only thing that matters. */
.tagline {
  font: 400 12px/1.3 var(--display); color: var(--ink-3);
  margin-top: 2px; letter-spacing: .01em;
}
@media (max-width: 520px) { .tagline { display: none; } }
nav a {
  color: var(--ink-3); text-decoration: none; font-size: 13px;
  margin-left: 15px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 500; padding-bottom: 2px;
}
nav a:hover { color: var(--ink); }
nav a.on { color: var(--induction); border-bottom: 1px solid var(--induction); }

/* --- hero: the countdown ---------------------------------------------- */
.pass {
  background: linear-gradient(160deg, var(--steel-850), var(--steel-900));
  border: 1px solid var(--steel-700);
  border-radius: var(--r);
  padding: 22px 20px;
  margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.pass::after {
  /* the induction ring: a cold glow bleeding from the corner */
  content: ""; position: absolute; top: -70px; right: -70px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77,163,255,.14), transparent 68%);
  pointer-events: none;
}
.pass .eyebrow {
  font: 500 11px/1 var(--ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 12px;
}
.pass .venue { font: 400 22px/1.15 var(--display); margin-bottom: 3px; }
.pass .when { font-size: 13px; color: var(--ink-2); }
.countdown {
  font: 700 clamp(38px, 12vw, 62px)/1 var(--mono);
  letter-spacing: -.03em; margin: 10px 0 4px;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.countdown .unit {
  font-size: .34em; font-weight: 400; color: var(--ink-3);
  letter-spacing: .04em; margin: 0 .5ch 0 .08ch;
}
.countdown.imminent { color: var(--induction); }
.pass.idle .countdown { font-size: 26px; color: var(--ink-2); font-weight: 400; }

/* --- service light ----------------------------------------------------- */
.lamp {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2);
}
.lamp i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--service);
  box-shadow: 0 0 0 3px rgba(143,217,74,.16);
  animation: breathe 3.2s ease-in-out infinite;
}
.lamp.off i { background: var(--ink-3); box-shadow: none; animation: none; }
.lamp.err i { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,107,107,.18); }
@keyframes breathe { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
@media (prefers-reduced-motion: reduce) { .lamp i { animation: none } }

/* --- rows / venue tickets ---------------------------------------------- */
.card {
  background: var(--steel-900); border: 1px solid var(--steel-700);
  border-radius: var(--r); padding: 2px 18px; margin-bottom: 18px;
}
.card h2 {
  font: 500 12px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin: 18px 0 0;
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--steel-900); border: 1px solid var(--steel-700); border-radius: var(--r); padding: 12px 13px; }
.stat .label { font: 500 10px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.stat .value { font: 700 21px/1.1 var(--mono); margin-top: 7px; font-variant-numeric: tabular-nums; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 15px 0; border-top: 1px solid var(--steel-800); }
.row:first-child { border-top: none; }
.venue-name { font: 400 19px/1.2 var(--display); }
.row .meta { font: 400 12px/1.5 var(--mono); color: var(--ink-3); margin-top: 3px; }
.row .meta.err { color: var(--danger); font-family: var(--ui); }
.row a.venue-link { color: inherit; text-decoration: none; }
.row a.venue-link:hover .venue-name { color: var(--induction); }
.paused .venue-name, .paused .meta { color: var(--ink-3); opacity: .6; }
.actions { display: flex; gap: 7px; flex-shrink: 0; align-items: center; }

.pill {
  font: 500 10px/1 var(--ui); letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 3px; white-space: nowrap;
}
.pill.ok { background: rgba(143,217,74,.13); color: var(--service); }
.pill.err { background: rgba(255,107,107,.13); color: var(--danger); }
.pill.off { background: var(--steel-800); color: var(--ink-3); }
.pill.warn { background: rgba(255,143,77,.13); color: var(--fire); }

/* --- controls ---------------------------------------------------------- */
button, .btn {
  font: 500 13px/1.3 var(--ui); letter-spacing: .02em;
  padding: 9px 15px; border-radius: 4px;
  border: 1px solid var(--steel-600); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: border-color .12s, background .12s, color .12s;
}
button:hover, .btn:hover { border-color: var(--induction); color: var(--induction); }
button:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--induction); outline-offset: 2px;
}
button.primary { background: var(--induction); border-color: var(--induction); color: var(--steel-950); font-weight: 700; }
button.primary:hover { background: #6bb4ff; border-color: #6bb4ff; color: var(--steel-950); }
button.small, .btn.small { padding: 6px 11px; font-size: 12px; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.danger:hover { background: rgba(255,107,107,.1); color: var(--danger); border-color: var(--danger); }
button[disabled] { opacity: .35; cursor: default; }
button[disabled]:hover { border-color: var(--steel-600); color: var(--ink); }
form.inline { display: inline; }

label { display: block; font: 500 11px/1 var(--ui); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); margin: 18px 0 7px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--ui); padding: 10px 12px;
  border: 1px solid var(--steel-700); border-radius: 4px;
  background: var(--steel-950); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--induction); }
.hint { font: 400 12px/1.55 var(--ui); color: var(--ink-3); margin-top: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 8px 12px; border: 1px solid var(--steel-700); border-radius: 3px;
  font-size: 12px; letter-spacing: .06em; color: var(--ink-2); cursor: pointer;
  text-transform: uppercase; }
.checks label:hover { border-color: var(--induction); color: var(--induction); }
.checks input { margin: 0; width: auto; }

.banner { padding: 12px 15px; border-radius: 4px; font-size: 13px; margin-bottom: 18px;
  border-left: 3px solid; }
.banner.err { background: rgba(255,107,107,.09); border-color: var(--danger); color: var(--danger); }
.banner.ok { background: rgba(143,217,74,.09); border-color: var(--service); color: var(--service); }
.banner.warn { background: rgba(255,143,77,.09); border-color: var(--fire); color: var(--fire); }
.banner a { color: inherit; }

/* --- signature: the chit rail ------------------------------------------ */
.rail {
  position: relative; padding: 26px 0 6px;
  /* the rail itself — the steel bar chits hang from */
}
.rail::before {
  content: ""; position: absolute; top: 12px; left: 0; right: 0; height: 3px;
  background: linear-gradient(180deg, var(--steel-600), var(--steel-800));
  border-radius: 2px;
}
.chit {
  background: var(--chit); color: var(--chit-ink);
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  padding: 13px 14px 12px; margin: 0 0 13px; border-radius: 1px;
  position: relative; box-shadow: 0 3px 14px rgba(0,0,0,.34);
  /* torn top edge, like a chit pulled off the printer */
  clip-path: polygon(0 4px, 3% 0, 6% 4px, 9% 0, 12% 4px, 15% 0, 18% 4px, 21% 0,
    24% 4px, 27% 0, 30% 4px, 33% 0, 36% 4px, 39% 0, 42% 4px, 45% 0, 48% 4px,
    51% 0, 54% 4px, 57% 0, 60% 4px, 63% 0, 66% 4px, 69% 0, 72% 4px, 75% 0,
    78% 4px, 81% 0, 84% 4px, 87% 0, 90% 4px, 93% 0, 96% 4px, 100% 0,
    100% 100%, 0 100%);
}
.chit:nth-child(odd) { transform: rotate(-.35deg); }
.chit:nth-child(even) { transform: rotate(.28deg); }
.chit .chit-head {
  display: flex; justify-content: space-between; gap: 10px;
  border-bottom: 1px dashed rgba(0,0,0,.28); padding-bottom: 7px; margin-bottom: 8px;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .62;
}
.chit .chit-venue { font: 400 17px/1.2 var(--display); margin-bottom: 4px; }
.chit .chit-venue a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(0,0,0,.25); }
.chit .chit-line { display: flex; justify-content: space-between; gap: 12px; }
.chit .chit-time { font-weight: 700; }
.chit .chit-seat { opacity: .6; }

pre.raw { background: var(--steel-950); border: 1px solid var(--steel-700);
  border-radius: 4px; padding: 12px; overflow-x: auto; font: 400 11px/1.6 var(--mono);
  max-height: 460px; color: var(--ink-2); }
.empty { color: var(--ink-3); font-size: 13px; padding: 26px 0; text-align: center; }
.alert-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--steel-800); font-size: 13px; }
.alert-row:first-child { border-top: none; }
.alert-row .when { color: var(--ink-3); font: 400 11px/1.5 var(--mono); width: 66px; flex-shrink: 0; }
.alert-row a { color: var(--induction); text-decoration: none; }
