/* ==========================================================================
   ARCHIVERS — design system
   Palette:  ink #14181F · stone #EDE8DE · off-white #F6F3EC
             concrete #A39D8E · brass #B08D57 · charcoal text #23262B
   Type:     display  Space Grotesk
             body     Inter
             mono     IBM Plex Mono  (etichette, quote, numeri — stile tavola tecnica)
   ========================================================================== */

:root {
    --ink: #14181f;
    --ink-soft: #1c222b;
    --stone: #ede8de;
    --off-white: #f6f3ec;
    --concrete: #a39d8e;
    --concrete-light: #d8d3c6;
    --brass: #b08d57;
    --brass-light: #c9a877;
    --charcoal: #23262b;
    --line: rgba(20, 24, 31, 0.14);
    --line-on-ink: rgba(246, 243, 236, 0.22);

    --display: "Space Grotesk", sans-serif;
    --body: "Inter", sans-serif;
    --mono: "IBM Plex Mono", monospace;

    --max: 1240px;
    --gutter: clamp(20px, 4vw, 64px);
    --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--off-white);
    color: var(--charcoal);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
button { font-family: inherit; }

.mono { font-family: var(--mono); }
.mono-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 0.9em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
}

/* subtle grain overlay for texture, ties to concrete/paper materiality */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    opacity: 0.025;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(246, 243, 236, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    padding: 18px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: var(--off-white);
    font-family: var(--mono);
    font-size: 0.85rem;
    border-radius: var(--radius);
}

.main-nav {
    display: flex;
    gap: clamp(20px, 3vw, 40px);
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover { border-color: var(--brass); color: var(--brass); }

.nav-index {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--concrete);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   FLASH MESSAGES
   ========================================================================== */

.flash-stack {
    max-width: var(--max);
    margin: 20px auto 0;
    padding: 0 var(--gutter);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    background: var(--stone);
    border-radius: var(--radius);
}

.flash--successo { border-color: #6b8f6b; }
.flash--errore { border-color: #b06060; }

.flash-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--ink);
    color: var(--off-white);
    border-radius: 2px;
}

.flash p { font-size: 0.92rem; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
    position: relative;
    background: var(--ink);
    color: var(--off-white);
    overflow: hidden;
    padding: clamp(64px, 12vw, 140px) var(--gutter) clamp(70px, 10vw, 130px);
}

.hero-svg-wrap {
    position: absolute;
    inset: 0;
    max-width: var(--max);
    margin: 0 auto;
}

.hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; }

.dim-line, .dim-tick, .dim-frame, .dim-cross {
    stroke: var(--line-on-ink);
    stroke-width: 1;
    fill: none;
}

.dim-frame { stroke: rgba(176, 141, 87, 0.35); stroke-dasharray: 4 5; }
.dim-cross { stroke: rgba(176, 141, 87, 0.18); }

.dim-line, .dim-tick, .dim-frame, .dim-cross {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: draw-in 2.4s cubic-bezier(.16,.8,.28,1) forwards;
}
.dim-frame { animation-delay: 0.3s; }
.dim-cross { animation-delay: 0.6s; }

@keyframes draw-in { to { stroke-dashoffset: 0; } }

.hero-label {
    position: absolute;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: var(--brass-light);
    opacity: 0;
    animation: fade-in-label 0.6s ease forwards;
    animation-delay: 1.6s;
}
.hero-label--top { top: 6.5%; left: 5%; }
.hero-label--side { top: 22%; left: 4%; writing-mode: vertical-rl; }
.hero-label--scale { bottom: 8%; right: 6%; }

@keyframes fade-in-label { to { opacity: 0.8; } }

.hero-inner {
    position: relative;
    max-width: var(--max);
    margin: 0 auto;
    max-width: 720px;
}

.eyebrow { color: var(--brass-light); margin-bottom: 22px; }

.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1.05;
    margin-bottom: 28px;
}

.hero-title em {
    font-style: normal;
    color: var(--brass-light);
}

.hero-sub {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--concrete-light);
    max-width: 46ch;
    margin-bottom: 40px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn--primary {
    background: var(--brass);
    color: var(--ink);
}
.btn--primary:hover { background: var(--brass-light); transform: translateY(-2px); }

.btn--ghost {
    border-color: var(--line-on-ink);
    color: var(--off-white);
}
.btn--ghost:hover { border-color: var(--brass-light); color: var(--brass-light); }

/* on light backgrounds, ghost buttons need dark line */
.pagina-studio .btn--ghost,
.pagina-contatti .btn--ghost,
.cta-banda .btn--ghost {
    border-color: var(--line);
    color: var(--charcoal);
}

/* ==========================================================================
   NUMERI (stat strip)
   ========================================================================== */

