@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 {
  --primary: #7B2C9E;
  --primary-dark: #5C1E78;
  --accent: #E84C9A;
  --teal: #2FB6C4;
  --coral: #F2765C;
  --yellow: #F6C453;
  --cream: #FBF3E4;
  --bg: #EEE6F7;
  --bg-alt: #F5EFFB;
  --bg-cream: #FBF5EA;
  --ink: #3A2A4D;
  --ink-soft: #6E5E7E;
  --white: #ffffff;
  --line: #E6D8F2;
  --shadow-sm: 0 4px 14px rgba(91, 30, 120, .08);
  --shadow-md: 0 12px 34px rgba(91, 30, 120, .14);
  --shadow-lg: 0 24px 60px rgba(91, 30, 120, .20);
  --grad: linear-gradient(135deg, #8E3FB0 0%, #E84C9A 100%);
  --grad-teal: linear-gradient(135deg, #2FB6C4 0%, #7B2C9E 100%);
  --radius: 22px;
  --radius-lg: 30px;
  --header-h: 76px;
  --maxw: 1200px;
  --font-head: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

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

html.hide #preloader { display: none; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--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; }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.12; font-weight: 700; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; position: relative; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  color: var(--accent); letter-spacing: 1.5px; text-transform: uppercase;
  font-size: 14px; margin-bottom: 14px;
}
.title-lg { font-size: clamp(30px, 4.2vw, 52px); }
.title-md { font-size: clamp(26px, 3.4vw, 40px); }
.lead { color: var(--ink-soft); font-size: 17px; }

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

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  padding: 15px 30px; border-radius: 100px; cursor: pointer; border: 0;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(232, 76, 154, .35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(232, 76, 154, .45); }
.btn-outline {
  background: #fff; color: var(--primary); border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { transform: translateY(-3px); border-color: var(--primary); color: var(--primary-dark); }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.28); transform: translateY(-3px); }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--header-h);
  display: flex; align-items: center;
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.header.scrolled { background: rgba(251, 245, 234, .92); backdrop-filter: blur(12px); box-shadow: var(--shadow-sm); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--ink); }
.logo img { width: 42px; height: 42px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.logo span { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  position: relative; font-family: var(--font-head); font-weight: 500; font-size: 16px;
  color: var(--ink); padding: 8px 14px; border-radius: 10px; transition: color .2s ease;
}
.nav-link::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--grad); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-link:hover { color: var(--primary); }
.nav-link:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .btn { padding: 11px 22px; font-size: 15px; }

.burger-btn {
  display: none; background: transparent; border: 0; cursor: pointer;
  width: 46px; height: 46px; border-radius: 12px; position: relative; flex-shrink: 0;
}
.burger-btn span { position: absolute; left: 11px; right: 11px; height: 3px; background: var(--primary); border-radius: 3px; transition: transform .3s ease, opacity .2s ease; }
.burger-btn span:nth-child(1) { top: 15px; }
.burger-btn span:nth-child(2) { top: 22px; }
.burger-btn span:nth-child(3) { top: 29px; }
.burger-btn.act span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-btn.act span:nth-child(2) { opacity: 0; }
.burger-btn.act span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
#mobile-menu {
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 999;
  background: var(--bg-cream); padding: 30px 24px;
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0; pointer-events: none; transform: translateY(-12px);
  transition: opacity .3s ease, transform .3s ease;
}
#mobile-menu.opened { opacity: 1; pointer-events: auto; transform: translateY(0); }
#mobile-menu .nav-link { font-size: 20px; padding: 14px 8px; border-bottom: 1px solid var(--line); }
#mobile-menu .nav-link::after { display: none; }
#mobile-menu .btn { margin-top: 20px; }

/* Hero */
.hero {
  position: relative; padding-top: calc(var(--header-h) + 70px); padding-bottom: 90px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center; opacity: .55;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(245,239,251,.4) 0%, rgba(238,230,247,.85) 100%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.6vw, 66px); margin-bottom: 20px; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: clamp(17px, 2vw, 21px); color: var(--ink-soft); max-width: 540px; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-visual { position: relative; display: flex; justify-content: center; }
.device {
  position: relative; width: 300px; max-width: 78%; border-radius: 40px;
  background: #fff; padding: 12px; box-shadow: var(--shadow-lg);
  border: 3px solid #fff; transform: rotate(2.5deg);
}
.device img { border-radius: 30px; width: 100%; }
.float-piece {
  position: absolute; opacity: .95;
  filter: drop-shadow(0 12px 22px rgba(91, 30, 120, .22));
  animation: floaty 5s ease-in-out infinite;
}
.float-piece svg { width: 100%; height: auto; display: block; }
.float-piece.p1 { top: -30px; left: -16px; width: 74px; animation-delay: 0s; }
.float-piece.p2 { bottom: 24px; left: -40px; width: 82px; animation-delay: 1.2s; }
.float-piece.p3 { top: 34px; right: -30px; width: 76px; animation-delay: .6s; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-16px) rotate(6deg); } }

/* Hero levitation on primary button */
.hero-cta .btn-primary { animation: levitate 3s ease-in-out infinite; }
.hero-cta .btn-primary:hover { animation-play-state: paused; }
@keyframes levitate { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Puzzles / collections grid */
.bg-cream { background: var(--bg-cream); }
.bg-alt { background: var(--bg-alt); }
.sec-head { max-width: 720px; margin: 0 auto 54px; text-align: center; }
.sec-head p { margin-top: 16px; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cat-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.cat-thumb { aspect-ratio: 4/3; overflow: hidden; position: relative; background: var(--bg-alt); }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.cat-card:hover .cat-thumb img { transform: scale(1.06); }
.cat-tag {
  position: absolute; top: 12px; left: 12px; background: rgba(123,44,158,.92); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 100px;
}
.cat-body { padding: 18px 20px 22px; }
.cat-body h3 { font-size: 20px; margin-bottom: 4px; }
.cat-body p { color: var(--ink-soft); font-size: 15px; }

.feature-pills { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 44px; }
.pill {
  display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line);
  padding: 11px 20px; border-radius: 100px; font-weight: 600; font-size: 15px; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); flex-shrink: 0; }

