/* ============================================================
   MELLO — Shared Design System
   Cosmic dreamy meets warm approachable
   ============================================================ */

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

:root {
  /* Core palette — cosmic dark */
  --deep:        #0d0420;
  --deep-2:      #1a0a2e;
  --mid:         #2b1150;
  --mid-2:       #3d1b6e;
  --purple:      #5b2d8e;
  --purple-lt:   #8b5cd6;
  --lavender:    #c8b8f5;
  --lavender-lt: #e4dcff;
  --mint:        #6ee7b7;
  --mint-dk:     #34c796;
  --mint-glow:   rgba(110, 231, 183, 0.35);
  --peach:       #ffb3a7;
  --gold:        #ffd56b;
  --pink:        #f0a5d1;
  --blue:        #8fc9ff;
  --star:        #fff6d6;

  /* Ink on dark */
  --ink:         #fefaff;
  --ink-muted:   #c8b8f5;
  --ink-dim:     #8a7bb8;
  --ink-on-mint: #0d2818;

  /* Surfaces */
  --surface:       rgba(91, 45, 142, 0.18);
  --surface-2:     rgba(139, 92, 214, 0.12);
  --surface-solid: #1a0a2e;
  --card:          #22123f;
  --card-lt:       #2d1955;
  --border:        rgba(200, 184, 245, 0.18);
  --border-strong: rgba(200, 184, 245, 0.4);

  /* Typography */
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body:    'Plus Jakarta Sans', 'Nunito', system-ui, sans-serif;

  /* Retro shadow */
  --shadow-offset: 4px;
  --shadow-color:  #0d0420;
  --shadow-accent: #6ee7b7;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-full: 999px;

  /* Motion */
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  /* Star density (tweakable) */
  --star-density: 1;
  --bg-darkness: 1;
}

/* ============================================================
   Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  background: var(--deep);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(91, 45, 142, 0.6), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(110, 231, 183, 0.08), transparent 60%),
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(139, 92, 214, 0.25), transparent 60%),
    linear-gradient(180deg, #0d0420 0%, #1a0a2e 40%, #0d0420 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Stars canvas layer */
#stars-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

main, header, footer, section {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Type
   ============================================================ */

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(44px, 6.2vw, 84px); font-weight: 600; letter-spacing: -0.03em; }
h2 { font-size: clamp(34px, 4.2vw, 56px); }
h3 { font-size: clamp(24px, 2.4vw, 32px); }
h4 { font-size: 20px; }

p { margin: 0; text-wrap: pretty; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
  padding: 6px 14px;
  background: rgba(110, 231, 183, 0.1);
  border: 1.5px solid rgba(110, 231, 183, 0.3);
  border-radius: var(--r-full);
}

.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--ink-muted);
  line-height: 1.55;
  max-width: 58ch;
}

.muted { color: var(--ink-muted); }

.mint-text { color: var(--mint); }
.gradient-text {
  background: linear-gradient(120deg, #6ee7b7 0%, #c8b8f5 50%, #f0a5d1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.container-wide {
  width: min(1360px, 94%);
  margin: 0 auto;
}

section {
  padding: clamp(60px, 9vw, 120px) 0;
}

.stack { display: flex; flex-direction: column; }
.stack-2 > * + * { margin-top: 8px; }
.stack-3 > * + * { margin-top: 12px; }
.stack-4 > * + * { margin-top: 16px; }
.stack-6 > * + * { margin-top: 24px; }
.stack-8 > * + * { margin-top: 32px; }

/* ============================================================
   Buttons (retro offset shadow)
   ============================================================ */

.btn {
  --bg: var(--mint);
  --fg: var(--ink-on-mint);
  --border-color: #0d0420;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--border-color);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--border-color);
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
  position: relative;
  white-space: nowrap;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 var(--border-color);
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: calc(var(--shadow-offset) - 2px) calc(var(--shadow-offset) - 2px) 0 var(--border-color);
}
.btn--ghost {
  --bg: transparent;
  --fg: var(--ink);
  --border-color: var(--lavender);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--purple);
}
.btn--ghost:hover {
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 var(--purple);
}
.btn--purple {
  --bg: var(--purple-lt);
  --fg: #fff;
  --border-color: #0d0420;
}
.btn--lg { padding: 18px 32px; font-size: 16px; }
.btn--sm { padding: 10px 18px; font-size: 13px; }

/* App Store badges */
.badges {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.badge-store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 16px;
  background: #0b0218;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(255,255,255,0.9);
  text-decoration: none;
  font-family: var(--font-body);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
  min-width: 172px;
}
.badge-store:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(255,255,255,0.9);
}
.badge-store__icon { width: 28px; height: 28px; flex-shrink: 0; }
.badge-store__text { display: flex; flex-direction: column; line-height: 1.1; }
.badge-store__small { font-size: 10px; opacity: 0.8; letter-spacing: 0.02em; }
.badge-store__big   { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--font-display); }

/* ============================================================
   Cards (retro offset)
   ============================================================ */

