/* DESIGN SYSTEM & VARIABLES - MONOCHROME EDITION */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
    
    /* Monochrome Dark Theme (Default) */
    --bg-color: #030305;
    --text-color: #f8fafc;
    --text-muted: #8e9cae;
    
    /* Monochrome Accents */
    --accent-orange: #ffffff;      /* White */
    --accent-purple: #737373;      /* Mid Grey */
    --accent-gradient: linear-gradient(135deg, #ffffff 0%, #737373 50%, #262626 100%);
    
    --card-bg: rgba(15, 15, 20, 0.6);
    --card-border: rgba(255, 255, 255, 0.04);
    --timeline-line-color: rgba(255, 255, 255, 0.08);
    
    --terminal-bg: rgba(10, 10, 14, 0.85);
    --terminal-header-bg: rgba(15, 15, 20, 0.95);
    --terminal-body-bg: rgba(6, 6, 8, 0.4);
    --terminal-border: rgba(255, 255, 255, 0.08);
    --terminal-border-focus: rgba(255, 255, 255, 0.2);
    --terminal-header-border: rgba(255, 255, 255, 0.05);
    --terminal-input-row-border: rgba(255, 255, 255, 0.05);
    
    --input-row-bg: rgba(10, 10, 14, 0.95);
    --option-btn-bg: rgba(255, 255, 255, 0.04);
    --option-btn-border: rgba(255, 255, 255, 0.12);
    --option-btn-text: #cbd5e1;
    --option-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --option-btn-hover-border: #ffffff;
    --option-btn-hover-text: #ffffff;
    
    --project-card-bg: rgba(10, 10, 15, 0.7);
    --project-card-border: rgba(255, 255, 255, 0.05);
    --project-card-btn-bg: #17171d;
    --project-card-btn-color: #ffffff;
    --project-card-btn-hover-bg: #ffffff;
    --project-card-btn-hover-color: #000000;
    
    --scroll-thumb: rgba(255, 255, 255, 0.15);
    --scroll-thumb-hover: rgba(255, 255, 255, 0.35);
    --dot-canvas-opacity: 0.15;
    
    --settings-bg: rgba(15, 15, 20, 0.85);
    --settings-border: rgba(255, 255, 255, 0.08);
    --settings-text: #e2e8f0;
    --settings-btn-active: #ffffff;
}

body[data-theme="light"] {
    --bg-color: #f1f5f9;
    --text-color: #0f172a;
    --text-muted: #475569;
    
    --accent-orange: #7c3aed;      /* Violet */
    --accent-purple: #3b82f6;      /* Blue */
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #10b981 100%);
    
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(15, 23, 42, 0.08);
    --timeline-line-color: rgba(15, 23, 42, 0.08);
    
    --terminal-bg: rgba(255, 255, 255, 0.92);
    --terminal-header-bg: rgba(226, 232, 240, 0.95);
    --terminal-body-bg: rgba(255, 255, 255, 0.6);
    --terminal-border: rgba(15, 23, 42, 0.1);
    --terminal-border-focus: rgba(124, 58, 237, 0.4);
    --terminal-header-border: rgba(15, 23, 42, 0.06);
    --terminal-input-row-border: rgba(15, 23, 42, 0.06);
    
    --input-row-bg: rgba(241, 245, 249, 0.95);
    --option-btn-bg: rgba(124, 58, 237, 0.03);
    --option-btn-border: rgba(124, 58, 237, 0.12);
    --option-btn-text: #475569;
    --option-btn-hover-bg: rgba(124, 58, 237, 0.08);
    --option-btn-hover-border: #7c3aed;
    --option-btn-hover-text: #7c3aed;
    
    --project-card-bg: rgba(255, 255, 255, 0.85);
    --project-card-border: rgba(15, 23, 42, 0.08);
    --project-card-btn-bg: #e2e8f0;
    --project-card-btn-color: #0f172a;
    --project-card-btn-hover-bg: #7c3aed;
    --project-card-btn-hover-color: #ffffff;
    
    --scroll-thumb: rgba(15, 23, 42, 0.15);
    --scroll-thumb-hover: rgba(15, 23, 42, 0.35);
    --dot-canvas-opacity: 0.25;
    
    --settings-bg: rgba(255, 255, 255, 0.95);
    --settings-border: rgba(15, 23, 42, 0.08);
    --settings-text: #334155;
    --settings-btn-active: #7c3aed;
}

/* BASE STYLES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* BACKGROUND CANVAS (Dot Distortion) */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* MONOCHROME BACKGROUND GLOWS */
.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -3;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.06; /* Extremely faint monochrome fog */
    animation: floatBlob 24s infinite alternate ease-in-out;
}

