/* PACK OUT preview page. The game's own palette: a loading bay at dusk, plywood truck, manila sheet. */

:root {
  --night: #1b2230;
  --night-2: #232c3d;
  --ply: #c9a878;
  --ply-dark: #a98a5c;
  --paper: #f3ecd9;
  --paper-edge: #dcd1b4;
  --ink: #26221c;
  --ink-soft: #62594b;
  --stop0: #e8a33a;
  --stop1: #37a79f;
  --stop2: #9d74d8;
  --bad: #d2463c;
  --good: #4c9a5a;
  --lamp: #ffd98a;
  --text: #e6e9f0;
  --text-soft: #aab3c5;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}
a {
  color: var(--lamp);
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 8px;
  top: 8px;
  background: var(--lamp);
  color: var(--ink);
  padding: 6px 10px;
  z-index: 10;
}

/* ---- hero ---------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(ellipse at 75% 0%, #3a4660 0%, var(--night) 60%),
    var(--night);
  padding: 18px 20px 40px;
  display: grid;
  gap: 18px;
}
.masthead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  font-size: 13px;
  color: var(--text-soft);
}
.masthead span:first-child {
  color: var(--lamp);
  font-weight: 700;
}
.pre {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin: 4px 0 10px;
}
h1 {
  font-size: clamp(30px, 6.4vw, 50px);
  line-height: 1.08;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  color: #fff;
  max-width: 17em;
}
.sub {
  margin: 0;
  color: var(--text);
  max-width: 34em;
}
.sub b {
  color: var(--lamp);
  font-weight: 600;
}
.demo-intro {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--text-soft);
}
.demo-intro b {
  color: var(--text);
  font-weight: 600;
}

/* ---- the demo -------------------------------------------------------------- */
#demo {
  background: var(--night-2);
  border: 1px solid #3a455c;
  border-radius: 8px;
  padding: 12px;
  position: relative;
  font-size: 15px;
  line-height: 1.35;
  outline: none;
}
.d-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}
.d-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-right: 2px;
}
.d-stop {
  background: var(--c);
  color: #14181f;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
}
.d-stop.now {
  box-shadow: 0 0 0 3px var(--lamp);
}
.d-stop.done {
  opacity: 0.4;
}
.d-arrow {
  color: var(--text-soft);
}

.d-body {
  display: grid;
  gap: 10px;
}
.d-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 4px;
  padding: 7px;
}
.d-row {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 6px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.035);
  border-left: 6px solid var(--c);
  border-radius: 3px;
  padding: 5px 7px;
  min-height: 44px;
}
.d-row .nm {
  font-weight: 700;
  font-size: 15px;
}
.d-row .spec {
  grid-column: 1 / -1;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.d-row em {
  grid-row: 1;
  grid-column: 2;
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bad);
  text-transform: uppercase;
}
.d-row.inhand {
  background: #fff6d6;
  outline: 2px solid var(--ink);
}
.d-row.placed {
  opacity: 0.42;
  text-decoration: line-through;
}
.d-row:focus-visible {
  outline: 3px solid var(--stop1);
}
.d-row:disabled {
  cursor: default;
}

.d-yard {
  position: relative;
}
.d-rig {
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  align-items: end;
}
.d-cab {
  height: 70%;
  min-height: 60px;
  background: #d7dce6;
  border-radius: 14px 0 0 6px;
  position: relative;
}
.d-cab i {
  position: absolute;
  left: 7px;
  top: 12px;
  width: 26px;
  height: 20px;
  border-radius: 4px;
  background: #5c7397;
}
.d-truck {
  position: relative;
  aspect-ratio: 6 / 2;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(100% / 6 - 1px),
      rgba(0, 0, 0, 0.18) calc(100% / 6 - 1px) calc(100% / 6)
    ),
    linear-gradient(var(--ply), var(--ply-dark));
  border: 5px solid #e9edf3;
  border-left: 0;
  border-right: 0;
  cursor: crosshair;
  touch-action: manipulation;
}
.d-door {
  align-self: stretch;
  background: #e9edf3;
  color: #5b6475;
  font-family: var(--mono);
  font-size: 9px;
  writing-mode: vertical-rl;
  display: grid;
  place-items: center;
  letter-spacing: 0.2em;
  border-radius: 0 4px 4px 0;
}
.d-col {
  position: absolute;
}
.d-col.hot {
  background: rgba(255, 217, 138, 0.22);
}
.d-item {
  all: unset;
  box-sizing: border-box;
  position: absolute;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  border-top: 5px solid var(--c);
  border-radius: 3px;
  padding: 3px 5px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: scale(0.96);
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.d-item .nm {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.1;
}
.d-item .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-soft);
}
.d-item .gauge {
  height: 4px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.d-item .gauge i {
  display: block;
  height: 100%;
  background: var(--good);
}
.d-item.over {
  background: #f6cfc9;
}
.d-item.over .meta {
  color: var(--bad);
  font-weight: 700;
}
.d-item.over .gauge i {
  background: var(--bad);
}
.d-item.gone {
  opacity: 0;
  transform: translateX(40px) scale(0.9);
}
.d-item:disabled {
  cursor: default;
}
.d-ghost {
  position: absolute;
  border: 2px dashed #fff;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.d-ghost.bad {
  border-color: var(--bad);
  background: rgba(210, 70, 60, 0.28);
  color: #fff;
}
.d-pave {
  min-height: 1.4em;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}
.d-pave b {
  background: var(--paper);
  color: var(--ink);
  border-left: 5px solid var(--c);
  padding: 1px 6px;
  margin-right: 4px;
  border-radius: 2px;
}
.d-toast {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92%;
  background: var(--paper);
  color: var(--ink);
  border-left: 5px solid var(--bad);
  padding: 6px 10px;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  margin: 0;
  font-size: 14px;
}
.d-toast[data-kind="hint"],
.d-toast[data-kind="info"] {
  border-left-color: var(--lamp);
}
.d-coach {
  margin: 10px 0;
  min-height: 2.7em;
  font-size: 15px;
}
.d-coach .who {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  background: var(--lamp);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 4px;
}
.d-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.d-tools button,
.btn-plain,
.d-skip {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 6px 8px;
  background: #34405a;
  color: var(--text);
  border: 1px solid #4a5874;
  border-radius: 6px;
  cursor: pointer;
}
.d-tools .d-go {
  background: var(--lamp);
  color: var(--ink);
  border-color: var(--lamp);
}
.d-tools button:disabled {
  opacity: 0.4;
  cursor: default;
}
.d-skip {
  display: none;
  margin-top: 6px;
  width: 100%;
}
#demo.driving .d-skip {
  display: block;
}
#demo.driving .d-tools {
  display: none;
}

