/* Lane. One pneumatic run, a sign rail over it, and a console at the delivery end. */

@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/fonts/martian-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --ink: #f3eadf;
  --ink-dim: #b89bb0;
  --ground: #0a0410;
  --ground-2: #140720;
  --accent: #e62a88;
  --accent-deep: #7a0e3f;
  --hair: rgba(230, 42, 136, 0.34);
  --hair-soft: rgba(230, 42, 136, 0.16);
  --fill: rgba(230, 42, 136, 0.06);
  --cyan: #9be8ff;
  --page: min(1440px, 100% - 96px);
  --display: clamp(44px, 7vw, 96px);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  image-rendering: pixelated;
  display: block;
}

/* the hall behind everything: blurred, and moving on its own clock */
.hall {
  position: fixed;
  inset: -8%;
  z-index: -2;
  background: url("/img/hall.webp") center / cover no-repeat;
  filter: blur(14px) saturate(0.85);
  opacity: 0.55;
  animation: drift 90s linear infinite alternate;
}
.hall::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, transparent 0%, var(--ground) 78%);
}
@keyframes drift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1.04);
  }
  to {
    transform: translate3d(2%, 1%, 0) scale(1.1);
  }
}

/* ---------------------------------------------------------------- the rail */
.fascia {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0 0;
}
.fascia-plate {
  width: var(--page);
  margin: 0 auto;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 32px;
  background:
    url("/img/rail-top.png") left top / auto 18px repeat-x,
    url("/img/rail-bottom.png") left bottom / auto 18px repeat-x,
    linear-gradient(180deg, #ef3b95 0%, #d41f76 55%, #a81159 100%);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.45), 0 0 0 2px #140208;
}
.fascia-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.fascia-mark .chip {
  width: 38px;
  height: auto;
}
.fascia-mark .wordmark {
  width: 132px;
  height: auto;
}
.stops {
  margin-left: auto;
  display: flex;
  gap: 28px;
}
.stops a {
  color: #26060f;
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 18px;
  border-bottom: 2px solid transparent;
}
.stops a:hover,
.stops a:focus-visible {
  border-bottom-color: #26060f;
}

/* ---------------------------------------------------------------- the keys */
.key {
  appearance: none;
  border: 0;
  background: transparent;
  color: #1b0209;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 62px;
  padding: 16px 30px 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* the slices are measured off the plate: the bright face is the part that stretches */
  /* slices measured off the plate; the widths squeeze the highlight and the wall so the bright
     face is what grows with the label */
  border-image: url("/img/key.png") 20 30 38 30 fill / 12px 26px 18px 26px / 0 stretch;
  transition: transform 0.08s ease;
}
.key:hover {
  filter: brightness(1.08);
}
.key:active {
  transform: translateY(2px);
}
.key:disabled,
.key[aria-disabled="true"] {
  filter: grayscale(0.75) brightness(0.65);
  cursor: not-allowed;
}
.key-small {
  min-height: 50px;
  font-size: 16px;
  padding: 12px 24px;
  white-space: nowrap;
}
.fascia .key-small {
  border-image: none;
  padding: 12px 24px;
  background: #16030c;
  color: var(--ink);
  border: 2px solid #3d0a21;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.12);
}
.fascia .key-small:hover {
  background: #240612;
}
.key-ghost {
  border-image: none;
  padding: 14px 32px;
  border: 2px solid var(--hair);
  color: var(--ink);
  background: var(--fill);
}
.key-link {
  font-size: 16px;
}

/* ---------------------------------------------------------------- the hero */
main {
  position: relative;
  z-index: 1;
}
.hero {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 132px) 0 clamp(40px, 6vw, 72px);
}
.eyebrow {
  margin: 0 0 24px;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.display {
  margin: 0;
  font-family: "Pixelify Sans", monospace;
  font-weight: 700;
  font-size: var(--display);
  line-height: 0.96;
  letter-spacing: 0.01em;
  text-transform: none;
  text-shadow: 0 6px 0 var(--accent-deep);
  max-width: 14ch;
}
.premise {
  margin: 32px 0 0;
  max-width: 70ch;
  font-size: 18px;
  color: var(--ink-dim);
}
.hero-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

/* ----------------------------------------------------------------- the run */
.run {
  /* full bleed: the pipe is one line from edge to edge, the text under it keeps the page column */
  width: 100%;
  padding-bottom: clamp(40px, 5vw, 72px);
}
.run-inner {
  width: var(--page);
  margin: 0 auto;
}
.run-track {
  position: relative;
  width: 100%;
  height: 86px;
  /* the ends are cut by the viewport, never by a gap */
  overflow: clip;
}
.run-tube {
  position: absolute;
  inset: 0;
  /* one seamless period of the run, tiled: collar to collar, so it continues past both edges */
  background: url("/img/tube-tile.png") left center / auto 100% repeat-x;
}
.run-capsule {
  position: absolute;
  top: 50%;
  left: 0;
  width: 108px;
  transform: translate(0, -50%);
  animation: travel 14s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  filter: drop-shadow(0 0 18px rgba(230, 42, 136, 0.75));
}
.run-capsule img {
  width: 100%;
  height: auto;
}
.run-capsule.parked {
  animation: none;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: grayscale(0.85) brightness(0.7);
}
@keyframes travel {
  0% {
    left: -12%;
  }
  100% {
    left: 100%;
  }
}
.run-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 0 0;
}
.run-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.run-name strong {
  font-family: "Pixelify Sans", monospace;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
}
.run-state {
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 2px solid var(--hair);
  background: var(--fill);
  padding: 12px 20px;
  white-space: nowrap;
}
.label {
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.dim {
  color: var(--ink-dim);
}
.mono {
  font-size: 16px;
  overflow-wrap: anywhere;
  min-width: 0;
}
.ticker {
  color: var(--accent);
}

/* the three facts of the live run, the reference's own flat cells */
.cells {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 40px;
  border: 1px solid var(--hair);
  background: var(--fill);
}
.cell {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--hair);
  min-width: 0;
}
.cell:last-child {
  border-right: 0;
}
.cell strong {
  font-family: "Pixelify Sans", monospace;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
}

