/* VertiGrid landing page — "Wall of levels".
   Standalone: only index.html loads this file. The other pages keep css/style.css. */

:root {
  --bg: #0a0033;
  --accent: #a99cff;
  --text: #d8d3f5;
  --text-2: #cfc9f0;
  --orange: #ff4d00;
  --ink: #14002e;
  --label: #14102e;
  --board: #f7f7f5;
  --bar: #263238;
  --hazard: #e00000;
  --goal: #00d400;
  --goal-ink: #062406;

  --display: "Chakra Petch", system-ui, sans-serif;
  --body: "Bai Jamjuree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --pad: 40px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

/* ---------------------------------------------------------
   Level tiles (real recordings, built by js/landing.js)
--------------------------------------------------------- */
@keyframes vgColUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes vgColDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }

.vg-board {
  position: relative;
  container-type: inline-size;
  width: 100%;
  overflow: hidden;
  background: var(--board);
  isolation: isolate; /* own stacking context so the label can never fall behind a playing video */
}

/* the wall is tilted, so a tile's edge pixels blend the clip with whatever is under it; keep that dark
   (page colour) so a light board background can't show as a thin white outline beside the side walls */
.vg-wall .vg-board { background: var(--bg); }

/* real gameplay clips (cropped to the board); object-fit trims a few % when a tile's shape differs */
.vg-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.vg-tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 8px;
  background: var(--label);
  color: #fff;
  font: 500 11px / 1.25 var(--mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
  z-index: 2; /* above the video; translateZ puts the label on its own layer, since some browsers paint playing video over later siblings */
  transform: translateZ(0);
  /* scale with the tile where container units are supported */
  left: 4cqw;
  bottom: 4cqw;
  padding: 1.2cqw 2.4cqw;
  font-size: clamp(11px, 4.2cqw, 12px);
}

/* ---------------------------------------------------------
   Nav
--------------------------------------------------------- */
.vg-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px var(--pad);
}

.vg-nav__brand { display: flex; padding: 12px 16px; background: var(--bg); }
.vg-nav__brand img { display: block; height: 22px; width: auto; }

.vg-nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 20px;
  background: var(--bg);
  font: 500 14px var(--mono);
  letter-spacing: 0.04em;
}
.vg-nav__links a { padding: 6px 10px; }
.vg-nav__links a.vg-badge { margin-left: 10px; padding: 0; }
.vg-nav__links .vg-badge img { height: 40px; }

.vg-badge { display: block; line-height: 0; }
.vg-badge img { display: block; width: auto; }
.vg-badge:hover { opacity: 0.88; }

.vg-menu {
  display: none;
  padding: 10px 12px;
  border: 0;
  background: var(--bg);
  color: #fff;
  font: 500 12px var(--mono);
  cursor: pointer;
}

/* ---------------------------------------------------------
   Hero: wall of levels + title panel
--------------------------------------------------------- */
.vg-hero {
  position: relative;
  height: 880px;
  overflow: hidden;
  background: var(--bg);
}

.vg-anchor { position: absolute; top: 0; left: 0; width: 0; height: 0; }

.vg-wall {
  position: absolute;
  top: -220px;
  bottom: -220px;
  left: -140px;
  right: -140px;
  transform: rotate(-7deg);
}

.vg-wall__grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  gap: 14px;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.vg-wall__grid.is-ready { opacity: 1; }

.vg-track { will-change: transform; }
.vg-cell { padding-bottom: 14px; }
.vg-cell > .vg-board { border-radius: 16px; }

.vg-hero.is-offscreen .vg-track { animation-play-state: paused !important; }

.vg-title {
  position: absolute;
  left: var(--pad);
  bottom: var(--pad);
  z-index: 2;
  /* the design's 620px is the content width (its panel is content-box), so 620 + 2 x 44px padding */
  width: min(708px, calc(100% - 2 * var(--pad)));
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 44px 44px 40px;
  background: var(--bg);
}

