/* ============ Farm to door: Capital's trucks on a 3D map ============ */

/* On its own (no JS, reduced motion, no WebGL) this is a finished, unpinned
   section: both headlines, a still map of the routes and every area lit.
   journey.js adds `.is-live` to pin it and play the 3D map with the scroll,
   and `.has-map` once the map has loaded. */
.journey {
  --journey-bg: #0b1611; /* the map's own ink, so the canvas meets the page */
  --journey-muted: #b9c2ad;
  position: relative;
  background: var(--journey-bg);
  color: var(--cream);
}
.journey__pin {
  display: grid;
  gap: clamp(2.5rem, 2rem + 2vw, 4rem);
  padding-block: var(--section);
}
.journey__pin > :is(.journey__head, .journey__body) {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  min-width: 0;
}
.journey__canvas,
.journey__shade,
.journey__labels { display: none; }

.journey__head { display: grid; justify-items: start; gap: 1rem; }
.journey__titles { display: grid; gap: 0.75rem; }
.journey__title { max-width: 20ch; }
.journey__title--areas { font-size: var(--step-3); }
.journey__cold {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem 0.42rem 0.6rem;
  border: 1px solid rgba(134, 182, 73, 0.6);
  border-radius: 999px;
  background: rgba(15, 29, 20, 0.5);
  font-size: 0.8rem;
  font-weight: 600;
  color: #d3e9b6;
  white-space: nowrap;
}
.journey__cold svg { width: 1.05rem; height: 1.05rem; color: var(--leaf); }

.journey__body {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(220px, 280px);
  justify-content: start;
  align-items: center;
  gap: clamp(1.5rem, 1rem + 3vw, 4rem);
}
.journey__still {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(201, 177, 120, 0.2);
  border-radius: var(--radius);
}

/* Where we deliver: a count and the six areas, each lit as its first truck
   arrives. */
.journey__panel {
  display: grid;
  gap: 0.9rem;
  padding: 1.2rem 1.25rem 1.3rem;
  border: 1px solid rgba(201, 177, 120, 0.3);
  border-radius: var(--radius);
  background: rgba(12, 22, 15, 0.66);
}
.journey__panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.journey__panel-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--journey-muted);
}
.journey__count { font-size: 0.8rem; color: var(--journey-muted); font-variant-numeric: tabular-nums; }
.journey__count b { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; line-height: 1; color: var(--gold); }
.journey__areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.journey__areas li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  opacity: 0.4;
  transition: opacity 0.4s;
}
.journey__areas i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  transition: background-color 0.4s, box-shadow 0.4s;
}
.journey__areas span { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.15; }
.journey__areas li.is-on { opacity: 1; }
.journey__areas li.is-on i { background: var(--gold); box-shadow: 0 0 10px rgba(201, 177, 120, 0.7); }

/* ---------- Pinned: the map fills the screen, the HUD sits over it ---------- */
.journey.is-live .journey__pin {
  display: block;
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
}
.journey.is-live :is(.journey__canvas, .journey__shade, .journey__labels) {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.journey.is-live .journey__canvas { width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s var(--ease-out); }
.journey.is-live.has-map .journey__canvas { opacity: 1; }
/* A vignette at the edges, and a darker band behind the headline. */
.journey.is-live .journey__shade {
  background:
    linear-gradient(180deg, rgba(12, 22, 15, 0.62) 0%, rgba(12, 22, 15, 0.28) 20%, transparent 40%),
    radial-gradient(125% 100% at 42% 50%, transparent 50%, rgba(11, 22, 17, 0.95) 100%);
}
.journey.is-live .journey__labels { overflow: hidden; }
.journey.is-live .journey__still { display: none; }

.journey.is-live .journey__pin > .journey__head {
  position: absolute;
  top: calc(4.25rem + clamp(0.5rem, 3vh, 1.75rem)); /* clears the header */
  left: var(--gutter);
  width: auto;
  max-width: calc(100% - 2 * var(--gutter));
  margin: 0;
  gap: 0.8rem;
  pointer-events: none;
}
.journey.is-live .journey__titles > * { grid-area: 1 / 1; }
.journey.is-live .journey__title {
  font-size: clamp(2.2rem, 1.3rem + 3.4vw, 4.6rem);
  line-height: 1;
  max-width: 13ch;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}
.journey.is-live .journey__title--areas { opacity: 0; }
.journey.is-live .journey__panel {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-42%);
  width: min(260px, 30vw);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
}

/* Place names on the map, placed by journey-scene.js. */
.journey__label {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
  will-change: transform;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}
.journey__label--area { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.journey__label--context { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: rgba(185, 194, 173, 0.55); letter-spacing: 0.04em; }
.journey__label--home { font-size: 0.86rem; font-weight: 700; line-height: 1.2; color: var(--cream); }
.journey__label--home small { display: block; font-size: inherit; font-weight: 400; color: var(--journey-muted); }
.journey__label--farms { font-size: 0.74rem; color: #cfe2b4; }

/* ---------- Phones: the panel moves to the bottom, two areas a row ---------- */
@media (max-width: 719px) {
  .journey__body { grid-template-columns: minmax(0, 1fr); }
  .journey__areas { grid-template-columns: 1fr 1fr; gap: 0.35rem 0.8rem; }
  .journey__areas span { font-size: 1.05rem; }
  .journey.is-live .journey__title { font-size: clamp(2rem, 1.2rem + 4vw, 2.6rem); max-width: 15ch; }
  .journey.is-live .journey__panel {
    top: auto;
    bottom: calc(clamp(1rem, 3.5vh, 2rem) + 1.2rem);
    left: var(--gutter);
    width: auto;
    transform: none;
    padding: 0.85rem 1rem;
    gap: 0.6rem;
  }
}