#blob-orange {
    background: #ffffff;
    top: -120px;
    left: -80px;
}

#blob-purple {
    background: #737373;
    bottom: -120px;
    right: -80px;
    animation-delay: -8s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, 70px) scale(1.1);
    }
    100% {
        transform: translate(-20px, 30px) scale(0.95);
    }
}

/* PIXEL CANVAS COMPONENT STYLING */
pixel-canvas {
    display: none; /* Nascosto per ora su richiesta */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover pixel-canvas {
    opacity: 0.35;
}

/* GLASS CARDS */
.glass-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 35px;
    transition: border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.02);
    transform: translateY(-4px);
}

/* Assicura che i testi stiano sopra il pixel canvas */
.glass-card > * {
    position: relative;
    z-index: 2;
}

/* HERO SECTION */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.hero-pixel-canvas {
    display: none; /* Nascosto per ora su richiesta */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.12;
    transition: opacity 0.4s ease;
}

.hero-section:hover .hero-pixel-canvas {
    opacity: 0.22;
}

.hero-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -1.5px;
    cursor: default;
    font-family: var(--font-family);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
    font-family: var(--font-mono);
}

/* Stile per l'effetto Text Animate */
.text-animate-chars {
    display: inline-block;
}

.text-animate-chars span {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    animation: textRevealStaggered 1.4s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes textRevealStaggered {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

.text-animate-chars span.animate-done {
    animation: none;
    opacity: 1;
    filter: blur(0);
    transform: none;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease, filter 0.3s ease;
    animation: bounceArrow 2s infinite;
}

.scroll-down-arrow:hover {
    color: #ffffff;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
}

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, 0);
    }
    40% {
        transform: translate(-50%, -10px);
    }
    60% {
        transform: translate(-50%, -5px);
    }
}

.mouse-wheel {
    animation: scrollDot 2s infinite ease-in-out;
}

@keyframes scrollDot {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(12px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 0;
    }
}

/* CHAT TERMINAL SECTION */
.chat-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 0;
    box-sizing: border-box;
}

