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

:root {
  --c-primary: #1f93c7;
  --c-primary-dark: #166a91;
  --c-primary-light: #7fd4f0;
  --c-accent: #ff8a5c;
  --c-accent-2: #ffc24b;
  --c-bg: #f7fbfd;
  --c-bg-alt: #eaf6fb;
  --c-sand: #fdf6ea;
  --c-text: #1d3d4c;
  --c-text-soft: #51707e;
  --c-white: #ffffff;
  --c-border: #d7eaf2;
  --grad-cta: linear-gradient(135deg, #34b3dd 0%, #1f93c7 60%, #1779a8 100%);
  --grad-warm: linear-gradient(135deg, #ffc24b 0%, #ff8a5c 100%);
  --font-head: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --header-h: 80px;
  --shadow-soft: 0 18px 40px rgba(31, 147, 199, 0.12);
  --shadow-card: 0 12px 28px rgba(29, 61, 76, 0.08);
  --radius: 22px;
}

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

html { scroll-behavior: smooth; }
html.hide #preloader { display: none; }

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.65;
  overflow-x: hidden;
}
body.fixed { overflow: hidden; }

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  color: var(--c-text);
}

.section { padding: 100px 0; position: relative; }
.section-alt { background: var(--c-bg-alt); }
.section-sand { background: var(--c-sand); }

.section-title {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.section-title span { color: var(--c-primary); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-primary);
  background: rgba(31, 147, 199, 0.1);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  padding: 15px 34px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-primary {
  background: var(--grad-cta);
  color: var(--c-white);
  box-shadow: 0 12px 26px rgba(31, 147, 199, 0.32);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(31, 147, 199, 0.4); }
.btn-warm {
  background: var(--grad-warm);
  color: var(--c-white);
  box-shadow: 0 12px 26px rgba(255, 138, 92, 0.32);
}
.btn-warm:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(255, 138, 92, 0.4); }
.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border: 2px solid var(--c-primary);
}
.btn-outline:hover { background: var(--c-primary); color: #fff; transform: translateY(-3px); }

@keyframes levitate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.btn-levitate { animation: levitate 3s ease-in-out infinite; }
.btn-levitate:hover { animation-play-state: paused; }

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

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease, height 0.3s ease;
}
.header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(29, 61, 76, 0.08);
  height: 68px;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--c-text);
}
.logo img { width: 40px; height: 40px; }
.logo span { line-height: 1.05; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav-link {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--c-text);
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--c-primary);
  transition: width 0.25s ease;
}
.nav-link:hover { color: var(--c-primary); }
.nav-link:hover::after { width: 100%; }

.header-cta { display: flex; align-items: center; gap: 16px; }
.header-cta .btn { padding: 11px 24px; font-size: 0.95rem; }

.burger-btn {
  display: none;
  background: transparent;
  border: 0;
  width: 42px; height: 42px;
  position: relative;
  cursor: pointer;
  z-index: 1100;
}
.burger-btn span {
  position: absolute;
  left: 9px;
  width: 24px; height: 2.5px;
  border-radius: 2px;
  background: var(--c-text);
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.burger-btn span:nth-child(1) { top: 14px; }
.burger-btn span:nth-child(2) { top: 20px; }
.burger-btn span:nth-child(3) { top: 26px; }
.burger-btn.act span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.burger-btn.act span:nth-child(2) { opacity: 0; }
.burger-btn.act span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* ---------- Mobile menu ---------- */
#mobile-menu {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  background: var(--c-white);
  box-shadow: -16px 0 40px rgba(29, 61, 76, 0.16);
  padding: 110px 34px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 105;
}
#mobile-menu.opened { opacity: 1; transform: translateX(0); pointer-events: auto; }
#mobile-menu .nav-link {
  font-size: 1.15rem;
  padding: 13px 0;
  border-bottom: 1px solid var(--c-border);
}
#mobile-menu .btn { margin-top: 22px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-h) + 40px);
  padding-bottom: 60px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, rgba(247, 251, 253, 0.4), rgba(247, 251, 253, 0.85)), url('../img/hero-bg.webp');
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 140px;
  background: linear-gradient(transparent, var(--c-bg));
  z-index: -1;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero-title {
  font-size: 3.1rem;
  font-weight: 700;
  margin-bottom: 22px;
}
.hero-title span { color: var(--c-primary); }
.hero-text p { color: var(--c-text-soft); margin-bottom: 14px; font-size: 1.05rem; }
.hero-text p.lead { color: var(--c-text); font-weight: 700; font-size: 1.12rem; }
.hero-tagline {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--c-primary-dark);
  margin: 22px 0 26px;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-text);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.pill:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: var(--c-primary-light);
}
.pill::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--grad-warm);
  animation: dot-pulse 1.8s ease-in-out infinite;
}
.hero-pills .pill:nth-child(2)::before { animation-delay: 0.6s; }
.hero-pills .pill:nth-child(3)::before { animation-delay: 1.2s; }
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 138, 92, 0.5); }
  50% { transform: scale(1.3); box-shadow: 0 0 0 5px rgba(255, 138, 92, 0); }
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-visual::before {
  content: '';
  position: absolute;
  width: 78%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 212, 240, 0.55), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -48%);
  z-index: 0;
}
.hero-visual img {
  position: relative;
  z-index: 1;
  max-height: 560px;
  width: auto;
  filter: drop-shadow(0 24px 40px rgba(29, 61, 76, 0.22));
}

