/* ============================================================
   SFONDO COSMICO
   ============================================================ */
.cosmic-sky {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    pointer-events: none;
}
body.light-theme .cosmic-sky {
    display: none;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    background: rgba(8, 10, 18, .88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background .4s ease, border-color .4s ease;
}

body.light-theme .site-header {
    background: rgba(242, 237, 229, .92);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.logo {
    margin-right: auto;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--gold);
    white-space: nowrap;
    transition: color .4s ease;
}

.logo-sub {
    display: block;
    margin-top: 2px;
    font-family: var(--serif);
    font-size: .78rem;
    font-weight:700;
    font-style: italic;
    letter-spacing: .4px;
    color: var(--text-muted);
    transition: color .4s ease;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-right: 4px;
}
.main-nav a {
    position: relative;
    font-size: .78rem;
    letter-spacing: 1.2px;
    color: var(--text-soft);
    transition: color var(--transition);
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 0;
    height: 1px;
    background: var(--gold);
    transition: width var(--transition);
}
.main-nav a:hover {
    color: var(--text);
}
.main-nav a:hover::after {
    width: 100%;
}

.theme-toggle-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: .3rem .9rem;
    font-size: .72rem;
    letter-spacing: .8px;
    color: var(--text-soft);
    cursor: pointer;
    transition: all .3s ease;
    font-family: var(--sans);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.theme-toggle-btn:hover {
    border-color: var(--gold-line);
    color: var(--text);
    background: var(--surface-hover);
}
.theme-toggle-btn .icon {
    font-size: .9rem;
}

/* ============================================================
   🌐 LANGUAGE SWITCHER
   IT · PL · EN
   ============================================================ */

.language-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 3px;
    border: 1px solid rgba(212, 165, 116, 0.18);
    border-radius: 20px;
    background: rgba(20, 16, 13, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.language-switcher button {
    appearance: none;
    border: 0;
    background: transparent;

    min-width: 32px;
    height: 27px;
    padding: 0 8px;

    border-radius: 15px;

    font-family: var(--body, 'Montserrat', sans-serif);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1px;

    color: rgba(232, 221, 208, 0.62);

    cursor: pointer;

    transition:
        color 0.35s ease,
        background 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.25s ease;
}

.language-switcher button:hover {
    color: var(--text-accent, #e8ddd0);
    background: rgba(212, 165, 116, 0.08);
}

.language-switcher button:active {
    transform: scale(0.94);
}

.language-switcher button.active {
    color: #f0dfc5;
    background: rgba(212, 165, 116, 0.14);
    box-shadow:
        inset 0 0 0 1px rgba(212, 165, 116, 0.20),
        0 0 12px rgba(212, 165, 116, 0.08);
}

/* ============================================================
   ACCESSIBILITÀ
   ============================================================ */

.language-switcher button:focus-visible {
    outline: 1px solid rgba(212, 165, 116, 0.55);
    outline-offset: 2px;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .language-switcher {
        gap: 2px;
        margin-left: 6px;
        padding: 2px;
    }

    .language-switcher button {
        min-width: 29px;
        height: 25px;
        padding: 0 6px;
        font-size: 0.62rem;
    }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    padding: clamp(90px, 13vw, 160px) 0 clamp(80px, 11vw, 130px);
    text-align: center;
    position: relative;
}
.hero .container {
    position: relative;
    z-index: 2;
}
.hero-kicker {
    margin-bottom: 18px;
    font-family: var(--sans);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .9;
    transition: color .4s ease;
}
.hero h1 {
    font-family: var(--display);
    font-size: clamp(2.5rem, 6vw, 5.3rem);
    font-weight: 500;
    letter-spacing: 5px;
    line-height: 1.05;
    color: var(--text);
    transition: color .4s ease;
    text-shadow: 0 0 30px rgba(0, 0, 0, .25);
}
.hero h1 span {
    color: var(--gold);
    transition: color .4s ease;
}
.hero-lead {
    max-width: 650px;
    margin: 28px auto 0;
    font-family: var(--serif);
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.55;
    color: var(--text-soft);
    transition: color .4s ease;
    opacity: .85;
    animation: textWaveSync 6s ease-in-out infinite alternate;
}
@keyframes textWaveSync {
    0% {
        opacity: 0.5;
        transform: translateY(12px);
    }
    50% {
        opacity: 0.85;
        transform: translateY(-6px);
    }
    100% {
        opacity: 0.9;
        transform: translateY(0px);
    }
}

/* ============================================================
   ONDA HERO — ANIMAZIONE CON FALLBACK
   ============================================================ */

.hero-line {
    width: 100%;
    max-width: 300px;
    height: 30px;
    margin: 34px auto 0;
    position: relative;
    overflow: visible;
}

.wave-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.wave-glow {
    fill: none;
    stroke: url(#waveGlow);
    stroke-width: 2.5;
    stroke-linecap: round;
    opacity: .8;
    animation: waveSinusoidal 5s ease-in-out infinite;
}

/* ANIMAZIONE PRINCIPALE */
@keyframes waveSinusoidal {
    0%, 100% {
        d: path("M0 15 C10 8, 30 8, 40 15 C50 22, 70 22, 80 15 C90 8, 110 8, 120 15");
        transform: translateX(-12px);
        opacity: .5;
    }
    50% {
        d: path("M0 15 C10 22, 30 22, 40 15 C50 8, 70 8, 80 15 C90 22, 110 22, 120 15");
        transform: translateX(0px);
        opacity: .8;
    }
}

/* FALLBACK per browser che NON supportano path() nelle keyframe (Safari, ecc.) */
@supports not (d: path("M0 0")) {
    .wave-glow {
        animation: none; /* disabilita l'animazione */
        d: path("M0 15 C10 8, 30 8, 40 15 C50 22, 70 22, 80 15 C90 8, 110 8, 120 15");
        opacity: .5;
    }
}
/* ============================================================
   ONDE DEL PENSIERO
   ============================================================ */
.thought-waves {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 500px;
    pointer-events: none;
    z-index: 1;
}
.thought-waves path:nth-child(1) {
    stroke: rgba(216, 181, 106, .50);
    stroke-width: 1.2;
    animation: waveMove 8s ease-in-out infinite alternate;
}
.thought-waves path:nth-child(2) {
    stroke: rgba(85, 182, 255, .40);
    stroke-width: .9;
    animation: waveMove 6s ease-in-out .6s infinite alternate;
}
.thought-waves path:nth-child(3) {
    stroke: rgba(154, 208, 255, .45);
    stroke-width: .7;
    animation: waveMove 6s ease-in-out 1.2s infinite alternate;
}
@keyframes waveMove {
    0% {
        transform: translateX(-80px) translateY(0);
    }
    50% {
        transform: translateX(80px) translateY(-4px);
    }
    100% {
        transform: translateX(-80px) translateY(0);
    }
}

/* ============================================================
   ALBERO FILOSOFICO
   ============================================================ */
.knowledge-tree {
    position: absolute;
    width: 160px;
    left: 17%;
    top: 12%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}
.knowledge-tree svg {
    display: block;
    width: 130px;
    height: auto;
    overflow: visible;
}
.tree-motto {
    margin-top: -6px;
    font-family: var(--serif);
    font-size: .82rem;
    font-style: italic;
    font-weight: 600;
    letter-spacing: .8px;
    color: var(--gold);
    opacity: .78;
    transition: color .4s ease;
}

/* ============================================================
   OROLOGIO DI ERACLITO
   ============================================================ */
.heraclitus-clock {
    position: absolute;
    width: 160px;
    right: 17%;
    top: 13%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

body.light-theme .heraclitus-clock svg circle:first-child {
    fill: rgba(242, 237, 229, 0.6);
}

body.light-theme .clock-motto {
    color: var(--gold);
    opacity: .7;
}
/* ============================================================
   FIUME DI ERACLITO  - OROLOGIO
   ============================================================ */
.heraclitus-clock {
    position: absolute;
    width: 160px;
    right: 17%;
    top: 12%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    pointer-events: none;
}

body.light-theme .heraclitus-clock svg circle:first-child {
    fill: rgba(242, 237, 229, 0.5);
}

.clock-motto {
    margin-top: 2px;
    font-family: var(--serif);
    font-size: .82rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: .8px;
    color: var(--gold);
    opacity: .78;
    transition: color .4s ease;
}

body.light-theme .clock-motto {
    color: var(--gold);
    opacity: .7;
}
/* ============================================================
   FILOSOFIA (EPOCHE)
   ============================================================ */
.philosophy-section {
    padding-bottom: 60px;
}
.section-heading {
    margin-bottom: 42px;
    text-align: center;
}
.section-heading h2 {
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--gold);
    transition: color .4s ease;
}
.section-heading p {
    margin-top: 8px;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-muted);
    transition: color .4s ease;
}

.epochs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.epoch-card {
    position: relative;
    min-height: 210px;
    padding: 5px 28px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
body.light-theme .epoch-card {
    background: linear-gradient(145deg, rgba(0, 0, 0, .025), rgba(0, 0, 0, .01));
}
.epoch-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-line);
    background: linear-gradient(145deg, rgba(216, 181, 106, .075), rgba(255, 255, 255, .02));
}
body.light-theme .epoch-card:hover {
    background: linear-gradient(145deg, rgba(184, 134, 11, .06), rgba(0, 0, 0, .02));
}
.epoch-number {
    font-family: var(--display);
    font-size: .68rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 5px;
    transition: color .4s ease;
    opacity: .85;
}
.epoch-card h3 {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 5px;
    letter-spacing: 1px;
     color: var(--gold);
    transition: color .4s ease;
}
.epoch-card h3::after {
    content: "";
    display: block;
    width: 30px;
    height: 1px;
    margin: 15px 0;
    background: var(--gold);
    opacity: .65;
    transition: background .4s ease;
}
.epoch-card p {
    font-family: var(--serif);
    font-size: 1.07rem;
    line-height: 1.45;
    color: var(--text-soft);
    transition: color .4s ease;
    opacity: .9;
}
.epoch-link {
    margin-top: auto;
    padding-top: 2px;
    font-size: .7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .75;
    transition: opacity var(--transition), color .4s ease;
}
.epoch-card:hover .epoch-link {
    opacity: 1;
}

/* ============================================================
   SCUOLE E TRADIZIONI — 6 CARD
   ============================================================ */
.scuole {
    padding: .5rem 0 1.5rem;
}
.scuole-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-top: 1rem;
}
.scuola-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.2rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    min-height: 140px;
    justify-content: center;
}
.scuola-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold-line);
    background: var(--surface-hover);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
}
body.light-theme .scuola-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .06);
}
.scuola-icon {
    font-size: 1.8rem;
    margin-bottom: .4rem;
    line-height: 1.2;
}
.scuola-card h3 {
    margin: 0;
    font-family: var(--display);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--gold);
    transition: color var(--transition);
}
.scuola-card p {
    margin: .3rem 0 0;
    font-family: var(--serif);
    font-size: .92rem;
    line-height: 1.3;
    color: var(--text-soft);
    opacity: .92;
    max-width: 90%;
}
.scuola-card:hover h3 {
    color: var(--gold);
}
.scuola-card:hover p {
    opacity: 1;
}

