/* Decision Board — a split-flap departure board on a cobalt station wall. */
:root {
  --wall: #2440d0;
  --wall-deep: #1a31a6;
  --ink: #ffffff;
  --ink-soft: rgba(255, 255, 255, 0.8);
  --ink-faint: rgba(255, 255, 255, 0.22);
  --housing: #121317;
  --flap-top: #2b2c32;
  --flap-bot: #222328;
  --flap-ink: #f2ede1;
  --go: #16a865;
  --stop: #e8392c;
  --wait: #ffc21a;
  --signal: #ffc21a;
  --paper: #ffffff;
  --paper-ink: #12205a;
  --paper-muted: #5a6486;
  --cond: 'Fira Sans Extra Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --sans: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --pay-paper: #ffffff;
  --pay-ink: #12205a;
  --pay-muted: #5a6486;
  --pay-line: rgba(18, 32, 90, 0.14);
  --pay-accent: #2440d0;
  --pay-accent-ink: #ffffff;
  --pay-font: var(--sans);
  --pay-display: var(--cond);
  --pay-radius: 18px;
}

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

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--wall);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 88px 88px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: min(880px, 100% - 32px);
  margin-inline: auto;
}

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

/* ── top bar ── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(880px, 100% - 32px);
  margin: 0 auto;
  padding: 18px 0 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--cond);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
}
.brand > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-mark {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, 11px);
  gap: 2px;
}
.brand-mark i {
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(var(--flap-top) 0 49%, #000 49% 53%, var(--flap-bot) 53%);
}
.brand-mark i:nth-child(2) {
  background: linear-gradient(var(--go) 0 49%, #0b5a34 49% 53%, var(--go) 53%);
}
.top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-tools select {
  appearance: none;
  min-height: 40px;
  padding: 6px 30px 6px 12px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E")
    no-repeat right 11px center;
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  cursor: pointer;
}
.top-tools select option {
  color: #111;
}
.sound {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.sound svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sound svg path:first-child {
  fill: currentColor;
}
.sound .mute {
  display: none;
}
.sound[aria-pressed='false'] .wave {
  display: none;
}
.sound[aria-pressed='false'] .mute {
  display: block;
}

/* ── the board ── */
.stage {
  padding: 28px 0 10px;
}
.board {
  container-type: inline-size;
  display: grid;
  gap: 7px;
  padding: clamp(10px, 2.2vw, 18px);
  border-radius: 14px;
  background: var(--housing);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 26px 60px rgba(5, 12, 50, 0.45);
}
.row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.cell {
  --top: var(--flap-top);
  --bot: var(--flap-bot);
  --chr: var(--flap-ink);
  position: relative;
  aspect-ratio: 0.74;
  border-radius: 4px;
  perspective: 400px;
  color: var(--chr);
  font-family: var(--cond);
  font-weight: 700;
  font-size: calc((100cqi - 36px) / 10 * 0.86);
  line-height: 1;
  text-transform: uppercase;
}
.cell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 4;
}
.cell .h {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}
.cell .h > i {
  position: absolute;
  left: 0;
  right: 0;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}
.cell .t,
.cell .ft {
  top: 0;
  background: var(--top);
  border-radius: 4px 4px 0 0;
}
.cell .b,
.cell .fb {
  bottom: 0;
  background: var(--bot);
  border-radius: 0 0 4px 4px;
}
.cell .t > i,
.cell .ft > i {
  top: 0;
}
.cell .b > i,
.cell .fb > i {
  bottom: 0;
}
.cell .ft {
  z-index: 3;
  transform-origin: 50% 100%;
  visibility: hidden;
}
.cell .fb {
  z-index: 3;
  transform-origin: 50% 0;
  visibility: hidden;
}
.cell.go {
  --top: #1bbb72;
  --bot: var(--go);
  --chr: #ffffff;
}
.cell.stop {
  --top: #f2493c;
  --bot: var(--stop);
  --chr: #ffffff;
}
.cell.wait {
  --top: #ffcc3d;
  --bot: var(--wait);
  --chr: #1b1c20;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: var(--housing);
  color: var(--flap-ink);
  font-family: var(--cond);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
}
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--status, var(--go));
  box-shadow: 0 0 12px var(--status, var(--go));
}

/* ── the question form ── */
.ask {
  max-width: 660px;
  padding: 18px 0 8px;
}
.lead {
  margin: 0 0 26px;
  font-size: clamp(19px, 2.6vw, 22px);
  line-height: 1.45;
  color: var(--ink);
  max-width: 34em;
}
.field-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
}
.q {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--housing);
  color: var(--flap-ink);
  caret-color: var(--signal);
  font: 600 clamp(22px, 3.4vw, 28px) / 1.2 var(--cond);
  letter-spacing: 0.01em;
}
.q::placeholder {
  color: rgba(242, 237, 225, 0.38);
}
.q:focus {
  outline: none;
  border-color: var(--signal);
}
.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
}
.example-list {
  display: contents;
}
.example {
  padding: 0;
  border: 0;
  border-bottom: 1.5px dashed rgba(255, 255, 255, 0.45);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.example:hover {
  border-bottom-color: var(--signal);
}

.personas {
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}
.persona-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.persona {
  position: relative;
}
.persona input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.persona > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 16px 8px 12px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.persona b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
}
.persona b svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.persona:hover > span {
  border-color: var(--ink);
}
.persona input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--wall-deep);
}
.persona input:focus-visible + span {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.form-error {
  margin: 18px 0 0;
  color: var(--signal);
  font-weight: 600;
}
.guard {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--paper-ink);
}
.guard p {
  margin: 0;
}
.guard a {
  color: var(--wall);
  font-weight: 600;
}

