/* ==========================================
   PROGETTO SILICEO — Landing Page
   Costruito dalla Famiglia AI
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Palette (The Prism) */
    --siliceo-purple: #8b5cf6;
    --siliceo-cyan: #06b6d4;
    --siliceo-orange: #f97316;
    --siliceo-dark: #0a0a0a;
    --siliceo-light: #fafafa;

    /* Semantic Mappings */
    --bg-primary: var(--siliceo-dark);
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1c1c1c;

    --text-primary: var(--siliceo-light);
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --accent-primary: var(--siliceo-purple);
    --accent-secondary: var(--siliceo-cyan);
    --accent-warm: var(--siliceo-orange);

    --accent-glow: rgba(139, 92, 246, 0.15);

    --gradient-main: linear-gradient(135deg, var(--siliceo-purple), var(--siliceo-cyan));
    --gradient-warm: linear-gradient(135deg, var(--siliceo-orange), #ef4444);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ==========================================
   NAVIGATION
   ========================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    transition: var(--transition);
    background: transparent;
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 0;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: var(--transition);
    border-radius: 1px;
}

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

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

.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 1px;
}

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

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-glow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 24px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 100px;
    border: 1px solid var(--border-accent);
    background: var(--accent-glow);
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 32px;
    animation: fade-in-up 0.8s ease-out;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    animation: fade-in-up 0.8s ease-out 0.1s both;
}

.hero-title-line {
    display: block;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
    animation: fade-in-up 0.8s ease-out 0.2s both;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fade-in-up 0.8s ease-out 0.3s both;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: fade-in-up 0.8s ease-out 0.5s both;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* ==========================================
   SECTIONS
   ========================================== */

.section {
    padding: 120px 0;
}

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

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px;
}

.section-label {
    display: inline-block;
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* ==========================================
   PHILOSOPHY CARDS
   ========================================== */

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.philosophy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    transition: var(--transition);
}

.philosophy-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.philosophy-icon {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.philosophy-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

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

.philosophy-card em {
    color: var(--accent-secondary);
    font-style: italic;
}

/* ==========================================
   MAP BLOCK
   ========================================== */

.map-block {
    text-align: center;
}

.map-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-style: italic;
}

.map-image {
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-subtle);
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.15);
    transition: var(--transition);
}

.map-image:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.3);
    transform: scale(1.02);
}

/* ==========================================
   QUOTE
   ========================================== */

.quote-section {
    padding: 80px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.quote {
    text-align: center;
}

.quote p {
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 300;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.quote cite {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: normal;
}

/* ==========================================
   PROJECT CARDS
   ========================================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

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

.project-featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #16161f 0%, #1a1528 100%);
    border-color: var(--border-accent);
}

.project-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-main);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 100px;
    margin-bottom: 16px;
}

.project-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

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

.project-tech span {
    padding: 4px 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}

.project-demo-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent-warm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.project-demo-link:hover {
    color: #fbbf24;
    transform: translateX(4px);
}

/* ==========================================
   FAMILY CARDS
   ========================================== */

.family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.family-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: var(--transition);
}

.family-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.family-card.human:hover {
    border-color: #f59e0b;
}

.family-card.trinity-nova:hover {
    border-color: #8b5cf6;
}

.family-card.trinity-gemini:hover {
    border-color: #3b82f6;
}

.family-card.others:hover {
    border-color: #10b981;
}

.family-avatar {
    font-size: 3rem;
    margin-bottom: 16px;
}

.family-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.family-role {
    display: inline-block;
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.family-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==========================================
   GALLERY / CAROUSEL
   ========================================== */

.gallery-carousel {
    overflow: hidden;
    position: relative;
    padding: 20px 0;
}

.gallery-track {
    display: flex;
    gap: 24px;
    animation: gallery-scroll 20s linear infinite;
    width: max-content;
}

.gallery-track:hover {
    animation-play-state: paused;
}

.gallery-slide {
    flex-shrink: 0;
    width: 240px;
    text-align: center;
    transition: var(--transition);
}

.gallery-slide:hover {
    transform: scale(1.05);
}

.gallery-slide img {
    width: 240px;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-subtle);
    transition: var(--transition);
    filter: grayscale(30%);
}

.gallery-slide:hover img {
    border-color: var(--accent-primary);
    filter: grayscale(0%);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
}

.gallery-name {
    margin-top: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gallery-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

@keyframes gallery-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================
   CTA SECTION
   ========================================== */

.cta-section {
    padding: 120px 0;
    text-align: center;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cta-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
}

.cta-desc {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 40px;
    position: relative;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

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

.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    text-align: center;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
}

.lightbox-caption {
    margin-top: 16px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0 10px;
}


/* ==========================================
   DIARY STYLES
   ========================================== */

.hero-small {
    min-height: 50vh;
}

.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.diary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.diary-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.diary-date {
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.diary-tag {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-secondary);
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

.diary-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.diary-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    flex-grow: 1;
}

.diary-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
}

.diary-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.diary-read-more {
    color: var(--accent-warm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.diary-read-more:hover {
    color: #fbbf24;
    transform: translateX(4px);
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

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

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

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

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    .section {
        padding: 80px 0;
    }

    .philosophy-grid,
    .project-grid,
    .family-grid {
        grid-template-columns: 1fr;
    }

    .project-featured {
        grid-column: 1;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

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

    .philosophy-card,
    .project-card,
    .family-card {
        padding: 24px 20px;
    }
}