/* =============================================
   ENRICO DELL'ONTE — Global Design System
   Palette: Cosmico / Dark / Lavanda
   ============================================= */

:root {
    --bg-color: #13131A;
    --surface-color: #1C1C26;
    --surface-light: #26263A;
    --accent-color: #A78BFA;
    --accent-glow: rgba(167, 139, 250, 0.15);
    --text-color: #EDE9FE;
    --text-muted: rgba(237, 233, 254, 0.65);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'DM Sans', sans-serif;
    --radius-card: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: initial; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */

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

p {
    line-height: 1.8;
    font-weight: 300;
    color: var(--text-muted);
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--accent-color); }

em {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--accent-color);
}

/* =============================================
   CUSTOM CURSOR
   ============================================= */

.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(167, 139, 250, 0.5);
    transition: width 0.2s, height 0.2s, border-color 0.2s;
}

/* =============================================
   THREE.JS CANVAS
   ============================================= */

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* =============================================
   LAYOUT
   ============================================= */

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

section {
    padding: 14vh 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* =============================================
   NAVBAR
   ============================================= */

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(19, 19, 26, 0.6);
    border-bottom: 1px solid rgba(167, 139, 250, 0.08);
}

.logo { height: 44px; width: auto; }

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}

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

/* =============================================
   SECTION TITLES
   ============================================= */

.section-title {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    margin-bottom: 4rem;
    color: var(--accent-color);
    letter-spacing: -1px;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
    font-weight: 500;
}

/* =============================================
   HERO SECTION (index.html)
   ============================================= */

#hero {
    position: relative;
    align-items: flex-start;
    min-height: 100vh;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 750px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--text-muted);
    max-width: 580px;
    margin-bottom: 3rem;
    font-weight: 300;
    line-height: 1.7;
}

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

.cta-button {
    display: inline-block;
    padding: 1rem 2.8rem;
    border: 1px solid var(--accent-color);
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: color 0.4s ease;
}

.cta-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.cta-button:hover { color: var(--bg-color); }
.cta-button:hover::after { transform: translateY(0); }

/* Section-level CTA (link to deeper pages) */
.section-cta {
    margin-top: 3.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.section-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(167, 139, 250, 0.3);
    padding-bottom: 3px;
    transition: all var(--transition);
}

.section-cta-link:hover {
    color: var(--text-color);
    border-color: var(--text-color);
    gap: 1rem;
}

.section-cta-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    transition: transform var(--transition);
}

.section-cta-link:hover svg { transform: translateX(4px); }

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color var(--transition);
    margin-bottom: 2.5rem;
}

.back-btn:hover { color: var(--accent-color); }

.back-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* =============================================
   ABOUT SECTION
   ============================================= */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

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

.about-text p {
    margin-bottom: 1.8rem;
    font-size: 1.05rem;
}

/* =============================================
   FUN FACTS CARD
   ============================================= */

.fun-facts {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(167, 139, 250, 0.05) 100%);
    padding: 2.5rem;
    border-radius: var(--radius-card);
    border: 1px solid rgba(167, 139, 250, 0.18);
    position: relative;
    overflow: hidden;
}

.fun-facts::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.fun-facts h3 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

.fun-facts-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 2rem;
    display: block;
}

.fun-facts ul {
    list-style: none;
    padding: 0;
}

.fun-facts ul li {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.fun-facts ul li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 5px;
    color: var(--accent-color);
    font-size: 0.65rem;
}

/* =============================================
   TIMELINE
   ============================================= */

.timeline {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-color) 20%, var(--accent-color) 80%, transparent);
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .timeline::before { left: 12px; }
}

.timeline-item {
    margin-bottom: 3.5rem;
    position: relative;
    width: 50%;
    padding-right: 3rem;
}

.timeline-item:nth-child(even) {
    margin-left: auto;
    padding-right: 0;
    padding-left: 3rem;
}

@media (max-width: 768px) {
    .timeline-item {
        width: 100%;
        padding-right: 0;
        padding-left: 3rem;
        margin-left: 0 !important;
    }
}

