/* 
   Valerio Puglisi | AI Architect
   Theme: Positive Future AI (Deep Navy / Teal / Glass)
*/

:root {
    --bg-dark: #0f172a;
    --bg-light: #1e1b4b;
    /* Indigo 950 */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-teal: #2dd4bf;
    /* Teal 400 */
    --accent-purple: #818cf8;
    /* Indigo 400 */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --nav-height: 80px;
}

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

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

body {
    background: radial-gradient(circle at top right, var(--bg-light), var(--bg-dark));
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 5px;
}

/* Canvas Background */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
    /* Let clicks pass through */
}

/* Typography & Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.highlight {
    color: var(--accent-teal);
    font-weight: 600;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(129, 140, 248, 0.3);
    /* Purple tint */
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    color: var(--accent-teal);
    border: 1px solid var(--accent-teal);
}

.btn-primary:hover {
    background: rgba(45, 212, 191, 0.1);
}

.btn-filled {
    background: var(--accent-teal);
    color: var(--bg-dark);
    font-weight: 700;
    border: 1px solid var(--accent-teal);
}

.btn-filled:hover {
    background: transparent;
    color: var(--accent-teal);
}

.btn-outline {
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Navigation */
.navbar {
    height: var(--nav-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar.gloss {
    background: rgba(15, 23, 42, 0.85);
    /* Dark semi-transparent */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.logo-symbol {
    color: var(--accent-teal);
}

.logo-text {
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-teal);
}

/* Navigation Active Indicator */
.nav-link.active::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--accent-teal);
    bottom: -5px;
    left: 0;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section (Landing) */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-height);
}

.hero-content {
    max-width: 800px;
}

.hero-greeting {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.hero-name {
    font-size: clamp(40px, 8vw, 80px);
    line-height: 1.1;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-size: clamp(30px, 5vw, 60px);
    color: var(--text-secondary);
    line-height: 1.2;
    margin-bottom: 2rem;
}

.typing-text {
    color: var(--accent-purple);
    border-right: 2px solid var(--accent-purple);
    animation: blink 0.75s step-end infinite;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* Avatar & Wrapper */
.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-avatar {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    max-width: 400px;
}

.avatar-img {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 50%;
    /* Circle avatar */
    border: 4px solid var(--accent-teal);
    box-shadow: 0 0 30px rgba(45, 212, 191, 0.3);
    animation: floatAvatar 4s ease-in-out infinite;
}

@keyframes floatAvatar {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(20px);
        /* Move down significantly to "indicate" down */
    }

    100% {
        transform: translateY(0px);
    }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .hero-wrapper {
        flex-direction: column-reverse;
        /* Avatar on top or bottom? Let's put text on top, avatar below */
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-avatar {
        margin-top: 2rem;
        max-width: 250px;
    }
}

/* Sub-pages Headers */
.page-content {
    padding-top: var(--nav-height);
    min-height: calc(100vh - 100px);
    /* rough footer height */
}

/* Scroll Down Mouse */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: scrollMouse 2s infinite;
}

@keyframes scrollMouse {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 15px);
        opacity: 0;
    }
}

@keyframes blink {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--accent-purple);
    }
}

/* Sections General */
.section {
    padding: 100px 0;
}

.section-header {
    margin-bottom: 3rem;
    max-width: 800px;
}

