/* ============================================================
   SOUND + MIND — Premium Design System
   Version 2.0 — "Set the bar"
   ============================================================
   This file provides the unified visual foundation across all pages.
   Import BEFORE page-specific <style> blocks.
   ============================================================ */

/* ── PREMIUM FONTS ────────────────────────────────────────── */
/* Playfair Display — editorial authority for hero headings
   Inter — crystal-clear readability for body
   Space Grotesk — retained for UI labels, buttons, nav        */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

/* ── DESIGN TOKENS ────────────────────────────────────────── */
:root {
    /* Background hierarchy */
    --p-bg-deep:       #060609;
    --p-bg-base:       #0a0a10;
    --p-bg-surface:    #0f0f1a;
    --p-bg-elevated:   #141422;
    --p-bg-card:       rgba(18, 18, 32, 0.72);

    /* Text hierarchy */
    --p-text-primary:  #f2ece4;
    --p-text-secondary: #b8bcc6;
    --p-text-tertiary: #7a8294;
    --p-text-muted:    #555d6e;

    /* Accent: Refined rose (less neon, more editorial) */
    --p-rose:          #d94070;
    --p-rose-light:    #e8698c;
    --p-rose-bright:   #f72585;
    --p-rose-dark:     #a82860;
    --p-rose-glow:     rgba(217, 64, 112, 0.12);
    --p-rose-glow-strong: rgba(217, 64, 112, 0.25);

    /* Accent: Warm teal */
    --p-teal:          #2ec9a0;
    --p-teal-light:    #5ee0be;
    --p-teal-dark:     #1a8a6e;
    --p-teal-glow:     rgba(46, 201, 160, 0.12);

    /* Accent: Warm amber / gold */
    --p-amber:         #d4a04a;
    --p-amber-light:   #e8c078;
    --p-amber-glow:    rgba(212, 160, 74, 0.12);

    /* Accent: Purple */
    --p-purple:        #9b6dff;
    --p-purple-light:  #c4a8ff;
    --p-purple-dark:   #7c3aed;
    --p-purple-glow:   rgba(155, 109, 255, 0.12);

    /* Accent: Rose gold / copper (new sophistication) */
    --p-copper:        #c8887a;
    --p-copper-light:  #e0a99c;
    --p-copper-glow:   rgba(200, 136, 122, 0.15);

    /* Borders */
    --p-border-subtle: rgba(148, 163, 184, 0.06);
    --p-border-light:  rgba(148, 163, 184, 0.12);
    --p-border-medium: rgba(148, 163, 184, 0.2);

    /* Shadows */
    --p-shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
    --p-shadow-md:     0 8px 32px rgba(0,0,0,0.4);
    --p-shadow-lg:     0 20px 60px rgba(0,0,0,0.5);
    --p-shadow-glow:   0 0 40px rgba(217, 64, 112, 0.15);

    /* Typography scale */
    --p-font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;
    --p-font-heading:  'Space Grotesk', system-ui, -apple-system, sans-serif;
    --p-font-body:     'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing scale */
    --p-space-xs:  0.5rem;
    --p-space-sm:  1rem;
    --p-space-md:  1.5rem;
    --p-space-lg:  2.5rem;
    --p-space-xl:  4rem;
    --p-space-2xl: 6rem;
    --p-space-3xl: 8rem;

    /* Border radius */
    --p-radius-sm:  0.5rem;
    --p-radius-md:  1rem;
    --p-radius-lg:  1.5rem;
    --p-radius-xl:  2rem;
    --p-radius-full: 100px;

    /* Transitions */
    --p-ease:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --p-ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
    --p-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --p-duration-fast: 0.15s;
    --p-duration:  0.3s;
    --p-duration-slow: 0.6s;
}

/* ── GLOBAL RESETS (layered, won't override page specifics) ── */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(217, 64, 112, 0.3);
    color: var(--p-text-primary);
}

/* ── PREMIUM BACKGROUND MESH ─────────────────────────────── */
/* Replaces flat black with a richer, textured dark bg        */
.p-bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120% 60% at 10% 20%, rgba(217, 64, 112, 0.04), transparent 60%),
        radial-gradient(ellipse 80% 50% at 90% 80%, rgba(46, 201, 160, 0.03), transparent 50%),
        radial-gradient(ellipse 60% 80% at 50% 0%, rgba(155, 109, 255, 0.025), transparent 50%);
}

/* Subtle noise texture overlay */
.p-bg-mesh::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.018;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* ── PREMIUM HERO SYSTEM ──────────────────────────────────── */
.p-hero {
    position: relative;
    overflow: hidden;
    padding: var(--p-space-3xl) var(--p-space-lg) var(--p-space-2xl);
    max-width: 1200px;
    margin: 0 auto;
}

.p-hero-display {
    font-family: var(--p-font-display);
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--p-text-primary);
}