.timeline-content {
    background: var(--surface-color);
    padding: 2rem 2.2rem;
    border-radius: 16px;
    border: 1px solid var(--surface-light);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.timeline-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.35);
}

.timeline-dot {
    position: absolute;
    top: 1.8rem;
    right: -6px;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.timeline-item:nth-child(even) .timeline-dot {
    right: auto;
    left: -6px;
}

@media (max-width: 768px) {
    .timeline-dot { left: 7px !important; right: auto !important; }
}

.timeline-date {
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: inline-block;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.timeline-title {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: var(--text-color);
}

.timeline-subtitle {
    font-size: 0.95rem;
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.75;
}

/* =============================================
   CONTACTS SECTION
   ============================================= */

#contacts {
    min-height: 70vh;
    text-align: center;
    align-items: center;
}

.contact-title {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.contact-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    font-weight: 300;
}

.social-links {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    font-size: 0.9rem;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    background: var(--surface-color);
    border: 1px solid var(--surface-light);
    transition: all var(--transition);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.social-link:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.3);
}

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

footer {
    margin-top: auto;
    padding: 2rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid rgba(167, 139, 250, 0.08);
}

@media (max-width: 600px) {
    footer { flex-direction: column; text-align: center; gap: 0.8rem; }
}

/* =============================================
   SPLINE VIEWER
   ============================================= */

spline-viewer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: auto;
    -webkit-mask-image: linear-gradient(to bottom, black 65%, transparent 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 65%, transparent 90%, transparent 100%);
}

spline-viewer::part(logo),
spline-viewer::part(watermark) {
    display: none !important;
}

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

.reveal-text { visibility: hidden; }

/* =============================================
   SKILL GRID (professionale.html)
   ============================================= */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.skill-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-light);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: transform var(--transition), border-color var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.skill-card:hover {
    transform: translateY(-4px);
    border-color: rgba(167, 139, 250, 0.3);
}

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

.skill-card-icon {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    display: block;
}

.skill-card-title {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--text-color);
    font-family: var(--font-heading);
}

.skill-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.skill-placeholder {
    text-align: center;
    padding: 3rem;
    border: 1px dashed rgba(167, 139, 250, 0.25);
    border-radius: var(--radius-card);
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* =============================================
   PROFILE PHOTO (personale.html)
   ============================================= */

.profile-photo-container {
    position: relative;
    display: inline-block;
}

.profile-photo {
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    display: block;
    object-fit: cover;
    object-position: top center;
    border: 1px solid rgba(167, 139, 250, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.profile-photo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(167, 139, 250, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* =============================================
   PASSION CARDS (personale.html)
   ============================================= */

.passions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.passion-card {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(167, 139, 250, 0.04) 100%);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--radius-card);
    padding: 2rem;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.passion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(167, 139, 250, 0.1);
}

.passion-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
}

.passion-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-family: var(--font-heading);
}

.passion-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* =============================================
   LANGUAGE BADGE
   ============================================= */

.language-badges {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--surface-color);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 50px;
    padding: 0.6rem 1.4rem;
}

.language-badge-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.language-badge-level {
    font-size: 0.75rem;
    color: var(--accent-color);
    letter-spacing: 1px;
}

/* =============================================
   OBJECTIVE BOX
   ============================================= */

.objective-box {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.08) 0%, var(--surface-color) 100%);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: var(--radius-card);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.objective-box::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 20px;
    font-family: var(--font-heading);
    font-size: 8rem;
    color: rgba(167, 139, 250, 0.06);
    line-height: 1;
    pointer-events: none;
}

.objective-text {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-style: italic;
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

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

@media (max-width: 768px) {
    .skills-grid { grid-template-columns: 1fr; }
    .passions-grid { grid-template-columns: 1fr; }
    .nav-links { gap: 1.5rem; }
    .nav-links a { font-size: 0.75rem; letter-spacing: 1.5px; }
    section { padding: 12vh 0; }
}
