/* Page CSS: only what sits inside the page's visuals and the kit lacks (taste-skill system.md).
   The campus scene in the hero, the arena phone in #match, the review card in #judge, the crest
   in the logo and the waitlist form's one-row layout. Colours inside the arena are the app's own. */

/* ---------------------------------------------------------------- the client's crest as the logo */
.nav__logo .nav__crest { height: 28px; width: auto; }

/* ---------------------------------------------------------------- hero: the face-off */
.hero__stage.faceoff { background: #0a0f1f; --px: 0; --py: 0; }
.hero__stage > picture img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 30%; }
.faceoff__art { transform: translate3d(calc(var(--px) * -8px), calc(var(--py) * -5px), 0) scale(1.03); }
.faceoff__fx { position: absolute; inset: 0; pointer-events: none; }
.faceoff__fx > img { position: absolute; max-width: none; }
.faceoff__gem {
  left: var(--x); top: var(--y); width: calc(var(--s) * 132px); height: auto;
  transform: translate3d(calc(-50% + var(--px) * var(--k)), calc(-50% + var(--py) * var(--k) * .6), 0);
  filter: drop-shadow(0 0 18px rgb(80 150 255 / .55));
}
.faceoff__gem--r { filter: drop-shadow(0 0 18px rgb(255 80 80 / .55)); }
.faceoff__sparks { inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .85; mix-blend-mode: screen; }
.faceoff__burst { left: 50%; top: 50%; width: clamp(240px, 34%, 484px); transform: translate3d(calc(-50% + var(--px) * 4px), calc(-50% + var(--py) * 3px), 0); }
.faceoff__shield {
  left: 50%; top: 50%; width: clamp(96px, 12%, 180px);
  transform: translate3d(calc(-50% + var(--px) * 6px), calc(-50% + var(--py) * 4px), 0);
  filter: drop-shadow(0 6px 24px rgb(0 0 0 / .6)) drop-shadow(0 0 22px rgb(255 200 90 / .45));
}
/* the entrance, once on load: the art settles, the crystals come in from their sides, the burst
   flares and the shield lands between the two players */
