/* ═══════════════════════════════════════════════════════════
   MAIN.CSS  — Global reset, CSS variables, typography, layout
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    /* Colors */
    --color-bg:            #faf9f7;
    --color-white:         #ffffff;
    --color-black:         #000000;
    --color-primary:       #18181b;
    --color-primary-hover: #27272a;

    /* Grays — slightly warm tint to match cream background */
    --color-gray-50:  #f9f8f6;
    --color-gray-100: #f2f1ef;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* Blues */
    --color-blue-50:   #eff6ff;
    --color-blue-100:  #dbeafe;
    --color-blue-200:  #bfdbfe;
    --color-blue-300:  #93c5fd;
    --color-blue-400:  #60a5fa;
    --color-blue-500:  #3b82f6;
    --color-blue-600:  #2563eb;
    --color-blue-800:  #1e40af;
    --color-blue-900:  #1e3a8a;
    --color-blue-950:  #172554;

    /* Indigo */
    --color-indigo-300: #a5b4fc;
    --color-indigo-500: #6366f1;
    --color-violet-200: #ddd6fe;

    /* Accents */
    --color-yellow:  #fcdd00;
    --color-orange:  #f59e0b;
    --color-cyan:    #06b6d4;
    --color-emerald: #10b981;

    /* Category palette */
    --color-indigo-bg:  #eef2ff; --color-indigo-txt:  #4338ca; --color-indigo-bdr: #c7d2fe;
    --color-orange-bg:  #fff7ed; --color-orange-txt:  #c2410c; --color-orange-bdr: #fed7aa;
    --color-pink-bg:    #fdf2f8; --color-pink-txt:    #9d174d; --color-pink-bdr:   #fbcfe8;
    --color-blue-bg:    #eff6ff; --color-blue-txt:    #1d4ed8; --color-blue-bdr:   #bfdbfe;
    --color-emerald-bg: #ecfdf5; --color-emerald-txt: #065f46; --color-emerald-bdr:#a7f3d0;
    --color-red-bg:     #fef2f2; --color-red-txt:     #991b1b; --color-red-bdr:    #fecaca;
    --color-sky-bg:     #f0f9ff; --color-sky-txt:     #0369a1; --color-sky-bdr:    #bae6fd;
    --color-amber-bg:   #fffbeb; --color-amber-txt:   #92400e; --color-amber-bdr:  #fde68a;
    --color-purple-bg:  #faf5ff; --color-purple-txt:  #6b21a8; --color-purple-bdr: #e9d5ff;
    --color-teal-bg:    #f0fdfa; --color-teal-txt:    #134e4a; --color-teal-bdr:   #99f6e4;
    --color-gray-cat-bg:#f9fafb; --color-gray-cat-txt:#374151; --color-gray-cat-bdr:#d1d5db;

    /* Typography */
    --font-sans:     'Plus Jakarta Sans', sans-serif;
    --font-serif:    'Playfair Display', serif;
    --font-designer: 'Pacifico', cursive;

    /* Font sizes */
    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   1.25rem;    /* 20px */
    --text-2xl:  1.5rem;     /* 24px */
    --text-3xl:  1.875rem;   /* 30px */
    --text-4xl:  2.25rem;    /* 36px */
    --text-5xl:  3rem;       /* 48px */
    --text-6xl:  3.75rem;    /* 60px */

    /* Spacing */
    --sp-1:  0.25rem;
    --sp-2:  0.5rem;
    --sp-3:  0.75rem;
    --sp-4:  1rem;
    --sp-5:  1.25rem;
    --sp-6:  1.5rem;
    --sp-8:  2rem;
    --sp-10: 2.5rem;
    --sp-12: 3rem;

    /* Radii */
    --radius-sm:   0.5rem;
    --radius-md:   0.75rem;
    --radius-lg:   1rem;
    --radius-xl:   1.25rem;
    --radius-2xl:  1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:   0 1px 4px rgba(0,0,0,0.03);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.02);
    --shadow-md:   0 8px 24px rgba(0,0,0,0.05);
    --shadow-lg:   0 16px 32px rgba(0,0,0,0.06);
    --shadow-xl:   0 20px 40px -12px rgba(0,0,0,0.10);
    --shadow-2xl:  0 25px 50px -12px rgba(0,0,0,0.15);

    /* Glass */
    --glass-bg:     rgba(253,251,248,0.75);
    --glass-border: rgba(255,255,255,0.60);
    --glass-blur:   20px;

    /* Nav */
    --nav-bg:     rgba(253,251,248,0.55);
    --nav-border: rgba(255,255,255,0.50);
    --nav-shadow: 0 24px 48px -12px rgba(0,0,0,0.06), inset 0 1px 1px rgba(255,255,255,0.90);

    /* Transitions */
    --transition-fast:   all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow:   all 0.5s ease;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    /* Cream base with colourful corner glows */
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse 90% 55% at 100% 0%,
            rgba(255, 237, 213, 0.85) 0%,
            rgba(254, 240, 180, 0.45) 30%,
            transparent 65%),
        radial-gradient(ellipse 65% 50% at 0% 100%,
            rgba(219, 234, 254, 0.70) 0%,
            rgba(221, 214, 254, 0.40) 40%,
            transparent 70%);
    color: var(--color-gray-900);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Hide scrollbar but keep functionality */
