/* Deeploy Tech: the first viewport. Hero grid, entry selector, livery panel
   and the live telemetry readout. Tokens live in base.css. */

/* ---------- Hero grid ---------- */

.grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-areas:
    "pitch livery"
    "hud hud";
  column-gap: clamp(24px, 4vw, 64px);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gutter) 0;
}

/* One streak crosses the grid on arrival: the page's single authored moment. */
.grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(22px, 3.2vw, 44px);
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow) 30%, var(--yellow) 70%, transparent);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
  animation: streak 1100ms var(--ease-out) 120ms both;
}

.pitch {
  grid-area: pitch;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 40px;
  container-type: inline-size;
}

/* Sized to the column: the longest line, slashes included, is 9.7em wide. */
.pitch .display {
  font-size: min(6rem, 10.1cqi);
}
.pitch .display > span { display: block; }
.pitch .display .hl { color: var(--yellow); }
.pitch .display .hl::after {
  content: "";
  display: inline-block;
  width: 1.18em;
  height: 0.5em;
  margin-left: 0.16em;
  background: var(--slashes-orange) left center / contain no-repeat;
  vertical-align: 0.06em;
}

.pitch__intro {
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

.pitch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  padding-left: 8px;
}

/* Entry selector: picking an entry paints the telemetry in its livery. */
.selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.selector__entry {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: baseline;
  padding: 14px 18px 14px 16px;
  border: 1px solid var(--track);
  background: var(--pit);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 220ms ease-out, border-color 220ms ease-out, color 220ms ease-out;
}
.selector__no {
  grid-row: span 2;
  align-self: center;
  font-style: italic;
  font-weight: 900;
  font-stretch: 125%;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--sel, var(--yellow));
}
.selector__name {
  font-style: italic;
  font-weight: 900;
  font-stretch: 118%;
  font-size: 1.0625rem;
  line-height: 1.15;
  text-transform: uppercase;
}
.selector__what {
  font-style: italic;
  font-weight: 700;
  font-stretch: 112%;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.selector__entry[data-select="orange"] { --sel: var(--orange); }
.selector__entry:focus-visible {
  background: var(--sel, var(--yellow));
  border-color: var(--sel, var(--yellow));
  color: var(--graphite);
  outline-color: var(--decal);
}
.selector__entry:focus-visible .selector__no,
.selector__entry:focus-visible .selector__what { color: var(--graphite); }
@media (hover: hover) {
  .selector__entry:hover {
    background: var(--sel, var(--yellow));
    border-color: var(--sel, var(--yellow));
    color: var(--graphite);
  }
  .selector__entry:hover .selector__no,
  .selector__entry:hover .selector__what { color: var(--graphite); }
}

/* ---------- Livery panel ---------- */

.livery {
  grid-area: livery;
  position: relative;
  min-height: 560px;
  margin-right: calc(var(--gutter) * -1);
}

.livery__field {
  position: absolute;
  inset: 0 0 64px 0;
  background: var(--yellow);
  color: var(--graphite);
  clip-path: polygon(17% 0, 100% 0, 100% 100%, 0 100%);
  overflow: hidden;
  animation: snap 900ms var(--ease-out) both;
}

/* Halftone decal fill, fading out across the field. */
.livery__field::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgb(14 17 20 / 0.5) 1.1px, transparent 1.5px);
  background-size: 7px 7px;
  -webkit-mask-image: linear-gradient(200deg, #000 0%, transparent 46%);
  mask-image: linear-gradient(200deg, #000 0%, transparent 46%);
}

.livery__hull {
  position: absolute;
  right: 7%;
  bottom: 15%;
  width: 46%;
  height: auto;
}
.livery__hull text {
  font-family: var(--font);
  font-style: italic;
  font-weight: 900;
  font-stretch: 125%;
  fill: var(--graphite);
}

.livery__stripes {
  position: absolute;
  right: 7%;
  bottom: 8%;
  width: 40%;
  height: 26px;
  background:
    var(--slashes-orange) right center / auto 100% no-repeat,
    linear-gradient(var(--orange), var(--orange)) left center / calc(100% - 66px) 7px no-repeat;
}

.livery__decal {
  position: absolute;
  top: 9%;
  right: 7%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--graphite);
  font-style: italic;
  font-weight: 900;
  font-stretch: 118%;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.livery__decal img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  box-shadow: 0 0 0 3px var(--graphite);
}

.livery__plate {
  position: absolute;
  top: calc(9% + 68px);
  right: 7%;
  padding: 3px 10px 3px 12px;
  background: var(--graphite);
  color: var(--yellow);
  font-style: italic;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cockpit {
  position: absolute;
  left: 5%;
  top: 34px;
  width: clamp(200px, 17vw, 248px);
  aspect-ratio: 660 / 1434;
  padding: 7px;
  border-radius: 38px;
  background: var(--graphite);
  box-shadow:
    0 0 0 2px var(--yellow),
    -16px 26px 48px rgb(0 0 0 / 0.55),
    -4px 8px 14px rgb(0 0 0 / 0.4);
  transform: rotate(4deg);
  animation: dock 1000ms var(--ease-out) 160ms both;
}
.cockpit img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 31px;
}

