/* ===========================================================================
   www.labica.it — foglio di stile del sito pubblico
   Nessun framework: solo CSS moderno, variabili e grid.
   =========================================================================== */

/* ------------------------------------------------------------- variabili -- */
/* I colori vengono dal logo: antracite #2b2a29 (lettering) e rosso #e31e24
   (il baffo). Il rosso fa l'accento, come nel logo, non il fondo.
   Il sito è scuro per tutti: non dipende più da come il visitatore ha
   impostato il sistema operativo. */
:root {
    color-scheme: dark;       /* rende scuri anche scrollbar e campi nativi */

    --bg:          #1a1918;   /* fondo pagina */
    --bg-soft:     #221f1e;   /* sezioni alternate */
    --bg-card:     #262322;   /* schede e campi */
    --ink:         #f1eeec;
    --ink-soft:    #b0a9a5;
    --line:        #393533;

    --brand:       #e31e24;   /* rosso del logo: pulsanti e superfici piene */
    --brand-hover: #b8141a;   /* rosso scurito: hover dei pulsanti pieni */
    --brand-ink:   #ff8a86;   /* rosso schiarito: link e testo sul fondo scuro */
    --brand-soft:  #3a1d1c;   /* fondo delle icone nelle schede */
    --accent:      #ff8a86;

    --night:       #2b2a29;   /* antracite del logo: header, footer, fascia CTA */
    --night-2:     #1c1b1a;

    --radius:      16px;
    --radius-sm:   10px;
    --shadow:      0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -20px rgba(0, 0, 0, .8);
    --shadow-lg:   0 26px 70px -34px rgba(0, 0, 0, .9);

    --wrap:        1140px;
    --gap:         clamp(1rem, 3vw, 2rem);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #ffb3b0; }   /* sul fondo scuro l'hover schiarisce, non scurisce */

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.container { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--brand); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
    text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700;
    color: var(--brand-ink); margin: 0 0 .6rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- bottoni -- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.25rem;
    border: 1px solid transparent; border-radius: 999px;
    font: inherit; font-weight: 600; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm  { padding: .45rem .9rem; font-size: .875rem; }
.btn-lg  { padding: .9rem 1.6rem; font-size: 1.0625rem; }

.btn-primary {
    background: var(--brand); color: #fff;
    box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 80%, transparent);
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; }

.btn-ghost {
    background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 28%, transparent);
}
.btn-ghost:hover { background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; }

/* ---------------------------------------------------------------- header -- */
/* Barra antracite come il footer: il sito è "chiuso" sopra e sotto dallo
   stesso colore del lettering del logo. Tinta piena, non color-mix: così si
   comporta allo stesso modo anche sui browser più vecchi. */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--night);
    color: #e6e1de;
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck {
    border-bottom-color: rgba(255, 255, 255, .14);
    box-shadow: 0 10px 26px -20px rgba(0, 0, 0, .9);
}

.header-inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand-logo { display: block; height: 32px; width: auto; }
@media (max-width: 420px) { .brand-logo { height: 26px; } }

.nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.nav-list { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav-link {
    display: block; padding: .5rem .7rem; border-radius: 8px;
    color: #bdb6b2; text-decoration: none; font-weight: 600; font-size: .94rem;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.nav-link.is-active { color: var(--accent); }   /* rosso chiaro: leggibile sull'antracite */

.nav-side { display: flex; align-items: center; gap: .75rem; }

.lang-switch {
    display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 2px;
    font-size: .78rem; font-weight: 700;
}
.lang-switch a, .lang-switch span {
    padding: .2rem .55rem; border-radius: 999px; text-decoration: none; color: #bdb6b2;
}
.lang-switch a:hover { color: #fff; }
.lang-switch .lang-current { background: var(--brand); color: #fff; }

.nav-toggle {
    margin-left: auto; display: none;
    width: 44px; height: 44px; padding: 0;
    background: none; border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px;
    cursor: pointer; color: #e6e1de;
}
.nav-toggle-bars { display: grid; gap: 4px; justify-items: center; }
.nav-toggle-bars span {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: grid; place-items: center; }
    .nav {
        position: fixed; inset: 72px 0 auto; z-index: 49;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--night); border-bottom: 1px solid rgba(255, 255, 255, .14);
        padding: .75rem 1.25rem 1.5rem;
        box-shadow: var(--shadow-lg);
        display: none;
    }
    .nav.is-open { display: flex; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-link {
        padding: .8rem .25rem; border-bottom: 1px solid rgba(255, 255, 255, .12);
        border-radius: 0; font-size: 1.05rem;
    }
    .nav-side { margin-top: 1rem; justify-content: space-between; }
}

/* ------------------------------------------------------------------ hero -- */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, #333130 0%, var(--night) 48%, #3d2321 100%);
    color: #f3f0ee;
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3.5rem, 8vw, 6rem);
}
.hero-inner { position: relative; z-index: 2; max-width: 46rem; }
.hero .eyebrow { color: var(--accent); }
.hero-title { margin-bottom: .4em; text-wrap: balance; }
.hero-sub { font-size: clamp(1.05rem, .95rem + .6vw, 1.375rem); color: #cbc4c0; margin-bottom: 2rem; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.hero .btn-ghost { color: #f3f0ee; border-color: rgba(255,255,255,.32); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* hero con immagine di copertina: la sfumatura scura resta sopra, così il
   testo è leggibile qualunque sia la foto */
.hero.has-image {
    background-image:
        linear-gradient(110deg, rgba(28, 27, 26, .96) 0%, rgba(28, 27, 26, .88) 42%, rgba(61, 35, 33, .74) 100%),
        var(--hero-img);
    background-size: cover;
    background-position: center;
}
.hero.has-image .hero-glow { opacity: .45; }

.hero-glow {
    position: absolute; inset: auto -10% -55% 45%; z-index: 1;
    width: 60vw; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(227,30,36,.5), rgba(227,30,36,.18) 45%, transparent 70%);
    filter: blur(30px);
    pointer-events: none;
}

/* ------------------------------------------------------------ page hero --- */
.page-hero {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
    background: linear-gradient(180deg, var(--bg-soft), var(--bg));
    border-bottom: 1px solid var(--line);
}
.page-hero h1 { max-width: 22ch; text-wrap: balance; }
.page-hero-sub { font-size: clamp(1.05rem, .95rem + .4vw, 1.25rem); color: var(--ink-soft); max-width: 62ch; margin: 0; }

/* immagine di copertina della pagina, sotto al titolo */
.page-cover { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.page-cover img {
    display: block; width: 100%; max-height: 440px; object-fit: cover;
    border-radius: var(--radius); box-shadow: var(--shadow);
}

/* --------------------------------------------------------------- sezioni -- */
.section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.section--muted { background: var(--bg-soft); }
.section--areas { padding-top: clamp(3rem, 7vw, 5rem); }

.section-head { max-width: 46rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section-title { margin-bottom: .35em; text-wrap: balance; }
.section-intro { color: var(--ink-soft); font-size: 1.0625rem; margin: 0; text-wrap: pretty; }
.section-more { margin: 2rem 0 0; }

/* ----------------------------------------------------------------- cards -- */
.cards {
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.card { display: flex; }
.card-link {
    position: relative;
    display: flex; flex-direction: column; gap: .35rem;
    width: 100%; padding: 1.5rem;
    background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
    color: inherit; text-decoration: none; box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-link:hover {
    transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    box-shadow: var(--shadow-lg); color: inherit;
}
.card-icon {
    display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: .65rem;
    border-radius: 13px; background: var(--brand-soft); color: var(--brand-ink);
}
.card-icon i { width: 22px; height: 22px; }
.card-media {
    display: block; overflow: hidden; margin: -.25rem 0 1rem;
    aspect-ratio: 16 / 10; max-height: 190px;
    border-radius: 12px; background: var(--bg-soft);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-title { margin: 0; font-size: 1.1rem; }
.card-text { margin: 0; color: var(--ink-soft); font-size: .94rem; }
.card-more {
    margin-top: auto; padding-top: .9rem;
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--brand-ink); font-weight: 600; font-size: .9rem;
}
.card-more i { width: 16px; height: 16px; transition: transform .18s ease; }
.card-link:hover .card-more i { transform: translateX(3px); }

/* Le 5 aree: la prima scheda occupa due colonne sugli schermi larghi */
@media (min-width: 1000px) {
    .cards--areas { grid-template-columns: repeat(6, 1fr); }
    .cards--areas .card { grid-column: span 2; }
    .cards--areas .card:nth-child(1),
    .cards--areas .card:nth-child(2) { grid-column: span 3; }
}

/* --------------------------------------------------------------- portfolio */
.works {
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.work {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; color: inherit; box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.work:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.work-media {
    display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden;
    background: linear-gradient(135deg, var(--night), #4a2724);
    color: rgba(255,255,255,.9);
}
.work-media img { width: 100%; height: 100%; object-fit: cover; }
.work-glyph i { width: 34px; height: 34px; }
.work-body { display: grid; gap: .3rem; padding: 1rem 1.1rem 1.25rem; }
.work-title { font-weight: 700; }
.work-text { color: var(--ink-soft); font-size: .9rem; }

/* ------------------------------------------------------ testo dal CMS ----- */
.prose { max-width: 46rem; font-size: 1.0625rem; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 2.2rem; font-size: 1.55rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose img { border-radius: var(--radius-sm); }
.prose blockquote {
    margin: 1.5rem 0; padding: .3rem 0 .3rem 1.2rem;
    border-left: 3px solid var(--brand); color: var(--ink-soft); font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.4rem; }
.prose th, .prose td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose code {
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
    padding: .1em .35em; font-size: .9em;
}

/* ------------------------------------------------------------- fascia CTA - */
.cta-band {
    background: linear-gradient(120deg, var(--night), #4a2724);
    color: #f3f0ee;
}
.cta-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1.5rem; padding: clamp(2rem, 5vw, 3.25rem) 0;
}
.cta-title { margin: 0 0 .35rem; font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2rem); max-width: 24ch; text-wrap: balance; }
.cta-text { margin: 0; color: #cbc4c0; max-width: 52ch; }
.cta-band .btn-primary { background: #fff; color: var(--night); }
.cta-band .btn-primary:hover { background: var(--accent); color: var(--night); }

/* ---------------------------------------------------------------- footer -- */
.site-footer {
    background: var(--night); color: #c2bbb7;
    padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
    font-size: .94rem;
}
.site-footer a { color: #e6e1de; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
    display: grid; gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.footer-logo { display: block; height: 38px; width: auto; }
.footer-tagline {
    margin: .55rem 0 0; color: #a29b97;
    font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
}
.footer-blurb { margin: .5rem 0 0; color: #a29b97; }
.footer-social { display: flex; gap: .6rem; margin-top: 1rem; }
.footer-social a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #45403d; border-radius: 10px; }
.footer-col h3 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-contacts li { display: flex; gap: .55rem; align-items: flex-start; }
.footer-contacts i { margin-top: .25rem; width: 16px; height: 16px; flex: none; color: var(--accent); }

.footer-bottom {
    display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center;
    margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #3a3634;
    color: #918a86; font-size: .85rem;
}
.footer-bottom p { margin: 0; }
.footer-langs { display: flex; gap: .75rem; }
.footer-langs span { color: #fff; }

/* ------------------------------------------------------------ form -------- */
.contact-grid {
    display: grid; gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
    .contact-grid { grid-template-columns: 20rem minmax(0, 1fr); }
}
.contact-aside .section-title { font-size: 1.6rem; }
.contact-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .7rem; }
.contact-list li { display: flex; gap: .6rem; align-items: flex-start; }
.contact-list i { margin-top: .3rem; width: 17px; height: 17px; flex: none; color: var(--brand); }

.form { display: grid; gap: 1.1rem; }
.form-grid { display: grid; gap: 1.1rem; }
@media (min-width: 600px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.field { display: grid; gap: .35rem; margin: 0; }
.field label { font-weight: 600; font-size: .9rem; }
.field .req { color: #d64545; }
.field input, .field select, .field textarea {
    width: 100%; padding: .7rem .85rem;
    font: inherit; color: inherit;
    background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field ::placeholder { color: var(--ink-soft); opacity: 1; }
.field--check label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.field--check input { width: auto; margin-top: .25rem; flex: none; }
.form-actions { margin: 0; }

/* honeypot anti-spam: fuori dallo schermo, non "display:none" (i bot lo notano) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin: 0 0 1.25rem; border: 1px solid; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-success { background: #0f3527; border-color: #1d6647; color: #9fe6c5; }
.alert-error   { background: #3a1613; border-color: #7e2b23; color: #f3b3ad; }

/* --------------------------------------------------------------- utility -- */
.page-404 .page-hero { border-bottom: 0; }
