@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Montserrat:wght@300;400;500;700&display=swap');

:root {
    --bg-deep: #0a0806;
    --bg-secondary: #120e0a;
    --bg-card: #16120e;
    --text-parchment: #d2c8b4;
    --text-dim: #948b78;
    --accent-iron: #222222;
    --accent-metal: #444444;
    --accent-gold: #8c734a;
    --transition-slow: 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-parchment);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* Evita overflow su media */
img, video, iframe {
    max-width: 100%;
}

/* Offset per anchor con navbar fissa */
#history, #carousel, #echoes, #memorial {
    scroll-margin-top: 110px;
}

h1, h2, h3, h4 {
    font-family: 'Lora', serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #f5f0e6;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--accent-gold);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    background: rgba(10, 8, 6, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    border-bottom: 1px solid rgba(210, 200, 180, 0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 60px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    position: relative; /* per posizionare il toggle su mobile */
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a,
.mobile-menu a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition-medium);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-gold);
    transition: var(--transition-medium);
}

.nav-links a:hover {
    color: var(--text-parchment);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-logo {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gate-house-icon {
    width: 100%;
    height: 100%;
    color: var(--accent-gold);
    transition: var(--transition-medium);
}

.nav-logo:hover .gate-house-icon {
    transform: scale(1.05);
    color: #fff;
}

/* Hamburger (solo mobile) */
.nav-toggle {
    display: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10, 8, 6, 0.4);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: var(--transition-medium);
}

.nav-toggle:hover {
    border-color: rgba(210, 200, 180, 0.25);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-parchment);
    margin: 0 auto;
    border-radius: 2px;
    transition: var(--transition-medium);
}

.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after { transform: translateY(6px); }

.navbar.is-open .nav-toggle-bars { background: transparent; }
.navbar.is-open .nav-toggle-bars::before { transform: translateY(0) rotate(45deg); }
.navbar.is-open .nav-toggle-bars::after { transform: translateY(0) rotate(-45deg); }

.mobile-menu {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: max-height 0.5s ease, opacity 0.3s ease, transform 0.3s ease;
    padding: 0 20px;
}

.navbar.is-open .mobile-menu {
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
    padding-bottom: 14px;
}

.mobile-menu a {
    display: block;
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.mobile-menu a:hover {
    color: var(--text-parchment);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(10, 8, 6, 0.8), rgba(10, 8, 6, 0.85)), url('https://images.unsplash.com/photo-1540914124281-342729c4aa1f?auto=format&fit=crop&q=80&w=1920') center/cover no-repeat;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, var(--bg-deep), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 5rem;
    margin-bottom: 20px;
    letter-spacing: 8px;
    line-height: 1.1;
    animation: fadeInDown 1.5s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-dim);
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: fadeInUp 1.5s ease-out 0.5s backwards;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gate Reveal Section */
.gate-reveal-section {
    position: relative;
    height: 300vh;
    background-color: var(--bg-deep);
}

.gate-container {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
    overflow: hidden;
}

.gate-structure {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    height: 80vh;
    transform-style: preserve-3d;
    z-index: 50;
    pointer-events: none;
}

.gate-frame {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 60;
}

.gate-pillar {
    position: absolute;
    bottom: 0;
    width: 50px;
    height: 100%;
    background: #111;
    border: 2px solid #222;
    box-shadow: 0 0 40px rgba(0,0,0,0.9);
    border-radius: 4px 4px 0 0;
}

.left-p { left: -25px; }
.right-p { right: -25px; }

.fixed-gate-arch {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
}

.arch-text {
    font-family: 'Lora', serif;
    font-size: 24px;
    font-weight: 700;
    fill: var(--text-parchment);
    letter-spacing: 12px;
    text-transform: uppercase;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.9));
}

.gate-wing {
    position: absolute;
    top: 170px; /* Adjust according to arch */
    width: calc(50% - 2px); /* Half width with tiny center gap */
    height: calc(100% - 170px);
    z-index: 55;
    background: transparent;
    color: var(--accent-iron);
}

.left-wing {
    left: 0;
    transform-origin: left center;
}

.right-wing {
    right: 0;
    transform-origin: right center;
}

.gate-wing svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
}

.revealed-content {
    position: relative;
    max-width: 800px;
    text-align: center;
    padding: 0 40px;
    z-index: 10;
    opacity: 0;
    transform: translateZ(-200px) translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.revealed-content h2::after {
    display: none; /* No underline in the reveal content */
}

.revealed-content.visible {
    opacity: 1;
    transform: translateZ(0) translateY(0);
}

.revealed-content p {
    font-size: 1.15rem;
    color: var(--text-dim);
    margin-bottom: 25px;
}

/* Sections General */
.section {
    padding: 150px 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Carousel Section */
.carousel-section {
    text-align: center;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 60px auto 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.05);
}

.carousel-track {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 600px;
    position: relative;
}

.carousel-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.5));
    pointer-events: none;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 8, 6, 0.6);
    color: var(--text-parchment);
    border: 1px solid rgba(255,255,255,0.1);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-medium);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-deep);
    border-color: var(--accent-gold);
}

