/* Fluid Sort Puzzle — glassmorphic landing (lavender / periwinkle system) */

:root {
  --grad-top: #c4b5fd;
  --grad-mid: #8b7cf8;
  --grad-bottom: #6d5ae8;
  --accent: #5d8bf4;
  --accent-hover: #4a7ae8;
  --cta-warm: #f97316;
  --cta-warm-hover: #ea580c;
  --glass: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.55);
  --text: #1e1b4b;
  --text-muted: #475569;
  --white: #ffffff;
  --shadow-soft: 0 18px 50px rgba(49, 46, 129, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(165deg, var(--grad-top) 0%, var(--grad-mid) 45%, var(--grad-bottom) 100%);
  background-attachment: fixed;
}

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

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

button {
  font-family: inherit;
}

/* Background blobs */
.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.blob--a {
  width: 420px;
  height: 420px;
  background: #fcd34d;
  top: -120px;
  right: -80px;
}

.blob--b {
  width: 360px;
  height: 360px;
  background: #67e8f9;
  bottom: 10%;
  left: -100px;
}

.blob--c {
  width: 300px;
  height: 300px;
  background: #fda4af;
  bottom: -80px;
  right: 20%;
}

.shell {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Glass panels */
.glass-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 0;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(49, 46, 129, 0.12);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.9;
}

.brand__img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(49, 46, 129, 0.2);
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.site-header.is-scrolled .brand__text {
  color: var(--text);
  text-shadow: none;
}

.nav--desktop .nav__list {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav--desktop a {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav--desktop a:hover {
  color: var(--white);
}

.site-header.is-scrolled .nav--desktop a {
  color: var(--text-muted);
}

.site-header.is-scrolled .nav--desktop a:hover {
  color: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
}

.site-header.is-scrolled .menu-toggle {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
}

.site-header.is-scrolled .menu-toggle:hover {
  background: rgba(99, 102, 241, 0.2);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: calc(var(--header-h) + 0.5rem) 1.25rem 1.25rem;
  background: rgba(30, 27, 75, 0.35);
  backdrop-filter: blur(4px);
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer__panel {
  padding: 1.5rem;
  max-width: 360px;
  margin-left: auto;
}

.mobile-drawer__list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.mobile-drawer__list a {
  display: block;
  padding: 0.85rem 0;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: color 0.2s ease;
}

.mobile-drawer__list a:hover {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--cta-warm), #fb923c);
  color: var(--white);
  box-shadow: 0 10px 28px rgba(249, 115, 22, 0.35);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--cta-warm-hover), #f97316);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.45);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.32);
}

.site-header.is-scrolled .btn--ghost {
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.6);
}

.site-header.is-scrolled .btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--sm {
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
}

.btn--block {
  width: 100%;
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 8vw, 5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.hero__copy {
  color: var(--white);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
  margin: 0 0 0.75rem;
}

.eyebrow--on-dark {
  color: rgba(255, 255, 255, 0.85);
}

.eyebrow--muted {
  color: var(--accent);
  letter-spacing: 0.08em;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 1rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.12);
}

.hero__lead {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  max-width: 34ch;
  opacity: 0.95;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.hero__badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.92;
}

.hero__badges li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero__badges svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Hero visual */
.hero__stage {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.phone-frame {
  position: relative;
  width: min(280px, 72vw);
  padding: 12px;
  border-radius: 36px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.15));
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), var(--shadow-soft);
}

.phone-frame__notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 26px;
  background: #1e1b4b;
  border-radius: 0 0 16px 16px;
  z-index: 2;
}

.phone-frame__shot {
  border-radius: 26px;
  width: 100%;
  aspect-ratio: 280 / 600;
  object-fit: cover;
  background: #e8e4ff;
}

/* Decorative tubes (CSS only) */
.tube-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.tube {
  width: 44px;
  height: 100px;
  border-radius: 12px 12px 22px 22px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(49, 46, 129, 0.15);
}

.tube__fill {
  height: 38%;
  width: 100%;
}

.tube__fill--mint {
  background: #6ee7b7;
}

.tube__fill--sky {
  background: #7dd3fc;
}

.tube__fill--sun {
  background: #fde047;
}

.tube__fill--coral {
  background: #fb923c;
}

/* Sections */
.section {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
  color: var(--white);
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin: 0;
  line-height:1.2;
}

.section__title--tight {
  color: var(--text);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature-card {
  padding: 1.5rem 1.5rem 1.65rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 55px rgba(49, 46, 129, 0.22);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(93, 139, 244, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-card__icon svg {
  width: 24px;
  height: 24px;
}

.feature-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.feature-card__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Screenshots gallery */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.screenshot-card {
  margin: 0;
  padding: 0.65rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.screenshot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 55px rgba(49, 46, 129, 0.22);
}

.screenshot-card img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
}

/* Download */
.download__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
}

.download__sub {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
}

.download__stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.store-btn:hover {
  background: var(--white);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.store-btn svg {
  width: 22px;
  height: 22px;
}

.store-btn--play {
  border-color: rgba(93, 139, 244, 0.45);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.footer__grid {
  display: grid;
  gap: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
}

.brand__text--footer {
  text-shadow: none;
}

.footer__tag {
  margin: 0.35rem 0 0;
  opacity: 0.85;
  font-size: 0.95rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.footer__links a {
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  transition: text-decoration-color 0.2s ease, opacity 0.2s ease;
}

.footer__links a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

.footer__copy {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.75;
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 27, 75, 0.45);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 1.75rem 1.75rem 1.5rem;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal__close:hover {
  background: rgba(99, 102, 241, 0.2);
}

.modal__close svg {
  width: 20px;
  height: 20px;
}

.modal__title {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
}

.modal__body {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

body.modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__copy {
    order: 1;
  }

  .hero__visual {
    order: 0;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__badges {
    align-items: center;
  }

  .nav--desktop {
    display: none;
  }

  .header__actions .btn--sm {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .screenshot-grid {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin-inline: auto;
  }

  .download__card {
    flex-direction: column;
    text-align: center;
  }

  .download__stores {
    justify-content: center;
  }
}

@media (min-width: 640px) and (max-width: 900px) {
  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
    width: min(680px, 100%);
    margin-inline: auto;
  }
}

@media (min-width: 901px) {
  .menu-toggle {
    display: none;
  }

  .mobile-drawer {
    display: none !important;
  }
}
