/* ==========================================================================
   VideoconDrone - style.css
   Palette: notte in volo (blu inchiostro) + luce d'oro (ora dorata).
   Font: Antonio (display, condensed) + Hanken Grotesk (testo).
   ========================================================================== */

:root {
    /* Colori */
    --bg: #111826;
    --bg: oklch(18% 0.025 255);
    --surface: #182234;
    --surface: oklch(22% 0.03 255);
    --surface-2: #1f2c42;
    --surface-2: oklch(26% 0.035 255);
    --line: rgba(233, 240, 255, 0.14);
    --ink: #f2efe7;
    --ink: oklch(96% 0.012 85);
    --muted: #aab6c8;
    --muted: oklch(78% 0.025 250);
    --accent: #e3a44a;
    --accent: oklch(76% 0.13 75);
    --accent-strong: #c9822e;
    --accent-strong: oklch(67% 0.14 68);
    --ink-on-accent: #221708;
    --ink-on-accent: oklch(22% 0.04 75);

    /* Tipografia */
    --font-display: 'Antonio', 'Arial Narrow', sans-serif;
    --font-body: 'Hanken Grotesk', 'Segoe UI', sans-serif;

    /* Spazi e misure */
    --container: 1180px;
    --section-y: clamp(4.5rem, 10vw, 8rem);
    --radius: 10px;

    /* Z-index */
    --z-header: 100;
}

/* --- Base ------------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3 { text-wrap: balance; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* --- Header ------------------------------------------------------------ */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: var(--z-header);
    padding: 1.1rem 0;
    transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
}

.site-header.scrolled {
    background: var(--bg);
    padding: 0.7rem 0;
    box-shadow: 0 1px 0 var(--line);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
}

.logo .logo-mark { color: var(--accent); }

.site-nav ul {
    display: flex;
    gap: clamp(1rem, 3vw, 2.2rem);
    list-style: none;
}

.site-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* --- Bottoni ------------------------------------------------------------ */

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    padding: 0.95rem 1.7rem;
    border-radius: 999px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent);
    color: var(--ink-on-accent);
}

.btn-primary:hover { background: var(--accent-strong); color: var(--ink); }

.btn-secondary {
    border-color: var(--line);
    color: var(--ink);
    background: transparent;
}

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

/* --- Hero ---------------------------------------------------------------- */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    isolation: isolate;
}

.hero-photo {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: heroDrift 26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroDrift {
    from { transform: scale(1.08); }
    to   { transform: scale(1); }
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top,
            var(--bg) 0%,
            rgba(17, 24, 38, 0.82) 22%,
            rgba(17, 24, 38, 0.35) 55%,
            rgba(17, 24, 38, 0.25) 100%);
}

.hero-content {
    width: 100%;
    padding-bottom: clamp(2.5rem, 7vh, 5rem);
    padding-top: 8rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 5.75rem);
    line-height: 0.98;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    max-width: 12ch;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-subtitle {
    margin-top: 1.4rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 52ch;
    color: var(--ink);
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2.2rem;
}

.hero-certs {
    margin-top: clamp(2.2rem, 5vh, 3.5rem);
    padding-top: 1.3rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1.6rem;
    row-gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.hero-certs strong {
    color: var(--ink);
    font-weight: 600;
}

.hero-certs span { white-space: nowrap; }

/* --- Sezioni: titoli ------------------------------------------------------ */

section { scroll-margin-top: 4.5rem; }

.section-head {
    margin-bottom: clamp(2.2rem, 5vw, 3.8rem);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: 0.015em;
}

.section-subtitle {
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 58ch;
}

/* --- Galleria "Dall'alto" -------------------------------------------------- */

.gallery-section { padding: var(--section-y) 0 0; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 230px;
    grid-auto-flow: dense;
    gap: 10px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img { transform: scale(1.045); }

.gallery-item figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2rem 1rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    background: linear-gradient(to top, rgba(13, 18, 29, 0.85), transparent);
}

.gallery-note {
    margin-top: 0.9rem;
    font-size: 0.9rem;
    color: var(--muted);
}

/* --- Servizi ---------------------------------------------------------------- */

.services-section { padding: var(--section-y) 0; }

.service-group {
    display: grid;
    grid-template-columns: minmax(240px, 340px) 1fr;
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(2rem, 4vw, 3rem) 0;
    border-top: 1px solid var(--line);
}

.service-group:first-of-type { border-top: none; padding-top: 0; }

.group-head { align-self: start; position: sticky; top: 5.5rem; }

.group-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--accent);
}

.group-intro {
    margin-top: 0.8rem;
    color: var(--muted);
    font-size: 1rem;
    max-width: 34ch;
}

.service-list { display: flex; flex-direction: column; }

.service-item {
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
}

.service-item:first-child { border-top: none; padding-top: 0; }