/* ============================================================
   RISORSE
   ============================================================ */
.resources {
    padding: 20px 0 45px;
    border-top: 1px solid rgba(255, 255, 255, .055);
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    transition: border-color .4s ease;
}
body.light-theme .resources {
    border-top: 1px solid rgba(0, 0, 0, .06);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.resources-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.resource {
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color var(--transition), background var(--transition);
}
.resource:hover {
    border-color: var(--gold-line);
    background: var(--surface-hover);
}
.resource small {
    display: block;
    margin-bottom: 10px;
    font-size: .68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color .4s ease;
}
.resource h3 {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
    transition: color .4s ease;
}
.resource p {
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--text-soft);
    transition: color .4s ease;
}

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter {
    padding: 55px 0;
    text-align: center;
}
.newsletter h2 {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--gold);
    transition: color .4s ease;
}
.newsletter p {
    max-width: 500px;
    margin: 12px auto 26px;
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--text-muted);
    transition: color .4s ease;
}
.newsletter-trigger {
    display: inline-flex;
    align-items: center;
    padding: 11px 20px;
    border: 1px solid var(--gold-line);
    border-radius: 30px;
    background: transparent;
    color: var(--gold);
    font-size: .72rem;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color .4s ease;
}
.newsletter-trigger:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    background: transparent;
    transition: background .4s ease, border-color .4s ease;
}
body.light-theme .site-footer {
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 50px;
}

