/* ============================================================
   Ranieri Rossi — sito professionale
   NB: nessun url() assoluto — il sito deve funzionare sotto sub-path
   ============================================================ */

:root {
    --navy-900: #0a1420;
    --navy-800: #0e1d2f;
    --navy-700: #14273e;
    --navy-600: #1b3350;
    --gold: #d9a441;
    --gold-light: #e7bd6b;
    --ink: #1e2a38;
    --muted: #5b6b7c;
    --bg: #f6f8fa;
    --card: #ffffff;
    --line: #e2e8ef;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(10, 20, 32, .06), 0 8px 24px rgba(10, 20, 32, .07);
    --shadow-lift: 0 2px 4px rgba(10, 20, 32, .08), 0 14px 34px rgba(10, 20, 32, .13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--navy-600); text-decoration-color: rgba(27, 51, 80, .35); text-underline-offset: 3px; }
a:hover { color: var(--gold); text-decoration-color: currentColor; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }

p { margin: 0 0 1em; }

.container { width: min(1100px, 100% - 3rem); margin-inline: auto; }

.overline {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 .8rem;
}

.lead { font-size: 1.18rem; color: var(--muted); max-width: 46em; }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 20, 32, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: .7rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: #fff;
}
.brand:hover { color: #fff; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold), #b8842e);
    color: var(--navy-900);
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .02em;
}
.brand-mark.small { width: 1.7rem; height: 1.7rem; font-size: .7rem; border-radius: 7px; margin-right: .45rem; vertical-align: -0.35rem; }

.brand-name { font-weight: 650; letter-spacing: .01em; }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }

.site-nav a {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--gold); }

.site-nav .nav-cta {
    border: 1px solid var(--gold);
    border-radius: 999px;
    padding: .38rem 1.05rem;
    color: var(--gold-light);
}
.site-nav .nav-cta:hover { background: var(--gold); color: var(--navy-900); border-bottom-color: var(--gold); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    padding: .5rem;
    cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }

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

.hero {
    position: relative;
    color: #fff;
    background:
        radial-gradient(700px 340px at 85% -10%, rgba(217, 164, 65, .22), transparent 65%),
        radial-gradient(560px 300px at -10% 110%, rgba(27, 51, 80, .8), transparent 70%),
        linear-gradient(160deg, var(--navy-900) 20%, var(--navy-700) 100%);
    padding-block: clamp(4.5rem, 10vw, 7.5rem);
    overflow: hidden;
}

.hero-inner { max-width: 780px; }

.hero h1 { color: #fff; }
.hero .lead { color: rgba(255, 255, 255, .8); }
.hero .lead strong { color: var(--gold-light); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.8rem; }

.hero-badges {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding: 0;
    margin: 2.4rem 0 0;
}
.hero-badges li {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .75);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: .3rem .85rem;
}

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

.btn {
    display: inline-block;
    font-weight: 650;
    font-size: .98rem;
    text-decoration: none;
    border-radius: 999px;
    padding: .72rem 1.5rem;
    transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.btn:active { transform: translateY(1px); }

.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: var(--navy-900); box-shadow: 0 6px 18px rgba(217, 164, 65, .35); }
.btn-gold:hover { color: var(--navy-900); box-shadow: 0 8px 24px rgba(217, 164, 65, .5); transform: translateY(-1px); }

.btn-ghost { border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }

.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-600); color: #fff; transform: translateY(-1px); }

/* ---------- Sezioni ---------- */

.section { padding-block: clamp(3.2rem, 7vw, 5.2rem); }
.section-alt { background: #eef2f6; }

.section-dark {
    background:
        radial-gradient(600px 300px at 90% 0%, rgba(217, 164, 65, .16), transparent 60%),
        linear-gradient(160deg, var(--navy-900), var(--navy-700));
    color: #fff;
}
.section-dark h2 { color: #fff; }
.section-dark .lead { color: rgba(255, 255, 255, .78); }

/* ---------- Griglie e card ---------- */

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 1.6rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.6rem; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.4rem;
    transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card p { color: var(--muted); font-size: .97rem; margin: 0; }

.card-icon {
    width: 2.9rem;
    height: 2.9rem;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(217, 164, 65, .16), rgba(217, 164, 65, .05));
    color: #b8842e;
    margin-bottom: 1rem;
}
.card-icon svg { width: 1.6rem; height: 1.6rem; }

/* ---------- Chi sono / split ---------- */

.split {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2.4rem;
    align-items: start;
    margin-top: 1.2rem;
}

.fact-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.5rem 1.2rem;
}
.fact-card h3 { margin-bottom: .8rem; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
    position: relative;
    padding: .32rem 0 .32rem 1.7rem;
    color: var(--muted);
}
.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .72em;
    width: .95em;
    height: .5em;
    border-left: 2.5px solid var(--gold);
    border-bottom: 2.5px solid var(--gold);
    transform: rotate(-45deg);
}

/* ---------- Progetti ---------- */

.projects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-top: 1.6rem;
}

