/* ==========================================================================
   Match Land — matchlandgame.com
   Modern rebuild of the original racecatgames.com (2017).
   Same look & content; contemporary CSS (custom properties, grid,
   scroll-driven parallax, snappy reveal animations, zero frameworks).
   ========================================================================== */

/* ------------------------------------------------------------- fonts ---- */

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/baloo-2-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/baloo-2-latin-800-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/roboto-latin-300-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/roboto-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/roboto-latin-500-normal.woff2') format('woff2');
}

/* ------------------------------------------------------------------ tokens */

:root {
  --green: #5CD489;
  --green-dark: #2ecc71;
  --green-toast: #7DD286;
  --heading: #888;
  --note: #999;
  --text-muted: #777;
  --section-light: #f8f8f8;
  --overlay: rgba(0, 0, 0, .6);
  --radius: 5px;
  --font-display: 'Baloo 2', 'Roboto', system-ui, sans-serif;

  /* snappy motion */
  --ease-spring: cubic-bezier(.22, 1.28, .42, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --speed: .45s;
}

/* ------------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Roboto', system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: inline-block; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  margin: 0;
}

section h2 {
  text-align: center;
  color: #666;
  letter-spacing: -.3px;
}

h1 strong, h2 strong { font-weight: 800; }

.section-note {
  margin: 0;
  text-align: center;
  display: block;
  font-size: 16px;
  color: var(--note);
  font-weight: 300;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ------------------------------------------------- reveal & intro motion */

[data-reveal], [data-intro] {
  opacity: 0;
  transition:
    opacity var(--speed) var(--ease-out),
    transform var(--speed) var(--ease-spring);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

[data-intro] { transition-delay: var(--intro-delay, 0s); }

[data-reveal="pop"], [data-intro="pop"] { transform: scale(.9); }
[data-reveal="up"],  [data-intro="up"]  { transform: translateY(26px); }
[data-reveal="down"],[data-intro="down"]{ transform: translateY(-22px); }

.is-visible[data-reveal], .is-visible[data-intro] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-intro] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- parallax */

#home, #downloads {
  position: relative;
  overflow: hidden;   /* clip the oversized parallax layer */
  isolation: isolate;
}

.parallax-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
}

#home .parallax-media { background-image: url('../img/bg/bg-2.webp'); }
#downloads .parallax-media { background-image: url('../img/bg/bg-1.webp'); }

/* Modern scroll-driven parallax (Chrome/Edge/Safari 26+), graceful static
   fallback everywhere else. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    #home .parallax-media {
      height: 140%;
      animation: parallax-hero linear both;
      animation-timeline: view();
      animation-range: exit;
    }
    #downloads .parallax-media {
      top: -15%;
      height: 130%;
      animation: parallax-band linear both;
      animation-timeline: view();
    }
  }
}

@keyframes parallax-hero {
  to { transform: translateY(-18%); }
}

@keyframes parallax-band {
  from { transform: translateY(-7%); }
  to   { transform: translateY(7%); }
}

/* ------------------------------------------------------------------- home */

#home .background-overlay {
  background-color: var(--overlay);
  padding: 64px 0 0;
}

.big-logo {
  margin: 0 auto 10px;
  display: block;
}

.big-logo { will-change: transform; }

.hero-columns {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: end;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  column-gap: 48px;
}

#home .left-column,
#home .right-column {
  margin-top: 40px;
  min-width: 0;
}

#home .left-column {
  padding-bottom: 96px;   /* keeps the store badges off the section edge */
}

#home h1 {
  margin: 0 0 22px;
  color: #fff;
  font-size: clamp(2.1rem, 1.3rem + 2.4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -.5px;
  text-align: left;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

#home h1 .accent { color: var(--green); }

.hero-description {
  margin: 0 0 38px;
  color: #fff;
  text-align: left;
  font-size: 16.5px;
  font-weight: 400;
  opacity: .82;
  line-height: 1.75;
  max-width: 480px;
}

.download-button-container {
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
  transition: transform .18s var(--ease-spring), filter .18s ease, box-shadow .18s ease;
}

.store-badge:hover {
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.1);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .35);
}
.store-badge:active { transform: scale(.96); }