.footer-brand {
    font-family: var(--display);
    font-size: .95rem;
    letter-spacing: 2px;
    color: var(--gold);
    transition: color .4s ease;
}

.footer-about {
    max-width: 380px;
    margin-top: 12px;
    font-family: var(--serif);
    font-size: 1rem;
    color: var(--text-muted);
    transition: color .4s ease;
}

.footer-column h4 {
    margin-bottom: 14px;
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);   /* ← corretto */
    transition: color .4s ease;
}

.footer-column a {
    display: block;
    margin-bottom: 7px;
    font-family: var(--serif);
    font-size: .95rem;
    color: var(--text-muted);
    transition: color .4s ease;   /* ← semplificato */
}
.footer-column a:hover {
    color: var(--gold);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 45px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .05);
    font-size: .65rem;
    letter-spacing: .7px;
    color: var(--text-muted);
    transition: border-color .4s ease, color .4s ease;
}
body.light-theme .footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, .06);
}

.footer-motto {
    font-family: var(--serif);
    font-style: italic;
    color: #a09080;
    letter-spacing: 1px;
    font-size: 1rem;
}

.footer-motto-author {
    font-style: normal;
    font-weight: 600;
    color: #8a7a6a;
    font-size: 0.95rem;
}

.footer-images-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(212, 165, 116, 0.08);
    padding-top: 2rem;
    flex-wrap: wrap;
}

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

