/* ============================================
   BASE STYLES - Reset & Foundation
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* ============================================
   ELEGANT AMBIENT BACKGROUND EFFECTS
   Subtle depth, glow, and texture
   ============================================ */

/* Subtle film grain overlay for sophistication */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

[data-theme="light"] body::before {
    opacity: 0.025;
}

/* Ambient glow spots - creates depth without motion */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 40% at 10% 20%, rgba(60, 60, 80, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 50% 35% at 90% 80%, rgba(40, 50, 70, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(30, 35, 50, 0.08) 0%, transparent 40%);
}

[data-theme="light"] body::after {
    background:
        radial-gradient(ellipse 60% 40% at 10% 20%, rgba(200, 210, 230, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 50% 35% at 90% 80%, rgba(180, 190, 210, 0.15) 0%, transparent 45%),
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(170, 180, 200, 0.1) 0%, transparent 40%);
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Section Base */
.section {
    padding: var(--section-padding) 0;
    position: relative;
}

.section--dark {
    background: var(--bg-secondary);
}

/* ============================================
   SECTION ENHANCEMENT EFFECTS
   Elegant dividers and subtle depth
   ============================================ */

/* Soft top glow line for sections */
.section--glow-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 800px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 20%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.06) 80%,
        transparent 100%
    );
}

[data-theme="light"] .section--glow-top::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.04) 20%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.04) 80%,
        transparent 100%
    );
}

/* Ambient corner glows for depth */
.section--ambient::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 40% 30% at 0% 0%, rgba(80, 90, 120, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 35% 25% at 100% 100%, rgba(60, 70, 100, 0.05) 0%, transparent 45%);
}

[data-theme="light"] .section--ambient::after {
    background:
        radial-gradient(ellipse 40% 30% at 0% 0%, rgba(180, 190, 220, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 35% 25% at 100% 100%, rgba(160, 170, 200, 0.06) 0%, transparent 45%);
}

/* Vignette effect for focus */
.section--vignette::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.15) 100%);
}

[data-theme="light"] .section--vignette::before {
    background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.03) 100%);
}

/* Subtle highlight stripe */
.section--highlight-stripe {
    overflow: hidden;
}

.section--highlight-stripe::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.01) 50%,
        transparent
    );
    pointer-events: none;
}

/* Glass panel effect */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

[data-theme="light"] .glass-panel::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* Elegant card glow on hover */
.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 255, 255, 0.05) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-glow:hover::before {
    opacity: 1;
}

/* Shimmer effect for premium elements */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    pointer-events: none;
}

/* Section Labels & Titles */
.section-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
}

/* Page Management (SPA-style) */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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

/* Section Highlight Animation */
@keyframes sectionPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1); }
    50% { box-shadow: 0 0 40px 20px rgba(255, 255, 255, 0.05); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.section-highlight {
    animation: sectionPulse 1.5s ease-out;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Selection */
::selection {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* ============================================
   PREMIUM BLUE ACCENT UTILITIES
   Subtle blue detailing for premium feel
   ============================================ */

/* Blue accent border utilities */
.accent-border-blue {
    border-color: var(--premium-blue-border) !important;
}

.accent-border-blue-top {
    border-top-color: var(--premium-blue-border) !important;
}

.accent-border-blue-bottom {
    border-bottom-color: var(--premium-blue-border) !important;
}

/* Blue glow effects */
.accent-glow-blue {
    box-shadow: 0 0 20px var(--premium-blue-glow) !important;
}

.accent-glow-blue-subtle {
    box-shadow: 0 0 12px var(--premium-blue-glow) !important;
}

/* Blue underline accent */
.accent-underline-blue {
    border-bottom: 2px solid var(--premium-blue) !important;
    position: relative;
}

.accent-underline-blue::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--premium-blue-glow) 0%, transparent 100%);
    filter: blur(2px);
}

/* ============================================
   AUTH-BASED VISIBILITY
   Show/hide elements based on login state
   ============================================ */

/* Default: show guest-only, hide auth-only */
.auth-only { display: none !important; }
.guest-only { display: inline-flex !important; }

/* When authenticated: hide guest-only, show auth-only */
.is-authenticated .auth-only { display: inline-flex !important; }
.is-authenticated .guest-only { display: none !important; }