.terminal-card {
    border: 1px solid var(--terminal-border);
    background: var(--terminal-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: border-color 0.3s ease;
}

.terminal-card:focus-within {
    border-color: var(--terminal-border-focus);
}

.terminal-header {
    display: flex;
    align-items: center;
    background: var(--terminal-header-bg);
    padding: 12px 20px;
    border-bottom: 1px solid var(--terminal-header-border);
}

.terminal-dots {
    display: flex;
    gap: 7px;
}

.terminal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #404040; /* Monochrome dots */
}
.terminal-dot.red { background: #404040; }
.terminal-dot.yellow { background: #737373; }
.terminal-dot.green { background: #a3a3a3; }

.terminal-title {
    margin-left: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.terminal-body {
    height: 380px;
    overflow-y: auto;
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--terminal-body-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.terminal-line {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeLine 0.3s forwards ease-out;
}

@keyframes fadeLine {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    color: var(--text-color);
    align-self: flex-start;
    max-width: 85%;
}

.bot-prompt {
    color: var(--text-muted);
    font-weight: 600;
}

.user-message {
    color: var(--text-color);
    align-self: flex-end;
    text-align: right;
    max-width: 85%;
}

.user-prompt {
    color: var(--accent-orange);
    font-weight: 600;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    animation: fadeLine 0.4s forwards ease-out;
}

.chat-option-btn {
    background: var(--option-btn-bg);
    border: 1px solid var(--option-btn-border);
    color: var(--option-btn-text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-option-btn:hover {
    background: var(--option-btn-hover-bg);
    border-color: var(--option-btn-hover-border);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.15);
    color: var(--option-btn-hover-text);
    transform: translateY(-2px);
}

.chat-option-btn:active {
    transform: translateY(0);
}

.terminal-input-row {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--terminal-input-row-border);
    padding: 14px 20px;
    background: var(--input-row-bg);
}

.input-prefix {
    font-family: var(--font-mono);
    color: var(--accent-orange);
    margin-right: 10px;
    font-size: 0.9rem;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* SHOWCASE SECTION - GRID LAYOUT */
.timeline-section {
    padding: 60px 0 100px;
    position: relative;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.project-carousel-viewport {
    overflow: hidden; /* Restored to clip projects horizontally to exactly 3 items */
    width: 100%;
    padding: 24px 0; /* Kept vertical padding for top/bottom hover scaling and shadows */
    margin: -24px 0;
}

.carousel-track {
    display: flex;
    gap: 30px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 20;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
}

.carousel-arrow:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.08);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-arrow.prev {
    left: -65px;
}

.carousel-arrow.next {
    right: -65px;
}

@media (max-width: 1100px) {
    .carousel-arrow.prev {
        left: -15px;
    }
    .carousel-arrow.next {
        right: -15px;
    }
}

/* PROJECT CARDS (Apple-inspired Style) */
.project-card {
    display: flex;
    flex-direction: column;
    padding: 0 !important; /* Override glass-card default padding */
    overflow: hidden;
    background: var(--project-card-bg);
    border: 1px solid var(--project-card-border);
    border-radius: 20px;
    min-height: 480px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease;
    width: calc((100% - 60px) / 3);
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .project-card {
        width: calc((100% - 30px) / 2);
    }
}

@media (max-width: 650px) {
    .project-card {
        width: 100%;
    }
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.project-card-image-wrapper {
    height: 220px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: #060609;
}

.project-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.project-card:hover .project-card-img {
    transform: scale(1.04);
    opacity: 0.95;
}

.project-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 2;
}

.project-card-hook {
    position: absolute;
    top: 18px;
    left: 18px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.project-card-info {
    padding: 28px 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.project-card-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.project-card-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
    margin-bottom: auto; /* Push button to the bottom if content is shorter */
}

.project-card-btn {
    background: var(--project-card-btn-bg);
    border: 1px solid var(--project-card-border);
    color: var(--project-card-btn-color);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.project-card-btn:hover {
    background: var(--project-card-btn-hover-bg);
    color: var(--project-card-btn-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.1);
}

.project-card-footer {
    border-top: 1px solid var(--project-card-border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted); /* Neutral gray color */
}

.project-card-site {
    color: var(--text-muted);
}

.project-card-tags {
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* PLACEHOLDERS INSIDE CARDS */
.project-card-placeholder {
    width: 100%;
    height: 100%;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: #060609;
    color: #666;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-align: left;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 12px;
    color: #4b5563;
}

.code-header .dots {
    display: flex;
    gap: 4px;
}

.code-header .dots::before, .code-header .dots::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.code-body {
    margin: 0;
    white-space: pre-wrap;
    color: #888;
    line-height: 1.45;
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    background: #060609;
    padding: 20px;
    width: 100%;
    height: 100%;
}

.chart-header {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 12px;
    text-align: left;
}

.chart-graph {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-svg {
    width: 100%;
    max-height: 120px;
}

/* CENTERED MODAL FOR DETAILED PROJECT EXPANSION */
.project-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s ease;
}

.project-drawer.active {
    visibility: visible;
    opacity: 1;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.drawer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    width: 620px;
    max-width: 90%;
    max-height: 85vh;
    background: #0a0a0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 2;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-drawer.active .drawer-content {
    transform: translate(-50%, -50%) scale(1);
}

.drawer-body {
    height: 100%;
    overflow-y: auto;
    padding: 0; /* Rimosso padding per contenere la card espansa in modo nativo */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.drawer-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1) rotate(90deg);
}

/* DRAWER INNER ELEMENTS */
.drawer-title {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-top: 10px;
}

.drawer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.drawer-img-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #060609;
}

.drawer-img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.9;
}

.drawer-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #e2e8f0;
    font-weight: 300;
}

.drawer-tech-section h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888888;
    margin-bottom: 12px;
}

.drawer-tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.drawer-tech-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.drawer-actions {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.drawer-btn {
    flex: 1;
    background: #ffffff;
    color: #000000;
    border: none;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 20px;
    border-radius: 30px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drawer-btn:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.drawer-btn.secondary {
    background: #17171d;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tags span {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.glass-card:hover .tags span {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

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

/* MONOCHROME BADGES */
.status-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 30px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    transition: all 0.25s ease;
}

.glass-card:hover .status-badge {
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* REVEAL CODE LINK */
.view-code-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #ffffff;
    opacity: 0.6;
    text-decoration: none;
    transition: opacity 0.2s ease, text-shadow 0.2s ease;
}

.view-code-btn:hover {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ABOUT SECTION & TIMELINE */
.about-section {
    padding: 60px 0 100px;
    position: relative;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 40px auto 0;
    padding-left: 30px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -37px;
    top: 24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #030305;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    background: #cbd5e1;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.timeline-content.glass-card {
    padding: 24px 28px;
    border-radius: 16px;
    background: rgba(10, 10, 15, 0.5);
}

.timeline-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.timeline-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
}

.hide-section {
    display: none !important;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 60px 0;
    color: rgba(255, 255, 255, 0.2);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

/* SOCIAL LINKS IN TERMINAL */
.terminal-social-icon {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
}

span:hover > .terminal-social-icon {
    transform: scale(1.2) rotate(4deg);
    filter: drop-shadow(0 0 4px var(--social-hover-shadow, currentColor));
}

span:hover > a {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* SETTINGS WIDGET (LANG & THEME TOGGLE) */
.settings-widget {
    position: fixed;
    top: 25px;
    left: 25px;
    z-index: 9999;
}

.settings-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--settings-bg);
    border: 1px solid var(--settings-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-widget:hover .settings-btn {
    transform: rotate(45deg) scale(1.05);
    border-color: var(--settings-btn-active);
}

.settings-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    width: 190px;
    background: var(--settings-bg);
    border: 1px solid var(--settings-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-widget:hover .settings-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.settings-section-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.settings-group {
    display: flex;
    gap: 6px;
}

.settings-toggle-btn {
    flex: 1;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--settings-border);
    color: var(--settings-text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

body[data-theme="light"] .settings-toggle-btn {
    background: rgba(0, 0, 0, 0.04);
}

.settings-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

body[data-theme="light"] .settings-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #000000;
}

.settings-toggle-btn.active {
    background: var(--settings-btn-active);
    color: var(--bg-color);
    border-color: var(--settings-btn-active);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .glass-card {
        padding: 25px;
    }
    
    .terminal-body {
        height: 320px;
    }
    
    .settings-widget {
        top: 15px;
        left: 15px;
    }
}

/* LIGHT MODE SPECIFIC OVERRIDES */
body[data-theme="light"] .hero-title {
    color: #000000;
}

body[data-theme="light"] .section-title {
    background: linear-gradient(to right, #000000, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body[data-theme="light"] .drawer-content {
    background: var(--bg-color);
    border-color: var(--card-border);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .drawer-close-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

body[data-theme="light"] .drawer-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000000;
}

body[data-theme="light"] .drawer-btn {
    background: #7c3aed;
    color: #ffffff;
}

body[data-theme="light"] .drawer-btn:hover {
    background: #6d28d9;
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.2);
}

body[data-theme="light"] .drawer-btn.secondary {
    background: #e2e8f0;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.05);
}

body[data-theme="light"] .drawer-btn.secondary:hover {
    background: #cbd5e1;
}

/* Page titles in Timeline / Chi sono */
body[data-theme="light"] .timeline {
    border-left-color: rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .timeline-content.glass-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

body[data-theme="light"] .timeline-content h3 {
    color: #000000;
    font-weight: 700;
}

body[data-theme="light"] .timeline-content p {
    color: #475569;
    font-weight: 300;
    font-size: 0.92rem;
    line-height: 1.65;
}

body[data-theme="light"] .timeline-dot {
    background: #7c3aed;
    border: 3px solid #f1f5f9;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

body[data-theme="light"] .timeline-item:hover .timeline-dot {
    background: #3b82f6;
}

/* Card overrides for Light Mode */
body[data-theme="light"] .project-card-image-wrapper {
    background: #e2e8f0;
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

body[data-theme="light"] .project-card-badge {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

body[data-theme="light"] .project-card-hook {
    color: #0f172a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] .project-card-placeholder {
    background: #f8fafc;
    color: #475569;
}

body[data-theme="light"] .code-header {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    color: #475569;
}

body[data-theme="light"] .code-header .dots::before, 
body[data-theme="light"] .code-header .dots::after {
    background: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .code-body {
    color: #334155;
}

body[data-theme="light"] .chart-placeholder {
    background: #f8fafc;
}

body[data-theme="light"] .chart-header {
    color: #475569;
}

body[data-theme="light"] .chart-svg path {
    stroke: #7c3aed;
}

body[data-theme="light"] .chart-svg line {
    stroke: rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .project-card-tags {
    color: #64748b;
}

body[data-theme="light"] .project-card-site {
    color: #64748b;
}

body[data-theme="light"] footer {
    color: #64748b;
    border-top-color: rgba(15, 23, 42, 0.08);
}

/* TERMINAL LINKS DYNAMIC COLORING */
.terminal-link {
    color: var(--text-color);
    text-decoration: underline;
    transition: all 0.2s ease;
}

.terminal-link:hover {
    color: var(--accent-purple) !important;
    text-shadow: 0 0 8px rgba(124, 58, 237, 0.3);
}

body[data-theme="light"] .terminal-link {
    color: #7c3aed;
}

body[data-theme="light"] .terminal-link:hover {
    color: #3b82f6 !important;
    text-shadow: none;
}

body[data-theme="light"] .terminal-social-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

/* Force GitHub SVG fill to be dark in Light Mode */
body[data-theme="light"] svg[style*="fill: #f0f6fc"] {
    fill: #0f172a !important;
}

body[data-theme="light"] span:hover > .terminal-social-icon {
    filter: drop-shadow(0 0 4px var(--social-hover-shadow, #7c3aed));
}

body[data-theme="light"] span:hover > a {
    color: #3b82f6 !important;
    text-shadow: none;
}