@media (prefers-reduced-motion: no-preference) {
  .faceoff__art { animation: fo-art 1100ms cubic-bezier(.22, 1, .36, 1) both; }
  .faceoff__gem { animation: fo-gem 900ms cubic-bezier(.22, 1, .36, 1) calc(350ms + var(--d)) both; }
  .faceoff__gem--r { animation-name: fo-gem-r; }
  .faceoff__sparks { animation: fo-fade 900ms ease 700ms both; }
  .faceoff__burst { animation: fo-burst 700ms cubic-bezier(.22, 1, .36, 1) 650ms both; }
  .faceoff__shield { animation: fo-shield 560ms cubic-bezier(.22, 1, .36, 1) 780ms both; }
}
@keyframes fo-art { from { opacity: 0; scale: 1.08; } to { opacity: 1; scale: 1; } }
@keyframes fo-gem { from { opacity: 0; translate: -60px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes fo-gem-r { from { opacity: 0; translate: 60px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes fo-fade { from { opacity: 0; } }
@keyframes fo-burst { from { opacity: 0; scale: .35; } to { opacity: 1; scale: 1; } }
@keyframes fo-shield { from { opacity: 0; scale: 1.9; } to { opacity: 1; scale: 1; } }
@media (max-width: 639px) {
  .faceoff__gem { width: calc(var(--s) * 84px); }
  .hero__stage > picture img { object-position: 50% 35%; }
}

/* ---------------------------------------------------------------- #match: the split and the phone */
@media (min-width: 640px) and (max-width: 1023px) { #match { --h: 2; } }
.match { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.match__text { grid-column: 1 / span 6; }
.a-frame { grid-column: 7 / -1; position: relative; display: grid; justify-items: center; }
@media (max-width: 1023px) {
  .match__text, .a-frame { grid-column: 1 / -1; }
  .a-frame { margin-top: var(--s-7); }
}
.match__steps { margin: 0; padding: 0; list-style: none; }
.match__steps > li { padding: 0; }
.match__jump {
  all: unset; box-sizing: border-box; display: grid; gap: var(--s-1); width: 100%; padding-block: var(--s-3); cursor: pointer;
  border-radius: var(--r-sm); transition: background-color 200ms ease;
}
.match__jump:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.match__jump:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.match__line { color: var(--ink); max-width: 56ch; }
.match__steps .rows__name { display: flex; align-items: center; gap: var(--s-3); }
.match__steps .rows__name::after { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color 300ms ease; }
.match__steps > li.is-current .rows__name::after { background: currentColor; }

.a-device {
  width: min(310px, 100%); aspect-ratio: 600 / 1304; padding: 10px; border-radius: 46px; box-sizing: content-box;
  background: #121214; box-shadow: 0 0 0 1px rgb(0 0 0 / .4), 0 30px 60px -24px rgb(0 0 0 / .55);
}
.a-device { overflow: hidden; }
.a-video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 36px; background: #10192d; }

/* ---------------------------------------------------------------- phone frames for the app's own screens */
.device {
  position: relative; width: var(--dw, 220px); max-width: 100%; aspect-ratio: 600 / 1304; padding: 8px; box-sizing: content-box;
  border-radius: 38px; background: #121214; box-shadow: 0 0 0 1px rgb(0 0 0 / .4), 0 24px 48px -22px rgb(0 0 0 / .6);
}
.device > :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 30px; background: #10192d; }
.device > .loop-pause { right: -44px; bottom: 0; }

/* ---------------------------------------------------------------- #app: the tour, three screens of the app */
.tour { align-items: start; }
.tour__item { display: grid; justify-items: start; gap: var(--s-3); }
.tour__item > .device { --dw: 200px; margin-bottom: var(--s-2); }
.tour__item { gap: var(--s-2); }
.tour__item > p { max-width: 34ch; }
@media (max-width: 1023px) { .tour__item { grid-column: auto / span 6; } .tour__item:last-child { grid-column: 1 / -1; } }
@media (min-width: 640px) and (max-width: 1023px) { #app { --h: 2; } }
@media (max-width: 639px) {
  /* a phone: the three titles as a list, then the three screens side by side, all on one screen */
  .tour { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-3); row-gap: 0; }
  .tour__item:nth-child(3) { display: none !important; }
  .tour__item, .tour__item:last-child { display: contents; }
  .tour__item > h3 { grid-column: 1 / -1; margin-top: var(--s-4); }
  .tour__item:first-child > h3 { margin-top: 0; }
  .tour__item > p { grid-column: 1 / -1; margin-top: var(--s-1); }
  .tour__item:nth-child(1) > h3 { grid-row: 1; } .tour__item:nth-child(1) > p { grid-row: 2; }
  .tour__item:nth-child(2) > h3 { grid-row: 3; } .tour__item:nth-child(2) > p { grid-row: 4; }
  .tour__item:nth-child(3) > h3 { grid-row: 5; } .tour__item:nth-child(3) > p { grid-row: 6; }
  .tour__item > .device { grid-row: 7; --dw: calc(100% - 12px); width: calc(100% - 12px); margin: var(--s-6) 0 0; border-radius: 20px; padding: 6px; }
  .tour__item > .device > :is(img, video) { border-radius: 15px; }
}

/* ---------------------------------------------------------------- #judge: the app's Game Review and Analyze Moves */
.judge { align-items: start; }
.judge__phones { display: flex; gap: var(--gutter); }
.judge__phones > .device { --dw: 230px; }
.judge__stats { grid-template-columns: minmax(0, 1fr); align-content: start; }
@media (max-width: 1023px) {
  .judge > .judge__phones, .judge > .judge__stats { grid-column: 1 / -1; }
  .judge__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--s-6); }
}

@media (max-width: 639px) { .judge__phones > .device { --dw: calc((342px - 12px - 32px) / 2); } }

/* ---------------------------------------------------------------- the waitlist form in the close */
.join { grid-template-columns: minmax(0, 1fr) auto; align-items: end; width: min(100%, 520px); }
.join > .field--full { grid-column: 1; }
.join > .btn-row { grid-column: 2; grid-row: 1; }
.join > .form__status { grid-column: 1 / -1; }
.join__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 639px) {
  .join { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .join > .btn-row { grid-column: 1; grid-row: auto; }
}

/* ---------------------------------------------------------------- hero on a phone: the stage takes what the words leave */
@media (max-width: 639px) {
  .hero--product .hero__stage:has(> picture) { flex: 1 1 auto; aspect-ratio: auto; min-height: 240px; }
}

/* ---------------------------------------------------------------- #questions: the lectern beside the answers */
.faq-split { align-items: start; }
.faq-split__hall { width: 100%; height: auto; border-radius: var(--r-lg); aspect-ratio: 6 / 5; object-fit: cover; }
@media (max-width: 1023px) {
  .faq-split > .faq, .faq-split > .hall { grid-column: 1 / -1; }
  .faq-split > .hall { margin-top: var(--s-6); }
  .faq-split__hall, .hall__canvas { aspect-ratio: 5 / 2; object-position: 50% 40%; }
}


/* ---------------------------------------------------------------- #record: books fly into the judge's chamber */
.books > .wrap { height: 100%; }
.books__pin { height: 100%; display: flex; flex-direction: column; }
.books__pin > .section-head { flex: none; }
.books__stage { position: relative; flex: 1 1 auto; min-height: 240px; overflow: hidden; border-radius: var(--r-lg); background: #d9c4a2; }
.books__room { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 60%; }
.books__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* a tablet: the section's box grows with its content, so the stage takes a height of its own */
@media (min-width: 640px) and (max-width: 1023px) {
  .books__stage { flex: none; height: calc(100svh - var(--padt) - var(--padb) - 260px); }
}

/* a phone: the match is two screens, the steps on the first and the recording on the second (.g2m) */
@media (max-width: 639px) {
  #match .match { display: contents; }
  #match .a-frame { margin-top: 0; }
  #match .a-device { width: min(296px, 100%); }
}


/* a phone: the tour video's pause button sits inside its frame, so nothing runs past the screen */
@media (max-width: 639px) { .tour__item > .device > .loop-pause { right: 8px; bottom: 8px; } }

/* ---------------------------------------------------------------- #questions: the debate hall, alive */
.hall { position: relative; margin: 0; }
.hall__canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--r-lg); aspect-ratio: 6 / 5; object-fit: cover; pointer-events: none; }