.footer-image {
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.footer-image-label {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-accent, #e8ddd0);
}
/* ============================================================
   PULSANTE TORNA SU
   ============================================================ */
.torna-su {
    position: fixed;
    bottom: 1.5rem;
    right: 6rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 216, 106, .28);
    background: rgba(10, 10, 26, .88);
    color: var(--gold, #d8b56a);
    font-size: 1.4rem;
    font-weight: 400;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    opacity: 0;
    transform: scale(.8);
    pointer-events: none;
    z-index: 1000;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.torna-su.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.torna-su:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(255, 216, 106, .65);
    background: rgba(18, 18, 42, .96);
    box-shadow: 0 8px 35px rgba(0, 0, 0, .45);
}
.torna-su:active {
    transform: scale(.92);
}
.torna-su:focus-visible {
    outline: 3px solid var(--gold, #d8b56a);
    outline-offset: 4px;
}
body.light-theme .torna-su {
    background: var(--gold, #b8860b);
    color: var(--bg, #f2ede5);
    border: 1px solid rgba(184, 134, 11, .3);
    backdrop-filter: none;
    box-shadow: 0 4px 20px rgba(184, 134, 11, .3);
}
body.light-theme .torna-su:hover {
    transform: translateY(-2px) scale(1.02);
    background: #a0780a;
    box-shadow: 0 8px 35px rgba(184, 134, 11, .4);
}

/* ============================================================
   PLAYER MUSICALE
   ============================================================ */
.music-player {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}
.music-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 216, 106, .28);
    background: rgba(10, 10, 26, .88);
    color: var(--gold);
    font-size: 1.25rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.music-toggle:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 216, 106, .65);
    background: rgba(18, 18, 42, .96);
}
body.light-theme .music-toggle {
    background: rgba(242, 237, 229, .94);
    border-color: rgba(184, 134, 11, .28);
    color: #b8860b;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}
body.light-theme .music-toggle:hover {
    border-color: rgba(184, 134, 11, .65);
    background: rgba(230, 225, 215, .96);
}
.music-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: 280px;
    padding: 16px 17px;
    background: rgba(12, 12, 30, .96);
    border: 1px solid rgba(255, 216, 106, .18);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.98);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.music-player.open .music-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
body.light-theme .music-panel {
    background: rgba(242, 237, 229, .97);
    border-color: rgba(184, 134, 11, .18);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .15);
}
.music-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px;
}
.music-label {
    display: block;
    font-size: .58rem;
    letter-spacing: 1.4px;
    color: rgba(255, 216, 106, .65);
    margin-bottom: 3px;
}
body.light-theme .music-label {
    color: rgba(184, 134, 11, .65);
}
.music-title {
    display: block;
    font-family: var(--serif);
    font-size: .95rem;
    color: #eee;
}
body.light-theme .music-title {
    color: #1a1a2e;
}
.music-close {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .45);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 4px;
    transition: color .25s ease;
}
body.light-theme .music-close {
    color: rgba(0, 0, 0, .45);
}
.music-close:hover {
    color: #fff;
}
body.light-theme .music-close:hover {
    color: #1a1a2e;
}
.music-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.music-play,
.music-volume {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    transition: color .25s ease;
}
body.light-theme .music-play,
body.light-theme .music-volume {
    color: #b8860b;
}
.music-play {
    font-size: .95rem;
    width: 25px;
}
.music-volume {
    font-size: .85rem;
    opacity: .8;
}
.music-progress {
    flex: 1;
    min-width: 0;
    height: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, .15);
    border-radius: 5px;
    cursor: pointer;
}
body.light-theme .music-progress {
    background: rgba(0, 0, 0, .15);
}
.music-progress::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
}
body.light-theme .music-progress::-webkit-slider-thumb {
    background: #b8860b;
}
.music-progress::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
}
body.light-theme .music-progress::-moz-range-thumb {
    background: #b8860b;
}
.player-status {
    font-size: .68rem;
    color: var(--text-muted);
    transition: color .4s ease;
}
body.light-theme .player-status {
    color: #6a6a7e;
}

