/* ============================================================
   TGC — THE GARAGES
   A pit lane of eleven shutters, the open bay below it, and the
   fan-connection card. Industrial: corrugation, bay numbers,
   hazard edges, heat from the team tint.

   Every moving part here is transform or opacity. The shutter in
   particular rolls on translateY inside an overflow-hidden frame
   rather than animating height, because eleven doors animating a
   layout property is eleven reflows a frame.
   ============================================================ */

.garages { padding-block: var(--space-section); border-block: 1px solid var(--line); }

.garages__head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 1.5rem; flex-wrap: wrap;
  margin-bottom: clamp(1.6rem, 3.5vw, 3rem);
}

/* ---------- THE GRID, IN CHAMPIONSHIP ORDER ---------- */
/* Twenty two faces, P1 first. Scrolls sideways; the leader is always
   the first thing in view. */
.gorder {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(6.2rem, 9vw, 7.6rem);
  gap: 1px;
  margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
  background: var(--line);
  border: 1px solid var(--line);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.gpos {
  --tint: var(--accent);
  position: relative;
  display: grid; grid-template-rows: auto auto auto; align-content: end;
  padding: 0 0 0.7rem;
  border: 0; color: inherit; text-align: left; cursor: pointer;
  background:
    radial-gradient(80% 60% at 50% 100%, color-mix(in srgb, var(--tint) 34%, transparent), transparent 70%),
    var(--surface);
  scroll-snap-align: start;
  overflow: hidden;
}
.gpos::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--tint);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform var(--d3) var(--ease-out);
}
.gpos:hover::after, .gpos:focus-visible::after { transform: scaleX(1); }
.gpos:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; }
.gpos__face {
  width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 0;
  transition: transform var(--d4) var(--ease-out);
}
.gpos:hover .gpos__face { transform: scale(1.06); }
.gpos__p {
  position: absolute; top: 0.45rem; left: 0.55rem;
  font-family: var(--display-face); font-weight: 700;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem); line-height: 1;
  color: var(--ink);
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.6);
}
.gpos:first-child .gpos__p { color: var(--accent); }
.gpos__code { padding-inline: 0.6rem; margin-top: 0.4rem; color: var(--ink); }
.gpos__pts { padding-inline: 0.6rem; color: var(--muted); }

/* ---------- THE LANE ---------- */
/* One row, always. Eleven is prime, so any wrap left Cadillac alone on
   a second row beside a wall of empty black. Where eleven do not fit,
   the lane scrolls sideways like a real pit lane. */
.pitlane {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(6.5rem, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.pitlane > * { scroll-snap-align: start; }

.gdoor {
  --tint: var(--accent);
  position: relative;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--d2) var(--ease-out);
}
.gdoor:hover, .gdoor:focus-visible { background: #16120e; }
.gdoor:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; z-index: 2; }

.gdoor__frame {
  position: relative;
  display: block;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  background: #070603;
}

/* The bay behind the shutter. A thin bar of team colour on the
   floor is the only colour in the lane until a door opens. */
.gdoor__inside {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(90% 70% at 50% 108%, color-mix(in srgb, var(--tint) 46%, transparent), transparent 62%),
    #070603;
}
.gdoor__inside::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: 0;
  height: 3px; background: var(--tint);
}
.gdoor__no {
  font-size: clamp(1.2rem, 2.4vw, 1.9rem);
  font-weight: 700;
  color: color-mix(in srgb, var(--tint) 70%, var(--ink));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--d3) var(--ease-out) 80ms,
              transform var(--d3) var(--ease-out) 80ms;
}

/* Corrugated steel. Rolls up and out of the frame. */
.gdoor__shutter {
  position: absolute; inset: 0;
  transform: translateY(0);
  transform-origin: 50% 0%;
  transition: transform var(--d4) var(--ease-io);
  background:
    repeating-linear-gradient(
      180deg,
      #1b1b1b 0 6px,
      #232323 6px 7px,
      #131313 7px 12px,
      #0e0e0e 12px 13px
    );
  box-shadow: inset 0 -14px 22px -10px #000;
}
/* A hazard stripe on the bottom lip, the way a real shutter has. */
.gdoor__shutter::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(
    -45deg, var(--tint) 0 7px, #0a0a0a 7px 14px);
  opacity: 0.85;
}