.project-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    transition: transform .18s, box-shadow .18s;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.project-card.featured {
    grid-column: 1 / -1;
    background:
        radial-gradient(520px 260px at 95% -20%, rgba(217, 164, 65, .2), transparent 60%),
        linear-gradient(150deg, var(--navy-900), var(--navy-700));
    border: 0;
    color: #fff;
}
.project-card.featured h3 { color: #fff; font-size: 1.6rem; }
.project-card.featured p { color: rgba(255, 255, 255, .8); }

.project-body { padding: 1.8rem 1.7rem; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
.project-body p { margin-bottom: .9rem; }

.project-tag {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .4rem;
}

.chip-row {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding: 0;
    margin: 0 0 1.2rem;
}
.chip-row li {
    font-size: .8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, .25);
    color: rgba(255, 255, 255, .85);
    border-radius: 999px;
    padding: .22rem .75rem;
}
.chip-row.big { margin: 1.2rem 0 1.6rem; }
.chip-row.big li {
    font-size: .95rem;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    padding: .45rem 1.05rem;
    box-shadow: var(--shadow);
}

.link-more { font-weight: 650; text-decoration: none; margin-top: auto; }
.link-more:hover span { margin-left: .2rem; }
.link-more span { transition: margin .15s; display: inline-block; }

/* ---------- Pagine progetto ---------- */

.page-hero {
    color: #fff;
    background:
        radial-gradient(640px 300px at 90% -20%, rgba(217, 164, 65, .2), transparent 60%),
        linear-gradient(160deg, var(--navy-900) 20%, var(--navy-700) 100%);
    padding-block: clamp(3.4rem, 7vw, 5.4rem);
}
.page-hero h1 { color: #fff; }
.page-hero .lead { color: rgba(255, 255, 255, .8); }
.page-hero .lead a { color: var(--gold-light); }

.breadcrumb { font-size: .88rem; margin-bottom: 1.6rem; color: rgba(255, 255, 255, .55); }
.breadcrumb a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold-light); }
.breadcrumb span[aria-hidden] { margin-inline: .35rem; }

.note-box {
    margin-top: 1.8rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    color: var(--muted);
}
.note-box strong { color: var(--ink); }

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

.contact-inner { text-align: center; max-width: 640px; }
.contact-inner .lead { margin-inline: auto; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .9rem; justify-content: center; margin-top: 1.6rem; }
.contact-note { margin-top: 1.4rem; color: rgba(255, 255, 255, .6); font-size: .95rem; }

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

.site-footer {
    background: var(--navy-900);
    color: rgba(255, 255, 255, .75);
    padding-block: 2.2rem;
    font-size: .93rem;
}
.footer-inner { display: flex; flex-direction: column; gap: .9rem; }
.footer-inner strong { color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-links a { color: rgba(255, 255, 255, .7); text-decoration: none; }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { color: rgba(255, 255, 255, .45); font-size: .85rem; }

/* ---------- Tech Provider WhatsApp ---------- */

.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .95rem;
    border-radius: 999px;
    background: rgba(37, 211, 102, .12);
    border: 1px solid rgba(37, 211, 102, .45);
    color: #b9f0d1;
    font-size: .86rem;
    font-weight: 650;
    letter-spacing: .01em;
    line-height: 1.35;
}
.tp-badge svg { width: 1.05rem; height: 1.05rem; flex: none; color: #25d366; }
.tp-badge.on-light { background: rgba(20, 130, 74, .08); border-color: rgba(20, 130, 74, .3); color: #14824a; }

.hero .tp-badge, .page-hero .tp-badge { margin-top: 1.4rem; }

/* ---------- Nitis: costellazione ---------- */

.constellation-map {
    display: block;
    width: 100%;
    height: auto;
    margin: 1.8rem 0 .6rem;
}
.constellation-map .cm-link { stroke: rgba(217, 164, 65, .45); stroke-width: 1; }
.constellation-map .cm-star { fill: var(--gold); }
.constellation-map .cm-halo { fill: rgba(217, 164, 65, .16); }
.constellation-map .cm-core { fill: var(--navy-800); stroke: var(--gold); stroke-width: 1.5; }
.constellation-map .cm-label { fill: rgba(255, 255, 255, .82); font-size: 11px; font-family: inherit; }
.constellation-map .cm-core-label { fill: #fff; font-size: 15px; font-weight: 700; letter-spacing: .06em; font-family: inherit; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 1.6rem;
}

.module-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.35rem 1.4rem;
    box-shadow: var(--shadow);
    transition: transform .18s, box-shadow .18s;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.module-card h3 { margin-bottom: .35rem; }
.module-card p { color: var(--muted); font-size: .97rem; margin: 0; }
.module-card .module-name { color: var(--gold); font-weight: 700; }
.module-card a { font-weight: 650; }

/* ---------- Reveal on scroll ---------- */

html.js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .55s ease, transform .55s ease;
}
html.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html.js .reveal { opacity: 1; transform: none; transition: none; }
    .card, .project-card, .btn { transition: none; }
}

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

@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3, .module-grid { grid-template-columns: repeat(2, 1fr); }
    .split { grid-template-columns: 1fr; gap: 1.6rem; }

    /* con sette voci la nav orizzontale non ci sta più: si passa al menu mobile */
    .nav-toggle { display: flex; }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--navy-900);
        border-bottom: 1px solid rgba(255, 255, 255, .1);
        padding: .6rem 1.5rem 1.2rem;
        display: none;
    }
    .site-nav a { padding: .7rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .site-nav .nav-cta { border: 0; padding: .7rem 0; color: var(--gold-light); }
    .site-nav .nav-cta:hover { background: none; }

    .nav-open .site-nav { display: flex; }
    .nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 680px) {
    .grid-3, .grid-4, .projects, .module-grid { grid-template-columns: 1fr; }

    /* la mappa è complementare: sotto i 680px restano le schede dei moduli */
    .constellation-map { display: none; }
}