/* ============================================================
   VIDEO — VISIONI
   Finestra discreta, coordinata con il player musicale
   ============================================================ */
.video-player {
    position: fixed;
    right: 24px;
    bottom: 82px;
    z-index: 9998;
    font-family: var(--sans);
}

.video-toggle {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(69, 230, 161, .28);
    background: rgba(10, 10, 26, .88);
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.video-toggle::before {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(69, 230, 161, .10);
    border-radius: 50%;
    animation: visionPulse 3.8s ease-in-out infinite;
    pointer-events: none;
}

.video-toggle:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(69, 230, 161, .65);
    background: rgba(18, 18, 42, .96);
    box-shadow: 0 8px 35px rgba(0, 0, 0, .45);
}

.video-toggle:active {
    transform: scale(.92);
}

.video-toggle:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 4px;
}

@keyframes visionPulse {
    0%, 100% { opacity: .15; transform: scale(.96); }
    50% { opacity: .55; transform: scale(1.08); }
}

.video-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: min(520px, calc(100vw - 32px));
    padding: 14px;
    background: rgba(9, 12, 21, .94);
    border: 1px solid rgba(69, 230, 161, .15);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .55),
        0 0 35px rgba(69, 230, 161, .025);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}

.video-player.open .video-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.video-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 2px 3px 11px;
}

.video-label {
    display: block;
    margin-bottom: 4px;
    font-family: var(--sans);
    font-size: .57rem;
    font-weight: 500;
    letter-spacing: 2.2px;
    color: rgba(69, 230, 161, .72);
    text-transform: uppercase;
}

.video-title {
    display: block;
    font-family: var(--serif);
    font-size: 1.22rem;
    font-weight: 500;
    letter-spacing: .3px;
    color: var(--text);
}

.video-close {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .42);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    transition: color .25s ease;
}

.video-close:hover { color: #fff; }

.video-frame {
    display: block;
    width: 100%;
    height: 292px;
    border: 0;
    border-radius: 10px;
    background: #05070d;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.video-video-title {
    margin: 10px 3px 0;
    font-family: var(--serif);
    font-size: .98rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text);
}
.video-note {
    margin: 9px 3px 1px;
    font-family: var(--serif);
    font-size: .82rem;
    font-style: italic;
    color: var(--text-muted);
}

body.light-theme .video-toggle {
    background: rgba(242, 237, 229, .94);
    border-color: rgba(0, 168, 107, .28);
    color: #00a86b;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

body.light-theme .video-toggle::before {
    border-color: rgba(0, 168, 107, .10);
}

body.light-theme .video-toggle:hover {
    border-color: rgba(0, 168, 107, .65);
    background: rgba(230, 238, 233, .98);
}

body.light-theme .video-panel {
    background: rgba(242, 237, 229, .97);
    border-color: rgba(0, 168, 107, .18);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .15);
}

