@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --bg: #111111;
    --bg2: #1a1a1a;
    --text: #f0ede8;
    --muted: #999999;
    --accent: #f5e200;
    --border: #222222;
    --nav-h: 62px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--accent);
    transition: text-shadow 0.3s, color 0.3s;
}

.nav-logo:hover,
.nav-logo.active {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(245, 226, 0, 0.9),
    0 0 20px rgba(245, 226, 0, 0.6),
    0 0 45px rgba(245, 226, 0, 0.3);
}

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

.nav-links a {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}

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

/* ── HOME HERO ── */
.hero {
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
}

.hero-left {
    display: flex;
    align-items: flex-end;
    padding: 2rem 2rem 2rem;
}

.hero-right {
    padding-top: var(--nav-h);
    overflow: hidden;
}

.hero-right model-viewer {
    --progress-bar-color: transparent;
    --progress-bar-height: 0px;
}

#model-progress-bar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    height: 2px;
    z-index: 9999;
    background: transparent;
    transition: opacity 0.4s;
}

#model-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.2s ease;
}

.hero-title {
    font-size: min(20vw, 20rem);
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.hero-title .accent {
    color: var(--accent);
    display: inline-block;
    text-shadow: 0 0 20px rgba(245, 226, 0, 0.5),
    0 0 60px rgba(245, 226, 0, 0.2),
    0 0 120px rgba(245, 226, 0, 0.1);
    transition: text-shadow 0.4s;
}

.hero-title .accent:hover {
    text-shadow: 0 0 20px rgba(245, 226, 0, 0.9),
    0 0 60px rgba(245, 226, 0, 0.5),
    0 0 120px rgba(245, 226, 0, 0.25);
}

.hero-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border);
}

.hero-desc {
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 340px;
    line-height: 1.65;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--text);
    text-decoration: none;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--text);
    color: var(--bg);
}

/* ── MANIFESTO ── */
.manifesto-wrap {
    padding: calc(var(--nav-h) + 5rem) 2rem 6rem;
    max-width: 700px;
    margin: 0 auto;
}

.manifesto-label {
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 3rem;
    display: block;
}

.manifesto-highlight {
/*    background: var(--accent);
    color: var(--bg); */
    display: inline;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.manifesto-hero {
}

.manifesto-wrap h1 {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 5rem;
}

.manifesto-text p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 1.8rem;
}

.manifesto-text p.lead {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 2.5rem;
}

.manifesto-text em {
    color: var(--accent);
    font-style: normal;
}

.manifesto-divider {
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin: 3rem 0;
}

.manifesto-portrait {
    margin: 0 0 0.5rem;
    position: relative;
}

.manifesto-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, var(--bg) 100%);
    pointer-events: none;
}

.manifesto-portrait img {
    width: 100%;
    display: block;
    filter: drop-shadow(0 0 30px rgba(245, 226, 0, 0.25)) drop-shadow(0 0 80px rgba(245, 226, 0, 0.1));
    transition: filter 0.4s;
}

.manifesto-portrait:hover img {
    filter: drop-shadow(0 0 40px rgba(245, 226, 0, 0.5)) drop-shadow(0 0 100px rgba(245, 226, 0, 0.2));
}

.contact-label {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem !important;
}

.contact-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.1em;
    transition: color 0.2s, border-color 0.2s;
}

.contact-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ── MODELLI ── */
.modelli-wrap {
    padding: calc(var(--nav-h) + 3.5rem) 2rem 6rem;
    max-width: 1100px;
    margin: 0 auto;
}

.modelli-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.modello-card {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.modello-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg2);
    position: relative;
    overflow: hidden;
}

.modello-media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modello-media--empty::after {
    content: "—";
    color: var(--border);
    font-size: 2rem;
}

.modello-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modello-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modello-slide.active {
    position: relative;
    opacity: 1;
}

.modello-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.modello-arrow-prev { left: 0.5rem; }
.modello-arrow-next { right: 0.5rem; }

.modello-dots {
    position: absolute;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 2;
}

.modello-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.modello-dot.active {
    background: var(--accent);
}

.modello-info {
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
}

.modello-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.modello-desc {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.7;
}