.vg-eyebrow {
  font: 500 14px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.vg-title h1 {
  font: 700 clamp(64px, 6.6vw, 84px) / 1.04 var(--display);
  letter-spacing: -0.01em;
}
.vg-title h1 span { color: var(--orange); }

.vg-lede {
  font-size: 19px;
  line-height: 1.5;
  color: var(--text);
  text-wrap: pretty;
}
.vg-lede strong { font-weight: 600; white-space: nowrap; } /* Bai Jamjuree is loaded up to 600 */

.vg-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.vg-cta .vg-badge img { height: 54px; }

.vg-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--goal);
  color: var(--goal-ink);
  font: 600 14px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.vg-pill__short { display: none; }

/* ---------------------------------------------------------
   One swipe moves everything.
--------------------------------------------------------- */
.vg-mech { padding: 120px var(--pad) 110px; }
.vg-wrap { max-width: 1200px; margin: 0 auto; }
.vg-mech .vg-wrap { display: flex; flex-direction: column; gap: 56px; }

.vg-mech__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
}

.vg-h2 { font: 700 clamp(40px, 4.7vw, 60px) / 1 var(--display); }
.vg-mech__head p {
  max-width: 480px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

.vg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.vg-card { display: flex; flex-direction: column; gap: 16px; }
.vg-card__board { position: relative; aspect-ratio: 100 / 110; border-radius: 18px; overflow: hidden; background: var(--board); }
.vg-card h3 { font: 600 26px var(--display); }
.vg-card p { font-size: 17px; line-height: 1.5; color: var(--text-2); }

/* ---------------------------------------------------------
   Two ways to play.
--------------------------------------------------------- */
.vg-modes { padding: 90px var(--pad); background: var(--orange); color: var(--ink); }
.vg-modes .vg-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.vg-modes__text { display: flex; flex-direction: column; gap: 20px; }
.vg-modes__text .vg-h2 { font-size: clamp(44px, 5vw, 64px); line-height: 0.95; }
.vg-modes__text p { max-width: 440px; font-size: 19px; line-height: 1.5; }
.vg-modes__text .vg-badge { align-self: flex-start; }
.vg-modes__text .vg-badge img { height: 54px; }

.vg-shots { display: flex; gap: 20px; justify-content: flex-end; align-items: flex-start; }
.vg-shot { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.vg-shot img { display: block; height: 520px; width: auto; }
.vg-shot span {
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font: 600 14px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------
   Gallery: Go on. Solve it.
--------------------------------------------------------- */
.vg-gallery { padding: 120px var(--pad) 110px; }
.vg-gallery .vg-wrap { display: flex; flex-direction: column; gap: 56px; }
.vg-gallery__head { display: flex; flex-direction: column; gap: 18px; }
.vg-gallery__head .vg-h2 span { color: var(--orange); }
.vg-gallery__head p:last-child { max-width: 480px; font-size: 19px; line-height: 1.55; color: var(--text); text-wrap: pretty; }
.vg-gallery__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: start; }
.vg-gallery__row img { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.vg-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  padding: 28px var(--pad);
  font: 500 13px var(--mono);
  color: var(--accent);
}
.vg-footer img { display: block; height: 16px; width: auto; }
.vg-footer__links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.vg-footer__links button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.vg-footer__links button:hover { color: var(--orange); }

/* ---------------------------------------------------------
   Cookie consent banner (behaviour lives in js/main.js)
--------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  padding: 20px 24px;
  background: var(--bg);
  border-top: 1px solid rgba(169, 156, 255, 0.3);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}
.cookie-banner.is-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cookie-banner__text { max-width: 720px; font-size: 15px; line-height: 1.5; color: var(--text); }
.cookie-banner__text a { color: var(--orange); text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner__text a:hover { color: #fff; }
.cookie-banner__actions { display: flex; gap: 12px; flex-shrink: 0; }

.vg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 13px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.vg-btn--ghost { background: transparent; color: var(--text); border-color: rgba(169, 156, 255, 0.45); }
.vg-btn--ghost:hover { border-color: #fff; color: #fff; }
.vg-btn--primary { background: var(--orange); color: var(--ink); }
.vg-btn--primary:hover { background: #ff6a26; color: var(--ink); }

/* ---------------------------------------------------------
   Reduced motion: boards and columns hold still
--------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .vg-track { animation: none !important; }
  .vg-wall__grid { transition: none; }
}

/* ---------------------------------------------------------
   Tablet and below
--------------------------------------------------------- */
@media (max-width: 900px) {
  .vg-mech__head { grid-template-columns: 1fr; gap: 20px; align-items: start; }
  .vg-modes .vg-wrap { grid-template-columns: 1fr; gap: 48px; }
  .vg-shots { justify-content: flex-start; }
  .vg-gallery__row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
}

/* ---------------------------------------------------------
   Mobile (design: 390px)
--------------------------------------------------------- */
@media (max-width: 720px) {
  :root { --pad: 20px; }

  .vg-hero { height: 820px; }
  .vg-wall { top: -120px; bottom: -120px; left: -70px; right: -70px; }

  .vg-nav { padding: 16px; }
  .vg-nav__brand { padding: 10px 12px; }
  .vg-nav__brand img { height: 16px; }
  .vg-menu { display: block; }
  .vg-nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    margin-top: -6px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 8px 16px;
  }
  .vg-nav__links.is-open { display: flex; }
  .vg-nav__links a { padding: 10px 12px; }
  .vg-nav__links a.vg-badge { margin: 8px 0 0 12px; padding: 0; }
  .vg-nav__links .vg-badge img { height: 44px; }

  .vg-title { left: 12px; right: 12px; bottom: 12px; width: auto; gap: 16px; padding: 26px 22px 24px; }
  .vg-eyebrow { font-size: 12px; }
  .vg-title h1 { font-size: clamp(46px, 9vw, 64px); }
  .vg-lede { font-size: 16px; }
  .vg-cta { gap: 10px; }
  .vg-cta .vg-badge img { height: 44px; }
  .vg-pill { height: 44px; gap: 8px; padding: 0 12px; border-radius: 8px; font-size: 11px; }
  .vg-pill__full { display: none; }
  .vg-pill__short { display: inline; }

  .vg-mech { padding: 56px var(--pad); }
  .vg-mech .vg-wrap { gap: 28px; }
  .vg-h2 { font-size: clamp(36px, 8vw, 48px); }
  .vg-mech__head p { font-size: 17px; }

  .vg-cards { grid-template-columns: 1fr; gap: 22px; }
  .vg-card { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 16px; align-items: center; }
  .vg-card h3 { font-size: 21px; margin-bottom: 6px; }
  .vg-card p { font-size: 15px; }

  .vg-modes { padding: 56px var(--pad); }
  .vg-modes .vg-wrap { gap: 36px; }
  .vg-modes__text .vg-h2 { font-size: clamp(40px, 9vw, 56px); }
  .vg-modes__text p { font-size: 17px; }
  .vg-modes__text .vg-badge img { height: 48px; }
  .vg-shots { gap: 12px; justify-content: center; }
  .vg-shot { flex: 1 1 0; min-width: 0; gap: 10px; }
  .vg-shot img { width: 100%; height: auto; }
  .vg-shot span { font-size: 11px; padding: 6px 10px; }

  .vg-gallery { padding: 56px var(--pad); }
  .vg-gallery .vg-wrap { gap: 28px; }
  .vg-gallery__head p:last-child { font-size: 17px; }
  .vg-gallery__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .vg-footer { flex-direction: column; align-items: flex-start; gap: 18px; }

  .cookie-banner { padding: 18px 20px; }
  .cookie-banner__inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .cookie-banner__actions .vg-btn { flex: 1; }
}