.gdoor.is-open .gdoor__shutter { transform: translateY(-100%); }
.gdoor.is-open .gdoor__no { opacity: 1; transform: none; }

.gdoor__label {
  display: grid; gap: 0.2rem;
  padding: 0.7rem clamp(0.5rem, 1.2vw, 0.9rem) 0.85rem;
  border-top: 1px solid var(--line);
}
.gdoor__bay { color: var(--muted); }
.gdoor__team {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(0.8rem, 1.5vw, 1rem); line-height: 1.05;
}
.gdoor.is-open .gdoor__team { color: var(--tint); }

/* ---------- THE OPEN BAY ---------- */
.garage {
  --tint: var(--accent);
  margin-top: 1px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tint);
  background: var(--surface);
  padding: clamp(1.4rem, 3.5vw, 3rem);
  display: grid;
  gap: clamp(1.6rem, 3vw, 2.6rem);
}
@media (min-width: 900px) {
  .garage { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .garage__head { grid-column: 1 / -1; }
}

.garage__entrant { color: var(--tint); }
.garage__name {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2rem, 1rem + 4.5vw, 4.5rem); line-height: 0.92;
  margin: 0.3rem 0 0.7rem;
}
.garage__note { color: var(--muted); max-width: 52ch; }

/* The seats. Number carries the weight, name sits under it. */
.garage__seats { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 560px) { .garage__seats { grid-template-columns: 1fr 1fr; } }

.gseat {
  background:
    radial-gradient(70% 60% at 80% 100%, color-mix(in srgb, var(--tint) 26%, transparent), transparent 70%),
    var(--ground);
  padding: clamp(1rem, 2.4vw, 1.8rem);
  padding-right: 46%;
  min-height: clamp(11rem, 18vw, 15rem);
  display: grid; gap: 0.35rem; align-content: end;
  position: relative;
  overflow: hidden;
}
/* The driver stands in the right of their seat. The cutouts are tall
   (waist up, about 1:2.9), so they are drawn larger than the seat and
   the seat's own edge crops them at the chest. */
.gseat__face {
  position: absolute; right: 4%; top: 8%;
  height: 190%; width: auto;
  pointer-events: none;
}
.gseat__no, .gseat__name, .gseat__champ { position: relative; }
.gseat__champ { color: var(--muted); }
.gseat::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px;
  background: var(--tint);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform var(--d3) var(--ease-out);
}
.gseat:hover::after { transform: scaleX(1); }
.gseat__no {
  font-family: var(--display-face); font-weight: 700;
  font-size: clamp(2.6rem, 1rem + 6vw, 5.5rem); line-height: 0.82;
  color: var(--tint);
  font-variant-numeric: tabular-nums;
}
.gseat__name {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem); line-height: 1.1;
}

/* The spec sheet. */
.gspec { display: grid; gap: 1px; align-self: start; }
.gspec__row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.gspec__row:last-child { border-bottom: 0; }
.gspec__val {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  text-align: right;
}

.garage__claim { grid-column: 1 / -1; display: grid; gap: 0.7rem; justify-items: start; }
.garage__claimnote { color: var(--muted); max-width: 48ch; }

.cta--ghost {
  background: transparent;
  color: var(--tint);
  border: 1px solid var(--tint);
}
.cta--ghost[aria-pressed="true"] { background: var(--tint); color: var(--accent-ink); }