.p-hero-display em {
    font-style: italic;
    background: linear-gradient(135deg, var(--p-rose) 0%, var(--p-rose-light) 50%, var(--p-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.p-hero-subtitle {
    font-family: var(--p-font-body);
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    font-weight: 400;
    line-height: 1.7;
    color: var(--p-text-secondary);
    max-width: 580px;
    margin-top: var(--p-space-md);
}

/* Cinematic glow orbs behind hero sections */
.p-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}

.p-hero-glow--rose {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(217, 64, 112, 0.12) 0%, transparent 70%);
    top: -150px;
    left: -100px;
}

.p-hero-glow--teal {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(46, 201, 160, 0.08) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
}

.p-hero-glow--purple {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(155, 109, 255, 0.08) 0%, transparent 70%);
    top: 50%;
    right: 10%;
    transform: translateY(-50%);
}

/* Abstract sound wave patterns (CSS-only) */
.p-hero-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.06;
}

.p-hero-waves::before,
.p-hero-waves::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 100%;
}

.p-hero-waves::before {
    background: repeating-linear-gradient(
        90deg,
        transparent 0%,
        rgba(217, 64, 112, 0.3) 2%,
        transparent 4%
    );
    animation: waveShift 20s linear infinite;
}

.p-hero-waves::after {
    background: repeating-linear-gradient(
        90deg,
        transparent 0%,
        rgba(46, 201, 160, 0.2) 1.5%,
        transparent 3%
    );
    animation: waveShift 15s linear infinite reverse;
}

@keyframes waveShift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── PREMIUM NAV ──────────────────────────────────────────── */
.p-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 6, 9, 0.82);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid var(--p-border-subtle);
    transition: background var(--p-duration) var(--p-ease),
                border-color var(--p-duration) var(--p-ease);
}

.p-nav.scrolled {
    background: rgba(6, 6, 9, 0.95);
    border-bottom-color: var(--p-border-light);
}

/* ── SCROLL ANIMATIONS ────────────────────────────────────── */
/* Elements start hidden, animate in when they enter viewport */
.p-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s var(--p-ease-out),
                transform 0.8s var(--p-ease-out);
}

.p-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.p-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s var(--p-ease-out),
                transform 0.8s var(--p-ease-out);
}

.p-reveal-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.p-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s var(--p-ease-out),
                transform 0.8s var(--p-ease-out);
}

.p-reveal-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.p-reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s var(--p-ease-out),
                transform 0.8s var(--p-ease-out);
}

.p-reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children */
.p-stagger > .p-reveal:nth-child(1) { transition-delay: 0s; }
.p-stagger > .p-reveal:nth-child(2) { transition-delay: 0.1s; }
.p-stagger > .p-reveal:nth-child(3) { transition-delay: 0.2s; }
.p-stagger > .p-reveal:nth-child(4) { transition-delay: 0.3s; }
.p-stagger > .p-reveal:nth-child(5) { transition-delay: 0.4s; }
.p-stagger > .p-reveal:nth-child(6) { transition-delay: 0.5s; }
.p-stagger > .p-reveal:nth-child(7) { transition-delay: 0.6s; }
.p-stagger > .p-reveal:nth-child(8) { transition-delay: 0.7s; }
.p-stagger > .p-reveal:nth-child(9) { transition-delay: 0.8s; }
.p-stagger > .p-reveal:nth-child(10) { transition-delay: 0.9s; }

/* ── PREMIUM BUTTON SYSTEM ────────────────────────────────── */
.p-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--p-font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--p-radius-full);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--p-duration) var(--p-ease);
    position: relative;
    overflow: hidden;
}

.p-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--p-duration) var(--p-ease);
}

.p-btn:hover::before {
    opacity: 1;
}

.p-btn-rose {
    background: linear-gradient(135deg, var(--p-rose), var(--p-rose-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(217, 64, 112, 0.3),
                inset 0 1px 0 rgba(255,255,255,0.1);
}

.p-btn-rose:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(217, 64, 112, 0.4),
                inset 0 1px 0 rgba(255,255,255,0.15);
}

.p-btn-ghost {
    background: rgba(255,255,255,0.04);
    color: var(--p-text-primary);
    border: 1px solid var(--p-border-medium);
}

.p-btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(148,163,184,0.35);
    transform: translateY(-1px);
}

/* ── PREMIUM CARD SYSTEM ──────────────────────────────────── */
.p-card {
    background: var(--p-bg-card);
    border: 1px solid var(--p-border-light);
    border-radius: var(--p-radius-lg);
    padding: var(--p-space-lg);
    transition: transform var(--p-duration) var(--p-ease),
                border-color var(--p-duration) var(--p-ease),
                box-shadow var(--p-duration) var(--p-ease);
    position: relative;
    overflow: hidden;
}

.p-card:hover {
    transform: translateY(-4px);
    border-color: var(--p-border-medium);
    box-shadow: var(--p-shadow-lg);
}

/* Shine effect on hover */
.p-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.6s var(--p-ease);
    pointer-events: none;
}

