/* ==========================================================================
   LokaKids — shared design system
   Tokens, reset, layout primitives and UI kit used by every page.
   ========================================================================== */

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

button, input, select { font: inherit; color: inherit; }

button { background: none; border: none; cursor: pointer; }

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

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --grape:      #7A5AF8;
    --grape-deep: #5B3FD6;
    --grape-soft: #EDE7FF;
    --bubblegum:  #FF6FA5;
    --bubble-deep:#E63C7E;
    --bubble-soft:#FFE6F0;
    --mint:       #17C3A2;
    --mint-deep:  #0E9C81;
    --mint-soft:  #DDF8F1;
    --sky:        #3BA9F5;
    --sky-deep:   #1B7FCC;
    --sky-soft:   #E1F1FF;
    --sunny:      #FFB627;
    --sunny-deep: #E08A00;
    --sunny-soft: #FFF3D9;
    --coral:      #FF7A59;

    /* Ink & surfaces */
    --ink:        #241B4F;
    --ink-soft:   #574B87;
    --ink-faint:  #8C85B4;
    --surface:    #FFFFFF;
    --surface-2:  #FBF9FF;
    --line:       #EDE8FA;

    /* Shape */
    --r-xs: 12px;
    --r-sm: 18px;
    --r-md: 26px;
    --r-lg: 34px;
    --r-xl: 44px;
    --r-pill: 999px;

    /* Depth — layered, soft, never harsh */
    --shadow-s: 0 2px 6px rgba(36, 27, 79, .06), 0 6px 16px rgba(36, 27, 79, .06);
    --shadow-m: 0 4px 10px rgba(36, 27, 79, .07), 0 14px 32px rgba(36, 27, 79, .10);
    --shadow-l: 0 8px 20px rgba(36, 27, 79, .09), 0 28px 60px rgba(36, 27, 79, .16);
    --shadow-glow: 0 10px 30px rgba(122, 90, 248, .35);

    /* Motion */
    --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
    --ease-out: cubic-bezier(.22, .8, .3, 1);

    /* Rhythm */
    --pad-page: clamp(16px, 4vw, 28px);
    --max: 1120px;
}

/* ── Page canvas ─────────────────────────────────────────────────────── */
body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 600;
    color: var(--ink);
    background: #F4F1FF;
    background-image:
        radial-gradient(1200px 600px at 12% -8%,  #FFE6F0 0%, rgba(255,230,240,0) 60%),
        radial-gradient(1000px 560px at 92% 4%,   #E1F1FF 0%, rgba(225,241,255,0) 62%),
        radial-gradient(900px 520px at 50% 108%,  #DDF8F1 0%, rgba(221,248,241,0) 60%),
        linear-gradient(180deg, #F7F4FF 0%, #F2F6FF 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Fredoka', 'Nunito', sans-serif;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.01em;
}

::selection { background: var(--grape); color: #fff; }

/* Focus: always visible, always cute */
:focus-visible {
    outline: 3px solid var(--grape);
    outline-offset: 3px;
    border-radius: var(--r-xs);
}

/* ── Floating background décor ───────────────────────────────────────── */
.decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(28px);
    opacity: .5;
    animation: floatBlob 18s var(--ease-out) infinite alternate;
}
.blob--1 { width: 320px; height: 320px; background: #FFC9DE; top: -80px; left: -60px; }
.blob--2 { width: 260px; height: 260px; background: #BFE3FF; top: 22%; right: -70px; animation-duration: 22s; }
.blob--3 { width: 300px; height: 300px; background: #C9F5E7; bottom: -90px; left: 18%; animation-duration: 26s; }

.floaty {
    position: absolute;
    font-size: 1.9rem;
    opacity: .32;
    animation: floatUpDown 7s ease-in-out infinite;
    user-select: none;
}

@keyframes floatBlob {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(30px, 40px, 0) scale(1.12); }
}
@keyframes floatUpDown {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-18px) rotate(6deg); }
}

/* ── Shell ───────────────────────────────────────────────────────────── */
.shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad-page);
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, .72);
    border-bottom: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 4px 20px rgba(36, 27, 79, .06);
}

.topbar__inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 10px var(--pad-page);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.brand > span:last-child { min-width: 0; overflow: hidden; }