/* phone mockup — anchored flush to the hero's bottom edge */
.right-column {
  display: flex;
  justify-content: center;
}

.iphone-container {
  width: 315px;
  height: 552px;
  background: url('../img/mockup/iphone-modern.webp') top center no-repeat;
  background-size: 315px;
  position: relative;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45));
}

@media (max-width: 991px) {
  .hero-columns { grid-template-columns: 1fr; }

  #home .left-column { padding-bottom: 0; }

  #home h1,
  .hero-description { text-align: center; }

  .hero-description { margin-left: auto; margin-right: auto; }

  .download-button-container { justify-content: center; }

  #home .right-column { margin-top: 56px; }

  .iphone-container {
    width: 250px;
    height: 436px;
    background-size: 250px;
  }
}

@media (max-width: 768px) {
  #home .right-column { display: none; }
  #home .background-overlay { padding-bottom: 80px; }
}

@media (max-width: 480px) {
  #home .background-overlay { padding: 56px 0 70px; }

  .hero-columns { padding: 0 22px; }

  .big-logo { width: 208px; height: 222px; margin-bottom: 26px; }

  .hero-description { font-size: 15px; margin-bottom: 30px; }
}

/* ---------------------------------------------------------- colored line */

.container-colored-line {
  position: relative;
  height: 45px;
  width: 300px;
  margin: 10px auto 0;
}

.colored-line {
  position: absolute;
  z-index: 10;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 23px;
  height: 8px;
  border-radius: 10px;
  background: var(--green);
}

.add-colored-line {
  position: absolute;
  top: 23px;
  right: 0;
  width: 100%;
  height: 2px;
  border-radius: 10px;
  background-color: var(--green);
}

@media (max-width: 480px) {
  .container-colored-line { width: 210px; }
  .colored-line { width: 13px; height: 6px; top: 21px; }
}

/* ------------------------------------------------------------ screenshots */

#screenshot {
  background: var(--section-light);
  padding: 75px 0;
}

.carousel { margin-top: 55px; }

.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 30px) / 4);
  gap: 30px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 12px 4px 28px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar { display: none; }

.shot {
  all: unset;
  cursor: zoom-in;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  transition: transform .2s var(--ease-spring), box-shadow .2s ease;
  line-height: 0;
}

.shot img { width: 100%; height: auto; display: block; }

.shot:hover, .shot:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
}

.shot:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

@media (max-width: 1199px) { .carousel-track { grid-auto-columns: calc((100% - 2 * 30px) / 3); } }
@media (max-width: 767px)  { .carousel-track { grid-auto-columns: calc((100% - 24px) / 2); gap: 24px; } }
@media (max-width: 479px)  { .carousel-track { grid-auto-columns: 86%; gap: 18px; } }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.carousel-dots button {
  all: unset;
  cursor: pointer;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d6d6d6;
  transition: background .2s ease, transform .2s var(--ease-spring);
}

.carousel-dots button:hover { transform: scale(1.25); }
.carousel-dots button.active { background: var(--green); }

/* -------------------------------------------------------------- press kit */

#downloads .background-overlay {
  background: var(--overlay);
  padding: 95px 0;
}

#downloads h2 {
  color: #fff;
  opacity: .9;
  margin-bottom: 40px;
}

.container-downloads { text-align: center; }

.download-button {
  display: inline-block;
  padding: 10px 15px;
  border-radius: var(--radius);
  border: 1px solid #fff;
  background: rgba(255, 255, 255, .15);
  line-height: 0;
  transition: background .18s ease, transform .18s var(--ease-spring), box-shadow .18s ease;
}

