/* ============================================================
   GIRL+GRID — NEXT ACADEMY ROUND

   A Didone clock on a blurred film, the round's lap glowing pink
   beside it, and the wildcard seat as a feature card underneath.
   Orchid (--accent-2) still means live and nothing else: the room
   dot, the current pip, "Racing now".

   Motion is transform / opacity / clip-path only. Everything is
   readable with reduced motion: no film, no roll, no entrance.
   ============================================================ */

.anext {
  --dot: var(--accent-2);
  --seat-pad: clamp(1.1rem, 2.4vw, 1.9rem);
  position: relative;
  isolation: isolate;
  padding-block: clamp(3.5rem, 8vw, 7rem) clamp(4.5rem, 8vw, 7rem);
  border-block: 1px solid var(--line);
  background: var(--surface);
  overflow: clip;
}
.anext[data-room="closed"] { --dot: var(--muted); }

/* ---------- atmosphere: the film, blurred to colour ---------- */
.anext__atmos {
  position: absolute; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.anext__film {
  position: absolute; inset: -8%;
  width: 116%; height: 116%;
  object-fit: cover;
  filter: blur(28px) saturate(1.5);
  opacity: 0.55;
}
.anext__atmos::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--surface) 8%, color-mix(in srgb, var(--surface) 72%, transparent) 46%, color-mix(in srgb, var(--surface) 30%, transparent)),
    linear-gradient(180deg, var(--surface), transparent 22%, transparent 70%, var(--surface));
}

.anext__grid {
  display: grid;
  grid-template-areas: "copy" "stage" "seat";
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
@media (min-width: 1000px) {
  .anext__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas: "copy stage" "seat seat";
    column-gap: clamp(2rem, 4vw, 4.5rem);
  }
}

/* ---------- the copy ---------- */
.anext__copy { grid-area: copy; display: grid; gap: clamp(0.9rem, 1.8vw, 1.3rem); justify-items: start; min-width: 0; }

.anext__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.anext__count { color: var(--muted); }
.anext__pips { display: flex; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.anext__pips li {
  width: clamp(1rem, 2vw, 1.5rem); height: 3px; border-radius: 2px;
  background: var(--glass-line);
}
.anext__pips li[data-s="done"] { background: var(--accent); }
.anext__pips li[data-s="now"] {
  background: var(--accent-2);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 80%, transparent);
}

.anext__where {
  margin: 0;
  font-family: var(--display-face);
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(3.6rem, 1.4rem + 7.4vw, 8.8rem);
  line-height: 0.88;
  letter-spacing: -0.035em;
  color: var(--accent-text);
  text-wrap: balance;
  padding-inline-end: 0.08em;   /* the italic overhang */
}

.anext__when {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.45rem 0.9rem;
  margin: 0;
  color: var(--muted);
}
.anext__when > span + span::before {
  content: ""; display: inline-block;
  width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
  margin-inline-end: 0.9rem; vertical-align: middle;
}
.anext__cc { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); }
.anext__flag {
  width: 1.35rem; height: 0.9rem; flex: none;
  border-radius: 2px;
  outline: 1px solid rgba(255, 255, 255, 0.22);
  outline-offset: -1px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ---------- the clock ---------- */
.anext__clock {
  width: 100%;
  container-type: inline-size;
  display: flex; align-items: flex-start;
  gap: clamp(0.9rem, 5cqi, 2.4rem);
  margin-block: clamp(0.4rem, 1.6vw, 1.2rem);
}
.anext__clock[data-mode="off"] { display: none; }
.anext__clock[data-mode="live"] .anext__unit { display: none; }

.anext__unit { display: grid; gap: 0.55rem; justify-items: start; }
.anext__fig {
  display: flex;
  font-family: var(--display-face);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.6rem, 13cqi, 6.6rem);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  color: var(--ink);
}
/* The live figure is the hot one. */
.anext__unit[data-u="s"] .anext__fig { color: var(--accent-text); }

.anext__slot {
  display: inline-grid;
  width: 0.62em;
  justify-items: center;
  /* A drum: clipped just above the figure's top and just under its
     baseline (Bodoni at line-height 1 sits its baseline 0.86em down),
     so a digit rises out of the floor. Open at the sides so the
     italic's overhang is never shaved. */
  clip-path: inset(0.02em -0.3em 0.11em -0.3em);
}
.anext__slot > span { grid-area: 1 / 1; }
.anext__slot > .is-in  { animation: anextIn 0.7s var(--ease-out) both; }
.anext__slot > .is-out { animation: anextOut 0.45s cubic-bezier(0.5, 0, 0.75, 0) both; }
@keyframes anextIn  { from { transform: translateY(88%); opacity: 0.2; } }
@keyframes anextOut { to   { transform: translateY(-88%); opacity: 0.2; } }

.anext__lab { color: var(--muted); padding-inline-start: 0.15em; }

.anext__live {
  margin: 0;
  font-family: var(--display-face);
  font-style: italic; font-weight: 500;
  font-size: clamp(2.6rem, 11cqi, 6rem);
  line-height: 1;
  color: var(--accent-2);
}

