/* mr-The Portfolio: European Engineering Studio Design System v2 */

:root {
    /* Semantic Color Tokens (Light / Cobalt Editorial) */
    --color-page: linear-gradient(160deg, #1D4289 0%, #2C58A8 45%, #3A6BBE 100%);
    --color-hero: linear-gradient(135deg, #FFFFFF 0%, #F2F7FE 60%, #E3EEFC 100%);
    --color-card: #F6F9FE;
    --color-panel: #EAF1FB;
    --color-peach: #FFF1E4;
    --color-peach-line: #F6D2B5;
    --color-peach-text: #6B3A1E;
    --color-text: #12305A;
    --color-soft: #34496A;
    --color-muted: #4F6585;
    --color-line: #D6E3F4;
    --color-border: #C9D8EE;
    --color-strong: #1F57A8;
    --color-acc: #CC3E17;
    --color-acc-text: #C23A15;
    --color-input: #FFFFFF;
    --color-chip: #FFFFFF;
    --color-inv: #12305A;
    --color-inv-text: #FFFFFF;
    --shadow-card: 0 20px 40px rgba(10, 30, 70, 0.18);
    --shadow-big: 0 30px 60px rgba(10, 30, 70, 0.25);

    /* Category Spectrum (Light) */
    --cat-c1: #0E7490;
    --cat-c2: #6D28D9;
    --cat-c3: #1D4ED8;
    --cat-c4: #047857;

    /* Legacy compatibility */
    --bg-dark: #070a13;
    --card-bg: rgba(16, 22, 38, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(204, 62, 23, 0.35);
    --primary-cyan: #06b6d4;
    --primary-indigo: #6366f1;
    --primary-purple: #a855f7;
    --mouse-x: -1000px;
    --mouse-y: -1000px;
}

html.dark {
    background-color: #0A1122;

    /* Semantic Color Tokens (Dark / Deep Space) */
    --color-page: linear-gradient(160deg, #0A1122 0%, #0F1B33 50%, #142445 100%);
    --color-hero: linear-gradient(135deg, #1A2740 0%, #16223A 60%, #131E33 100%);
    --color-card: #151F33;
    --color-panel: #1C2943;
    --color-peach: #2B201B;
    --color-peach-line: #4A3428;
    --color-peach-text: #F0BE9E;
    --color-text: #EAF0FA;
    --color-soft: #B9C6DB;
    --color-muted: #93A4BF;
    --color-line: #26344F;
    --color-border: #33425F;
    --color-strong: #86B6FA;
    --color-acc: #CC3E17;
    --color-acc-text: #FF8F63;
    --color-input: #0F1828;
    --color-chip: #1C2943;
    --color-inv: #EAF0FA;
    --color-inv-text: #12305A;
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.35);
    --shadow-big: 0 30px 60px rgba(0, 0, 0, 0.45);

    /* Category Spectrum (Dark) */
    --cat-c1: #22D3EE;
    --cat-c2: #A78BFA;
    --cat-c3: #60A5FA;
    --cat-c4: #34D399;
}

html {
    scroll-behavior: smooth;
    background-color: #1D4289;
    color-scheme: light dark;
}

body {
    background-color: #1D4289;
    background: var(--color-page);
    min-height: 100vh;
    color: #e2e8f0;
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.dark body {
    background-color: #0A1122;
}

/* Typography Classes */
.font-display {
    font-family: 'Fira Sans Extra Condensed', sans-serif;
    letter-spacing: normal;
}

.font-sans {
    font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Terracotta Accent Utilities */
.bg-terracotta {
    background-color: #CC3E17;
}

.hover\:bg-terracotta-hover:hover {
    background-color: #B53412;
}

.text-terracotta {
    color: #CC3E17;
}

.text-terracotta-text {
    color: #C23A15;
}

html.dark .text-terracotta-darkText {
    color: #FF8F63;
}

.border-terracotta {
    border-color: #CC3E17;
}

/* Category Badges */
.cat-badge-c1 {
    color: var(--cat-c1);
    background: rgba(14, 116, 144, 0.12);
    border: 1px solid rgba(14, 116, 144, 0.25);
}

.cat-badge-c2 {
    color: var(--cat-c2);
    background: rgba(109, 40, 217, 0.12);
    border: 1px solid rgba(109, 40, 217, 0.25);
}

.cat-badge-c3 {
    color: var(--cat-c3);
    background: rgba(29, 78, 216, 0.12);
    border: 1px solid rgba(29, 78, 216, 0.25);
}

.cat-badge-c4 {
    color: var(--cat-c4);
    background: rgba(4, 120, 87, 0.12);
    border: 1px solid rgba(4, 120, 87, 0.25);
}

/* Background Patterns & Textures */
.bg-grid-pattern {
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
}

.bg-dot-matrix {
    background-image: radial-gradient(rgba(6, 182, 212, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Text Gradients (Linear & Vercel style) */
.text-gradient-pearl {
    background: linear-gradient(180deg, #ffffff 15%, #cbd5e1 75%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-aurora {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
    background: linear-gradient(135deg, #ffffff 20%, #a5f3fc 65%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
    background: linear-gradient(135deg, #f472b6 0%, #c084fc 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism & Surface Highlights */
.glass-panel {
    background: rgba(13, 18, 32, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.glass-card {
    background: rgba(16, 23, 41, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 10px 25px -10px rgba(0, 0, 0, 0.4);
}

/* Bento Card & Interactive Spotlight (Linear / Aceternity effect) */
.bento-card {
    position: relative;
    background: rgba(16, 23, 41, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    isolation: isolate;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        500px circle at var(--mouse-x, -1000px) var(--mouse-y, -1000px),
        rgba(6, 182, 212, 0.12),
        transparent 40%
    );
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15), 
                0 20px 40px -15px rgba(0, 0, 0, 0.6), 
                0 0 30px -10px rgba(6, 182, 212, 0.2);
}

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

/* Glow effects */
.glow-cyan {
    box-shadow: 0 0 40px -10px rgba(6, 182, 212, 0.4);
}

.glow-purple {
    box-shadow: 0 0 40px -10px rgba(168, 85, 247, 0.4);
}

.glow-indigo {
    box-shadow: 0 0 40px -10px rgba(99, 102, 241, 0.4);
}

/* Shimmer Buttons */
.btn-shimmer {
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        60deg,
        transparent 35%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 65%
    );
    transform: rotate(25deg) translate(-100%, 0);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.btn-shimmer:hover::after {
    transform: rotate(25deg) translate(100%, 0);
}

/* Radar pulse animation for online status */
@keyframes pulseRadar {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-radar {
    animation: pulseRadar 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* Subtle border animation */
@keyframes borderBeam {
    0%, 100% {
        border-color: rgba(6, 182, 212, 0.3);
    }
    50% {
        border-color: rgba(99, 102, 241, 0.5);
    }
}

.animate-border-beam {
    animation: borderBeam 4s ease-in-out infinite;
}

/* Reading progress bar (GPU scaleX transform) */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #CC3E17, #3A6BBE, #60A5FA);
    z-index: 100;
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform;
}

/* Sticky Header GPU compositing isolation */
header.sticky {
    transform: translateZ(0);
    will-change: transform;
}

/* Custom Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 20, 45, 0.8);
}

::-webkit-scrollbar-thumb {
    background: rgba(58, 107, 190, 0.5);
    border-radius: 9999px;
    border: 2px solid transparent;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(204, 62, 23, 0.7);
}

/* Prose & Typography enhancement */
.prose {
    color: #cbd5e1;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.prose pre {
    background-color: #090e1c !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.prose code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
}

/* Alpine x-cloak */
[x-cloak] {
    display: none !important;
}
