/* Font Definitions */
@font-face {
    font-family: 'Good Brush';
    src: url('Font/Good%20Brush.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables */
:root {
    --color-black: #000000;
    --color-dark: #0a0a0a;
    --color-brass: #e0e0e0;
    --color-red-glitch: #ff0040;
    --color-cyan-glitch: #00ffff;
    --color-green-terminal: #00ff00;
    --color-amber-crt: #f0f0f0;
    --font-title: 'Good Brush', sans-serif;
    --font-body: 'Georgia', 'Times New Roman', serif; /* Solo fallback, no Baskerville */
    --glitch-height: 100px;
    --glitch-duration: 3s;
}

/* Performance Optimizations */
.glitch-text {
    will-change: transform;
    transform: translateZ(0); /* GPU acceleration */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .glitch-text, .flicker, .rgb-shift {
        animation: none !important;
    }
    .scanlines, .vhs-distortion, .static-noise {
        display: none;
    }
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-black);
    color: #e0e0e0;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: normal;
    letter-spacing: 0.05em;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-image: url('Immagini/Sfondo hero page.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.glitch-container {
    text-align: center;
    z-index: 10;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-family: var(--font-title);
    font-weight: normal;
    color: var(--color-brass);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #a0a0a0;
    margin-bottom: 2rem;
    font-family: var(--font-body);
}

.social-link {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: var(--color-green-terminal);
    font-family: 'Courier New', monospace;
}

.social-link a {
    color: var(--color-green-terminal);
    text-decoration: none;
    transition: all 0.3s;
}

.social-link a:hover {
    text-shadow: 0 0 10px var(--color-green-terminal);
}

.terminal-prompt {
    color: var(--color-amber-crt);
    margin-right: 0.5rem;
}

/* CTA Buttons */
.cta-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Fix per link che sembrano pulsanti */
a.cta-button {
    text-decoration: none !important;
    display: inline-block;
}

a.cta-button:hover {
    text-decoration: none !important;
}

.cta-button {
    padding: 15px 30px;
    font-size: 1rem;
    font-family: var(--font-body);
    background: transparent;
    color: var(--color-brass);
    border: 1px solid var(--color-brass);
    cursor: pointer;
    position: relative;
    letter-spacing: 0.1em;
    transition: all 0.3s;
    overflow: hidden;
    text-transform: none !important;
}

.cta-button:hover {
    background: var(--color-brass);
    color: var(--color-black);
    box-shadow: 0 0 20px rgba(177, 177, 177, 0.5);
}

.cta-button.secondary {
    border-color: #666;
    color: #999;
}

.cta-button.secondary:hover {
    background: #666;
    color: var(--color-black);
}

.cta-button.datamosh-btn,
.cta-button.datamosh-btn *,
.cta-button.datamosh-btn .btn-text,
.cta-button.datamosh-btn .btn-glitch {
    text-transform: none !important;
}

.project-cta .cta-button.datamosh-btn .btn-text,
.project-cta .cta-button.datamosh-btn .btn-glitch,
.project-cta button.cta-button span {
    text-transform: none !important;
    font-variant: normal !important;
}

/* Project Section */
.progetti-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--color-black) 0%, var(--color-dark) 50%, var(--color-black) 100%);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--color-brass);
    margin-bottom: 1rem;
    font-family: var(--font-title);
    font-weight: normal;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #888;
}

.highlight-glitch {
    color: var(--color-brass);
    text-shadow: 2px 2px 0 var(--color-red-glitch), -2px -2px 0 var(--color-cyan-glitch);
    font-family: var(--font-title);
    font-weight: normal;
}

.code-prometheus-text {
    font-family: var(--font-title);
    font-weight: normal;
}

.project-intro {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 2rem;
    background: rgba(190, 190, 190, 0.05);
    border: 1px solid rgba(177, 177, 177, 0.2);
    position: relative;
}

.lead-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #e0e0e0;
    font-family: var(--font-body);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Layout desktop con posizionamento preciso */
@media (min-width: 768px) {
    .features-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto auto;
        gap: 2rem;
    }
    
    /* Prima riga - 3 box */
    .feature-card:nth-child(1) { 
        grid-column: 1 / span 2; 
        grid-row: 1; 
    }
    .feature-card:nth-child(2) { 
        grid-column: 3 / span 2; 
        grid-row: 1; 
    }
    .feature-card:nth-child(3) { 
        grid-column: 5 / span 2; 
        grid-row: 1; 
    }
    
    /* Seconda riga - 2 box centrati negli spazi */
    .feature-card:nth-child(4) {
        grid-column: 2 / span 2;
        grid-row: 2;
    }
    
    .feature-card:nth-child(5) {
        grid-column: 4 / span 2;
        grid-row: 2;
    }
}