/* ------------------------------------------------------------- the marquee */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 14px 0;
  margin: clamp(40px, 6vw, 80px) 0;
}
.marquee-row {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: slide 38s linear infinite;
}
.marquee-row span {
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  gap: 32px;
  white-space: nowrap;
}
.marquee-row img {
  width: 18px;
  height: auto;
}
@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ------------------------------------------------------------- the sections */
.section {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 0;
  /* the rail is sticky, so an anchor lands below it */
  scroll-margin-top: 152px;
}
.hero,
.run {
  scroll-margin-top: 152px;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.section-head h2 {
  margin: 0;
  font-family: "Pixelify Sans", monospace;
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
}
.section-head p {
  margin: 0;
  color: var(--ink-dim);
}

/* the loading rack */
.rack {
  margin-top: 44px;
  border: 1px solid var(--hair);
  background: var(--fill);
}
.rack-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 24px 36px;
  border-bottom: 1px solid var(--hair-soft);
  min-width: 0;
}
.rack-row:last-child {
  border-bottom: 0;
}
.rack-row img {
  width: 56px;
  height: auto;
}
.rack-row .place {
  font-family: "Pixelify Sans", monospace;
  font-size: 28px;
  color: var(--accent);
}
.rack-row .who {
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: 16px;
}
.rack-row .bid {
  font-family: "Pixelify Sans", monospace;
  font-size: 26px;
  white-space: nowrap;
}
.rack-row .flag {
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.empty {
  margin: 0;
  padding: 32px;
  color: var(--ink-dim);
}

/* booking and launching */
.booking {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}
.booking .key {
  align-self: center;
}
.booking-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
}
.field {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--hair);
  background: var(--ground-2);
  padding: 12px 20px;
  min-height: 56px;
}
.field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: "Martian Mono", monospace;
  font-size: 22px;
  outline: none;
}
.field-unit {
  color: var(--ink-dim);
}
.launch {
  margin-top: 48px;
  border: 1px solid var(--accent);
  background: rgba(230, 42, 136, 0.08);
  padding: 32px;
}
.launch-form {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px 24px;
  align-items: center;
  margin-top: 24px;
}
.launch-form input {
  min-height: 52px;
  padding: 10px 18px;
  background: var(--ground-2);
  border: 2px solid var(--hair);
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  min-width: 0;
}
.launch-form .key {
  grid-column: 2;
  justify-self: start;
}

/* the rules */
.rules {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--hair);
}
.rules li {
  display: flex;
  gap: 24px;
  padding: 36px 40px;
  border-right: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  min-width: 0;
}
.rules li:nth-child(2n) {
  border-right: 0;
}
.rules li:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.rules p {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}
.rule-no {
  font-family: "Pixelify Sans", monospace;
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}
.risk {
  margin: 32px 0 0;
  color: var(--ink-dim);
  max-width: 80ch;
}

