@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --bg: #FCF5E9;
  --bg-alt: #F6E9D2;
  --bg-deep: #F1DCB8;
  --primary: #E8763C;
  --primary-dark: #C85F2A;
  --accent: #2F9E8F;
  --accent-light: #57BEB0;
  --text: #4A3626;
  --text-light: #8A7360;
  --white: #FFFFFF;
  --shadow: 0 12px 32px rgba(74, 54, 38, 0.14);
  --radius: 20px;
  --header-h: 84px;
}

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

html.hide #preloader { opacity: 0; pointer-events: none; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

ul, ol { list-style: none; }

h1, h2, h3 {
  font-family: 'Fredoka', sans-serif;
  color: var(--text);
  line-height: 1.15;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(47, 158, 143, 0.12);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}
#preloader img { width: 60px; height: 60px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 17px;
  padding: 16px 34px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  box-shadow: 0 10px 28px rgba(232, 118, 60, 0.35);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(232, 118, 60, 0.45);
}

/* Header */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  padding: 18px 0;
}
#header.scrolled {
  background: rgba(252, 245, 233, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(74, 54, 38, 0.08);
  padding: 12px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { height: 34px; }
.main-nav { display: flex; align-items: center; gap: 32px; }
.nav-link {
  position: relative;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text);
  padding: 4px 0;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}
.nav-link:hover::after { width: 100%; }

.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 1100;
}
.burger-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger-btn.act span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger-btn.act span:nth-child(2) { opacity: 0; }
.burger-btn.act span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

#mobile-menu {
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 80vw);
  height: 100vh;
  background: var(--bg);
  box-shadow: -10px 0 40px rgba(74, 54, 38, 0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 120px 40px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 990;
}
#mobile-menu.opened { opacity: 1; pointer-events: auto; transform: translateX(0); }
#mobile-menu .nav-link { font-size: 20px; padding: 10px 0; }

body.fixed { overflow: hidden; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(252,245,233,0.55) 0%, rgba(252,245,233,0.85) 85%, var(--bg) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
}
.hero-content h1 {
  font-size: clamp(40px, 5.5vw, 68px);
  margin-bottom: 18px;
}
.hero-sub {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: 34px;
}
.hero-visual { display: flex; justify-content: center; }
.hero-tiles {
  max-width: 520px;
  animation: floatTile 3s ease-in-out infinite;
}
.btn-primary { animation: floatBtn 3s ease-in-out infinite; }
.btn-primary:hover { animation-play-state: paused; }

@keyframes floatBtn {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes floatTile {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Generic section spacing */
section { padding: 110px 0; }

.section-head { max-width: 700px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); }
.section-intro { margin-top: 16px; color: var(--text-light); font-size: 18px; }
.section-note {
  margin-top: 32px;
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Premise */
.premise { background: var(--bg-alt); }
.premise-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}
.premise-text h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 22px; }
.premise-text p { color: var(--text-light); margin-bottom: 16px; font-size: 17px; }
.premise-image img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Gameplay */
.gameplay-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}
.gameplay-list { display: flex; flex-direction: column; gap: 18px; }
.gameplay-list li {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 6px 18px rgba(74, 54, 38, 0.08);
  font-weight: 700;
  font-size: 17px;
}
.step-num {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  color: var(--primary);
  background: rgba(232, 118, 60, 0.12);
  min-width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.gameplay-image img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Elements */
.elements { background: var(--bg-alt); }
.elements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: 0 6px 18px rgba(74, 54, 38, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  margin-bottom: 18px;
}
.stat-icon svg { width: 26px; height: 26px; }
.stat-card h3 { font-size: 18px; font-weight: 600; }

/* Journey */
.journey-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}
.journey-image img { border-radius: var(--radius); box-shadow: var(--shadow); }
.journey-text h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 26px; }
.journey-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; }
.journey-steps li {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 700;
  font-size: 17px;
}
.journey-steps .step-num {
  background: var(--accent);
  color: var(--white);
  min-width: 34px;
  height: 34px;
  font-size: 15px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(74, 54, 38, 0.1);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.gallery-item-wide { grid-column: span 2; }
.gallery-item-wide img { aspect-ratio: 16/7.2; }
.gallery-item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 20px;
  background: linear-gradient(180deg, transparent, rgba(74,54,38,0.75));
  color: var(--white);
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 15px;
}

/* Contact */
.contact {
  position: relative;
  text-align: center;
  overflow: hidden;
  color: var(--white);
}
.contact-bg { position: absolute; inset: 0; z-index: 0; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; }
.contact-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(74,54,38,0.55), rgba(74,54,38,0.8));
}
.contact-inner { position: relative; z-index: 1; }
.contact .eyebrow { background: rgba(255,255,255,0.16); color: var(--white); }
.contact h2 {
  color: var(--white);
  font-size: clamp(30px, 4.2vw, 46px);
  margin-bottom: 32px;
}

/* Footer */
#footer { background: var(--bg-deep); padding: 44px 0; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links { display: flex; gap: 26px; }
.footer-links a { font-weight: 600; font-size: 15px; }
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 14px; color: var(--text-light); width: 100%; text-align: center; order: 3; }

/* Legal pages */
.legal-page { padding-top: calc(var(--header-h) + 60px); }
.legal-content { max-width: 820px; }
.legal-content h1 { font-size: 40px; margin-bottom: 10px; }
.legal-content section { padding: 28px 0 0; }
.legal-content h2 { font-size: 24px; margin-bottom: 12px; }
.legal-content h3 { font-size: 19px; margin: 16px 0 8px; }
.legal-content p, .legal-content li { color: var(--text-light); margin-bottom: 10px; }
.legal-content ul { padding-left: 22px; list-style: disc; }
.legal-content a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.legal-content a:hover,
.legal-content a:focus-visible { color: var(--primary); text-decoration-color: var(--primary); }

/* Responsive */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .burger-btn { display: flex; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-visual { order: -1; }
  .hero-tiles { max-width: 340px; }
  .premise-inner, .gameplay-inner, .journey-inner { grid-template-columns: 1fr; }
  .journey-image { order: -1; }
  .elements-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item-wide { grid-column: span 2; }
}

@media (max-width: 768px) {
  section { padding: 76px 0; }
  .elements-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item-wide { grid-column: span 1; }
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 640px) {
  .hero-content h1 { font-size: 34px; }
  .btn { padding: 14px 26px; font-size: 15px; }
  #mobile-menu { padding: 100px 28px; width: 100%; }
}