/* ---------- Telemetry ---------- */

.hud {
  grid-area: hud;
  --hud-bg: var(--pit);
  --hud-ink: var(--ink);
  --hud-soft: var(--ink-quiet);
  --hud-line: var(--track);
  --hud-cell: var(--pit-raised);
  --hud-score: var(--yellow);
  --hud-title: var(--yellow);
  position: relative;
  z-index: 1;
  margin-top: -28px;
  padding: 22px clamp(16px, 2.4vw, 32px) 20px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-line);
  color: var(--hud-ink);
  transition: background-color 280ms var(--ease-out), color 280ms var(--ease-out), border-color 280ms var(--ease-out);
}

/* The memorable moment: selecting an entry floods the readout in its livery.
   Keyboard focus always counts; hover only where a real pointer hovers, since
   touch browsers keep :hover after a tap and would leave the readout flooded
   after the jump to the entry. */
body:has(.selector__entry:focus-visible) .hud {
  --hud-bg: var(--yellow);
  --hud-ink: var(--graphite);
  --hud-soft: #2a2f20;
  --hud-line: rgb(14 17 20 / 0.24);
  --hud-cell: rgb(14 17 20 / 0.07);
  --hud-score: var(--graphite);
  --hud-title: var(--graphite);
}
body:has(.selector__entry[data-select="orange"]:focus-visible) .hud {
  --hud-bg: var(--orange);
  --hud-soft: #2b1206;
}
@media (hover: hover) {
  body:has(.selector__entry:hover) .hud {
    --hud-bg: var(--yellow);
    --hud-ink: var(--graphite);
    --hud-soft: #2a2f20;
    --hud-line: rgb(14 17 20 / 0.24);
    --hud-cell: rgb(14 17 20 / 0.07);
    --hud-score: var(--graphite);
    --hud-title: var(--graphite);
  }
  body:has(.selector__entry[data-select="orange"]:hover) .hud {
    --hud-bg: var(--orange);
    --hud-soft: #2b1206;
  }
}

.hud__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-bottom: 14px;
}
.hud__head .label { color: var(--hud-title); font-size: 0.9375rem; }
.hud__via {
  font-size: 0.875rem;
  color: var(--hud-soft);
}

.readout {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.readout th,
.readout td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-top: 1px solid var(--hud-line);
}
.readout thead th {
  padding-top: 0;
  padding-bottom: 10px;
  border-top: 0;
  color: var(--hud-soft);
  font-style: italic;
  font-weight: 700;
  font-stretch: 112%;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.readout .unit { letter-spacing: 0.04em; text-transform: none; }

.readout tbody th {
  padding-left: 0;
  color: var(--hud-ink);
  font-style: italic;
  font-weight: 900;
  font-stretch: 118%;
  font-size: 1.0625rem;
  text-transform: uppercase;
  white-space: nowrap;
}
.readout thead th:first-child { padding-left: 0; }

.readout [data-k="wind"],
.readout [data-k="gust"],
.readout [data-k="score"] {
  width: 1%;
  min-width: 96px;
  font-style: italic;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 1.75rem;
  line-height: 1;
  white-space: nowrap;
  /* A 3px gap of panel colour keeps adjacent cells apart. */
  background: linear-gradient(to right, transparent 3px, var(--hud-cell) 3px);
}
.readout [data-k="score"] { color: var(--hud-score); }
.readout .of {
  margin-left: 2px;
  font-size: 0.8125rem;
  font-weight: 700;
  font-stretch: 100%;
  color: var(--hud-soft);
}

.readout [data-k="verdict"] { font-weight: 600; }
.verdict__line { white-space: nowrap; }
/* What drives the verdict, in the API's own words. */
.verdict__reason {
  display: block;
  max-width: 36ch;
  margin-top: 4px;
  color: var(--hud-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
}
.readout [data-k="source"],
.readout [data-k="age"] {
  color: var(--hud-soft);
  font-size: 0.9375rem;
}
.readout [data-k="age"] { white-space: nowrap; }

/* Severity is a count of filled bars, so it reads without colour. */
.mark {
  display: inline-flex;
  gap: 3px;
  margin-right: 10px;
  vertical-align: -1px;
}
.mark i {
  width: 6px;
  height: 15px;
  border: 1.5px solid currentColor;
  transform: skewX(var(--slant));
  opacity: 0.55;
}
.mark i.on { background: currentColor; opacity: 1; }
.verdict--good { color: var(--hud-ink); }
.verdict--caution { color: var(--hud-score); }
.verdict--bad { color: var(--orange); }
body:has(.selector__entry:focus-visible) .verdict--bad { color: var(--hud-ink); }
@media (hover: hover) {
  body:has(.selector__entry:hover) .verdict--bad { color: var(--hud-ink); }
}
.verdict--none { color: var(--hud-soft); }

.readout tr.is-fresh [data-k="wind"],
.readout tr.is-fresh [data-k="gust"],
.readout tr.is-fresh [data-k="score"] {
  animation: settle 700ms var(--ease-out) both;
}

.hud__foot {
  max-width: 62ch;
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--hud-soft);
}
.hud__foot a { color: inherit; }