.download-button:hover {
  background: rgba(255, 255, 255, .25);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
}

.download-button:active { transform: scale(.96); }

/* ---------------------------------------------------------------- contact */

#contact {
  padding: 75px 0;
  position: relative;
}

.contact-form {
  padding: 0;
  width: 500px;
  max-width: 100%;
  margin: 60px auto 0;
  font-weight: 300;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  height: 40px;
  padding-left: 15px;
  border: 2px solid #ccc;
  margin-bottom: 15px;
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
  background: #fff;
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.split-row input { margin-bottom: 15px; }

@media (min-width: 769px) {
  .split-row input[type="text"] {
    border-radius: var(--radius) 0 0 var(--radius);
    position: relative;
    z-index: 2;
  }
  .split-row input[type="email"] {
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-left: -2px;
    width: calc(100% + 2px);
  }
}

@media (max-width: 768px) {
  .split-row { grid-template-columns: 1fr; }
}

.contact-form textarea {
  height: 100px;
  padding-top: 10px;
  margin-bottom: 20px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(92, 212, 137, .18);
  z-index: 3;
}

.form-submit { text-align: center; margin: 25px 0 0; }

.form-submit button {
  font: inherit;
  font-weight: 400;
  height: 50px;
  padding: 0 25px;
  border-radius: var(--radius);
  color: #fff;
  border: none;
  background: var(--green);
  cursor: pointer;
  transition: opacity .15s ease, transform .15s var(--ease-spring), box-shadow .15s ease;
}

.form-submit button:hover { opacity: .85; box-shadow: 0 6px 16px rgba(92, 212, 137, .4); }
.form-submit button:active { transform: scale(.94); }

@media (max-width: 768px) { #contact { padding-left: 20%; padding-right: 20%; } }
@media (max-width: 480px) { #contact { padding-left: 40px; padding-right: 40px; } }

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  top: 70px;
  right: 30px;
  color: #fff;
  padding: 10px 40px 10px 20px;
  background: var(--green-toast);
  border-radius: 19px;
  font-size: 14px;
  font-style: normal;
  opacity: 0;
  z-index: 9999;
  transform: scale(0);
  box-shadow: 0 0 5px 1px rgba(0, 0, 0, .1);
  transition: transform .35s var(--ease-spring), opacity .25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: .95;
  transform: scale(1);
  pointer-events: auto;
}

.toast-close {
  all: unset;
  cursor: pointer;
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 13px;
  background: #fff;
  border-radius: 50%;
  color: var(--green-toast);
}

@media (max-width: 768px) {
  .toast {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 0;
    text-align: center;
    padding-top: 15px;
    height: 52px;
  }
}

/* ----------------------------------------------------------------- footer */

footer {
  padding: 50px 0;
  background: var(--section-light);
  text-align: center;
}

.footer-detail {
  color: var(--text-muted);
  font-weight: 300;
  margin: 0;
}

/* --------------------------------------------------------------- lightbox */

.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(3px);
}

.lightbox[open] { animation: lightbox-in .18s var(--ease-out); }

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox img {
  max-width: min(86vw, 620px);
  max-height: 84vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.lightbox-close,
.lightbox-arrow {
  all: unset;
  cursor: pointer;
  position: fixed;
  color: #fff;
  z-index: 2;
  font-size: 34px;
  line-height: 1;
  width: 44px;
  height: 44px;
  text-align: center;
  border-radius: 50%;
  transition: background .15s ease, transform .15s var(--ease-spring);
}

.lightbox-close:hover,
.lightbox-arrow:hover { background: rgba(255, 255, 255, .15); transform: scale(1.1); }

.lightbox-close { top: 18px; right: 22px; }

.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
}

.lightbox-arrow:hover { transform: translateY(-50%) scale(1.1); }

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

@media (max-width: 600px) {
  .lightbox-arrow { display: none; } /* swipe/keys still work */
}
