/* Pilot features page showcase sections (features/_pilot_showcase) and the
   cell-coverage map behind the connectivity section
   (pilot_network/_cell_coverage). */

.pilot-showcase {
  position: relative;
  padding: 4rem 0;
  border-top: 1px solid var(--raad-hairline);
}

/* Hero sections: the pitch centred on top, the demo as a large stage in a
   teal glow, the bullets in a row underneath. */
.pilot-showcase--hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 1rem;
  display: grid;
  justify-items: center;
  gap: clamp(2rem, 4vw, 3rem);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 48px);
}

.pilot-showcase-head {
  max-width: 44rem;
  text-align: center;
}

.pilot-showcase-head h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.pilot-showcase-head p {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
}

.pilot-showcase-stage {
  position: relative;
  width: min(100%, 1080px);
}

/* No published demo: drop the empty stage so the bullets sit under the copy. */
.pilot-showcase-stage:not(:has(*)) {
  display: none;
}

.pilot-showcase-stage::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 55%, rgba(47, 179, 159, 0.2), transparent 65%);
  pointer-events: none;
}

.pilot-showcase-stage .demo-browser {
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--raad-hairline-strong);
}

.pilot-showcase-bullets.pilot-showcase-bullets--row {
  margin: 0;
  width: min(100%, 1080px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 2rem;
}

.pilot-showcase-copy .eyebrow {
  display: block;
  font-family: var(--raad-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--raad-cyan);
  margin-bottom: 0.5rem;
}

.pilot-showcase-copy h2 {
  margin-bottom: 0.5rem;
}

.pilot-showcase-copy p {
  color: var(--raad-text-dim);
}

.pilot-showcase-bullets {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.pilot-showcase-bullets li {
  list-style: none;
  padding-left: 1.4rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--raad-text);
}

.pilot-showcase-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--raad-cyan);
}

.pilot-showcase-demo .alpha-clip video,
.pilot-showcase-demo .demo-browser {
  width: 100%;
}