.service-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.service-client {
    margin-top: 0.15rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.service-description {
    margin-top: 0.7rem;
    max-width: 62ch;
}

.service-deliverable {
    margin-top: 0.7rem;
    font-size: 0.97rem;
}

.service-deliverable strong {
    color: var(--accent);
    font-weight: 700;
}

.service-note {
    margin-top: 0.35rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.difficulty-badge {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid;
    white-space: nowrap;
}

.diff-bassa       { color: #9fd9a8; border-color: rgba(159, 217, 168, 0.45); }
.diff-medio-bassa { color: #e9c98a; border-color: rgba(233, 201, 138, 0.45); }
.diff-media       { color: #eda87c; border-color: rgba(237, 168, 124, 0.45); }

/* --- Flotta -------------------------------------------------------------------- */

.fleet-section {
    padding: var(--section-y) 0;
    background: var(--surface);
}

.fleet-list { display: flex; flex-direction: column; }

.drone-row {
    display: grid;
    grid-template-columns: 190px 1.2fr 1fr;
    gap: clamp(1.2rem, 3vw, 2.5rem);
    align-items: center;
    padding: 1.8rem 0;
    border-top: 1px solid var(--line);
}

.drone-row:first-child { border-top: none; }

.drone-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: var(--radius);
    padding: 0.9rem;
}

.drone-image {
    max-height: 110px;
    object-fit: contain;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.drone-row:hover .drone-image { transform: translateY(-4px); }

.drone-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.05;
}

.drone-type {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
}

.drone-description {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.97rem;
    max-width: 44ch;
}

.drone-specs {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem 1.4rem;
}

.drone-specs li { line-height: 1.35; }

.spec-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.spec-value { font-weight: 700; font-size: 1rem; }

/* --- Fascia YouTube -------------------------------------------------------------- */

.youtube-band {
    background: var(--accent);
    color: var(--ink-on-accent);
    padding: clamp(2.8rem, 6vw, 4.5rem) 0;
}

.youtube-band-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.youtube-band h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.015em;
}

.youtube-band p {
    margin-top: 0.5rem;
    font-weight: 500;
    max-width: 48ch;
}

.btn-dark {
    background: var(--bg);
    color: var(--ink);
}

.btn-dark:hover { background: var(--surface-2); transform: translateY(-2px); }

/* --- Contatti ---------------------------------------------------------------------- */

.contact-section { padding: var(--section-y) 0; }

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}

.contact-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.015em;
}

.contact-text {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 46ch;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.contact-item {
    padding: 1.1rem 1.3rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.contact-item .contact-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.contact-item a,
.contact-item span {
    color: var(--ink);
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    overflow-wrap: anywhere;
}

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

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

/* --- Form contatti (contact.php) ------------------------------------------------------ */

.contact-form { max-width: 620px; }

.form-group { margin-bottom: 1.4rem; }

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted); }

.form-group textarea { min-height: 150px; resize: vertical; }

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius);
    margin-bottom: 1.4rem;
    font-weight: 600;
}

.alert-success {
    background: rgba(110, 200, 130, 0.14);
    border: 1px solid rgba(110, 200, 130, 0.4);
    color: #a5e0b0;
}

.alert-error {
    background: rgba(230, 110, 100, 0.14);
    border: 1px solid rgba(230, 110, 100, 0.4);
    color: #f0a8a0;
}

/* --- Footer -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2.5rem 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-certs { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }

.footer-certs span { white-space: nowrap; }

.site-footer a { color: var(--ink); font-weight: 600; text-decoration: none; }

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

/* --- Animazioni di ingresso -------------------------------------------------------------- */
/* Visibile di default; il JS aggiunge .has-reveal a <html> solo se può gestirle. */

.has-reveal .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.has-reveal .reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .hero-photo img { animation: none; }
    .has-reveal .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .gallery-item img,
    .drone-image,
    .btn { transition: none; }
}

/* --- Responsive ------------------------------------------------------------------------ */

@media (max-width: 920px) {
    .service-group { grid-template-columns: 1fr; gap: 1.2rem; }
    .group-head { position: static; }
    .group-intro { max-width: 58ch; }

    .drone-row {
        grid-template-columns: 130px 1fr;
        grid-template-areas:
            "img info"
            "img specs";
        align-items: start;
    }
    .drone-row .drone-image-wrapper { grid-area: img; }
    .drone-row .drone-info { grid-area: info; }
    .drone-row .drone-specs { grid-area: specs; margin-top: 1rem; }

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

@media (max-width: 680px) {
    .site-nav a { font-size: 0.85rem; }
    .site-nav ul { gap: 0.9rem; }
    .header-content { flex-direction: column; gap: 0.5rem; }
    .site-header { padding: 0.7rem 0; }
    .site-header.scrolled { padding: 0.5rem 0; }

    .hero-content { padding-top: 10rem; }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 180px;
    }
    .gallery-item.wide { grid-column: span 2; }

    .drone-row {
        grid-template-columns: 1fr;
        grid-template-areas: "img" "info" "specs";
        justify-items: start;
    }
    .drone-image-wrapper { justify-content: flex-start; }

    .service-header { flex-wrap: wrap; }
}
