/* ==========================================
   VETRUM TEMPORIS - Main Styles
   Design System: Liquid Glass Minimalism
   ========================================== */

:root {
    /* Palette Vincolante */
    --acqua-marina: #6FB7B2;
    --verde-laguna: #A9C8B5;
    --lapislazuli: #1F3A5F;
    --oro-veneziano: #D4AF37;
    
    /* Gradients */
    --gradient-laguna: linear-gradient(135deg, var(--acqua-marina) 0%, var(--verde-laguna) 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(31, 58, 95, 0.02) 0%, rgba(111, 183, 178, 0.05) 100%);
    
    /* Glass Effects */
    --glass-blur: 24px;
    --glass-opacity: 0.08;
    --glass-border: rgba(255, 255, 255, 0.18);
    
    /* Typography */
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-xxl: 10rem;
    
    /* Animation */
    --ease-glass: cubic-bezier(0.4, 0.0, 0.2, 1);
    --duration-slow: 1200ms;
    --duration-normal: 600ms;
    --duration-fast: 300ms;
}

/* ==========================================
   Reset & Base
   ========================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    color: var(--lapislazuli);
    background: linear-gradient(180deg, 
        rgba(169, 200, 181, 0.08) 0%, 
        rgba(111, 183, 178, 0.12) 50%,
        rgba(31, 58, 95, 0.08) 100%
    );
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
    padding-top: 80px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(111, 183, 178, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(169, 200, 181, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Micro-noise texture */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   Typography
   ========================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    color: var(--lapislazuli);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 300;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}

p {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    color: var(--lapislazuli);
    opacity: 0.9;
}

a {
    color: var(--acqua-marina);
    text-decoration: none;
    transition: opacity var(--duration-fast) var(--ease-glass);
}

a:hover {
    opacity: 0.7;
}

/* ==========================================
   Layout Containers
   ========================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    position: relative;
    z-index: 2;
}

section {
    padding: var(--space-xl) 0;
    position: relative;
}

/* ==========================================
   Navigation
   ========================================== */

.nav-glass {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    border-bottom: 1px solid var(--glass-border);
    transition: all var(--duration-normal) var(--ease-glass);
    box-shadow: 0 2px 20px rgba(31, 58, 95, 0.03);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--lapislazuli);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--lapislazuli);
    opacity: 0.8;
    transition: opacity var(--duration-fast) var(--ease-glass);
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
}

.nav-links a.active {
    font-weight: 500;
}

.nav-link-highlight {
    background: linear-gradient(135deg, var(--aquamarine) 0%, var(--celestial) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1 !important;
    font-weight: 500;
}

/* ==========================================
   Hero Section
   ========================================== */

.hero {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: -80px;
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#liquidCanvas {
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--space-md);
}

.hero-title {
    margin-bottom: var(--space-md);
    opacity: 0;
    animation: fadeInUp var(--duration-slow) var(--ease-glass) 0.3s forwards;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: var(--space-lg);
    opacity: 0;
    animation: fadeInUp var(--duration-slow) var(--ease-glass) 0.6s forwards;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--lapislazuli);
    transition: all var(--duration-normal) var(--ease-glass);
    opacity: 0;
    animation: fadeInUp var(--duration-slow) var(--ease-glass) 0.9s forwards;
}

.hero-cta:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.hero-cta svg {
    transition: transform var(--duration-fast) var(--ease-glass);
}

.hero-cta:hover svg {
    transform: translateY(3px);
}

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* Ottimizzazione performance animazioni */
.hero-title,
.hero-subtitle,
.hero-cta {
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==========================================
   Sections
   ========================================== */

.section-title {
    text-align: center;
    margin-bottom: var(--space-lg);
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
    .nav-links {
        gap: var(--space-md);
    }
    
    .nav-links a {
        font-size: 0.85rem;
    }
    
    section {
        padding: var(--space-lg) 0;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 120px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-xs) var(--space-sm);
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm);
    }
    
    .hero {
        margin-top: -120px;
        padding-top: 120px;
    }
}