/* ===============================================
   MODERN DESIGN SYSTEM - Francesco Dulio Portfolio
   =============================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Primary Palette - Modern & Bold */
    --primary: #6366f1;           /* Indigo */
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;         /* Cyan */
    --secondary-dark: #0891b2;
    --accent: #f59e0b;            /* Amber */
    --accent-glow: #fbbf24;

    /* Gradient Colors */
    --gradient-1: #667eea;
    --gradient-2: #764ba2;
    --gradient-3: #f093fb;
    --gradient-4: #f5576c;
    --gradient-5: #4facfe;
    --gradient-6: #00f2fe;

    /* Neutral Colors */
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===============================================
   BASE RESET & DEFAULTS
   =============================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 30%, rgba(118, 75, 162, 0.1) 0%, transparent 45%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundPulse 15s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ===============================================
   TYPOGRAPHY
   =============================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ===============================================
   CONTAINER
   =============================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ===============================================
   HEADER & NAVIGATION
   =============================================== */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-sm) 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-normal);
}

header.scrolled {
    padding: var(--space-xs) 0;
    background: rgba(10, 10, 15, 0.95);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    cursor: pointer;
    transition: var(--transition-normal);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition-normal);
}

.logo:hover::after {
    width: 100%;
}

.nav-links {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.nav-links a {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition-normal);
    border-radius: var(--radius-full);
    z-index: -1;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    opacity: 1;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: var(--space-xs);
    z-index: 1001;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===============================================
   HERO SECTION
   =============================================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(80px + var(--space-2xl)) var(--space-md) var(--space-2xl);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.4) 0%, rgba(10, 10, 15, 0) 50%, rgba(10, 10, 15, 0.8) 100%);
    z-index: 1;
}

/* Page Specific Heroes */
.hero-home { background-image: url('../assets/images/hero-home.png'); }
.hero-software { background-image: url('../assets/images/hero-software.png'); }
.hero-finance { background-image: url('../assets/images/hero-finance.png'); }
.hero-entrepreneurship { background-image: url('../assets/images/hero-entrepreneurship.png'); }

/* Dynamic Variants for pages with missing assets */
.hero-insurance { 
    background-image: url('../assets/images/hero-home.png'); 
    filter: hue-rotate(200deg) brightness(0.8); 
}
.hero-palio { 
    background-image: url('../assets/images/hero-home.png'); 
    filter: hue-rotate(320deg) saturate(1.2); 
}
.hero-church { 
    background-image: url('../assets/images/hero-home.png'); 
    filter: hue-rotate(45deg) brightness(1.1); 
}
.hero-family { 
    background-image: url('../assets/images/hero-home.png'); 
    filter: hue-rotate(180deg) brightness(0.9); 
}
.hero-projects { 
    background-image: url('../assets/images/hero-software.png'); 
    filter: hue-rotate(90deg) opacity(0.7); 
}

.hero-content {
    position: relative;
    z-index: 2;
    background: rgba(10, 10, 15, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    max-width: 900px;
}

/* Animated Gradient Orbs */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.hero::before {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--primary), var(--gradient-2));
    top: -200px;
    right: -200px;
    opacity: 0.3;
}

.hero::after {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--secondary), var(--gradient-6));
    bottom: -150px;
    left: -150px;
    opacity: 0.25;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(20px, 10px) rotate(3deg); }
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
    text-shadow: 0 0 80px rgba(99, 102, 241, 0.5);
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.hero .highlight {
    display: inline-block;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    color: var(--accent);
    margin-bottom: var(--space-md);
    padding: var(--space-xs) var(--space-lg);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.4), 0 0 60px rgba(245, 158, 11, 0.2); }
    100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.2); }
}

.hero .tagline {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.8rem;
    animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator i {
    font-size: 1.5rem;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ===============================================
   MAIN CONTENT
   =============================================== */

main.container {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-2xl);
}

/* Section Title */
.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===============================================
   CARDS GRID
   =============================================== */

.bio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
}

/* Modern Card */
.card {
    position: relative;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    opacity: 0;
    transform: translateY(40px);
    overflow: hidden;
}

/* Card Gradient Border Effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -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;
    opacity: 0;
    transition: var(--transition-normal);
    pointer-events: none;
}

/* Card Glow Effect */
.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0;
    transition: var(--transition-slow);
    pointer-events: none;
    transform: scale(0.5);
}

.card:hover {
    transform: translateY(-8px);
    background: var(--bg-card-hover);
    border-color: transparent;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(99, 102, 241, 0.1);
}

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