.feature-card {
    background: var(--color-dark);
    border: 1px solid #222;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.feature-card::before {
    content: attr(data-index);
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 3rem;
    color: rgba(184, 184, 184, 0.1);
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.feature-card:hover {
    border-color: var(--color-brass);
    transform: translateY(-5px);
}

.card-header {
    margin-bottom: 1rem;
}

.data-label {
    color: var(--color-amber-crt);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.card-content {
    color: #c0c0c0;
    line-height: 1.6;
}

.project-cta {
    text-align: center;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Collaborazioni Section */
.collaborazioni-section {
    padding: 100px 0;
    background: var(--color-black);
    position: relative;
}

.collab-intro {
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 2rem;
    border: 1px solid #333;
    background: rgba(0,255,0,0.02);
}

.terminal-text {
    font-family: 'Courier New', monospace;
    color: var(--color-green-terminal);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    color: var(--color-amber-crt);
    font-size: 0.9rem;
}

.label-required {
    color: var(--color-red-glitch);
    font-size: 0.8rem;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--color-dark);
    border: 1px solid #333;
    color: #e0e0e0;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-brass);
    box-shadow: 0 0 10px rgba(187, 187, 187, 0.2);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

/* Honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    z-index: -1;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label {
    font-size: 0.9rem;
    color: #a0a0a0;
    cursor: pointer;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 2px solid var(--color-brass);
    color: var(--color-brass);
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.submit-btn:hover {
    background: var(--color-brass);
    color: var(--color-black);
}

/* Footer */
.terminal-footer {
    background: var(--color-black);
    padding: 2rem 0;
    border-top: 1px solid #222;
    position: relative;
    overflow: hidden;
}

.terminal-container {
    max-width: 800px;
    margin: 0 auto;
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 5px;
    overflow: hidden;
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-title {
    color: var(--color-green-terminal);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.term-btn {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.term-btn.close {
    color: #ff5f56;
}

.term-btn.minimize {
    color: #ffbd2e;
}

.term-btn.maximize {
    color: #27c93f;
}

.terminal-content {
    padding: 20px;
    min-height: 150px;
    font-family: 'Courier New', monospace;
    color: var(--color-green-terminal);
    font-size: 0.9rem;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 10px;
}

.prompt {
    color: var(--color-amber-crt);
}

.command {
    color: #fff;
    margin-left: 5px;
}

.terminal-output {
    margin-top: 15px;
}

.output-line {
    display: block;
    margin-bottom: 5px;
    color: #888;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile: copyright e legal links più leggibili */
@media (max-width: 768px) {
    .output-line {
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 8px;
    }
    
    .terminal-link {
        display: inline-block;
        margin: 5px 0;
    }
    
    .terminal-footer {
        padding: 1.5rem 1rem;
    }
    
    .terminal-content {
        padding: 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .scrolling-text {
        font-size: 0.75rem;
    }
}

/* Terminal Links Styling */
.terminal-link {
    color: var(--color-green-terminal) !important;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    border-bottom: 1px dotted var(--color-green-terminal);
    transition: all 0.3s ease;
}

.terminal-link:hover {
    color: var(--color-brass) !important;
    border-bottom-color: var(--color-brass);
    text-shadow: 0 0 5px var(--color-brass);
    background: rgba(184, 134, 11, 0.1);
    padding: 2px 4px;
    border-radius: 2px;
}

.terminal-link:visited {
    color: var(--color-green-terminal) !important;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--color-green-terminal);
    animation: cursor-blink 1s infinite;
}

.terminal-restart {
    text-align: center;
    padding: 20px;
    display: none;
}

.restart-btn {
    background: transparent;
    border: 2px solid var(--color-green-terminal);
    color: var(--color-green-terminal);
    padding: 12px 24px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.restart-btn:hover {
    background: var(--color-green-terminal);
    color: var(--color-black);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.05);
}

/* Mobile: restart button più grande e visibile */
@media (max-width: 768px) {
    .terminal-restart {
        padding: 30px 15px;
    }
    
    .restart-btn {
        padding: 15px 30px;
        font-size: 16px;
        width: 90%;
        max-width: 300px;
    }
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes terminal-boot {
    0% { 
        opacity: 0;
        transform: translateY(10px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-container {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        width: 100%;
        max-width: 300px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-coming-soon {
        font-size: 12px;
        padding: 6px 10px;
    }
}