body::-webkit-scrollbar { display: none; }
body { -ms-overflow-style: none; scrollbar-width: none; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Aurora Background ─────────────────────────────────────── */
/*
 * Animated pastel aurora — blue/indigo/violet glow at top-right.
 * aurora-bg is transparent so the body corner-glow gradients show through.
 */
.aurora-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: transparent; /* let body gradients show through */
}

.aurora-layer {
    position: absolute;
    inset: -20px;
    opacity: 0.45;               /* clearly visible pastel glow */
    filter: blur(22px);
    will-change: background-position;
    background-image:
        /* White brightness stripes */
        repeating-linear-gradient(
            100deg,
            #ffffff 0%,   #ffffff 7%,
            transparent 10%, transparent 12%,
            #ffffff 16%
        ),
        /* Richer blue / indigo / violet palette */
        repeating-linear-gradient(
            100deg,
            #93c5fd 10%, #a5b4fc 15%,
            #c7d2fe 20%, #ddd6fe 25%,
            #bfdbfe 30%, #6ee7f7 35%
        );
    background-size: 300% 200%;
    background-position: 50% 50%;
    animation: aurora 50s linear infinite;
    /* Mask: strong at top-right, fades to nothing in the middle */
    mask-image: radial-gradient(ellipse 85% 65% at 105% -5%, black 0%, rgba(0,0,0,0.6) 45%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 85% 65% at 105% -5%, black 0%, rgba(0,0,0,0.6) 45%, transparent 75%);
}

/* Second layer — slower, reversed, offset hue for depth */
.aurora-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.65;
    background-image:
        repeating-linear-gradient(
            100deg,
            #ffffff 0%,   #ffffff 7%,
            transparent 10%, transparent 12%,
            #ffffff 16%
        ),
        repeating-linear-gradient(
            100deg,
            #bae6fd 10%, #818cf8 15%,
            #c4b5fd 20%, #f0abfc 25%,
            #bfdbfe 30%
        );
    background-size: 200% 100%;
    background-position: 70% 30%;
    animation: aurora 75s linear infinite reverse;
}

/* ── Layout shell ──────────────────────────────────────────── */
.site-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    width: 100%;
    overflow-x: hidden;
    opacity: 0; /* faded in by GSAP on load */
    padding-bottom: 5rem;
}

.bottom-gradient {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3rem;
    background: linear-gradient(to top, var(--color-bg), transparent);
    pointer-events: none;
    z-index: 40;
}

@media (min-width: 768px) {
    .bottom-gradient { height: 6rem; }
}

/* ── Section containers ────────────────────────────────────── */
.section {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1rem 5rem;
}

@media (min-width: 640px)  { .section { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .section { padding-inline: 2rem; } }

/* ── Typography helpers ────────────────────────────────────── */
.font-sans     { font-family: var(--font-sans); }
.font-serif    { font-family: var(--font-serif); }
.font-designer { font-family: var(--font-designer); }

.heading-display {
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--color-gray-900);
}

.heading-section {
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

@media (min-width: 768px) { .heading-section { font-size: var(--text-3xl); } }
@media (min-width: 1024px) { .heading-section { font-size: var(--text-4xl); } }

.heading-designer {
    font-family: var(--font-designer);
    font-weight: 400;
    font-size: 1.25em;
    position: relative;
    display: inline-block;
}

/* Yellow highlight underline behind a word */
.highlight-underline {
    position: relative;
    display: inline-block;
}
.highlight-underline svg {
    position: absolute;
    width: 120%;
    left: -10%;
    height: 40%;
    bottom: 10%;
    z-index: -1;
    overflow: visible;
}
.highlight-underline path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

/* ── Glass utilities ───────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.05);
}

.ios-card {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.50);
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.60);
}

/* ── Utility ───────────────────────────────────────────────── */
.gpu { transform: translateZ(0); will-change: transform; backface-visibility: hidden; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

.spin-loader {
    width: 2rem; height: 2rem;
    border: 2px solid var(--color-gray-300);
    border-top-color: var(--color-gray-900);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Responsive helpers ────────────────────────────────────── */
@media (max-width: 767px) { .md\:hidden-mobile { display: none !important; } }
@media (min-width: 768px) { .md\:hidden        { display: none !important; } }