.p-card:hover::after {
    left: 100%;
}

/* ── PREMIUM SECTION DIVIDER ──────────────────────────────── */
.p-divider {
    width: 100%;
    height: 1px;
    border: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--p-border-light) 20%,
        rgba(217, 64, 112, 0.15) 50%,
        var(--p-border-light) 80%,
        transparent 100%
    );
    margin: var(--p-space-2xl) 0;
}

/* ── PREMIUM EYEBROW / TAG ────────────────────────────────── */
.p-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--p-font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 1rem;
    border-radius: var(--p-radius-full);
    margin-bottom: var(--p-space-md);
}

.p-eyebrow--rose {
    color: var(--p-rose-light);
    background: var(--p-rose-glow);
    border: 1px solid rgba(217, 64, 112, 0.2);
}

.p-eyebrow--teal {
    color: var(--p-teal-light);
    background: var(--p-teal-glow);
    border: 1px solid rgba(46, 201, 160, 0.2);
}

.p-eyebrow--purple {
    color: var(--p-purple-light);
    background: var(--p-purple-glow);
    border: 1px solid rgba(155, 109, 255, 0.2);
}

/* ── FLOATING PARTICLES (pure CSS) ────────────────────────── */
.p-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.p-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat var(--dur, 12s) var(--delay, 0s) infinite var(--p-ease);
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: translateY(80vh) scale(1);
    }
    90% {
        opacity: 0.3;
        transform: translateY(-10vh) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) scale(0);
    }
}

/* ── PREMIUM FOOTER ───────────────────────────────────────── */
.p-footer {
    text-align: center;
    padding: var(--p-space-xl) var(--p-space-lg);
    color: var(--p-text-muted);
    font-family: var(--p-font-body);
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--p-border-subtle);
}

.p-footer a {
    color: var(--p-text-tertiary);
    text-decoration: none;
    transition: color var(--p-duration-fast);
}

.p-footer a:hover {
    color: var(--p-text-secondary);
}

/* ── ABSTRACT VISUAL: SOUND WAVE LINES (CSS-only art) ─────── */
.p-soundwave-art {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0.07;
    pointer-events: none;
}

.p-soundwave-art .bar {
    width: 2px;
    background: currentColor;
    border-radius: 1px;
    animation: soundBarPulse var(--dur, 2s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes soundBarPulse {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* ── ABSTRACT VISUAL: NEURAL NETWORK DOTS ─────────────────── */
.p-neural-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.p-neural-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--p-rose);
    opacity: 0.15;
    animation: neuralPulse var(--dur, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes neuralPulse {
    0%, 100% { opacity: 0.08; transform: scale(0.8); }
    50% { opacity: 0.25; transform: scale(1.5); }
}

/* ── GRADIENT TEXT UTILITIES ───────────────────────────────── */
.p-gradient-rose {
    background: linear-gradient(135deg, var(--p-rose) 0%, var(--p-rose-light) 50%, var(--p-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.p-gradient-teal {
    background: linear-gradient(135deg, var(--p-teal) 0%, var(--p-teal-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.p-gradient-warm {
    background: linear-gradient(135deg, var(--p-amber) 0%, var(--p-copper) 50%, var(--p-rose-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.p-gradient-purple {
    background: linear-gradient(135deg, var(--p-purple) 0%, var(--p-purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── SECTION SPACING (generous whitespace) ────────────────── */
.p-section {
    padding: var(--p-space-3xl) var(--p-space-lg);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.p-section-tight {
    padding: var(--p-space-xl) var(--p-space-lg);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ── SMOOTH PAGE TRANSITIONS ──────────────────────────────── */
body {
    animation: pageIn 0.5s var(--p-ease-out) both;
}

@keyframes pageIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── RESPONSIVE PREMIUM ADJUSTMENTS ───────────────────────── */
@media (max-width: 768px) {
    :root {
        --p-space-xl:  3rem;
        --p-space-2xl: 4rem;
        --p-space-3xl: 5rem;
    }

    .p-hero {
        padding: var(--p-space-2xl) var(--p-space-md) var(--p-space-xl);
    }

    .p-hero-display {
        font-size: clamp(2.2rem, 8vw, 3.5rem);
    }

    .p-section {
        padding: var(--p-space-2xl) var(--p-space-md);
    }
}

@media (max-width: 480px) {
    :root {
        --p-space-xl:  2.5rem;
        --p-space-2xl: 3rem;
        --p-space-3xl: 4rem;
    }

    .p-hero-display {
        font-size: clamp(2rem, 9vw, 2.8rem);
    }
}

/* ── ACCESSIBILITY: Reduced motion ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .p-reveal,
    .p-reveal-left,
    .p-reveal-right,
    .p-reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .p-particle,
    .p-soundwave-art .bar,
    .p-neural-dot,
    .p-hero-waves::before,
    .p-hero-waves::after {
        animation: none;
    }

    body {
        animation: none;
    }
}