body.light-theme .video-label { color: rgba(0, 168, 107, .72); }
body.light-theme .video-close { color: rgba(0, 0, 0, .42); }
body.light-theme .video-close:hover { color: #0f1f16; }

@media (max-width: 650px) {
    .video-player { right: 15px; bottom: 68px; }
    .video-panel { width: min(440px, calc(100vw - 30px)); }
}

@media (max-width: 480px) {
    .video-player { right: 1rem; bottom: 62px; }
    .video-toggle { width: 42px; height: 42px; }
    .video-panel { bottom: 52px; padding: 10px; border-radius: 13px; }
    .video-title { font-size: 1.05rem; }
}

/* ============================================================
   NEWSLETTER MODALE
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}
.modal.open {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    position: relative;
    width: min(480px, 100%);
    padding: 38px;
    border: 1px solid var(--gold-line);
    border-radius: 16px;
    background: #10131d;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
    transition: background .4s ease, border-color .4s ease;
}
body.light-theme .modal-content {
    background: #e8e2d8;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .15);
}
.modal-content h3 {
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gold);
    margin-bottom: 12px;
    transition: color .4s ease;
}
.modal-content p {
    font-family: var(--serif);
    color: var(--text-soft);
    transition: color .4s ease;
}
.close-modal {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: 0;
    transition: color .3s ease;
}
.close-modal:hover {
    color: var(--text);
}

/* ============================================================
   FORM NEWSLETTER
   ============================================================ */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}
.newsletter-form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: rgba(255, 255, 255, .035);
    color: var(--text);
    outline: none;
    transition: border-color .3s ease, background .4s ease, color .4s ease;
}
body.light-theme .newsletter-form input[type="email"] {
    background: rgba(0, 0, 0, .04);
    color: var(--text);
    border-color: rgba(0, 0, 0, .1);
}
.newsletter-form input[type="email"]:focus {
    border-color: var(--gold-line);
}
.newsletter-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-family: var(--serif);
    font-size: .78rem;
    line-height: 1.45;
    color: var(--text-muted);
    cursor: pointer;
}
.newsletter-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--gold);
    cursor: pointer;
}
.newsletter-consent span {
    flex: 1;
}
.newsletter-consent strong {
    color: var(--text-soft);
}
.newsletter-consent a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.newsletter-consent a:hover {
    color: var(--text);
}
.newsletter-form button[type="submit"] {
    align-self: flex-end;
    padding: 11px 20px;
    border: 1px solid var(--gold-line);
    border-radius: 7px;
    background: var(--gold-soft);
    color: var(--gold);
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease, color .4s ease;
}
body.light-theme .newsletter-form button[type="submit"] {
    background: rgba(184, 134, 11, .12);
}
.newsletter-form button[type="submit"]:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg);
}
.newsletter-form button[type="submit"]:disabled {
    opacity: .55;
    cursor: wait;
}
.privacy-note {
    margin-top: 14px;
    font-size: .75rem;
    color: var(--text-muted) !important;
}

/* ============================================================
   ECHO RIPPLE (click effect)
   ============================================================ */