.card {
  background: var(--card);
  border: 2px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(13, 4, 32, 0.9);
  padding: 28px;
  position: relative;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.card--tilt:hover {
  transform: translate(-2px, -4px) rotate(-0.4deg);
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 4px) 0 rgba(13, 4, 32, 0.9);
}
.card--mint {
  background: linear-gradient(135deg, #6ee7b7 0%, #34c796 100%);
  color: var(--ink-on-mint);
  border-color: #0d0420;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 #0d0420;
}
.card--lav {
  background: linear-gradient(135deg, #3d1b6e 0%, #5b2d8e 100%);
  border-color: rgba(200, 184, 245, 0.35);
}
.card--hl {
  border-color: var(--mint);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--mint);
}

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(13, 4, 32, 0.75);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--border);
}
.nav__inner {
  width: min(1300px, 94%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.logo__mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6ee7b7, #34c796);
  border: 2px solid #0d0420;
  box-shadow: 2px 2px 0 #0d0420;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__links a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--r-full);
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--ink); background: rgba(200, 184, 245, 0.08); }
.nav__links a.is-active { color: var(--mint); }

.nav__right { display: flex; align-items: center; gap: 12px; }

.nav__burger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: transparent;
  border: 2px solid var(--lavender);
  color: var(--ink);
  cursor: pointer;
  place-items: center;
}

/* mobile */
@media (max-width: 860px) {
  .nav__links, .nav__right .btn { display: none; }
  .nav__burger { display: grid; }
  .nav.is-open .nav__links {
    display: flex;
    position: absolute;
    top: 100%; left: 4%; right: 4%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(13, 4, 32, 0.96);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: 4px 4px 0 rgba(13, 4, 32, 0.9);
    padding: 12px;
    margin-top: 8px;
  }
  .nav.is-open .nav__links a { padding: 12px 16px; }
}

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

.footer {
  position: relative;
  padding: 80px 0 32px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 800px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
.footer__col h5 {
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mint);
  margin-bottom: 16px;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: 10px; }
.footer__col a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 15px;
  transition: color .2s;
}
.footer__col a:hover { color: var(--mint); }
.footer__blurb {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 16px 0 20px;
  max-width: 32ch;
}
.footer__social {
  display: flex;
  gap: 10px;
}
.footer__social a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--ink-muted);
  transition: transform .2s, color .2s, border-color .2s;
}
.footer__social a:hover {
  color: var(--mint);
  border-color: var(--mint);
  transform: translateY(-2px);
}
.footer__bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-dim);
  font-size: 13px;
}
.footer__bottom a { color: var(--ink-dim); text-decoration: none; margin-left: 18px; }
.footer__bottom a:hover { color: var(--mint); }

/* ============================================================
   Utilities
   ============================================================ */

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.wrap { flex-wrap: wrap; }

.center-text { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  border: 0;
  margin: 48px 0;
}

/* Reveal on scroll — staged in with a small fade. Always visible by default. */
.reveal {
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-hidden {
  opacity: 0;
  transform: translateY(24px);
}

/* Floating orbs / gradient glows */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.glow--mint { background: radial-gradient(circle, rgba(110, 231, 183, 0.4), transparent 70%); }
.glow--purple { background: radial-gradient(circle, rgba(139, 92, 214, 0.55), transparent 70%); }
.glow--pink { background: radial-gradient(circle, rgba(240, 165, 209, 0.3), transparent 70%); }

/* Floating emoji decorations */
.floaty {
  position: absolute;
  font-size: 28px;
  pointer-events: none;
  animation: floaty 6s ease-in-out infinite;
}
.floaty:nth-child(2) { animation-delay: -2s; animation-duration: 7s; }
.floaty:nth-child(3) { animation-delay: -4s; animation-duration: 8s; }
.floaty:nth-child(4) { animation-delay: -1s; animation-duration: 6.5s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

/* ============================================================
   Tweaks panel
   ============================================================ */

.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: 320px;
  background: rgba(13, 4, 32, 0.96);
  backdrop-filter: blur(20px);
  border: 2px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 6px 6px 0 rgba(0,0,0,0.9);
  padding: 0;
  display: none;
  font-family: var(--font-body);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  flex-direction: column;
}
.tweaks.is-on { display: flex; }
.tweaks__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tweaks__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.tweaks__close {
  background: none;
  border: 0;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
}
.tweaks__body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tweak {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tweak__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.tweak__swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tweak__swatch {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  position: relative;
  transition: transform .15s;
}
.tweak__swatch:hover { transform: scale(1.1); }
.tweak__swatch.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink-on-mint), 0 0 0 4px var(--ink); }

.tweak__options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tweak__opt {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  font-family: inherit;
}
.tweak__opt.is-on {
  background: var(--mint);
  color: var(--ink-on-mint);
  border-color: var(--mint);
}

.tweak__slider {
  width: 100%;
  accent-color: var(--mint);
}

/* Tweak: shadow offset */
.btn, .card, .badge-store, .phone-mock, .logo__mark {
  /* use var(--shadow-offset) so tweak slider takes effect */
}

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