.numeri { border-bottom: 1px solid var(--line); }

.numeri-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 34px var(--gutter);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.numero-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.numero-valore { font-size: 1.7rem; font-weight: 500; color: var(--ink); }
.numero-label { font-size: 0.82rem; color: var(--concrete); }

/* ==========================================================================
   SECTION HEADINGS (shared)
   ========================================================================== */

.section-heading {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(50px, 8vw, 90px) var(--gutter) 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.section-heading h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.link-arrow {
    font-size: 0.9rem;
    font-weight: 500;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--line);
    transition: border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}
.link-arrow:hover { border-color: var(--brass); color: var(--brass); }

/* ==========================================================================
   PROJECT GRID (home)
   ========================================================================== */

.grid-progetti {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter) clamp(50px, 8vw, 90px);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(20px, 3vw, 32px);
}

.card-progetto { display: block; group: card; }

.card-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--stone), var(--concrete-light));
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.card-numero {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 0.75rem;
    color: var(--ink);
    background: rgba(246, 243, 236, 0.75);
    padding: 3px 8px;
    border-radius: 2px;
}

.card-corners {
    position: absolute;
    inset: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card-progetto:hover .card-corners,
.dettaglio-visual .card-corners { opacity: 1; }

.card-corners span {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--brass);
}
.card-corners span:nth-child(1) { top: 0; left: 0; border-right: none; border-bottom: none; }
.card-corners span:nth-child(2) { top: 0; right: 0; border-left: none; border-bottom: none; }
.card-corners span:nth-child(3) { bottom: 0; left: 0; border-right: none; border-top: none; }
.card-corners span:nth-child(4) { bottom: 0; right: 0; border-left: none; border-top: none; }

.card-info h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}
.card-progetto:hover .card-info h3 { color: var(--brass); }

.card-meta { font-size: 0.78rem; color: var(--concrete); }

/* ==========================================================================
   FILOSOFIA
   ========================================================================== */

.filosofia { border-top: 1px solid var(--line); background: var(--stone); }

.filosofia-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(60px, 9vw, 110px) var(--gutter);
    text-align: left;
}

.filosofia-testo {
    font-family: var(--display);
    font-size: clamp(1.3rem, 2.6vw, 1.9rem);
    line-height: 1.35;
    margin-bottom: 28px;
    color: var(--ink);
}

/* ==========================================================================
   PAGE HEADER (progetti / studio / contatti)
   ========================================================================== */

.page-header {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(60px, 10vw, 100px) var(--gutter) clamp(30px, 5vw, 50px);
}

.page-header h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-bottom: 14px; }
.page-header-sub { color: var(--concrete); max-width: 56ch; font-size: 1rem; }

/* ==========================================================================
   PROJECTS LIST
   ========================================================================== */

.lista-progetti {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter) 100px;
    border-top: 1px solid var(--line);
}

.riga-progetto {
    display: grid;
    grid-template-columns: 44px 1fr 140px 120px 70px 24px;
    align-items: center;
    gap: 20px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    transition: background 0.2s ease;
}
.riga-progetto:hover { background: rgba(176, 141, 87, 0.06); }

.riga-numero { color: var(--brass); font-size: 0.85rem; }
.riga-titolo h2 { font-size: 1.2rem; margin-bottom: 6px; }
.riga-desc {
    font-size: 0.88rem;
    color: var(--concrete);
    max-width: 60ch;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.riga-cat, .riga-luogo, .riga-anno { font-size: 0.8rem; color: var(--charcoal); }
.riga-arrow { font-size: 1.1rem; color: var(--brass); opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; }
.riga-progetto:hover .riga-arrow { opacity: 1; transform: translateX(4px); }

/* ==========================================================================
   PROJECT DETAIL
   ========================================================================== */

.dettaglio-header {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(50px, 9vw, 90px) var(--gutter) 0;
}

.dettaglio-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 10px 0 30px; }

.dettaglio-visual {
    position: relative;
    aspect-ratio: 21 / 9;
    background: linear-gradient(135deg, var(--stone), var(--concrete-light));
    border-radius: var(--radius);
}

.dettaglio-body {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(40px, 7vw, 70px) var(--gutter);
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: clamp(30px, 5vw, 70px);
}