.echo-ripple {
    position: fixed;
    left: 0;
    top: 0;
    width: 160px;
    height: 160px;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    opacity: 1;
}
.echo-ripple svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.echo-ripple path {
    fill: none;
    stroke: #ffd76a;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform-box: view-box;
    transform-origin: 50% 50%;
    filter: drop-shadow(0 0 3px rgba(255, 215, 106, .35)) drop-shadow(0 0 10px rgba(255, 215, 106, .12));
}
.echo-ripple .ripple-1 {
    stroke-width: 1px;
    opacity: .82;
    transform: scale(.02);
}
.echo-ripple .ripple-1.start {
    animation: darkRipple1 3.8s cubic-bezier(.12, .55, .25, 1) forwards;
}
@keyframes darkRipple1 {
    0% {
        opacity: .82;
        transform: scale(.02);
    }
    3% {
        opacity: .82;
    }
    25% {
        opacity: .60;
    }
    55% {
        opacity: .25;
    }
    100% {
        opacity: 0;
        transform: scale(5.8);
    }
}
.echo-ripple .ripple-2 {
    stroke-width: .75px;
    opacity: 0;
    animation: darkRipple2 3.8s cubic-bezier(.12, .55, .25, 1) .22s forwards;
}
@keyframes darkRipple2 {
    0% {
        opacity: 0;
        transform: scale(.05);
    }
    10% {
        opacity: .46;
    }
    35% {
        opacity: .28;
    }
    65% {
        opacity: .10;
    }
    100% {
        opacity: 0;
        transform: scale(5.0);
    }
}
.echo-ripple .ripple-3 {
    stroke-width: .55px;
    opacity: 0;
    animation: darkRipple3 3.8s cubic-bezier(.12, .55, .25, 1) .44s forwards;
}
@keyframes darkRipple3 {
    0% {
        opacity: 0;
        transform: scale(.05);
    }
    12% {
        opacity: .30;
    }
    40% {
        opacity: .15;
    }
    70% {
        opacity: .045;
    }
    100% {
        opacity: 0;
        transform: scale(4.3);
    }
}
.echo-origin {
    position: fixed;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: #ffd76a;
    pointer-events: none;
    z-index: 100000;
    box-shadow: 0 0 5px rgba(255, 215, 106, .75), 0 0 14px rgba(255, 215, 106, .35);
    animation: echoOrigin .28s ease-out forwards;
}
@keyframes echoOrigin {
    0% {
        opacity: .95;
        transform: scale(.7);
    }
    35% {
        opacity: .75;
        transform: scale(1.4);
    }
    100% {
        opacity: 0;
        transform: scale(2.4);
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .scuole-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}
@media (max-width: 900px) {
    .epochs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand-block {
        grid-column: 1 / -1;
    }
}
@media (max-width: 768px) {
    .scuole-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .scuola-card {
        min-height: 120px;
        padding: 1rem .6rem;
    }
    .scuola-icon {
        font-size: 1.5rem;
    }
    .scuola-card h3 {
        font-size: .8rem;
    }
    .scuola-card p {
        font-size: .7rem;
    }
}
@media (max-width: 650px) {
    .container {
        width: min(100% - 30px, 1180px);
    }
    .header-inner {
        min-height: 68px;
        flex-wrap: wrap;
    }
    .logo-sub {
        display: none;
    }
    .main-nav {
        gap: 15px;
    }
    .main-nav a {
        font-size: .65rem;
        letter-spacing: .8px;
    }
    .hero {
        padding-top: 90px;
    }
    .hero h1 {
        letter-spacing: 2px;
    }
    .epochs-grid,
    .resources-inner,
    .footer-main {
        grid-template-columns: 1fr;
    }
    .epoch-card {
        min-height: 210px;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    .newsletter-form {
        flex-direction: column;
    }
    .music-player {
        right: 15px;
        bottom: 15px;
    }
    .torna-su {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
        bottom: 1.2rem;
        right: 1.2rem;
    }
    .theme-toggle-btn {
        font-size: .65rem;
        padding: .2rem .6rem;
    }
    .theme-toggle-btn .icon {
        font-size: .75rem;
    }
}
@media (max-width: 520px) {
    .modal-content {
        padding: 32px 22px 26px;
    }
    .newsletter-form button[type="submit"] {
        align-self: stretch;
        width: 100%;
    }
}
@media (max-width: 480px) {
    .torna-su {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
        bottom: 1rem;
        right: 1rem;
    }
    .main-nav {
        gap: 10px;
    }
    .main-nav a {
        font-size: .6rem;
        letter-spacing: .5px;
    }
    .scuole-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .scuola-card {
        min-height: 100px;
        padding: .8rem .4rem;
    }
    .scuola-icon {
        font-size: 1.3rem;
    }
    .scuola-card h3 {
        font-size: .75rem;
    }
    .scuola-card p {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Contenitore che mantiene le proporzioni 4:3 del video */
.video-frame-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 3/4 * 100 = 75% per il rapporto 4:3 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #05070d;
}

.video-frame-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

