/* ============================================
   In The Wild Match 3 — Landing Page Styles
   ============================================ */

:root {
  --green: #76a627;
  --green-dark: #5a8020;
  --green-glow: rgba(118, 166, 39, 0.45);
  --tan: #e8d5b5;
  --tan-muted: rgba(232, 213, 181, 0.7);
  --bg-dark: #0a0f0a;
  --white: #ffffff;
  --font-display: 'Outfit', sans-serif;
  --font-hero: 'Raleway', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--tan);
  overflow-x: hidden;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

.container--narrow {
  width: min(480px, 92vw);
}

/* Film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   Hero
   ============================================ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__layer {
  position: absolute;
  inset: 0;
}

.hero__layer--photo {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__layer--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero__layer--overlay {
  background: linear-gradient(
    180deg,
    rgba(8, 8, 12, 0.5) 0%,
    rgba(8, 8, 12, 0.1) 40%,
    transparent 55%,
    rgba(10, 15, 10, 0.55) 100%
  );
}

.hero__layer--vignette {
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
}

/* Mist animation */
.hero__mist {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero__mist span {
  position: absolute;
  bottom: 0;
  width: 200%;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(200, 210, 200, 0.06));
  animation: mist-drift 18s linear infinite;
}

.hero__mist span:nth-child(1) { left: -50%; animation-duration: 22s; opacity: 0.5; }
.hero__mist span:nth-child(2) { left: -30%; animation-duration: 16s; animation-delay: -6s; opacity: 0.3; height: 30%; }
.hero__mist span:nth-child(3) { left: -70%; animation-duration: 26s; animation-delay: -12s; opacity: 0.4; height: 25%; }

@keyframes mist-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(25%); }
}

/* Nav */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 4vw;
  animation: fade-down 1s var(--ease-out) 0.2s both;
}

.nav__logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-hero);
  font-weight: 900;
  color: var(--white);
  text-transform: uppercase;
  line-height: 0.95;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.nav__logo-line {
  display: block;
  font-size: clamp(0.65rem, 2vw, 0.85rem);
  letter-spacing: 0.12em;
}

.nav__logo-line:nth-child(2) {
  font-size: clamp(0.9rem, 2.8vw, 1.15rem);
  letter-spacing: 0.08em;
}

.nav__logo-line--sub {
  font-size: clamp(0.45rem, 1.2vw, 0.55rem);
  letter-spacing: 0.25em;
  color: var(--tan-muted);
}

.nav__cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.nav__cta:hover {
  background: var(--green);
  color: var(--bg-dark);
  box-shadow: 0 0 24px var(--green-glow);
}

/* Hero content */
.hero__content {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 6rem;
}

.hero__title-wrap {
  margin-bottom: 1rem;
}

.hero__title {
  font-family: var(--font-hero);
  font-weight: 900;
  color: var(--white);
  text-transform: uppercase;
  line-height: 0.95;
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(255, 255, 255, 0.1);
}

.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
  animation: title-reveal 0.9s var(--ease-out) forwards;
}

.hero__title-line--1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: 0.15em;
  animation-delay: 0.4s;
}

.hero__title-line--2 {
  font-size: clamp(4rem, 14vw, 8rem);
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ffffff 55%, #f4f4f4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
  animation-delay: 0.6s;
}

.hero__title-line--3 {
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 0.35em;
  color: var(--tan-muted);
  -webkit-text-fill-color: var(--tan-muted);
  animation-delay: 0.85s;
}

@keyframes title-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__tagline {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  color: var(--white);
  max-width: 28ch;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 1.1s both;
}

/* Play button */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  background: linear-gradient(180deg, #8ec832 0%, var(--green) 50%, var(--green-dark) 100%);
  border: 3px solid var(--green-dark);
  border-radius: 16px;
  padding: 0.9rem 2.8rem;
  box-shadow:
    0 4px 0 var(--green-dark),
    0 8px 32px var(--green-glow);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fade-up 0.8s var(--ease-out) 1.3s both, pulse-glow 3s ease-in-out 2.5s infinite;
}

.btn-play:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 6px 0 var(--green-dark),
    0 12px 48px var(--green-glow);
}

.btn-play:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 var(--green-dark),
    0 4px 16px var(--green-glow);
}

.btn-play--large {
  font-size: 1.4rem;
  padding: 1rem 3.2rem;
}

.btn-play__icon {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 0 var(--green-dark), 0 8px 32px var(--green-glow); }
  50% { box-shadow: 0 4px 0 var(--green-dark), 0 8px 48px rgba(118, 166, 39, 0.7); }
}

.hero__platforms {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 1.5s both;
}

.hero__platforms-note {
  font-size: 0.85rem;
  color: rgba(232, 213, 181, 0.55);
  letter-spacing: 0.05em;
}

.hero__platforms-logos {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.hero__platform {
  display: flex;
  color: rgba(255, 255, 255, 0.85);
}

.hero__platform svg {
  display: block;
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.hero__platform svg path,
.hero__platform svg circle {
  fill: currentColor;
}

/* Scroll indicator */
/* Game icon wave */
.hero__icon-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.hero__icon-wave img {
  position: absolute;
  bottom: 6px;
  left: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  will-change: transform, opacity;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tan-muted);
  opacity: 0;
  animation: fade-up 0.8s var(--ease-out) 2s both;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--green), transparent);
  animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
  0%, 100% { transform: scaleY(0.3); opacity: 0.3; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Sections
   ============================================ */

.section {
  position: relative;
  padding: clamp(4rem, 10vw, 7rem) 0;
}

.section--gameplay {
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(30, 60, 20, 0.15), transparent),
    var(--bg-dark);
}

.section--cta {
  position: relative;
  padding: clamp(5rem, 12vw, 8rem) 0;
  overflow: hidden;
}

.section__header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3.5rem;
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1rem;
}

.section__desc {
  color: var(--tan-muted);
  font-size: 1.05rem;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Gameplay section
   ============================================ */

.gameplay-grid {
  display: flex;
  justify-content: center;
}

.phone-frame {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  border: 3px solid rgba(118, 166, 39, 0.3);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.6);
}

.phone-frame__glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, var(--green-glow), transparent 70%);
  animation: phone-glow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes phone-glow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* ============================================
   CTA
   ============================================ */

.cta__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(118, 166, 39, 0.12), transparent),
    linear-gradient(180deg, var(--bg-dark), #0f1808);
}

.cta {
  position: relative;
  text-align: center;
}

.cta__logo {
  width: clamp(140px, 25vw, 200px);
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
}

.cta__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 1rem;
}

.cta__desc {
  max-width: 480px;
  margin: 0 auto 2rem;
  color: var(--tan-muted);
  font-size: 1.05rem;
}

.cta__buttons {
  margin-bottom: 1.5rem;
}

.cta__note {
  font-size: 0.85rem;
  color: rgba(232, 213, 181, 0.4);
  letter-spacing: 0.05em;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.footer__logo {
  width: 80px;
  margin: 0 auto 1rem;
  opacity: 0.6;
}

.footer__copy {
  font-size: 0.8rem;
  color: rgba(232, 213, 181, 0.35);
}

/* ============================================
   Particles canvas
   ============================================ */

#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .phone-frame {
    max-width: 260px;
  }

  .hero__content {
    padding-bottom: 5rem;
  }

  .nav__cta {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__mist span {
    display: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