/* ---------- WHO RUNS WHOSE ENGINE ---------- */
.eband {
  margin-top: clamp(2rem, 4vw, 3.5rem);
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
}
.eband__col {
  background: var(--surface);
  padding: clamp(1rem, 2.2vw, 1.6rem);
  display: grid; gap: 0.5rem; align-content: start;
}
.eband__maker { color: var(--muted); }
.eband__count {
  font-family: var(--display-face); font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.2rem); line-height: 0.85;
  color: var(--accent);
}
.eband__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.eband__list li {
  font-size: 0.9rem;
  padding-left: 0.85rem;
  position: relative;
}
.eband__list li::before {
  content: ""; position: absolute; left: 0; top: 0.52em;
  width: 0.4rem; height: 0.4rem; background: var(--tint);
}

/* ---------- FIND YOUR PEOPLE ---------- */
.fan {
  --tint: var(--accent);
  padding-block: var(--space-section);
}
.fan__head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3.4rem); }
.fan__title { font-size: var(--text-section); margin: 0.6rem 0 1rem; }
.fan__lede { color: var(--muted); max-width: 50ch; }

.fan__steps {
  list-style: none; margin: 0 0 clamp(2rem, 4vw, 3.4rem); padding: 0;
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
}
.fstep {
  background: var(--surface);
  padding: clamp(1.2rem, 2.6vw, 2rem);
  display: grid; gap: 0.5rem; align-content: start;
}
.fstep__no { color: var(--accent); }
.fstep__title {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem); line-height: 1.05;
}
.fstep__body { color: var(--muted); font-size: 0.94rem; }

/* The card. Goes from grey to team colour the moment a garage is
   claimed, which is the only feedback the claim needs. */
.fan__card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  background: var(--surface);
  padding: clamp(1.3rem, 3vw, 2.4rem);
  display: grid; gap: 0.9rem; justify-items: start;
  max-width: 44rem;
  transition: border-color var(--d3) var(--ease-out);
}
.fan[data-picked="true"] .fan__card { border-left-color: var(--tint); }

.fan__cardhead { display: grid; gap: 0.2rem; }
.fan__team {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1;
  color: var(--muted);
  transition: color var(--d3) var(--ease-out);
}
.fan[data-picked="true"] .fan__team { color: var(--tint); }

.fan__phraseLabel { margin-top: 0.4rem; }
.fan__phrase {
  display: inline-flex; align-items: center; gap: 1.2rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--line-light);
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  letter-spacing: 0.06em;
  transition: border-color var(--d2) var(--ease-out), transform var(--d2) var(--ease-out);
}
.fan__phrase:hover { border-color: var(--accent); transform: translateY(-2px); }
.fan__phrase:active { transform: translateY(0); }
.fan__phrase em { font-style: normal; color: var(--muted); }

.fan__where a { color: var(--accent); }
.fan__small { margin-top: 1.2rem; color: var(--muted); }

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .gdoor__shutter,
  .gdoor__no,
  .gseat::after,
  .gpos::after,
  .gpos__face,
  .fan__phrase,
  .fan__card,
  .fan__team { transition: none; }
}

/* ---------- THE CAR IN THE BAY ----------
   A whole car is five times wider than a door, so the door is the cutout:
   the car is parked across it at full size and the frame shows the engine
   cover and title sponsor. It sits in front of the shutter, dimmed, and
   comes up to full colour when its door opens. */
.gdoor__inside { align-items: start; padding-top: 12%; }
.gdoor__bayview {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 0, #000 16%, #000 84%, transparent 100%);
          mask-image: linear-gradient(100deg, transparent 0, #000 16%, #000 84%, transparent 100%);
}
.gdoor__car {
  position: absolute; left: 50%; bottom: 6%;
  height: 56%; width: auto; max-width: none;
  transform: translateX(-46%);
  transform-origin: 46% 100%;
  filter: brightness(0.5) saturate(0.55);
  transition: transform var(--d4) var(--ease-out), filter var(--d3) var(--ease-out);
}
.gdoor:hover .gdoor__car,
.gdoor:focus-visible .gdoor__car { filter: brightness(0.9) saturate(1); transform: translateX(-53%); }
.gdoor.is-open .gdoor__car { filter: none; transform: translateX(-46%) scale(1.14); }
@media (prefers-reduced-motion: reduce) { .gdoor__car { transition: none; } }
