/* Archivo self-hosted (variabile wght 100-900, wdth 62-125, subset latin).
   Preload in index.php. font-display: optional = niente flash, niente LCP bloccato. */
@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: optional;
    src: url("/assets/frontend/fonts/archivo/archivo-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Poster pulito: canvas bianco incorniciato dalla carta di Untitled,
   inchiostro come voce, cremisi #c41248 come punto. */
:root {
    color-scheme: light;
    --frame: #ece9e4;
    --canvas: #fdfdfc;
    --ink: #131311;
    --ink-panel: #0f0f0e;
    --paper: #ece9e4;
    --muted: #55534e;
    --quiet: #6d6a64;
    --dim: #8a8781;
    --line: rgba(19, 19, 17, 0.12);
    --line-strong: rgba(19, 19, 17, 0.3);
    --line-inverse: rgba(236, 233, 228, 0.16);
    --muted-inverse: rgba(236, 233, 228, 0.68);
    --accent: #c41248;
    --font-sans: "Archivo", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
    --font-mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --container: 1180px;
    --canvas-gap: clamp(0.6rem, 1.5vw, 1.25rem);
    --label-tracking: 0.12em;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--frame);
    color: var(--ink);
    font-family: var(--font-sans);
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@supports not (overflow: clip) {
    body,
    .hero {
        overflow-x: hidden;
    }
}

::selection {
    background: var(--accent);
    color: var(--paper);
}

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

a {
    color: inherit;
    overflow-wrap: anywhere;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
    border-radius: 2px;
}

.panel-dark a:focus-visible {
    outline-color: var(--paper);
}

h1,
h2,
h3,
p,
ul {
    margin: 0;
}

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

h1 {
    font-size: clamp(3rem, 8.5vw, 6rem);
    font-weight: 650;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

h2 {
    font-size: clamp(1.9rem, 4.2vw, 3.1rem);
    font-weight: 620;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

h3 {
    font-size: clamp(1.15rem, 1.8vw, 1.35rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

p {
    font-size: clamp(1rem, 1.3vw, 1.13rem);
    line-height: 1.7;
    color: var(--muted);
    text-wrap: pretty;
}

/* Il punto cremisi: la firma. */
.dot {
    color: var(--accent);
}

.container {
    width: min(calc(100% - clamp(2rem, 6vw, 6rem)), var(--container));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: 1rem;
    z-index: 100;
    transform: translateY(-150%);
    border-radius: 999px;
    padding: 0.7rem 1rem;
    background: var(--ink);
    color: var(--canvas);
    text-decoration: none;
    transition: transform 180ms var(--ease);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ---------- Header (sulla cornice) ---------- */

.site-head {
    padding: clamp(0.9rem, 2vw, 1.3rem) 0;
}

.site-head__inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.6rem;
    flex-wrap: wrap;
}

.site-head__name {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.site-head__nav {
    display: flex;
    gap: 0.6rem 1.7rem;
}

.site-head__nav a {
    color: var(--quiet);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 180ms var(--ease);
}

.site-head__nav a:hover {
    color: var(--ink);
}

/* ---------- Canvas ---------- */

.canvas {
    margin: 0 var(--canvas-gap) var(--canvas-gap);
    border-radius: 16px;
    background: var(--canvas);
    box-shadow: 0 1px 2px rgba(19, 19, 17, 0.04);
    overflow: clip;
}

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

.hero {
    position: relative;
    display: grid;
    align-content: center;
    min-height: calc(100svh - 8.5rem);
    padding: clamp(4rem, 9vw, 7rem) 0;
    text-align: center;
    isolation: isolate;
}

/* Grid: i blocchi con max-width restano davvero centrati, non solo il testo. */
.hero .container {
    display: grid;
    justify-items: center;
}

/* Colonne sottili in wireframe, alla Bequant: quasi invisibili, sfumano in basso. */
.hero__field {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    mask-image: linear-gradient(180deg, transparent 4%, rgba(0, 0, 0, 0.9) 30%, transparent 96%);
    -webkit-mask-image: linear-gradient(180deg, transparent 4%, rgba(0, 0, 0, 0.9) 30%, transparent 96%);
}

.hero__field span {
    position: absolute;
    bottom: 0;
    border: 1px solid rgba(19, 19, 17, 0.07);
    border-bottom: 0;
    background: rgba(19, 19, 17, 0.006);
}

.hero__field span:nth-child(1) {
    left: 12%;
    width: 13%;
    height: 74%;
}

.hero__field span:nth-child(2) {
    left: 30%;
    width: 17%;
    height: 46%;
}

.hero__field span:nth-child(3) {
    right: 26%;
    width: 15%;
    height: 88%;
}

.hero__field span:nth-child(4) {
    right: 8%;
    width: 12%;
    height: 58%;
}

.hero__kicker {
    color: var(--quiet);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: var(--label-tracking);
    line-height: 1.6;
    text-transform: uppercase;
}

.hero h1 {
    margin-top: clamp(1.1rem, 2.5vw, 1.6rem);
    max-width: 14ch;
}

.hero__role {
    margin-top: clamp(1.3rem, 2.8vw, 1.9rem);
    max-width: 44rem;
    font-size: clamp(1.08rem, 1.8vw, 1.3rem);
    line-height: 1.65;
}

.hero__role a {
    color: var(--ink);
    font-weight: 600;
    text-decoration-color: rgba(196, 18, 72, 0.5);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.22em;
    transition: color 180ms var(--ease);
}

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

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    margin-top: clamp(2rem, 4vw, 2.8rem);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1rem;
    border: 1px solid var(--ink);
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1;
    text-decoration: none;
    text-align: center;
    transition:
        color 180ms var(--ease),
        border-color 180ms var(--ease),
        background 180ms var(--ease),
        transform 180ms var(--ease);
}

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

.button--primary {
    background: var(--ink);
    color: var(--canvas);
}

.button--primary:hover {
    background: #000;
}

.button--secondary {
    border-color: var(--line-strong);
    color: var(--ink);
}

.button--secondary:hover {
    border-color: var(--ink);
}

/* Bottoni chiari dentro il pannello scuro */
.panel-dark .button--primary {
    border-color: var(--paper);
    background: var(--paper);
    color: var(--ink-panel);
}

.panel-dark .button--primary:hover {
    background: #fff;
}

.panel-dark .button--secondary {
    border-color: var(--line-inverse);
    color: var(--paper);
}

.panel-dark .button--secondary:hover {
    border-color: rgba(236, 233, 228, 0.6);
}

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

.section {
    padding: clamp(4.5rem, 10vw, 8.5rem) 0;
    border-top: 1px solid var(--line);
}

.section--flush {
    border-top: 0;
}

.split {
    display: grid;
    grid-template-columns: minmax(8rem, 0.3fr) minmax(0, 1fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: start;
}

/* Grammatica ereditata da Untitled: indice numerato + micro-label mono. */
.section__label {
    color: var(--quiet);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: var(--label-tracking);
    line-height: 1.6;
    text-transform: uppercase;
}

.section__num {
    color: var(--accent);
}

.section__copy {
    display: grid;
    gap: clamp(1.2rem, 2vw, 1.8rem);
}

.section__copy > p {
    max-width: 62ch;
}

.section__copy p a,
.legal-copy a {
    color: var(--ink);
    font-weight: 550;
    text-decoration-color: rgba(196, 18, 72, 0.5);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.24em;
    transition: color 180ms var(--ease);
}

.section__copy p a:hover,
.legal-copy a:hover {
    color: var(--accent);
}

/* ---------- Statement (centrato, peso contro peso) ---------- */

.statement {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: clamp(2rem, 4.5vw, 3.2rem);
}

.statement h2 {
    max-width: 16ch;
    font-size: clamp(2.3rem, 5.6vw, 4.2rem);
    letter-spacing: -0.03em;
    line-height: 1.06;
}

.statement h2 .dim {
    color: var(--dim);
}

.statement__copy {
    display: grid;
    gap: 1.2rem;
    max-width: 60ch;
    text-align: left;
}

/* ---------- Ledger (indice servizi) ---------- */

.ledger {
    margin-top: clamp(0.4rem, 1.5vw, 1rem);
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--line);
}

.ledger__row {
    display: grid;
    grid-template-columns: 3.2rem minmax(11rem, 0.36fr) minmax(0, 1fr);
    gap: 0.6rem 2rem;
    align-items: baseline;
    border-top: 1px solid var(--line);
    padding: clamp(1.3rem, 2.5vw, 1.7rem) 0;
}

.ledger__num {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 650;
}

.ledger__row p {
    max-width: 52ch;
    font-size: 1rem;
    line-height: 1.65;
}

/* ---------- Pannello scuro (il momento Untitled) ---------- */

.panel-dark {
    margin: 0 var(--canvas-gap);
    border-radius: 12px;
    background: var(--ink-panel);
    color: var(--paper);
}

.panel-dark .section__label {
    color: rgba(236, 233, 228, 0.6);
}

.panel-dark h2 {
    color: var(--paper);
}

.panel-dark p {
    color: var(--muted-inverse);
}

.section--panel {
    border-top: 0;
    padding: clamp(4.5rem, 10vw, 8rem) 0;
}

.panel-dark__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 0.6rem;
}

/* Citazione fedele del marchio Untitled (come la firma email dello studio). */
.untitled-mark {
    display: grid;
    gap: 0.55rem;
    width: fit-content;
    margin-top: clamp(1.6rem, 3.5vw, 2.4rem);
    text-decoration: none;
}

.untitled-mark__word {
    color: var(--paper);
    font-family: var(--font-sans);
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
    font-weight: 880;
    letter-spacing: -0.045em;
    line-height: 1;
}

.untitled-mark__bar {
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0.3);
    transform-origin: left;
    transition: transform 320ms var(--ease);
}

.untitled-mark:hover .untitled-mark__bar {
    transform: scaleX(1);
}

.untitled-mark__payoff {
    color: rgba(236, 233, 228, 0.6);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

/* ---------- Hero della pagina Untitled ---------- */

.hero--untitled {
    margin: 0 var(--canvas-gap);
    border-radius: 12px;
    background: var(--ink-panel);
    color: var(--paper);
    min-height: min(78svh, 46rem);
}

.hero--untitled .hero__kicker {
    color: rgba(236, 233, 228, 0.6);
}

.hero--untitled h1 {
    color: var(--paper);
    font-weight: 880;
    letter-spacing: -0.045em;
}

.hero--untitled .hero__payoff {
    margin-top: 1rem;
    color: rgba(236, 233, 228, 0.6);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
}

.hero--untitled .hero__role {
    color: var(--muted-inverse);
}

.hero--untitled .hero__bar {
    width: 82px;
    height: 3px;
    margin-top: 1.4rem;
    background: var(--accent);
}

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

.contact {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: clamp(1.1rem, 2vw, 1.5rem);
}

.contact-mail {
    width: fit-content;
    color: var(--ink);
    font-size: clamp(1.6rem, 4.5vw, 3rem);
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.15;
    text-decoration: underline;
    text-decoration-color: rgba(196, 18, 72, 0.5);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.16em;
    transition: color 180ms var(--ease), text-decoration-color 180ms var(--ease);
}

.contact-mail:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}

.contact-alt {
    max-width: 44rem;
    color: var(--quiet);
}

.contact-alt a {
    color: var(--ink);
    font-weight: 550;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.24em;
}

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

/* ---------- Footer (sulla cornice) ---------- */

.site-footer {
    padding: clamp(1.2rem, 2.5vw, 1.8rem) 0;
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.4rem;
}

.site-footer p,
.site-footer a {
    color: var(--quiet);
    font-size: 0.86rem;
}

.site-footer a {
    text-decoration: none;
}

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

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem 1.2rem;
}

/* ---------- Pagine legali / 404 ---------- */

.legal-page {
    padding: clamp(5rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 7rem);
}

.legal-page__inner {
    display: grid;
    gap: 1.4rem;
}

.legal-page h1 {
    max-width: 16ch;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
}

.legal-copy {
    display: grid;
    gap: 1rem;
    max-width: 48rem;
    padding-top: 1rem;
}

.inline-link {
    display: inline-flex;
    width: fit-content;
    border-bottom: 1px solid rgba(196, 18, 72, 0.5);
    padding-bottom: 0.24rem;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

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

.panel-dark .inline-link,
.hero--untitled .inline-link {
    color: var(--paper);
}

.panel-dark .inline-link:hover,
.hero--untitled .inline-link:hover {
    color: #fff;
}

/* ---------- Reveal ---------- */

/* Solo transform, mai opacity: il contenuto resta sempre visibile (crawler,
   renderer headless, JS disattivato) e con JS sale dolcemente in posizione. */
.js [data-reveal] {
    transform: translateY(16px);
    transition: transform 720ms var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
    transform: translateY(0);
}

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

@media (max-width: 900px) {
    .ledger__row {
        grid-template-columns: 3.2rem minmax(0, 1fr);
    }

    .ledger__row p {
        grid-column: 2;
    }
}

@media (max-width: 760px) {
    .split {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero {
        min-height: calc(100svh - 10rem);
    }

    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer__links {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .container {
        width: min(calc(100% - 1.75rem), var(--container));
    }

    h1 {
        font-size: clamp(2.6rem, 13.5vw, 3.4rem);
    }

    h2 {
        font-size: clamp(1.65rem, 8vw, 2.1rem);
    }

    .statement h2 {
        font-size: clamp(1.9rem, 9.5vw, 2.5rem);
    }

    p {
        font-size: 1rem;
        line-height: 1.65;
    }

    .site-head__nav a {
        font-size: 0.88rem;
    }

    .hero__actions,
    .button {
        width: 100%;
    }

    #untitled .panel-dark__actions {
        justify-content: center;
    }

    #untitled .untitled-mark {
        justify-items: center;
        margin-inline: auto;
        text-align: center;
    }

    .button {
        min-height: 3.3rem;
    }

    .section {
        padding: clamp(4rem, 15vw, 5.5rem) 0;
    }

    .ledger__row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .ledger__row p {
        grid-column: 1;
    }

    .contact-mail {
        font-size: clamp(1.3rem, 6.8vw, 1.7rem);
    }
}

@media (max-width: 370px) {
    .container {
        width: min(calc(100% - 1.25rem), var(--container));
    }

    h1 {
        font-size: clamp(2.2rem, 13vw, 2.7rem);
    }
}

/* ---------- Reduced motion ---------- */

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

    .js [data-reveal] {
        transform: none;
    }
}