.brand__mark {
    width: 44px; height: 44px;
    border-radius: 14px;
    background: linear-gradient(150deg, #FFF 0%, #F3ECFF 100%);
    box-shadow: var(--shadow-s);
    display: grid; place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
}
.brand__mark img { width: 36px; height: 36px; object-fit: contain; }

.brand__name {
    display: block;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.22rem;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand__name span { color: var(--grape); }
.brand__tag {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.topbar__spacer { flex: 1; }
.topbar__tools { display: flex; align-items: center; gap: 8px; }

@media (max-width: 560px) {
    .topbar__inner { gap: 8px; }
    .brand__tag { display: none; }
    .brand__name { font-size: 1rem; }
    .brand__mark { width: 38px; height: 38px; border-radius: 12px; }
    .brand__mark img { width: 31px; height: 31px; }
    .star-count { padding: 8px 13px; font-size: .92rem; }
    .btn--icon { width: 42px; height: 42px; font-size: 1.05rem; }
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    line-height: 1;
    padding: 14px 26px;
    min-height: 50px;
    border-radius: var(--r-pill);
    color: var(--ink);
    background: #fff;
    box-shadow: var(--shadow-s);
    transition: transform .18s var(--ease-bounce), box-shadow .18s var(--ease-out), filter .18s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover  { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.btn:active { transform: translateY(0) scale(.97); }

.btn--primary {
    color: #fff;
    background: linear-gradient(140deg, var(--grape) 0%, var(--grape-deep) 100%);
    box-shadow: var(--shadow-glow);
}
.btn--primary:hover { box-shadow: 0 14px 34px rgba(122, 90, 248, .45); }

.btn--candy {
    color: #fff;
    background: linear-gradient(140deg, var(--bubblegum) 0%, var(--bubble-deep) 100%);
    box-shadow: 0 10px 26px rgba(255, 111, 165, .38);
}
.btn--mint {
    color: #fff;
    background: linear-gradient(140deg, var(--mint) 0%, var(--mint-deep) 100%);
    box-shadow: 0 10px 26px rgba(23, 195, 162, .35);
}
.btn--sky {
    color: #fff;
    background: linear-gradient(140deg, var(--sky) 0%, var(--sky-deep) 100%);
    box-shadow: 0 10px 26px rgba(59, 169, 245, .35);
}
.btn--ghost {
    background: rgba(255, 255, 255, .8);
    border: 2px solid var(--line);
    box-shadow: none;
}
.btn--ghost:hover { background: #fff; box-shadow: var(--shadow-s); }

.btn--sm { padding: 10px 18px; min-height: 42px; font-size: .92rem; }
.btn--lg { padding: 18px 38px; min-height: 62px; font-size: 1.2rem; }

.btn--icon {
    width: 46px; height: 46px;
    min-height: 0;
    padding: 0;
    border-radius: 15px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, .85);
    border: 2px solid var(--line);
    box-shadow: none;
}
.btn--icon:hover { background: #fff; box-shadow: var(--shadow-s); }

.btn[disabled] { opacity: .45; pointer-events: none; }

/* ── Chips & pills ───────────────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: var(--r-pill);
    font-size: .85rem;
    font-weight: 800;
    background: #fff;
    color: var(--ink-soft);
    box-shadow: var(--shadow-s);
    white-space: nowrap;
}
.chip--grape { background: var(--grape-soft); color: var(--grape-deep); box-shadow: none; }
.chip--candy { background: var(--bubble-soft); color: var(--bubble-deep); box-shadow: none; }
.chip--mint  { background: var(--mint-soft);  color: var(--mint-deep);  box-shadow: none; }
.chip--sky   { background: var(--sky-soft);   color: var(--sky-deep);   box-shadow: none; }
.chip--sun   { background: var(--sunny-soft); color: var(--sunny-deep); box-shadow: none; }

.star-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 17px;
    border-radius: var(--r-pill);
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    color: #7A4E00;
    background: linear-gradient(140deg, #FFE9A8, #FFC53D);
    box-shadow: 0 6px 16px rgba(255, 182, 39, .38);
}
.star-count__num { font-variant-numeric: tabular-nums; }
.star-count.is-bumping { animation: starBump .5s var(--ease-bounce); }

@keyframes starBump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.22) rotate(-6deg); }
    100% { transform: scale(1); }
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-m);
    border: 1px solid rgba(255, 255, 255, .9);
}

.panel {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, .95);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-m);
}

/* ── Section headings ────────────────────────────────────────────────── */
.section { padding: clamp(36px, 7vw, 68px) 0; }

.section__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--grape);
    margin-bottom: 12px;
}
.section__title { font-size: clamp(1.6rem, 4.2vw, 2.5rem); margin-bottom: 10px; }
.section__lede  { color: var(--ink-soft); font-size: clamp(1rem, 2vw, 1.1rem); max-width: 52ch; }
.section__head  { margin-bottom: clamp(22px, 4vw, 38px); }
.section__head--center { text-align: center; }
.section__head--center .section__lede { margin-inline: auto; }

/* ── Modal / overlay ─────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(30, 20, 70, .5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn .25s var(--ease-out);
}
.modal[hidden] { display: none; }

.modal__card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: var(--r-xl);
    padding: clamp(26px, 5vw, 40px);
    text-align: center;
    box-shadow: var(--shadow-l);
    animation: popIn .45s var(--ease-bounce);
    max-height: 90vh;
    overflow-y: auto;
}
.modal__emoji { font-size: 3.6rem; line-height: 1; margin-bottom: 10px; }
.modal__title { font-size: clamp(1.6rem, 5vw, 2.1rem); margin-bottom: 8px; }
.modal__text  { color: var(--ink-soft); margin-bottom: 20px; }
.modal__actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 34px var(--pad-page) 42px;
    color: var(--ink-faint);
    font-size: .9rem;
}
.site-footer__links {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 12px;
    font-weight: 800;
}
.site-footer__links a { color: var(--ink-soft); }
.site-footer__links a:hover { color: var(--grape); }

/* ── Confetti ────────────────────────────────────────────────────────── */
.confetti-bit {
    position: fixed;
    top: -14px;
    z-index: 300;
    pointer-events: none;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0%   { opacity: 1; transform: translate3d(0, -10px, 0) rotate(0deg); }
    100% { opacity: .1; transform: translate3d(var(--drift, 0px), 104vh, 0) rotate(720deg); }
}

/* ── Entrance animations ─────────────────────────────────────────────── */
/* Scoped to .js so content is never left invisible when scripts fail to run. */
.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
    transition-delay: var(--reveal-delay, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }
@keyframes bobble {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50%      { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(3deg); }
}
@keyframes shakeNo {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-9px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(4px); }
}

.u-bobble { animation: bobble 4.5s ease-in-out infinite; }

/* ── Utilities ───────────────────────────────────────────────────────── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.u-center { text-align: center; }
.u-stack { display: flex; flex-direction: column; }

/* ── Respect motion preferences ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}