/* the ledger */
.ledger {
  margin-top: 44px;
  border: 1px solid var(--hair);
  background: var(--fill);
}
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 28px 36px;
  border-bottom: 1px solid var(--hair-soft);
  align-items: center;
  min-width: 0;
}
.ledger-row:last-child {
  border-bottom: 0;
}
.ledger-row a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
  overflow-wrap: anywhere;
  font-size: 16px;
}
.ledger-row a:hover {
  color: var(--accent);
}
.ledger-row .val {
  font-family: "Pixelify Sans", monospace;
  font-size: 24px;
}
.ledger-row .exit {
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 28px;
  border: 1px solid var(--hair);
}
.totals div {
  padding: 32px 36px;
  border-right: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.totals div:last-child {
  border-right: 0;
}
.totals strong {
  font-family: "Pixelify Sans", monospace;
  font-size: 30px;
}

/* the console at the delivery end */
.console-section {
  padding-bottom: clamp(72px, 9vw, 140px);
}
.console {
  border-image: url("/img/console.png") 76 46 52 46 fill / 76px 46px 52px 46px / 0 stretch;
  padding: 0;
}
.console-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 104px 10px;
  min-height: 86px;
}
.console-strip .mono {
  color: #0d0a12;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 16px;
}
.lamps {
  display: flex;
  gap: 10px;
}
.lamps i {
  width: 14px;
  height: 14px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2.6s steps(2, end) infinite;
}
.lamps i:last-child {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation-delay: 1.3s;
}
@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.25;
  }
}
.console-body {
  padding: 30px 104px 74px;
}
.mint {
  margin: 14px 0 28px;
  font-size: 20px;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hair);
  padding: 20px 24px;
}
.console-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* the toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 24px);
  background: var(--ground-2);
  border: 2px solid var(--accent);
  color: var(--ink);
  padding: 16px 26px;
  font-size: 16px;
  max-width: min(560px, calc(100% - 48px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 40;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 980px) {
  :root {
    --page: calc(100% - 48px);
  }
  .section-head,
  .launch-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .launch-form .key {
    grid-column: 1;
  }
  .cells,
  .rules,
  .totals {
    grid-template-columns: minmax(0, 1fr);
  }
  .cell,
  .rules li,
  .totals div {
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }
  .cell:last-child,
  .rules li:last-child,
  .totals div:last-child {
    border-bottom: 0;
  }
  .ledger-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
  }
}

/* the rail carries the mark, the stops and the action only while all four fit on one line */
@media (max-width: 900px) {
  .stops {
    display: none;
  }
  .fascia .key-small {
    margin-left: auto;
    padding: 10px 18px;
  }
}

@media (max-width: 720px) {
  :root {
    --page: calc(100% - 32px);
  }
  body {
    font-size: 17px;
  }
  .fascia-plate {
    min-height: 76px;
    padding: 14px 16px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .fascia-mark .chip {
    width: 26px;
  }
  .fascia-mark .wordmark {
    width: 92px;
  }

  .stops a {
    font-size: 16px;
    padding: 12px 16px;
  }

  .run-track {
    height: 64px;
  }
  .run-capsule {
    width: 76px;
  }
  .run-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .rack-row {
    grid-template-columns: 48px minmax(0, 1fr);
    row-gap: 10px;
    padding: 18px 20px;
  }
  .rack-row img {
    width: 42px;
  }
  .console {
    border-image: none;
    border: 2px solid var(--hair);
    background:
      url("/img/rail-top.png") left top / auto 14px repeat-x,
      linear-gradient(180deg, rgba(42, 8, 28, 0.9), rgba(16, 4, 22, 0.95));
  }
  .console-strip {
    padding: 26px 24px 12px;
    min-height: 64px;
    border-bottom: 1px solid var(--hair);
  }
  .console-strip .mono {
    color: var(--ink-dim);
  }
  .console-body {
    padding: 28px 24px 36px;
  }
  .cell,
  .rules li,
  .totals div,
  .ledger-row,
  .rack-row {
    padding-left: 32px;
    padding-right: 32px;
  }
  .cell strong,
  .totals strong {
    font-size: 34px;
  }
  .rule-no {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hall,
  .run-capsule,
  .marquee-row,
  .lamps i {
    animation: none;
  }
  .run-capsule {
    left: 50%;
    transform: translate(-50%, -50%);
  }
  html {
    scroll-behavior: auto;
  }
}

/* ------------------------------------------------- the hero's machine panel */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.hero-text {
  min-width: 0;
}
.panel {
  border: 1px solid var(--hair);
  background: rgba(10, 4, 16, 0.72);
  margin-top: 56px;
  min-width: 0;
}
.panel-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--hair);
  background: var(--fill);
}
.panel-strip img {
  width: 34px;
  height: auto;
}
.panel-strip .mono {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.panel-state {
  margin-left: auto;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.panel-rows {
  margin: 0;
  padding: 0;
}
.panel-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--hair-soft);
  min-width: 0;
}
.panel-rows dt {
  flex: 0 0 auto;
}
.panel-rows dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-family: "Pixelify Sans", monospace;
  font-size: 26px;
  line-height: 1.2;
}
.panel-rows dd.mono {
  font-family: "Martian Mono", monospace;
  font-size: 16px;
}
.panel-note {
  margin: 0;
  padding: 20px 28px 24px;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel {
    margin-top: 8px;
  }
}

@media (max-width: 420px) {
  .panel-rows > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 22px 28px;
  }
  .panel-rows dd {
    text-align: left;
    font-size: 24px;
  }
  .panel-strip,
  .panel-note {
    padding-left: 24px;
    padding-right: 24px;
  }
}
