/* Design system: shadcn/ui tokens and component shapes, in plain CSS, with a playful color layer. */

:root {
    --background: hsl(260 60% 99%);
    --foreground: hsl(252 35% 14%);
    --card: #fff;
    --muted: hsl(255 40% 96%);
    --muted-foreground: hsl(252 12% 46%);
    --border: hsl(255 30% 90%);
    --input: hsl(255 30% 88%);
    --primary: hsl(262 83% 58%);
    --primary-foreground: #fff;
    --destructive: hsl(350 85% 56%);
    --ring: hsl(262 83% 58% / .45);
    --radius: 1rem;

    --violet: #8b5cf6;
    --pink: #ec4899;
    --amber: #f59e0b;
    --emerald: #10b981;
    --sky: #0ea5e9;
    --rose: #f43f5e;
    --slate: #64748b;

    --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

    --shadow-sm: 0 1px 2px hsl(252 40% 20% / .06);
    --shadow: 0 1px 3px hsl(252 40% 20% / .08), 0 8px 24px -8px hsl(252 40% 20% / .12);
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--background);
    background-image:
        radial-gradient(circle at 8% 12%, hsl(262 90% 85% / .45), transparent 28rem),
        radial-gradient(circle at 92% 6%, hsl(330 90% 85% / .4), transparent 26rem),
        radial-gradient(circle at 80% 95%, hsl(45 95% 80% / .35), transparent 28rem),
        radial-gradient(hsl(252 30% 50% / .09) 1px, transparent 1px);
    background-size: auto, auto, auto, 22px 22px;
    background-attachment: fixed;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
kbd {
    font-family: ui-monospace, monospace;
    font-size: .75em;
    padding: .05rem .35rem;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: .35rem;
    background: #fff;
}

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--muted-foreground); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header / footer ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(1.4) blur(10px);
    background: hsl(0 0% 100% / .7);
    border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; height: 3.75rem; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
}
.brand-logo {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, var(--violet), var(--pink));
    box-shadow: 0 3px 0 hsl(262 60% 40%);
    font-size: 1.2rem;
    transition: transform .25s;
}
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.08); }
.brand-accent { background: linear-gradient(90deg, var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; gap: .25rem; margin-left: auto; }
.nav-links a {
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    padding: .4rem .8rem;
    border-radius: 999px;
    color: var(--muted-foreground);
    transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--muted); color: var(--foreground); }
.nav-links a.active { background: var(--foreground); color: #fff; }

main.container { flex: 1; padding-top: 1.5rem; padding-bottom: 2.5rem; }

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.1rem 0;
    font-size: .85rem;
    color: var(--muted-foreground);
    background: hsl(0 0% 100% / .5);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; }

/* ---------- card ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + .25rem);
    box-shadow: var(--shadow);
}
.card-header { padding: 1.25rem 1.25rem 0; }
.card-title { font-size: 1.2rem; font-weight: 700; }
.card-description { font-size: .875rem; color: var(--muted-foreground); }
.card-content { padding: 1.25rem; }

/* ---------- button ---------- */
.btn {
    --btn-bg: var(--card);
    --btn-fg: var(--foreground);
    --btn-edge: var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: .75rem;
    border: 1px solid var(--btn-edge);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 700;
    font-size: .9rem;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    box-shadow: 0 2px 0 var(--btn-edge);
    transition: transform .1s, box-shadow .1s, background .15s, filter .15s;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--btn-edge); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.btn-primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-edge: hsl(262 60% 42%); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-destructive { --btn-bg: var(--destructive); --btn-fg: #fff; --btn-edge: hsl(350 70% 40%); }
.btn-ghost { --btn-bg: transparent; --btn-edge: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--muted); filter: none; }
.btn-sm { height: 2rem; padding: 0 .7rem; font-size: .8rem; border-radius: .6rem; }
.btn-lg { height: 3.25rem; padding: 0 1.5rem; font-size: 1.05rem; border-radius: 1rem; }
.btn-icon { width: 2.5rem; padding: 0; }

