/* Sweet Bonanza Hub - main.css
   Claymorphism design system. Candy-store palette, 4-layer shadows, oversized radii.
   Written AFTER templates/components, under exact list of HTML classes. */

/* ==========================================================
   CSS CUSTOM PROPERTIES - Claymorphism Candy Shop Palette
   ========================================================== */
:root {
    /* Background - never pure white, always slightly tinted lavender */
    --bg-base: #F4F1FA;
    --bg-surface: #FFFFFF;
    --bg-elevated: #F9F7FE;
    --bg-pressed: #EFEBF5;
    --bg-glass: rgba(255, 255, 255, 0.72);

    /* Text */
    --text: #332F3A;
    --text-muted: #635F69;
    --text-dim: #8B8791;
    --text-on-accent: #FFFFFF;
    --text-on-light-accent: #1A0F2A;

    /* Accents - Vibrant & Saturated */
    --accent: #7C3AED;
    --accent-light: #A78BFA;
    --accent-dark: #6D28D9;
    --accent-bg: rgba(124, 58, 237, 0.08);
    --accent-hot-pink: #DB2777;
    --accent-hot-pink-light: #F472B6;
    --accent-sky: #0EA5E9;
    --accent-sky-light: #7DD3FC;
    --accent-amber: #F59E0B;
    --accent-amber-light: #FCD34D;
    --success: #10B981;
    --success-light: #6EE7B7;
    --danger: #EF4444;
    --danger-light: #FCA5A5;

    /* Borders (very soft) */
    --border: rgba(124, 58, 237, 0.08);
    --border-hover: rgba(124, 58, 237, 0.2);

    /* Typography */
    --font-heading: 'Nunito', system-ui, -apple-system, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

    /* Radii - Claymorphism oversized */
    --radius-xs: 12px;
    --radius-sm: 16px;
    --radius: 20px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-xl: 48px;
    --radius-2xl: 60px;

    /* Layout */
    --header-h: 72px;
    --container-max: 1280px;
    --container-pad: 24px;

    /* Fonts */
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Transitions */
    --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Generic shadow alias (mapped to clay-card for consistency) */
    --shadow: 16px 16px 32px rgba(160, 150, 180, 0.2),
              -10px -10px 24px rgba(255, 255, 255, 0.9),
              inset 6px 6px 12px rgba(139, 92, 246, 0.03),
              inset -6px -6px 12px rgba(255, 255, 255, 1);

    /* Shadow System - 4-layer Clay shadows */
    --shadow-clay-sm:
        6px 6px 14px rgba(160, 150, 180, 0.18),
        -4px -4px 10px rgba(255, 255, 255, 0.95),
        inset 2px 2px 4px rgba(255, 255, 255, 0.6),
        inset -2px -2px 4px rgba(139, 92, 246, 0.03);

    --shadow-clay-card:
        16px 16px 32px rgba(160, 150, 180, 0.2),
        -10px -10px 24px rgba(255, 255, 255, 0.9),
        inset 6px 6px 12px rgba(139, 92, 246, 0.03),
        inset -6px -6px 12px rgba(255, 255, 255, 1);

    --shadow-clay-card-hover:
        22px 22px 44px rgba(160, 150, 180, 0.28),
        -14px -14px 32px rgba(255, 255, 255, 0.95),
        inset 8px 8px 14px rgba(139, 92, 246, 0.04),
        inset -8px -8px 14px rgba(255, 255, 255, 1);

    --shadow-clay-button:
        10px 10px 20px rgba(124, 58, 237, 0.28),
        -6px -6px 14px rgba(255, 255, 255, 0.5),
        inset 3px 3px 6px rgba(255, 255, 255, 0.4),
        inset -3px -3px 6px rgba(0, 0, 0, 0.08);

    --shadow-clay-button-hover:
        14px 14px 28px rgba(124, 58, 237, 0.36),
        -8px -8px 18px rgba(255, 255, 255, 0.6),
        inset 4px 4px 8px rgba(255, 255, 255, 0.4),
        inset -4px -4px 8px rgba(0, 0, 0, 0.1);

    --shadow-clay-pressed:
        inset 8px 8px 16px rgba(160, 150, 180, 0.22),
        inset -8px -8px 16px rgba(255, 255, 255, 0.95);

    --shadow-clay-deep:
        30px 30px 60px rgba(160, 150, 180, 0.25),
        -20px -20px 44px rgba(255, 255, 255, 0.95),
        inset 10px 10px 20px rgba(139, 92, 246, 0.04),
        inset -10px -10px 20px rgba(255, 255, 255, 1);
}