.spec-riga {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.spec-riga dt { margin-bottom: 4px; }
.spec-riga dd { margin: 0; font-size: 0.95rem; }

.dettaglio-lead {
    font-family: var(--display);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    line-height: 1.4;
    margin-bottom: 22px;
}

.dettaglio-testo p + p { margin-top: 18px; color: var(--charcoal); }

.dettaglio-nav {
    max-width: var(--max);
    margin: 0 auto;
    padding: 30px var(--gutter) clamp(60px, 9vw, 100px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
}

.dettaglio-nav-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 24px;
    font-weight: 500;
}
.dettaglio-nav-centro { text-align: center; align-items: center; }
.dettaglio-nav-destra { text-align: right; align-items: flex-end; }
.dettaglio-nav-link:hover { color: var(--brass); }

/* ==========================================================================
   STUDIO PAGE
   ========================================================================== */

.studio-testo {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--gutter) 40px;
}
.studio-testo p + p { margin-top: 18px; }

.valori { border-top: 1px solid var(--line); background: var(--stone); }

.grid-valori {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter) clamp(60px, 9vw, 100px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(20px, 3vw, 30px);
}

.valore-item {
    padding: 24px 0 0;
    border-top: 2px solid var(--ink);
}
.valore-item h3 { font-size: 1.05rem; margin-bottom: 10px; }
.valore-item p { font-size: 0.9rem; color: var(--concrete); }

.cta-banda {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(60px, 9vw, 100px) var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.cta-banda p { font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.8rem); max-width: 20ch; }

/* ==========================================================================
   CONTACT PAGE
   ========================================================================== */

.contatti-body {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter) clamp(70px, 9vw, 110px);
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: clamp(30px, 5vw, 70px);
}

.form-contatti { display: flex; flex-direction: column; gap: 22px; }

.campo { display: flex; flex-direction: column; }

.campo input,
.campo textarea {
    font-family: var(--body);
    font-size: 1rem;
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: var(--off-white);
    border-radius: var(--radius);
    color: var(--charcoal);
    resize: vertical;
}
.campo input:focus,
.campo textarea:focus {
    outline: none;
    border-color: var(--brass);
}

.form-contatti .btn { align-self: flex-start; }

.contatti-info {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding-top: 4px;
}
.contatti-info p { font-size: 0.95rem; }
.contatti-info a:hover { color: var(--brass); }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--ink);
    color: var(--concrete-light);
    margin-top: clamp(40px, 6vw, 70px);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: clamp(50px, 8vw, 80px) var(--gutter) 40px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 30px;
}

.footer-col p { font-size: 0.9rem; line-height: 1.6; }
.footer-col a:hover { color: var(--brass-light); }
.footer-col .logo-mark { margin-bottom: 14px; }
.footer-coords .mono { color: var(--brass-light); }

.footer-bottom {
    max-width: var(--max);
    margin: 0 auto;
    padding: 20px var(--gutter) 30px;
    border-top: 1px solid var(--line-on-ink);
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--concrete);
    flex-wrap: wrap;
    gap: 10px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    .numeri-inner { grid-template-columns: repeat(2, 1fr); }
    .grid-valori { grid-template-columns: repeat(2, 1fr); }
    .dettaglio-body { grid-template-columns: 1fr; }
    .contatti-body { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .riga-progetto {
        grid-template-columns: 34px 1fr 24px;
        row-gap: 6px;
    }
    .riga-cat, .riga-luogo, .riga-anno { display: none; }
}

@media (max-width: 720px) {
    .main-nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--off-white);
        flex-direction: column;
        padding: 30px var(--gutter);
        gap: 4px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 90;
    }
    .main-nav.is-open { transform: translateX(0); }
    .main-nav a {
        font-size: 1.3rem;
        padding: 16px 0;
        border-bottom: 1px solid var(--line);
        justify-content: space-between;
        flex-direction: row-reverse;
    }
    .nav-toggle { display: flex; }

    .grid-progetti { grid-template-columns: 1fr; }
    .grid-valori { grid-template-columns: 1fr; }
    .numeri-inner { grid-template-columns: 1fr 1fr; }
    .dettaglio-nav { grid-template-columns: 1fr; text-align: left !important; }
    .dettaglio-nav-centro, .dettaglio-nav-destra { align-items: flex-start !important; text-align: left !important; }
    .footer-inner { grid-template-columns: 1fr; }
    .cta-banda { flex-direction: column; align-items: flex-start; }
    .hero-label--side { display: none; }
}

@media (max-width: 480px) {
    .header-inner { padding: 16px var(--gutter); }
    .logo-word { display: none; }
}


.slider-progetti {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.slider-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.5rem 0 1rem;
    /* hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.slider-track::-webkit-scrollbar {
    display: none;
}

.slider-track .card-progetto {
    flex: 0 0 auto;
    width: 320px; /* adjust to your card width */
    scroll-snap-align: start;
}

.slider-arrow {
    flex-shrink: 0;
    background: none;
    border: 1px solid currentColor;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
    .slider-arrow { display: none; } /* rely on touch swipe on mobile */
}