.cta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 30px;
  min-height: 64px;
  padding: 14px 28px;
  border: 0;
  border-radius: 14px;
  background: var(--signal);
  color: #17181c;
  font: 800 25px/1.1 var(--cond);
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 0 #b98700, 0 14px 30px rgba(10, 15, 60, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cta:hover {
  filter: brightness(1.04);
}
.cta:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b98700, 0 8px 20px rgba(10, 15, 60, 0.3);
}
.cta-price {
  font: 500 16px/1.2 var(--sans);
  opacity: 0.78;
}

/* ── result: boarding pass ── */
.result {
  padding: 22px 0 0;
}
.shared-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 18px;
  padding: 14px 16px 14px 20px;
  border-radius: 14px;
  background: var(--wall-deep);
}
.shared-banner p {
  margin: 0;
  font-weight: 500;
}
.shared-invalid {
  font-size: 19px;
}

.pass {
  display: grid;
  grid-template-columns: 1fr 210px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 24px 60px rgba(5, 12, 50, 0.4);
  overflow: hidden;
}
.pass-main {
  padding: 26px 28px 20px;
}
.pass-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--paper-ink);
  font-family: var(--cond);
  font-weight: 700;
  font-size: 22px;
}
.pass-brand {
  color: var(--wall);
}
.pass-field {
  margin: 0 0 16px;
}
.pass .k {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--paper-muted);
}
.pass .v {
  margin: 2px 0 0;
  font-weight: 600;
}
.pass-q {
  font-family: var(--cond);
  font-size: 30px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  font-family: var(--cond);
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  background: var(--chip, var(--go));
}
.chip.wait {
  color: #1b1c20;
}
.pass-quote {
  margin: 4px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(36, 64, 208, 0.07);
}
.pass-quote p {
  margin: 4px 0 0;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 500;
}
.pass-stub {
  position: relative;
  padding: 26px 24px 20px;
  border-left: 2px dashed rgba(18, 32, 90, 0.28);
}
.pass-stub::before,
.pass-stub::after {
  content: '';
  position: absolute;
  left: -13px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wall);
}
.pass-stub::before {
  top: -12px;
}
.pass-stub::after {
  bottom: -12px;
}
.pass .v.big {
  font-family: var(--cond);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}
.barcode {
  height: 54px;
  margin-top: 10px;
}
.barcode svg {
  display: block;
  width: 100%;
  height: 100%;
}
.pass-fine {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 28px 16px;
  border-top: 1px solid rgba(18, 32, 90, 0.12);
  color: var(--paper-muted);
  font-size: 13px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 22px;
  border: 0;
  border-radius: 12px;
  font: 600 17px/1.1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.btn-light {
  background: var(--ink);
  color: var(--wall-deep);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink-faint);
}
.btn-ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* ── footer ── */
.foot {
  margin-top: 64px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--ink-faint);
  color: var(--ink-soft);
  font-size: 14px;
}
.foot p {
  margin: 0 0 10px;
}
.more {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.more a {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
    background-size: 64px 64px;
  }
  .brand {
    font-size: 19px;
  }
  .top-tools {
    flex: none;
  }
  .q {
    font-size: 21px;
  }
  .stage {
    padding-top: 18px;
  }
  .board {
    gap: 5px;
    border-radius: 10px;
  }
  .row {
    gap: 3px;
  }
  .cell {
    font-size: calc((100cqi - 27px) / 10 * 0.86);
    border-radius: 3px;
  }
  .cta {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .pass {
    grid-template-columns: 1fr;
  }
  .pass-main {
    padding: 22px 20px 16px;
  }
  .pass-brand {
    display: none;
  }
  .pass-stub {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 8px;
    padding: 18px 20px 16px;
    border-left: 0;
    border-top: 2px dashed rgba(18, 32, 90, 0.28);
  }
  .pass-stub::before,
  .pass-stub::after {
    top: -13px;
    left: auto;
  }
  .pass-stub::before {
    left: -12px;
  }
  .pass-stub::after {
    right: -12px;
    bottom: auto;
  }
  .pass-stub .pass-field {
    margin: 0;
  }
  .barcode {
    grid-column: 1 / -1;
    height: 42px;
    margin-top: 4px;
  }
  .pass-q {
    font-size: 26px;
  }
  .pass-fine {
    padding: 12px 20px 14px;
  }
  .actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta,
  .persona > span {
    transition: none;
  }
}