@media (max-width: 860px) {
  .pilot-showcase-head { text-align: left; justify-self: stretch; }
  .pilot-showcase-bullets.pilot-showcase-bullets--row { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------------
   Controller pairing: copy beside a draggable 3D DJI RC Plus
   (controller_model_controller.js).
   ----------------------------------------------------------------------- */

.pilot-showcase--controller {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 1rem;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.pilot-showcase--controller h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.controller-model {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
}

.controller-model::before {
  content: "";
  position: absolute;
  inset: 5%;
  z-index: -1;
  background: radial-gradient(circle at 50% 55%, rgba(47, 179, 159, 0.22), transparent 65%);
  pointer-events: none;
}

.controller-model__canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  /* Vertical swipes still scroll the page; sideways drags turn the model. */
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.controller-model__canvas:active { cursor: grabbing; }
.controller-model[data-state="ready"] .controller-model__canvas { opacity: 1; }
.controller-model[data-state="fallback"] .controller-model__canvas { display: none; }

.controller-model__fallback {
  display: none;
  position: absolute;
  top: 50%;
  left: 5%;
  width: 90%;
  height: auto;
  transform: translateY(-50%);
  border-radius: 12px;
  box-shadow: 0 0 0 10px #111, 0 40px 120px rgba(0, 0, 0, 0.6);
}

.controller-model[data-state="fallback"] .controller-model__fallback { display: block; }

/* The stage holds everything the model shows; Enlarge lifts it into a fixed
   layer over the page (the section keeps its square box). */
.controller-model__stage {
  position: absolute;
  inset: 0;
}

.controller-model__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(8, 24, 21, 0.9), rgba(3, 7, 6, 0.96) 70%);
  backdrop-filter: blur(8px);
  transition: opacity 0.35s ease;
}

/* Body-framed (the pilots page): the body fills the square box beside the
   copy and the antennas rise into extra stage above it, over the section's
   top padding. */
.controller-model--body:not(.is-enlarged) .controller-model__stage { top: -22%; }

.controller-model.is-enlarged .controller-model__stage {
  position: fixed;
  z-index: 2000;
}

/* raad.css gives every section in main `position: relative; z-index: 1`, so each
   is its own stacking context and later ones (the connectivity map) paint over
   the fixed stage: lift its section above them while enlarged. */
.pilot-showcase--controller:has(.controller-model.is-enlarged) { z-index: 2000; }

.controller-model.is-enlarged .controller-model__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.controller-model.is-leaving .controller-model__backdrop { opacity: 0; }
.controller-model.is-enlarged .controller-model__canvas { cursor: default; touch-action: none; }
.controller-model.is-entering .controller-model__canvas,
.controller-model.is-leaving .controller-model__canvas { opacity: 0; transition-duration: 0.25s; }

/* Same capsule as the demo player's back / restart / next controls, just below
   the model (inside the enlarged layer, near the bottom of the screen). */
.controller-model__controls {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 100%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(6, 18, 16, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  line-height: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.controller-model[data-state="ready"] .controller-model__controls { opacity: 1; }
.controller-model:not([data-state="ready"]) .controller-model__controls { pointer-events: none; }
.controller-model.is-enlarged .controller-model__controls { top: auto; bottom: 1.5rem; }

/* Doubled class: pico.min.css styles every button (filled, bordered, shadowed). */
.controller-model__button.controller-model__button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 2rem;
  margin: 0;
  padding: 0 0.85rem 0 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--raad-text, #dfe7ec);
  box-shadow: none;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  width: auto;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.controller-model__button.controller-model__button:focus-visible {
  outline: 2px solid var(--raad-cyan, #2fb39f);
  outline-offset: 2px;
}

.controller-model__button.controller-model__button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.controller-model__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.controller-model__icon--close,
.controller-model.is-enlarged .controller-model__icon--enlarge { display: none; }
.controller-model.is-enlarged .controller-model__icon--close { display: block; }

/* No scrolling under the enlarged controller. */
html.controller-model-open { overflow: hidden; }

@media (max-width: 860px) {
  .pilot-showcase--controller { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------------
   Connectivity section: full-screen segmented map (RTK/NTRIP, cell,
   LAANC/airspace, weather) with a centre reticle readout.
   ----------------------------------------------------------------------- */

/* Full bleed out of main.container, like the coverage globe. `svh` (not
   `vh`) so mobile browser chrome doesn't push the section, and the bottom
   bits (legend/pill/attribution — all anchored to the frame's own bottom
   edge) taller than a short desktop window, past `min-height`. */
.pilot-showcase--connectivity-map {
  position: relative;
  height: 90svh;
  min-height: 600px;
  padding: 0;
  margin-inline: calc(50% - 50vw);
}

/* Overlaid on the map itself, centred at the top. `pointer-events: none` on
   the header lets drags/clicks reach the map through it; the text elements
   opt back in so they stay selectable. */
.pilot-showcase-head--connectivity {
  position: absolute;
  z-index: 6;
  inset: 0 0 auto;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3rem) 1.5rem clamp(2.5rem, 7vw, 4rem);
  text-align: center;
  pointer-events: none;
}

.pilot-showcase-head--connectivity .eyebrow,
.pilot-showcase-head--connectivity h2,
.pilot-showcase-head--connectivity p {
  pointer-events: auto;
}

.pilot-showcase-head--connectivity h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

/* The pill sits just below the overlaid header, not under it. */
.pilot-showcase--connectivity-map .connectivity-map-pill.connectivity-map-pill {
  top: clamp(11.25rem, calc(24vw + 1.25rem), 14.25rem) !important;
}

@media (max-width: 860px) {
  .pilot-showcase-head--connectivity {
    padding: 1.5rem 1rem 2.75rem;
  }

  .pilot-showcase--connectivity-map .connectivity-map-pill.connectivity-map-pill {
    top: clamp(13rem, 46vw, 15rem) !important;
  }
}

/* A short desktop window (e.g. a laptop lid half-open, devtools docked):
   `min-height: 640px` would otherwise push the frame — and the pill
   anchored to its bottom — below the fold. Shrink the floor with the
   viewport, independent of the 860px *width* breakpoint below. */
@media (max-height: 700px) {
  .pilot-showcase--connectivity-map {
    min-height: min(600px, 90svh);
  }
}

@media (max-height: 760px) {
  .connectivity-map-frame.connectivity-map-frame { --reticle-y: 66%; }
}

/* --reticle-y: where the reticle (and the map centre, via Mapbox padding set
   by the controller from the reticle's position) sits: below the middle, so
   the readout card above it is what's centred in the frame. Lower on short
   screens so the pill and card fit above it. */
.connectivity-map-frame {
  --reticle-y: calc(50% + 10.25rem);
  --edge-inset: clamp(1rem, 11%, 6rem);
  position: relative !important;
  height: 100%;
  overflow: hidden;
  background: #0b0e11;
  touch-action: pan-y;
}

/* Doubled class: mapbox-gl.css sets .mapboxgl-map { position: relative } on
   the container, which would collapse it to zero height. */
.connectivity-map.connectivity-map {
  position: absolute;
  inset: 0;
}

.connectivity-map-reticle {
  position: absolute;
  z-index: 2;
  top: var(--reticle-y);
  left: 50%;
  width: 1.1rem;
  height: 1.1rem;
  translate: -50% -50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.connectivity-map-reticle::before,
.connectivity-map-reticle::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
}

.connectivity-map-reticle::before { left: 50%; top: -0.4rem; bottom: -0.4rem; width: 1px; translate: -50% 0; }
.connectivity-map-reticle::after { top: 50%; left: -0.4rem; right: -0.4rem; height: 1px; translate: 0 -50%; }

/* Mirrors the dashboard's one map tooltip/hover-card style
   (_map_card.scss: map-card-bg/border/radius/shadow/text/muted/key),
   including its Mapbox-popup caret — replicated here as a CSS triangle
   since this card isn't a Mapbox popup, always pointing straight down at
   the reticle below it. */
/* RTK layer only: a subtle label under the reticle marking it as the
   site's own location (every base is read out relative to it). */
/* Above the reticle: the layer pill riding on the readout card, whose caret
   touches the reticle. Below it: "Your location" (RTK) and the legend. */
/* --card-x/--card-y: set from JS (px) while the hover readout follows the
   cursor; unset, the stack falls back to the centred reticle position. */
.connectivity-map-stack {
  position: absolute;
  z-index: 4;
  top: var(--card-y, var(--reticle-y));
  left: var(--card-x, 50%);
  translate: -50% calc(-100% - 1.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100% - 2rem);
  pointer-events: none;
}

/* Not enough room above the anchor point: flip below it, caret on top. */
.connectivity-map-stack--below {
  translate: -50% 1.6rem;
}

.connectivity-map-stack--below .connectivity-map-card::after {
  top: auto;
  bottom: 100%;
  border-top: none;
  border-bottom: 7px solid rgba(0, 0, 0, 0.8);
}

.connectivity-map-under {
  position: absolute;
  z-index: 3;
  top: var(--reticle-y);
  left: 50%;
  translate: -50% 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: calc(100% - 2rem);
  pointer-events: none;
}

.connectivity-map-location {
  margin: 0;
  padding: 0.1rem 0.5rem;
  font-family: var(--raad-font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--raad-text-dim);
  background: rgba(11, 14, 17, 0.6);
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* One width for every layer's card, so switching layers doesn't resize it. */
.connectivity-map-card {
  position: relative;
  width: 264px;
  max-width: calc(100vw - 2rem);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.connectivity-map-card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% 0;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgba(0, 0, 0, 0.8);
}

.connectivity-map-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px 6px;
}

.connectivity-map-card__body ~ .connectivity-map-card__header,
.connectivity-map-card__header:has(+ .connectivity-map-card__body) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.connectivity-map-card__title {
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.02em;
}

.connectivity-map-card__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.connectivity-map-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 10px;
}

.connectivity-map-card__rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.connectivity-map-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.connectivity-map-card__key {
  flex: none;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.connectivity-map-card__val {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.connectivity-map-card__footer {
  padding: 6px 12px 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* The carrier/LTE/5G coverage table (dashboard's connectivity-popup__table),
   typeset like the other cards' rows: keys muted, values bold, same size and
   row rhythm. Doubled classes: Pico gives every table a bottom margin and
   every cell a background, a bottom border and its own padding. */
.connectivity-map-card__table.connectivity-map-card__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.connectivity-map-card__table.connectivity-map-card__table th,
.connectivity-map-card__table.connectivity-map-card__table td {
  padding: 1.5px 0 1.5px 12px;
  border: 0;
  background: transparent;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.85);
}

.connectivity-map-card__table.connectivity-map-card__table thead th,
.connectivity-map-card__table.connectivity-map-card__table th[scope="row"] {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}

.connectivity-map-card__table.connectivity-map-card__table th[scope="row"],
.connectivity-map-card__table.connectivity-map-card__table thead th:first-child {
  width: 100%;
  padding-left: 0;
  text-align: left;
}

/* Every chip in a card (rows and table) is the same size. */
.connectivity-map-card__value::before,
.connectivity-map-card .connectivity-map-chip {
  width: 8px;
  height: 8px;
}

.connectivity-map-card__value::before {
  content: "";
  display: inline-block;
  margin-right: 0.35rem;
  border-radius: 2px;
  background: var(--chip);
}

.connectivity-map-card__none {
  color: rgba(255, 255, 255, 0.5);
}

.connectivity-map-chip {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  flex: none;
}

/* About an inch in from the bottom (less on short screens), in a faint
   capsule so the labels stay readable over coloured hexagons/radar. */
.connectivity-map-legend {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: var(--edge-inset);
  translate: -50% 0;
  max-width: calc(100% - 2rem);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(6, 18, 16, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1rem;
  font-size: 0.75rem;
  color: var(--raad-text-dim);
}

.connectivity-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.connectivity-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 2rem;
}

/* Reserve the overlaid header's space so the fallback list (shown without
   WebGL/Mapbox) doesn't center under it. */
.pilot-showcase--connectivity-map .connectivity-map-fallback {
  padding-top: clamp(10rem, 24vw, 13rem);
}

@media (max-width: 860px) {
  .pilot-showcase--connectivity-map .connectivity-map-fallback {
    padding-top: clamp(13rem, 46vw, 15rem);
  }
}

.connectivity-map-fallback-heading {
  text-align: center;
  color: var(--raad-text-dim);
  margin-bottom: 1rem;
}

.connectivity-map-fallback-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 32rem;
}

.connectivity-map-fallback-list li {
  display: grid;
  gap: 0.15rem;
}

.connectivity-map-fallback-list strong { color: var(--raad-text); }
.connectivity-map-fallback-list span { color: var(--raad-text-dim); font-size: 0.85rem; }

/* Same capsule as the demo player's / 3D controller's controls. Doubled
   class: Pico's `[role=group]` selector has the same specificity as a
   single class and would otherwise win (display/position/width) depending
   on stylesheet load order. */
/* About an inch in from the top (less on short screens). */
.connectivity-map-pill.connectivity-map-pill {
  position: absolute !important;
  z-index: 5;
  top: var(--edge-inset) !important;
  left: 50% !important;
  translate: -50% 0;
  width: auto !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(6, 18, 16, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

/* Doubled class: pico.min.css styles every button. */
.connectivity-map-segment.connectivity-map-segment {
  display: flex;
  align-items: center;
  height: 2.6rem;
  margin: 0;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--raad-text, #dfe7ec);
  box-shadow: none;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  width: auto;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.connectivity-map-segment.connectivity-map-segment:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.connectivity-map-segment.connectivity-map-segment[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); color: #fff; }
.connectivity-map-segment.connectivity-map-segment:disabled { opacity: 0.35; cursor: default; }
.connectivity-map-segment.connectivity-map-segment:focus-visible { outline: 2px solid var(--raad-cyan, #2fb39f); outline-offset: 2px; }

.connectivity-map-attribution {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  /* Right-aligned: Mapbox's logo (required) sits bottom-left. */
  padding: 0.6rem 1.5rem 0.6rem 8rem;
  text-align: right;
  font-size: 0.75rem;
  color: var(--raad-text-faint);
  background: linear-gradient(0deg, rgba(11, 14, 17, 0.85), transparent);
}

@media (max-width: 860px) {
  .pilot-showcase--connectivity-map {
    height: 80vh;
    min-height: 480px;
  }

  .connectivity-map-card { min-width: 0; }
  .connectivity-map-segment.connectivity-map-segment { height: 2.3rem; padding: 0 0.75rem; font-size: 0.85rem; }
}