/* ---------- badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    border: 1px solid transparent;
    background: var(--muted);
    color: var(--foreground);
}
.badge-outline { background: transparent; border-color: var(--border); }

/* ---------- inputs ---------- */
.input, .select {
    height: 2.5rem;
    width: 100%;
    padding: 0 .8rem;
    border: 1px solid var(--input);
    border-radius: .75rem;
    background: #fff;
    font-size: .9rem;
    transition: box-shadow .15s, border-color .15s;
}
.input::placeholder { color: var(--muted-foreground); }
.select {
    appearance: none;
    padding-right: 2.2rem;
    font-weight: 700;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6590' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
}
.select:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    height: 2.5rem;
    padding: 0 .6rem;
    text-align: left;
    font-weight: 700;
    font-size: .8rem;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
}
.table td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: hsl(255 40% 97%); }
.table tbody tr:last-child td { border-bottom: 0; }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    z-index: 30;
    min-width: 13rem;
    padding: .3rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .9rem;
    box-shadow: var(--shadow);
    animation: pop-in .15s ease-out;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .5rem .65rem;
    border: 0;
    border-radius: .6rem;
    background: none;
    font-size: .875rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.dropdown-item:hover { background: var(--muted); }
.dropdown-item.danger { color: var(--destructive); }
.dropdown-item:disabled { opacity: .45; cursor: not-allowed; }
.dropdown-sep { height: 1px; background: var(--border); margin: .3rem; }

/* ---------- dialog ---------- */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: hsl(252 40% 10% / .55);
    backdrop-filter: blur(3px);
    animation: fade-in .15s ease-out;
}
.dialog {
    width: 100%;
    max-width: 30rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px hsl(252 40% 10% / .35);
    padding: 1.5rem;
    animation: pop-in .2s cubic-bezier(.2, 1.4, .4, 1);
}
.dialog-emoji { font-size: 2.5rem; line-height: 1; margin-bottom: .5rem; }
.dialog-title { font-size: 1.4rem; font-weight: 800; }
.dialog-desc { margin-top: .35rem; color: var(--muted-foreground); font-size: .95rem; }
.dialog .input { margin-top: 1rem; }
.dialog-choices { display: grid; gap: .75rem; margin-top: 1.25rem; }
.dialog-choice {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-align: left;
    border: 2px solid var(--border);
    border-radius: 1rem;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--border);
    transition: transform .12s, border-color .15s, background .15s;
}
.dialog-choice:hover, .dialog-choice:focus-visible { border-color: var(--primary); background: hsl(262 90% 98%); outline: none; transform: translateY(-2px); }
.dialog-choice-emoji { font-size: 2rem; }
.dialog-choice b { display: block; font-family: var(--font-display); font-size: 1.15rem; }
.dialog-choice small { color: var(--muted-foreground); font-size: .85rem; }
.dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

/* ---------- toast ---------- */
.toaster {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: min(24rem, calc(100vw - 2rem));
}
.toast {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: .9rem;
    box-shadow: var(--shadow);
    font-size: .9rem;
    font-weight: 600;
    animation: slide-in .25s cubic-bezier(.2, 1.3, .4, 1);
}
.toast.success { border-left-color: var(--emerald); }
.toast.warning { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--destructive); }
.toast.leaving { opacity: 0; transform: translateX(1rem); transition: .2s; }

/* ---------- home ---------- */
.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
.hero p { margin-top: .5rem; font-size: 1.1rem; color: var(--muted-foreground); }
.wiggle { display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.app-card {
    position: relative;
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.app-card:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: 0 20px 40px -16px hsl(262 60% 40% / .35); }
.app-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -60% auto;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: var(--app-color, var(--violet));
    opacity: .12;
}
.app-icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    font-size: 1.9rem;
    background: var(--app-color, var(--violet));
    box-shadow: 0 4px 0 hsl(0 0% 0% / .15);
    margin-bottom: 1rem;
}
.app-card h2 { font-size: 1.35rem; font-weight: 800; }
.app-card p { margin-top: .35rem; color: var(--muted-foreground); font-size: .95rem; }
.app-card .go { margin-top: 1rem; font-weight: 800; color: var(--primary); }
.app-card.soon { border-style: dashed; box-shadow: none; background: hsl(0 0% 100% / .6); }
.app-card.soon:hover { transform: none; box-shadow: none; }

@media (max-width: 575.98px) {
    .site-header .container { gap: .5rem; }
    .brand { font-size: 1.05rem; }
    .brand-accent { display: none; }
    .nav-links a { padding: .35rem .6rem; font-size: .8rem; white-space: nowrap; }
}

/* ---------- motion ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(6px); } }
@keyframes slide-in { from { opacity: 0; transform: translateY(1rem) scale(.96); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-12deg); } 20% { transform: rotate(10deg); } 30% { transform: rotate(-6deg); } 40% { transform: rotate(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