.card:hover::after {
    opacity: 0.05;
    transform: scale(1);
}

.card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Card Header */
.card h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.4rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.card h2 i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    transition: var(--transition-normal);
}

.card:hover h2 i {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Feature List */
.feature-list {
    list-style: none;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.feature-list li:hover {
    color: var(--text-primary);
    padding-left: var(--space-xs);
}

.feature-list li i {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 2px;
    transition: var(--transition-fast);
}

.feature-list li:hover i {
    transform: scale(1.2);
    color: var(--accent-glow);
}

/* ===============================================
   PAGE HERO (for subpages)
   =============================================== */

.page-hero {
    padding: calc(100px + var(--space-xl)) var(--space-md) var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.page-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===============================================
   FOOTER
   =============================================== */

footer {
    background: rgba(10, 10, 15, 0.9);
    border-top: 1px solid var(--glass-border);
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* ===============================================
   CUSTOM SCROLLBAR
   =============================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--secondary));
}

/* ===============================================
   SELECTION
   =============================================== */

::selection {
    background: var(--primary);
    color: var(--text-primary);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 1024px) {
    .bio-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-md);
        transition: var(--transition-normal);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
        padding: var(--space-sm) var(--space-lg);
    }

    .hero {
        min-height: auto;
        padding: calc(100px + var(--space-xl)) var(--space-md) var(--space-xl);
    }

    .hero::before,
    .hero::after {
        width: 300px;
        height: 300px;
    }

    .bio-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .card {
        padding: var(--space-md);
    }

    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .highlight {
        font-size: 1rem;
        padding: var(--space-xs) var(--space-sm);
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .card h2 i {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

/* ===============================================
   ANIMATION UTILITIES
   =============================================== */

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animations */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ===============================================
   LOADING STATE
   =============================================== */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===============================================
   CURSOR GLOW (optional enhancement)
   =============================================== */

.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

@media (hover: none) {
    .cursor-glow {
        display: none;
    }
}

/* ===============================================
   HOMEPAGE REFINEMENTS
   A presence page with visual confidence and depth
   =============================================== */

/* Homepage-specific body class */
body.homepage {
    /* Slightly mute the background animation for homepage */
}

body.homepage::before {
    animation: backgroundPulse 30s ease-in-out infinite; /* Slower pulse */
    opacity: 0.8;
}

body.homepage .nav-home {
    display: none;
}

/* Refined Hero Section */
.hero.hero-refined {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(100px + var(--space-xl)) var(--space-md) var(--space-xl);
}

.hero.hero-refined::before,
.hero.hero-refined::after {
    animation: floatSubtle 40s ease-in-out infinite; /* Much slower, subtler */
    opacity: 0.15; /* More muted */
}

.hero.hero-refined::after {
    animation-delay: -20s;
    opacity: 0.12;
}

@keyframes floatSubtle {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(15px, -15px) rotate(2deg); }
}

/* Hero Opening Statement */
.hero-opening {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    line-height: 1.3;
    letter-spacing: -0.02em;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Supporting Paragraph */
.hero-supporting {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    line-height: 1.8;
}

/* Hero CTA - Subtle Email Link */
.hero-cta {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-normal);
    letter-spacing: 0.02em;
}

.hero-cta:hover {
    color: var(--text-primary);
    border-bottom-color: var(--primary-light);
}

/* Homepage Main Content */
.homepage-main {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-2xl);
    max-width: 800px;
}

/* Content Sections */
.content-section {
    margin-bottom: var(--space-2xl);
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* Context List (What I work on) */
.context-list {
    list-style: none;
    padding: 0;
}

.context-list li {
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.context-list li:last-child {
    border-bottom: none;
}

.context-list li:hover {
    color: var(--text-primary);
    padding-left: var(--space-xs);
}

/* Declarative List (How I work) */
.declarative-list {
    list-style: none;
    padding: 0;
}

.declarative-list li {
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.declarative-list li:last-child {
    border-bottom: none;
}

.declarative-list li:hover {
    color: var(--text-primary);
    padding-left: var(--space-xs);
}

/* Signature Section */
.signature-section {
    margin: var(--space-2xl) 0;
    padding: var(--space-xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.signature-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 2;
    text-align: center;
    letter-spacing: 0.01em;
}

/* Human Section */
.human-section {
    margin-bottom: var(--space-2xl);
}

.human-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* Center the 4th item (Altrove) below the first 3 on desktop */
@media (min-width: 769px) {
    .human-item:nth-child(4) {
        grid-column: 2;
    }
}

.human-item {
    text-align: center;
    background: var(--bg-card);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    transition: var(--transition-normal);
}

.human-item:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

.human-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.human-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.human-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Signal Section - Very Restrained */
.signal-section {
    margin-bottom: var(--space-2xl);
    text-align: center;
}

.signal-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/* Social Links */
.social-section {
    text-align: center;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-sm) var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.social-link i {
    font-size: 1rem;
    color: var(--text-muted);
}

.social-link:hover {
    color: var(--text-primary);
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.social-link:hover i {
    color: var(--text-primary);
}

/* Explore Section */
.explore-section {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.explore-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.explore-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm) var(--space-md);
}

.explore-nav a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--space-xs) 0;
    transition: var(--transition-fast);
    position: relative;
}

.explore-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-light);
    transition: var(--transition-normal);
}