/* ==========================================================
   RESET & BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-base);
    min-height: 100vh;
    padding-top: var(--header-h);
    position: relative;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }

button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font-family: inherit; }

ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 12px; }
strong { font-weight: 700; color: var(--text); }

/* ==========================================================
   LAYOUT UTILITIES
   ========================================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    width: 100%;
}

.section { padding: 64px 0; position: relative; }
.section--tight { padding: 28px 0; }

.section-head { text-align: center; margin-bottom: 40px; }
.section-head__title { margin-bottom: 12px; }
.section-head__subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 720px; margin: 0 auto; line-height: 1.6; }
.section-head__prose { max-width: 820px; margin: 20px auto 0; text-align: left; color: var(--text-muted); line-height: 1.7; }
.section-head__prose p { margin-bottom: 14px; }
.section-head__prose a { color: var(--accent); font-weight: 500; }

.section-foot { text-align: center; margin-top: 36px; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 999;
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius);
}
.skip-link:focus { left: 8px; }

.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }

/* ==========================================================
   CLAY BLOBS (background ambient)
   ========================================================== */
.clay-blobs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}
.clay-blob {
    position: absolute;
    width: 55vh;
    height: 55vh;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}
.clay-blob--1 { background: var(--accent-light); top: -10%; left: -10%; animation: clay-float 14s ease-in-out infinite; }
.clay-blob--2 { background: var(--accent-hot-pink-light); top: 20%; right: -15%; animation: clay-float 18s ease-in-out infinite reverse; }
.clay-blob--3 { background: var(--accent-sky-light); bottom: -10%; left: 30%; animation: clay-float 22s ease-in-out infinite; }

@keyframes clay-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.08); }
    66% { transform: translate(-15px, 20px) scale(0.95); }
}

@media (prefers-reduced-motion: reduce) {
    .clay-blob { animation: none; }
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 48px;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.btn--sm { padding: 9px 18px; min-height: 40px; font-size: 0.88rem; }
.btn--lg { padding: 16px 30px; min-height: 56px; font-size: 1.02rem; }
.btn--block { width: 100%; }

.btn--primary {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    color: #FFFFFF;
    box-shadow: var(--shadow-clay-button);
}
.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-clay-button-hover);
    color: #FFFFFF;
}
.btn--primary:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-clay-pressed);
}

.btn--ghost {
    background: var(--bg-surface);
    color: var(--accent);
    box-shadow: var(--shadow-clay-sm);
}
.btn--ghost:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-clay-card);
    color: var(--accent-dark);
}

.btn--secondary {
    background: var(--bg-surface);
    color: var(--text);
    box-shadow: var(--shadow-clay-sm);
}
.btn--secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-clay-card);
    color: var(--accent);
}

/* Focus */
*:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

::selection { background: var(--accent-light); color: #FFFFFF; }

/* ==========================================================
   BREADCRUMBS
   ========================================================== */
.crumbs {
    padding: 16px 0;
    font-size: 0.9rem;
}
.crumbs__link { color: var(--text-muted); }
.crumbs__link:hover { color: var(--accent); }
.crumbs__sep { color: var(--text-dim); margin: 0 8px; }
.crumbs__current { color: var(--text); font-weight: 500; }

/* ==========================================================
   SCROLLBARS
   ========================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-pressed); }
::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