.modello-download {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.7rem 1.4rem;
    border: 1px solid var(--text);
    background: transparent;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.modello-download:hover {
    background: var(--text);
    color: var(--bg);
}

/* ── MAP PAGE ── */
html:has(body.map-body) {
    overflow: hidden;
    height: 100%;
}

body.map-body {
    overflow: hidden;
    height: 100vh;
    overscroll-behavior: none;
}

#map {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
}

.leaflet-container {
    background: var(--bg) !important;
}

/* Leaflet overrides */
.leaflet-control-attribution {
    background: rgba(17, 17, 17, 0.8) !important;
    color: #444 !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: #666 !important;
}

.leaflet-control-zoom a {
    background: var(--bg2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: #2a2a2a !important;
}

/* Custom pin */
@keyframes pin-glow {
    0%, 100% { filter: drop-shadow(0 0 3px #f5e20088) drop-shadow(0 0 6px #f5e20022); }
    50%       { filter: drop-shadow(0 0 6px #f5e200aa) drop-shadow(0 0 12px #f5e20044); }
}

.custom-pin {
    background: none !important;
    border: none !important;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    animation: pin-glow 2.2s ease-in-out infinite;
}

.custom-pin:hover {
    transform: scale(1.55);
    filter: drop-shadow(0 0 20px #f5e200ff) drop-shadow(0 0 40px #f5e200cc) drop-shadow(0 0 60px #f5e20066) !important;
    animation: none;
}

.custom-pin.pin-active {
    transform: scale(1.7);
    filter: drop-shadow(0 0 22px #f5e200ff) drop-shadow(0 0 44px #f5e200dd) drop-shadow(0 0 70px #f5e20088) !important;
    animation: none;
}

/* Cluster pin */
.cluster-pin {
    background: none !important;
    border: none !important;
    cursor: pointer;
}

.cluster-inner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #f5e200;
    box-shadow: 0 0 10px #f5e200aa, 0 0 22px #f5e20044;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #f5e200;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cluster-pin:hover .cluster-inner {
    transform: scale(1.2);
    box-shadow: 0 0 20px #f5e200ff, 0 0 45px #f5e200cc;
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    padding: clamp(0.5rem, 4vw, 1.5rem);
    box-sizing: border-box;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg2);
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - clamp(1rem, 8vw, 3rem));
    overflow-y: auto;
    border: 1px solid var(--border);
    transform: translateY(16px);
    transition: transform 0.25s;
    box-sizing: border-box;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

/* Gallery */
#gallery-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 55vh;
    background: #000;
    position: relative;
    overflow: hidden;
}

.gallery-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-img.active {
    opacity: 1;
}

.gallery-nav {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    pointer-events: none;
    z-index: 10;
}

.gallery-btn {
    pointer-events: all;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-family: inherit;
}

.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.gallery-counter {
    position: absolute;
    bottom: 0.6rem;
    right: 0.75rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.05em;
    z-index: 10;
}

/* Modal header + body */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.modal-date {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.3rem;
    letter-spacing: 0.06em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 1rem;
    transition: color 0.2s;
    font-family: inherit;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.25rem 1.5rem 1.75rem;
}

.modal-desc {
    font-size: 0.92rem;
    line-height: 1.75;
    color: #999999;
}

/* ── SELEZIONE TESTO ── */
::selection {
    background: var(--accent);
    color: var(--bg);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
    html:has(.hero),
    body:has(.hero) {
        overflow: hidden;
        height: 100%;
    }

    .hero {
        height: 100dvh;
        overflow: hidden;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto auto;
    }

    .hero-left {
        grid-row: 2;
        padding: 0.75rem 1.5rem;
    }

    .hero-right {
        grid-row: 1;
        padding-top: var(--nav-h);
        min-height: 0;
    }

    .hero-title {
        font-size: 28vw;
    }

    .hero-bar {
        grid-row: 3;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .manifesto-wrap {
        padding-top: calc(var(--nav-h) + 3rem);
    }

    .modelli-wrap {
        padding-top: calc(var(--nav-h) + 2rem);
    }

    .modelli-grid {
        grid-template-columns: 1fr;
    }
}