/* ---------- Story (2-col) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.split-media {
  position: relative;
}
.split-media::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.split-text p { color: var(--c-text-soft); margin-bottom: 16px; }
.split-text p.lead { color: var(--c-text); font-weight: 700; font-size: 1.1rem; }

/* ---------- Puzzles ---------- */
.center-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.center-head p { color: var(--c-text-soft); margin-top: 6px; }

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }
.feature-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-cta);
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.feature-card:nth-child(even) .feature-icon { background: var(--grad-warm); }
.feature-card h3 { font-size: 1.18rem; margin-bottom: 8px; }
.feature-card p { color: var(--c-text-soft); font-size: 0.96rem; }

.puzzle-note {
  margin-top: 44px;
  text-align: center;
  background: var(--c-white);
  border: 1px dashed var(--c-primary-light);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.puzzle-note p { color: var(--c-text-soft); }
.puzzle-note p.lead { font-family: var(--font-head); font-weight: 600; color: var(--c-text); font-size: 1.15rem; margin-bottom: 6px; }

/* ---------- Rebuild ---------- */
.rebuild-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0 28px;
}
.rebuild-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--c-text);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
.rebuild-list li:hover {
  transform: translateX(7px);
  box-shadow: var(--shadow-soft);
  border-color: var(--c-primary-light);
  background: #fff;
}
.rebuild-list li::before {
  content: '';
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad-warm);
  position: relative;
  transition: transform 0.28s ease;
}
.rebuild-list li:hover::before {
  transform: scale(1.15) rotate(-8deg);
}
.rebuild-list li::after {
  content: '✓';
  position: absolute;
  margin-left: 7px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Play / Game Details ---------- */
.play {
  position: relative;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.play-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(135deg, rgba(22, 106, 145, 0.82), rgba(23, 121, 168, 0.78)), url('../img/image-4.webp');
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.play .container { position: relative; z-index: 1; }
.play .section-title, .play .eyebrow { color: #fff; }
.play .eyebrow { background: rgba(255, 255, 255, 0.18); }
.play-text {
  max-width: 680px;
  margin: 0 auto 30px;
  color: rgba(255, 255, 255, 0.92);
}
.play-text p { margin-bottom: 12px; }
.detail-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 36px;
  max-width: 880px;
}
.detail-pill {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.92rem;
  backdrop-filter: blur(4px);
}
.detail-pill strong { font-family: var(--font-head); color: var(--c-accent-2); margin-right: 6px; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  background: var(--c-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 56px 0 30px;
  overflow: hidden;
}
.footer-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(22, 106, 145, 0.92), rgba(20, 80, 110, 0.96)), url('../img/footer-bg.webp');
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.footer .container { position: relative; z-index: 1; }
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}
.footer-brand img { width: 42px; height: 42px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 26px; }
.footer-links a { font-weight: 700; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--c-accent-2); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 26px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Legal pages ---------- */
.legal-page {
  padding: calc(var(--header-h) + 70px) 0 90px;
  background: var(--c-bg);
}
.legal-content {
  max-width: 860px;
  margin: 0 auto;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 48px 50px;
  box-shadow: var(--shadow-card);
}
.legal-content h1 { font-size: 2.2rem; margin-bottom: 24px; color: var(--c-primary-dark); }
.legal-content h2 { font-size: 1.4rem; margin: 30px 0 12px; }
.legal-content h3 { font-size: 1.12rem; margin: 22px 0 10px; color: var(--c-primary-dark); }
.legal-content p { color: var(--c-text-soft); margin-bottom: 14px; }
.legal-content ul { margin: 0 0 16px 22px; list-style: disc; }
.legal-content li { color: var(--c-text-soft); margin-bottom: 7px; }
.legal-content a { color: var(--c-primary); font-weight: 700; }
.legal-content section { margin-bottom: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav, .header-cta .btn { display: none; }
  .burger-btn { display: block; }
  .hero-title { font-size: 2.6rem; }
  .section-title { font-size: 2.1rem; }
  .puzzle-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 72px 0; }
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-pills, .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-visual img { max-height: 380px; }
  .split { grid-template-columns: 1fr; gap: 34px; }
  .split.reverse .split-media { order: -1; }
  .footer-top { flex-direction: column; text-align: center; }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero-title { font-size: 2.1rem; }
  .section-title { font-size: 1.8rem; }
  .puzzle-grid { grid-template-columns: 1fr; }
  .rebuild-list { grid-template-columns: 1fr; }
  .legal-content { padding: 30px 22px; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
  .footer-brand { flex-direction: column; }
}