.explore-nav a:hover {
    color: var(--text-primary);
}

.explore-nav a:hover::after {
    width: 100%;
}

/* Homepage Responsive */
@media (max-width: 768px) {
    .hero.hero-refined {
        min-height: auto;
        padding: calc(100px + var(--space-lg)) var(--space-md) var(--space-lg);
    }

    .human-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .human-item {
        padding: var(--space-sm) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .human-item:last-child {
        border-bottom: none;
    }

    .explore-nav {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* ===============================================
   SUBPAGE REFINEMENTS
   Matching the homepage presence style
   =============================================== */

/* Subpage-specific body class */
body.subpage::before {
    animation: backgroundPulse 30s ease-in-out infinite;
    opacity: 0.8;
}

/* Subpage Main Content - Same narrow width as homepage */
.subpage-main {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-2xl);
    max-width: 800px;
}

/* Section fade-in animations for subpages */
body.subpage .content-section,
body.subpage .signature-section,
body.subpage .explore-section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSection 0.6s ease forwards;
}

body.subpage .content-section:nth-child(1) { animation-delay: 0.1s; }
body.subpage .content-section:nth-child(2) { animation-delay: 0.2s; }
body.subpage .signature-section { animation-delay: 0.3s; }
body.subpage .content-section:nth-child(4) { animation-delay: 0.4s; }
body.subpage .explore-section { animation-delay: 0.5s; }

@keyframes fadeInSection {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subpage hero refinement */
body.subpage .hero.hero-refined {
    min-height: 70vh;
}

/* Subpage Responsive */
@media (max-width: 768px) {
    body.subpage .hero.hero-refined {
        min-height: auto;
        padding: calc(100px + var(--space-lg)) var(--space-md) var(--space-lg);
    }

    .subpage-main {
        padding-top: var(--space-lg);
    }
}

/* ===============================================
   LANGUAGE SWITCHER
   =============================================== */

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--space-sm);
    padding-left: var(--space-sm);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.lang-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Language Switcher Responsive */
@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 0;
        margin-top: var(--space-lg);
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: var(--space-md);
    }

    .lang-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

/* ===============================================
   PROJECTS PAGE STYLES
   =============================================== */

/* Project Example - Consistent with homepage sections */
.project-example {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-example:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.project-example h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
    transition: var(--transition-fast);
}

.project-example:hover h3 {
    color: var(--primary-light);
}

/* Section Description - Matches context and declarative lists */
.section-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    transition: var(--transition-fast);
}

.project-example:hover .section-description {
    color: var(--text-primary);
}

.project-links-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-sm);
}

.project-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    min-height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition-fast);
}

.project-links a:hover {
    color: var(--text-primary);
    border-color: rgba(129, 140, 248, 0.6);
    background: rgba(129, 140, 248, 0.12);
}

.github-repo-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.github-repo-card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    padding: var(--space-sm);
    transition: var(--transition-fast);
}

.github-repo-card:hover {
    border-color: rgba(129, 140, 248, 0.4);
    background: rgba(129, 140, 248, 0.08);
}

.github-repo-title {
    display: inline-flex;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0.35rem;
}

.github-repo-card:hover .github-repo-title {
    color: var(--primary-light);
}

.github-repo-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-xs);
    line-height: 1.5;
}

.github-repo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.github-repo-chip {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    padding: 0.2rem 0.55rem;
}

.github-fallback {
    margin-top: var(--space-sm);
}

/* Projects Page Responsive */
@media (max-width: 768px) {
    .project-example {
        margin-bottom: var(--space-lg);
        padding-bottom: var(--space-md);
    }

    .project-example h3 {
        font-size: 1.2rem;
    }

    .section-description {
        font-size: 1rem;
    }
}