.section-title {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

.section-number {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    font-weight: 400;
    margin-right: 10px;
    font-size: 1.4rem;
}

.section-line {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    margin-top: 20px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
}

.stat-card.hover-effect:hover {
    cursor: pointer;
    border-color: var(--accent-teal);
}

.stat-icon {
    font-size: 2rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

/* Experience (Timeline) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

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

.timeline-dot {
    position: absolute;
    left: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent-teal);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-teal);
}

.job-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.job-title {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.job-company {
    color: var(--accent-teal);
    font-family: var(--font-mono);
    font-weight: 500;
}

.job-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 20px;
}

.job-desc {
    list-style: none;
    margin-bottom: 1.5rem;
}

.job-desc li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.job-desc li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-purple);
}

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.job-tags span {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-teal);
    background: rgba(45, 212, 191, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
}

/* Skills Cards */
.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-title i {
    color: var(--accent-purple);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    transform: translateY(-2px);
}

/* Projects Grid */
.projects-grid,
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 3rem;
}

.project-card,
.blog-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.project-icon {
    font-size: 2.5rem;
    color: var(--accent-teal);
}

.project-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.project-links a:hover {
    color: var(--accent-teal);
}

.project-title {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tags {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.show-more-container {
    text-align: center;
}

/* Blog Styles */
.blog-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
}

.blog-title a {
    color: var(--text-primary);
}

.blog-title a:hover {
    color: var(--accent-teal);
}

.blog-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    font-weight: 600;
    color: var(--accent-teal);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Article Page */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
}

.article-meta {
    font-family: var(--font-mono);
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

.article-tag::before {
    content: '• ';
    color: var(--text-secondary);
}

.article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.article-body {
    padding: 3rem;
    font-size: 1.1rem;
}

.article-body p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.article-body .lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
}

.article-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.article-body ul {
    margin-bottom: 1.5rem;
    padding-left: 20px;
    color: var(--text-secondary);
}

.article-body li {
    margin-bottom: 0.5rem;
}

blockquote {
    border-left: 4px solid var(--accent-teal);
    padding-left: 20px;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.article-footer {
    margin-top: 3rem;
    text-align: center;
}

/* Contact */
.center-text {
    text-align: center;
}

.contact-container {
    max-width: 600px;
}

.highlight-text {
    font-family: var(--font-mono);
    color: var(--accent-teal);
    margin-bottom: 1rem;
}

.title-large {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.contact-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.big {
    padding: 15px 40px;
    font-size: 1rem;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.social-links {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--accent-teal);
    transform: translateY(-3px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

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

/* Responsive */
/* Responsive */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 0 15px;
    }

    .hero-name {
        font-size: clamp(32px, 6vw, 60px);
    }
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }

    .navbar {
        background: rgba(15, 23, 42, 0.95);
    }

    .nav-toggle {
        display: block;
        color: var(--accent-teal);
        z-index: 1100;
        /* Ensure it's above the menu */
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        /* Slightly wider for better readability */
        height: 100vh;
        background: rgba(17, 24, 39, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border-left: 1px solid var(--glass-border);
        padding: 2rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

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

    .nav-link {
        font-size: 1.2rem;
        padding: 10px 0;
        display: block;
        width: 100%;
        text-align: center;
    }

    .nav-link.btn-primary {
        margin-top: 1rem;
    }

    .hero-section {
        padding-top: 120px;
        /* More space for fixed header */
        text-align: center;
        justify-content: center;
    }

    .hero-content {
        margin: 0 auto;
        padding-bottom: 3rem;
        /* Space for scroll indicator */
    }

    .hero-name {
        font-size: 2.8rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-desc {
        margin: 0 auto 2rem auto;
    }

    .hero-actions {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .section-header {
        text-align: center;
        margin: 0 auto 3rem auto;
    }

    .section-title {
        justify-content: center;
        font-size: 1.6rem;
    }

    .section-line {
        display: none;
        /* Hide line on mobile for cleaner look */
    }

    .article-body {
        padding: 1.5rem;
    }

    /* Ensure widget doesn't block content */
    footer {
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        width: 100%;
        /* Full width on very small screens */
    }

    .hero-name {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .stat-card,
    .glass-card {
        padding: 1.5rem 1rem;
    }

    .title-large {
        font-size: 2.2rem;
    }
}

/* =========================================
   Demos Section
   ========================================= */
.demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.demo-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.demo-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-teal);
    box-shadow: 0 10px 40px rgba(45, 212, 191, 0.12);
}

.demo-card .demo-icon {
    font-size: 2rem;
    color: var(--accent-teal);
    margin-bottom: 1rem;
}

.demo-card .demo-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.demo-card .demo-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.demo-card .demo-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-purple);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.demo-card.coming-soon {
    opacity: 0.55;
    cursor: not-allowed;
}

.demo-card.coming-soon:hover {
    transform: none;
    border-color: var(--glass-border);
    box-shadow: none;
}