.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

/* Testimonials Section */
.testimonials-section .centered-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.large-video-container {
    width: 100%;
    max-width: 1100px;
    height: 600px;
    margin: 60px auto 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    overflow: hidden;
    background: #000;
}

.large-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.centered-text {
    max-width: 800px;
    margin: 0 auto;
}

.centered-text p {
    font-size: 1.15rem;
    color: var(--text-dim);
    margin-bottom: 25px;
}

/* Echoes Cards */
.echoes-section {
    text-align: center;
}

.contrast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.contrast-card {
    background: var(--bg-card);
    padding: 60px 40px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    text-align: left;
}

.contrast-card h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-parchment);
    letter-spacing: 2px;
}

.contrast-card p {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.7;
}

.contrast-card:hover {
    transform: translateY(-10px);
    border-color: rgba(210, 200, 180, 0.15);
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
}

/* Featured Video */
.featured-video {
    text-align: center;
}

.iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 1100px;
    margin: 60px auto 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 25px 60px rgba(0,0,0,0.7);
    background: #000;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Footer */
.footer {
    background: #050403;
    padding: 120px 40px 60px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.03);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--accent-gold);
}

.quote {
    font-size: 2.2rem;
    font-family: 'Lora', serif;
    font-style: italic;
    color: var(--text-parchment);
    max-width: 900px;
    margin: 0 auto 20px;
    line-height: 1.4;
    text-align: center;
}

.quote-author {
    text-align: center;
    font-size: 1rem;
    color: #c8b89a;
    letter-spacing: 1px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    text-transform: uppercase;
}

.quote-author span {
    font-style: italic;
    text-transform: none;
}

.credits {
    font-size: 0.9rem;
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 1200px) {
    .nav-container {
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .contrast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-content h1 { font-size: 3.5rem; }
    
    .gate-structure {
        width: 95%;
        height: 70vh;
    }
    
    .fixed-gate-arch {
        top: -10px;
        height: 150px;
    }
    
    .gate-wing {
        top: 130px;
        height: calc(100% - 130px);
    }
}

@media (max-width: 768px) {
    .nav-container {
        justify-content: center;
        padding: 0 20px;
        gap: 0;
    }
    
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .contrast-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 { 
        font-size: 2.8rem;
        letter-spacing: 4px;
    }
    .hero-content p { 
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .section {
        padding: 110px 18px;
    }
    
    .carousel-slide { height: 400px; }
    .large-video-container { height: 400px; }
    
    .gate-structure {
        height: 60vh;
    }
    .fixed-gate-arch {
        height: 120px;
    }
    .arch-text { 
        font-size: 18px;
        letter-spacing: 8px;
    }
    
    .gate-wing {
        top: 100px;
        height: calc(100% - 100px);
    }

    /* Evita accavallamenti tra arco e titolo su schermi bassi */
    .gate-container {
        padding-top: 120px; /* spazio per navbar + arco */
        padding-bottom: 40px;
    }

    .revealed-content {
        margin-top: 90px;
    }
    
    .quote { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    h2 { font-size: 1.7rem; }
    h1, h2, h3, h4 { letter-spacing: 3px; }

    .carousel-slide { height: 320px; }
    .large-video-container { height: 320px; }

    .carousel-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .carousel-btn.prev { left: 12px; }
    .carousel-btn.next { right: 12px; }

    .revealed-content { padding: 0 18px; }
    .revealed-content p { font-size: 1.05rem; }

    .gate-container {
        padding-top: 140px;
    }

    .revealed-content {
        margin-top: 110px;
    }
}

.title-team{
    text-align: center;
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 35px;
    color: #524538;
    letter-spacing: 1px;
}

.team-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 60px;
    max-width: 800px;
    margin: auto;
    padding: 10px 20px;
}

.team-grid p{
    margin: 0;
    font-size: 18px;
    color: #444444;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.team-grid p::after{
    content: "";
    display: block;
    width: 40px;
    height: 2px;
    background-color: #8c734a;
    margin: 8px auto 0;
    transition: width 0.3s ease;
}

.team-grid p:hover{
    color: #d2c8b4;
    transform: translateY(-2px);
}

.team-grid p:hover::after{
    width: 70px;
}

.professor{
    font-weight: bold;
    color: #d2c8b4;
}

@media (max-width: 600px){
    .team-grid{
        grid-template-columns: 1fr;
        gap: 15px;
    }
}



:root {
    --bg-deep: #0a0806;
    --bg-secondary: #120e0a;
    --bg-card: #16120e;
    --text-parchment: #d2c8b4;
    --text-dim: #948b78;
    --accent-iron: #222222;
    --accent-metal: #444444;
    --accent-gold: #8c734a;
    --transition-slow: 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}