/* ---------- the room, the ticket ---------- */
.anext__act { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.1rem; }
.anext__room {
  display: inline-flex; align-items: center; gap: 0.65rem;
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.anext__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dot); flex: none; }
.anext[data-room="open"] .anext__dot { animation: anextPulse 2.4s var(--ease-out) infinite; }
@keyframes anextPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); }
  70%  { box-shadow: 0 0 0 0.6rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.anext__note { margin: 0; max-width: 46ch; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }

/* ---------- the lap ---------- */
.anext__stage {
  grid-area: stage;
  position: relative;
  width: 100%;
  max-width: 40rem;
  aspect-ratio: 1 / 0.92;
  justify-self: center;
}
.anext__glow {
  position: absolute; inset: 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--accent) 34%, transparent),
    color-mix(in srgb, var(--accent-2) 12%, transparent) 58%,
    transparent);
  filter: blur(24px);
  pointer-events: none;
  animation: anextBreathe 7s ease-in-out infinite alternate;
}
@keyframes anextBreathe {
  from { scale: 0.9; opacity: 0.7; }
  to   { scale: 1.06; opacity: 1; }
}
.anext__art { position: absolute; inset: 0; }
.anext__flat {
  position: absolute; inset: 12%;
  color: var(--accent);
  transition: opacity 0.6s var(--ease-out);
}
.anext__flat svg { width: 100%; height: 100%; overflow: visible; }
.anext__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
  cursor: grab;
  /* A vertical swipe still scrolls the page on a phone; sideways turns the lap. */
  touch-action: pan-y;
}
.anext__canvas.is-held { cursor: grabbing; }
.anext__art.is-3d .anext__canvas { opacity: 1; }
.anext__art.is-3d .anext__flat { opacity: 0; }

.anext__hint {
  position: absolute; top: 2%; left: 0;
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}
.anext__hint::before {
  content: ""; width: 1.6rem; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.anext__stage:has(.is-3d) .anext__hint { opacity: 1; }
.anext__stage.is-touched .anext__hint { opacity: 0; }

/* ---------- the wildcard seat ---------- */
.anext__seat {
  grid-area: seat;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem clamp(1.2rem, 3vw, 2.6rem);
  align-items: end;
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  padding: var(--seat-pad);
  border-radius: 1.4rem;
  background:
    radial-gradient(60% 120% at 12% 100%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    var(--glass-bg);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.7);
}
.anext__seat.has-pic { grid-template-columns: clamp(7rem, 30vw, 9rem) minmax(0, 1fr); }
@media (min-width: 760px) {
  .anext__seat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .anext__seat.has-pic { grid-template-columns: clamp(11rem, 19vw, 16rem) minmax(0, 1fr) minmax(0, 1.05fr); }
}

/* Her portrait breaks out of the top of the card and stands on its
   bottom edge; the crop of the source is faded out rather than cut. */
.anext__seatpic {
  align-self: end;
  margin-top: calc(-1 * clamp(4rem, 9vw, 8rem));
  margin-bottom: calc(-1 * var(--seat-pad));
}
/* The source is a wide 900x720 frame with her in the middle third;
   cover into a portrait box keeps her and drops the empty sides. */
.anext__seatpic img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 0;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
  transform-origin: 50% 100%;
  transition: transform 0.8s var(--ease-out);
}
/* Stacked (car on its own row), she rises out of the top edge instead. */
@media (max-width: 759.98px) {
  .anext__seatpic { align-self: start; margin-bottom: 0; }
}
@media (hover: hover) {
  .anext__seat:hover .anext__seatpic img { transform: translateY(-6px) scale(1.035); }
}

.anext__seatcopy { display: grid; gap: 0.35rem; min-width: 0; padding-bottom: 0.2rem; }
.anext__seatcopy p { margin: 0; }
.anext__seatno {
  font-family: var(--display-face);
  font-optical-sizing: auto;
  font-style: italic; font-weight: 600;
  font-size: clamp(3.4rem, 2rem + 4vw, 6.2rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--accent-text);
  margin-top: 0.3rem !important;
}
.anext__seatname {
  margin: 0;
  font-family: var(--display-face);
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.anext__seatteam { color: var(--muted); }

.anext__seatcar {
  grid-column: 1 / -1;
  display: grid; gap: 0.8rem;
  margin: 0;
  min-width: 0;
  align-self: center;
}
@media (min-width: 760px) { .anext__seatcar { grid-column: auto; } }
.anext__seatcar img {
  display: block;
  width: 100%; max-width: 26rem; height: auto;
  aspect-ratio: 327 / 82;
  object-fit: contain;
  justify-self: center;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.5));
}
.anext__seatnote { color: var(--muted); font-size: 0.92rem; line-height: 1.5; max-width: 40ch; justify-self: center; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .anext[data-room="open"] .anext__dot,
  .anext__glow { animation: none; }
  .anext__slot > span { animation: none !important; }
  .anext__seatpic img { transition: none; }
}