.d-report {
  position: absolute;
  inset: 0;
  background: rgba(27, 34, 48, 0.94);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: auto;
}
.d-report[hidden] {
  display: none;
}
.d-report h3 {
  margin: 0 0 8px;
  font-family: var(--sans);
  letter-spacing: 0;
  font-size: 24px;
  color: #fff;
}
.d-stars {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--mono);
  font-size: 14px;
}
.d-stars .on {
  color: var(--lamp);
}
.d-stars .off {
  color: #ef8f86;
}
.d-lines p {
  margin: 4px 0;
}
.d-small {
  font-size: 13px;
  color: var(--text-soft);
}
.d-next {
  color: var(--text-soft);
  font-size: 14px;
}
.d-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.d-nojs {
  margin: 0;
}

/* ---- buttons --------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
  background: var(--lamp);
  color: var(--ink);
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  min-height: 48px;
}
.btn:hover {
  background: #ffe4a8;
}
.hero-cta {
  margin-top: 14px;
}
.fine {
  font-size: 14px;
  color: var(--text-soft);
  margin: 8px 0 0;
}
.phone-only {
  display: none;
}

/* ---- body copy ------------------------------------------------------------- */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: 8px 20px 30px;
}
section {
  padding: 26px 0 10px;
  border-top: 1px solid #2f3a50;
}
h2 {
  font-size: clamp(25px, 4.4vw, 32px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: #fff;
}
h3 {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--lamp);
  margin: 22px 0 4px;
}
p {
  margin: 0 0 14px;
}
b {
  font-weight: 600;
}
.aside {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-soft);
}
ul,
ol {
  padding-left: 1.2em;
}
li {
  margin: 0 0 10px;
}
.jobs b {
  color: #fff;
}
table.count {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 18px;
  font-size: 16px;
}
.count th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-align: left;
  font-weight: 400;
}
.count th,
.count td {
  padding: 8px 6px;
  border-bottom: 1px solid #2f3a50;
}
.count td:nth-child(n + 2),
.count th:nth-child(n + 2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.count tr:last-child td {
  color: var(--lamp);
  font-weight: 700;
}
figure {
  margin: 20px 0 8px;
}
figure img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #3a455c;
  display: block;
}
figcaption {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 6px;
}
.faq dt {
  font-weight: 700;
  color: #fff;
  margin-top: 12px;
}
.faq dd {
  margin: 2px 0 8px;
}
.close {
  text-align: left;
  padding-bottom: 20px;
}
.ps {
  margin-top: 26px;
  font-style: italic;
}
footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 10px 20px 40px;
  font-size: 14px;
  color: var(--text-soft);
  border-top: 1px solid #2f3a50;
}

/* ---- layout ---------------------------------------------------------------- */
@media (min-width: 640px) {
  .d-sheet { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
}

@media (min-width: 1120px) {
  .hero {
    grid-template-columns: minmax(360px, 1fr) minmax(600px, 1.35fr);
    grid-template-rows: auto 1fr;
    column-gap: 44px;
    padding: 22px 40px 50px;
  }
  .masthead {
    grid-column: 1 / -1;
  }
  .hero-copy {
    padding-top: 30px;
  }
}
@media (max-width: 860px), (pointer: coarse) {
  .desk-only {
    display: none;
  }
  .phone-only {
    display: inline-block;
  }
  span.phone-only {
    display: inline;
  }
}
@media (max-width: 480px) {
  body {
    font-size: 17px;
  }
  .hero {
    padding: 14px 12px 32px;
  }
  #demo {
    padding: 9px;
  }
  .d-sheet {
    grid-template-columns: 1fr 1fr;
  }
  .d-row {
    min-height: 40px;
    padding: 4px 6px;
  }
  .d-row .nm {
    font-size: 14px;
  }
  .d-rig {
    grid-template-columns: 30px 1fr 14px;
  }
  .d-cab i {
    left: 4px;
    width: 18px;
    height: 14px;
  }
  .d-item {
    padding: 2px 3px;
  }
  .d-item .nm {
    font-size: 11.5px;
  }
  .d-item .meta {
    font-size: 9px;
  }
  .d-tools button {
    font-size: 13px;
    padding: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .d-item {
    transition: none;
  }
}