/* Two-column feature blocks */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.two-col.rev { grid-template-columns: .6fr 1fr; }
/* .two-col.rev .col-media { order: 2; } */
.col-text h2 { margin-bottom: 18px; }
.col-text p { color: var(--ink-soft); margin-bottom: 16px; }
.col-text .btn { margin-top: 12px; }

.check-list { margin: 24px 0 6px; display: grid; gap: 13px; }
.check-list li { position: relative; padding-left: 38px; color: var(--ink); font-weight: 500; }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 8px;
  background: var(--grad); background-size: cover;
}
.check-list li::after {
  content: ''; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}

.col-media { position: relative; }
.media-card {
  background: #fff; padding: 14px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); transform: rotate(-1.5deg);
}
.media-card.tilt-r { transform: rotate(1.5deg); }
.media-card img { border-radius: 20px; width: 100%; }

/* Difficulty selector */
.diff-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow-md);
}
.diff-panel h4 { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); margin-bottom: 18px; }
.diff-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.chip {
  font-family: var(--font-head); font-weight: 600; font-size: 16px; padding: 12px 20px; border-radius: 14px;
  background: var(--bg-alt); color: var(--primary); border: 2px solid transparent; cursor: default;
}
.chip small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }
.chip.on { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(232,76,154,.32); border: none; }
.chip.on small { color: rgba(255,255,255,.85); }
.progress { height: 12px; background: var(--bg-alt); border-radius: 100px; overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; width: 68%; background: var(--grad-teal); border-radius: 100px; }
.diff-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.saved-tag { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; font-weight: 700; color: var(--teal); font-size: 14px; }
.saved-tag::before { content: ''; width: 18px; height: 18px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(47,182,196,.18); }

/* Final CTA */
.final-cta { position: relative; overflow: hidden; text-align: center; color: #fff; padding: 104px 0; }
.final-cta .cta-bg { position: absolute; inset: 0; z-index: 0; background: var(--grad); }
.final-cta .cta-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 55%); }
.final-cta .wrap { position: relative; z-index: 2; max-width: 760px; }
.final-cta h2 { color: #fff; font-size: clamp(30px, 4.6vw, 50px); margin-bottom: 18px; }
.final-cta p { color: rgba(255,255,255,.92); font-size: 19px; margin-bottom: 32px; }

/* Footer */
.footer { position: relative; color: rgba(255,255,255,.82); padding: 74px 0 30px; overflow: hidden; background: var(--primary-dark); }
.footer-bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: .38; }
.footer::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(59,20,80,.82), rgba(45,15,64,.94)); }
.footer .wrap { position: relative; z-index: 2; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.15); }
.footer .logo { color: #fff; margin-bottom: 16px; }
.footer .logo span { color: #fff; }
.footer-about { max-width: 380px; font-size: 15px; color: rgba(255,255,255,.75); }
.footer h5 { font-family: var(--font-head); color: #fff; font-size: 17px; margin-bottom: 16px; font-weight: 600; }
.footer-links { display: grid; gap: 11px; }
.footer-links a { color: rgba(255,255,255,.78); font-size: 15px; transition: color .2s ease, padding .2s ease; }
.footer-links a:hover { color: #fff; padding-left: 5px; }
.footer-contact a { color: #fff; font-weight: 700; border-bottom: 2px solid rgba(255,255,255,.4); }
.footer-contact a:hover { border-color: #fff; }
.footer-bottom { padding-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 14px; color: rgba(255,255,255,.6); }

/* Legal pages */
.legal-hero { padding: calc(var(--header-h) + 60px) 0 40px; background: var(--bg-alt); text-align: center; }
.legal-hero h1 { font-size: clamp(30px, 4vw, 46px); margin-bottom: 10px; }
.legal-hero .date { color: var(--ink-soft); font-weight: 600; }
.legal-page { padding: 56px 0 90px; background: var(--bg-cream); }
.legal-content { max-width: 860px; margin: 0 auto; background: #fff; padding: 46px clamp(22px, 4vw, 56px); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.legal-content h1 { font-size: 30px; margin-bottom: 8px; }
.legal-content h2 { font-size: 22px; margin: 30px 0 12px; color: var(--primary); }
.legal-content h3 { font-size: 18px; margin: 22px 0 10px; }
.legal-content p { margin-bottom: 14px; color: var(--ink-soft); }
.legal-content ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; color: var(--ink-soft); }
.legal-content li { margin-bottom: 8px; }
.legal-content strong { color: var(--ink); }
.legal-content section { margin-bottom: 8px; }
.legal-content .date { color: var(--ink-soft); font-weight: 600; }
.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) {
  .nav, .header-actions .btn { display: none; }
  .burger-btn { display: block; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .two-col { gap: 40px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .section { padding: 70px 0; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .two-col,
  .two-col.rev { grid-template-columns: 1fr; gap: 34px; }
  .two-col.rev .col-media { order: 0; }
  .col-text { text-align: center; }
  .check-list { text-align: left; max-width: 460px; margin-left: auto; margin-right: auto; }
  .col-text .btn { margin-left: auto; margin-right: auto; }
  .media-card, .device { transform: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .cat-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .diff-panel { padding: 22px; }
}
