/* =====================================================================
   Architetto Mattia Casonato — foglio di stile
   ===================================================================== */

@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --bg: #0f0f0e;
  --bg-2: #161614;
  --bg-3: #1f1e1b;
  --paper: #f3f1ec;
  --ink: #171614;
  --text: #ecebe6;
  --muted: #a19d95;
  --line: rgba(236, 235, 230, .12);
  --line-2: rgba(236, 235, 230, .24);
  --accent: #b5a493;       /* tortora del logo, schiarito per il contrasto su scuro */
  --accent-2: #9f8f7f;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --header-h: 76px;

  --fs-xs: .78rem;
  --fs-sm: .9rem;
  --fs-base: clamp(1rem, .96rem + .2vw, 1.1rem);
  --fs-lead: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  --fs-h3: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
  --fs-h2: clamp(2rem, 1.4rem + 2.6vw, 3.6rem);
  --fs-display: clamp(2.2rem, 1.2rem + 4.4vw, 5.4rem);
  --fs-hero: clamp(3.2rem, 1rem + 10vw, 10.5rem);
  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/1.65 "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.1; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul.plain, ol { list-style: none; margin: 0; padding: 0; }
address { font-style: normal; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--gutter), 1760px); margin-inline: auto; }
.wrap-inner { padding-inline: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--paper); color: var(--ink); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* ---------- tipografia */
.eyebrow {
  font-size: var(--fs-xs); letter-spacing: .28em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 1.2rem; display: flex; align-items: center; gap: .9em;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.eyebrow a:hover { color: var(--text); }
.h2 { font-size: var(--fs-h2); font-weight: 300; }
.h3 { font-size: var(--fs-h3); font-weight: 400; }
.h2 sup, .h3 sup, .chip sup { font-size: .5em; color: var(--muted); vertical-align: super; margin-left: .2em; }
.display { font-size: var(--fs-display); font-weight: 300; line-height: 1.05; letter-spacing: -.02em; }
.lead { font-size: var(--fs-lead); font-weight: 300; line-height: 1.55; max-width: 46ch; }
.link { border-bottom: 1px solid var(--line-2); transition: border-color .3s; }
.link:hover { border-color: var(--accent); }
.link-arrow { display: inline-flex; align-items: center; gap: .6em; font-size: var(--fs-sm); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.link-arrow svg { transition: transform .35s var(--ease); }
.link-arrow:hover svg, a:hover > .link-arrow svg { transform: translateX(5px); }

/* ---------- bottoni */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: .7em; min-height: 50px; padding: 0 26px;
  background: var(--text); color: var(--ink); border: 1px solid var(--text); border-radius: 999px; cursor: pointer;
  font-size: var(--fs-sm); letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
  transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: var(--text); color: var(--text); }

/* ---------- header */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: top .4s var(--ease);
}
/* lo sfondo sfocato sta su uno pseudo-elemento: backdrop-filter sull'header
   intrappolerebbe il menu mobile (position: fixed) dentro l'header */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: rgba(15, 15, 14, .78); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled::before { opacity: 1; }
.brand, .nav-toggle { position: relative; }
.site-header.is-hidden { top: calc(-1 * var(--header-h) - 2px); } /* niente transform: romperebbe il menu fixed */
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; z-index: 2; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-weight: 500; letter-spacing: .06em; font-size: 1rem; text-transform: uppercase; }
.brand-text small { font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(18px, 2.6vw, 40px); }
.nav a { position: relative; font-size: var(--fs-sm); letter-spacing: .16em; text-transform: uppercase; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: grid; place-content: center; gap: 7px; width: 46px; height: 46px; z-index: 2;
    background: none; border: 1px solid var(--line-2); border-radius: 50%; cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--text); transition: transform .4s var(--ease); }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center;
    padding: calc(var(--header-h) + 20px) var(--gutter) 40px;
    clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease); visibility: hidden;
  }
  .nav.is-open { clip-path: inset(0); visibility: visible; }
  .nav ul { flex-direction: column; gap: 6px; }
  .nav a { font-size: clamp(2rem, 9vw, 3rem); letter-spacing: 0; text-transform: none; font-weight: 300; }
  .nav.is-open li { animation: menu-in .6s var(--ease) both; }
  .nav.is-open li:nth-child(2) { animation-delay: .06s; }
  .nav.is-open li:nth-child(3) { animation-delay: .12s; }
  .nav.is-open li:nth-child(4) { animation-delay: .18s; }
  body.menu-open { overflow: hidden; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(24px); } }

/* ---------- hero home */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-media, .hero-slide { position: absolute; inset: 0; margin: 0; }
.hero-slide { opacity: 0; transition: opacity 1.6s ease; }
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.hero-slide.is-active img { animation: kenburns 9s linear both; }
@keyframes kenburns { from { transform: scale(1.12) translate3d(0, 0, 0); } to { transform: scale(1) translate3d(-1%, -1%, 0); } }
.hero-shade { position: absolute; inset: 0; z-index: 2; background:
  linear-gradient(180deg, rgba(10,10,9,.55) 0%, rgba(10,10,9,0) 22%, rgba(10,10,9,.15) 40%, rgba(10,10,9,.88) 100%),
  linear-gradient(90deg, rgba(10,10,9,.62), rgba(10,10,9,0) 65%); }
.hero-content { position: relative; z-index: 3; padding-bottom: clamp(24px, 6vh, 64px); text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.hero-content .eyebrow, .page-hero-content .eyebrow { color: #e2d6c8; }
.page-hero-content { text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.btn { text-shadow: none; }
.hero-title { font-size: var(--fs-hero); font-weight: 300; line-height: .9; letter-spacing: -.035em; margin-bottom: .25em; text-transform: uppercase; }
.hero-title span { display: inline-block; }
.hero-title span:last-child { font-weight: 500; }
.hero-lead { font-size: var(--fs-lead); font-weight: 300; max-width: 40ch; margin-bottom: 1.8em; color: #dcd9d2; }
.hero-in { animation: rise 1.1s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
.hero-foot { position: relative; z-index: 3; display: flex; align-items: center; gap: 24px; padding: 18px 0 26px; border-top: 1px solid var(--line); }
.hero-caption { font-size: var(--fs-sm); display: flex; gap: .7em; align-items: baseline; min-width: 0; }
.hero-caption span { color: var(--muted); font-size: var(--fs-xs); letter-spacing: .2em; text-transform: uppercase; }
.hero-caption strong { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-caption:hover strong { color: var(--accent); }
.hero-bars { flex: 1; display: flex; gap: 6px; max-width: 320px; margin-left: auto; }
.hero-bar { flex: 1; height: 2px; background: var(--line-2); overflow: hidden; }
.hero-bar i { display: block; height: 100%; background: var(--text); transform: scaleX(0); transform-origin: left; }
.hero-bar.is-done i { transform: scaleX(1); }
.hero-bar.is-active i { animation: bar var(--slide, 6s) linear both; }
@keyframes bar { to { transform: scaleX(1); } }
.hero-count { font-size: var(--fs-xs); letter-spacing: .2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.hero-count b { color: var(--text); font-weight: 500; }
.scroll-cue { position: absolute; z-index: 3; right: var(--gutter); bottom: 110px; width: 1px; height: 70px; background: var(--line-2); overflow: hidden; }
.scroll-cue span { position: absolute; inset: 0; background: var(--text); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }
@media (max-width: 640px) {
  .hero-bars { display: none; } .scroll-cue { display: none; } .hero-count { margin-left: auto; }
  .hero-shade { background: linear-gradient(180deg, rgba(10,10,9,.5) 0%, rgba(10,10,9,.1) 25%, rgba(10,10,9,.55) 50%, rgba(10,10,9,.92) 100%); }
  .eyebrow { letter-spacing: .2em; }
}

/* ---------- page hero */
.page-hero { position: relative; min-height: min(72svh, 720px); display: flex; align-items: flex-end; overflow: hidden; padding-top: var(--header-h); }
.page-hero-tall { min-height: 92svh; }
.page-hero-media { position: absolute; inset: 0; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,9,.6) 0%, rgba(10,10,9,.1) 35%, rgba(10,10,9,.88) 100%); }
.page-hero-content { position: relative; padding-block: clamp(40px, 9vh, 96px); }
.page-title { font-size: var(--fs-display); font-weight: 300; letter-spacing: -.025em; line-height: 1; max-width: 18ch; }
.page-hero-intro { font-size: var(--fs-lead); font-weight: 300; max-width: 52ch; margin-top: 1.2rem; color: #d8d5ce; }
.page-plain { padding-top: calc(var(--header-h) + clamp(40px, 8vw, 100px)); min-height: 70vh; }

/* parallasse: solo nei browser che supportano le scroll-driven animations, zero JS */
@supports (animation-timeline: view()) {
  .parallax img { animation: parallax linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  @keyframes parallax { from { transform: translateY(-6%) scale(1.14); } to { transform: translateY(6%) scale(1.14); } }
  .page-hero .parallax img { animation-range: exit -20% exit 100%; }
  @keyframes parallax-hero { from { transform: scale(1.06); } to { transform: translateY(14%) scale(1.06); } }
  .page-hero .parallax img { animation-name: parallax-hero; }
}

/* ---------- sezioni */
.section { padding-block: clamp(72px, 11vw, 160px); position: relative; }
.section-tight { padding-block: clamp(48px, 7vw, 100px); }
.section-dark { background: var(--bg-2); }
.section-light { background: var(--paper); color: var(--ink); }
.section-light .muted, .section-light .h3 sup { color: #6d6962; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: clamp(32px, 5vw, 64px); }
.section-head .lead { margin-top: 1.2rem; }

.intro-grid { display: grid; grid-template-columns: minmax(160px, 1fr) 3fr; gap: 24px 60px; }
.quote { margin-bottom: .7em; }
.quote .w { display: inline-block; opacity: .15; transition: opacity .6s ease; }
.quote .w.on { opacity: 1; }
@media (max-width: 760px) { .intro-grid { grid-template-columns: 1fr; } }

/* ---------- card progetti */
.card { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-3); isolation: isolate; }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { position: absolute; inset: auto 0 0; padding: clamp(48px, 6vw, 90px) clamp(18px, 2.4vw, 30px) clamp(18px, 2.4vw, 30px); background: linear-gradient(0deg, rgba(10,10,9,.92) 0%, rgba(10,10,9,.6) 55%, rgba(10,10,9,0) 100%); z-index: 1; text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.card-kicker { font-size: var(--fs-xs); letter-spacing: .22em; text-transform: uppercase; color: #d2c4b5; margin-bottom: .5em; }
.card-title { font-size: var(--fs-h3); font-weight: 400; }
.card-meta { font-size: var(--fs-sm); color: #cfcbc3; margin-top: .3em; }
.card::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); border-radius: inherit; pointer-events: none; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: clamp(14px, 1.6vw, 24px); }

.feat-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(14px, 1.6vw, 24px); }
.feat-grid .card { grid-column: span 6; }
.feat-grid .feat-1 { grid-column: span 7; } .feat-grid .feat-2 { grid-column: span 5; }
.feat-grid .feat-3 { grid-column: span 4; } .feat-grid .feat-4 { grid-column: span 4; } .feat-grid .feat-5 { grid-column: span 4; }
.feat-grid .feat-6 { grid-column: span 12; }
.feat-grid .feat-1 .card-media, .feat-grid .feat-2 .card-media { aspect-ratio: auto; height: clamp(320px, 42vw, 620px); }
.feat-grid .feat-6 .card-media { aspect-ratio: 21 / 9; }
@media (max-width: 900px) {
  .feat-grid .card { grid-column: span 12 !important; }
  .feat-grid .card .card-media { aspect-ratio: 4 / 3 !important; height: auto !important; }
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(28px, 4vw, 48px); }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--line-2); border-radius: 999px;
  background: none; cursor: pointer; font-size: var(--fs-sm); letter-spacing: .06em; transition: background .3s, color .3s, border-color .3s;
}
.chip:hover { border-color: var(--text); }
.chip[aria-current] { background: var(--text); color: var(--ink); border-color: var(--text); }
.chip[aria-current] sup { color: #6d6962; }

/* ---------- numeri */
.numbers { padding-block: clamp(56px, 8vw, 110px); border-block: 1px solid var(--line); }
.nums { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 32px; }
.num { border-left: 1px solid var(--line); padding-left: clamp(16px, 2vw, 28px); }
.num-value { font-size: clamp(2.8rem, 1.6rem + 4vw, 5.6rem); font-weight: 200; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.num-plus { font-size: 2rem; color: var(--accent); font-weight: 300; vertical-align: top; margin-left: 4px; }
.num p { color: var(--muted); font-size: var(--fs-sm); margin-top: .8em; max-width: 18ch; }
@media (max-width: 760px) { .nums { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- icone a tratto */
.ico { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 50%; color: var(--accent); flex: none; transition: background .4s, color .4s, border-color .4s, transform .5s var(--ease); }
.ico svg { width: 22px; height: 22px; stroke-width: 1.4; }
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
li:hover > .ico, li:hover .step-top .ico, a:hover > .ico { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: rotate(-8deg); }
.srv-list .ico { width: 42px; height: 42px; }
.pillars .ico { margin-bottom: 14px; }
.js [data-reveal] .ico svg path, .js [data-reveal] .ico svg circle { stroke-dasharray: 80; stroke-dashoffset: 80; transition: stroke-dashoffset 1.6s var(--ease) .3s; }
.js [data-reveal].is-in .ico svg path, .js [data-reveal].is-in .ico svg circle, .js [data-reveal] .is-in .ico svg path { stroke-dashoffset: 0; }

/* ---------- pilastri (intro home) */
.pillars { list-style: none; margin: clamp(32px, 4vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px clamp(20px, 3vw, 48px); }
.pillars li { border-top: 1px solid var(--line-2); padding-top: 20px; }
.pillars h3 { font-size: var(--fs-lead); font-weight: 400; margin-bottom: .5em; }
.pillars p { color: var(--muted); font-size: var(--fs-sm); }
@media (max-width: 760px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- progetto raccontato */
.section-light .eyebrow, .section-light .link-arrow { color: #7a6a5a; }
.story-lead { font-size: var(--fs-lead); font-weight: 400; line-height: 1.45; margin: 1.4rem 0 1.6rem; max-width: 40ch; }
.story-part { border-top: 1px solid var(--line-2); padding: 16px 0 6px; }
.section-light .story-part { border-color: rgba(23, 22, 20, .16); }
.story-part h3 { font-size: var(--fs-xs); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: .6em; }
.section-light .story-part h3 { color: #7a6a5a; }
.story-part p { font-size: var(--fs-base); line-height: 1.65; }
.prose.story-text p:first-child::first-letter { all: unset; }

/* ---------- valori */
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.values li { padding: 32px clamp(16px, 2vw, 32px) 8px 0; border-right: 1px solid var(--line); padding-left: clamp(0px, 2vw, 32px); }
.values li:first-child { padding-left: 0; }
.values li:last-child { border-right: 0; }
.values h3 { font-size: var(--fs-h3); margin: 1.4rem 0 .8rem; }
.values p { color: var(--muted); }
.idx { font-size: var(--fs-xs); letter-spacing: .2em; color: var(--accent); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .values { grid-template-columns: 1fr 1fr; }
  .values li { border-right: 0; padding-left: 0 !important; border-bottom: 1px solid var(--line); padding-bottom: 28px; }
  .values li:nth-child(odd) { padding-right: 20px; }
}
@media (max-width: 560px) { .values { grid-template-columns: 1fr; } }

/* ---------- rail orizzontale */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 28vw, 420px); gap: clamp(12px, 1.4vw, 20px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  padding: 4px max(var(--gutter), (100vw - var(--maxw)) / 2) 24px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  overscroll-behavior-x: contain;
}
.rail-card { scroll-snap-align: start; position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.rail-media { aspect-ratio: 3 / 4; overflow: hidden; }
.rail-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.rail-card:hover img { transform: scale(1.07); }
.rail-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10,10,9,.85), rgba(10,10,9,0) 50%); z-index: 1; }
.rail-title { position: absolute; left: 22px; bottom: 20px; z-index: 2; font-size: var(--fs-h3); }
.rail-card > svg { position: absolute; right: 22px; bottom: 26px; z-index: 2; transition: transform .4s var(--ease); }
.rail-card:hover > svg { transform: translateX(5px); }
@media (max-width: 640px) { .rail { grid-auto-columns: 72vw; } }

/* ---------- servizi */
.services-teaser { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px 80px; align-items: start; }
.srv-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.srv-list a { display: flex; align-items: center; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); transition: padding .4s var(--ease), color .3s; }
.srv-t { flex: 1; font-size: var(--fs-h3); font-weight: 300; }
.srv-list a:hover { padding-left: 14px; color: var(--accent); }
.srv-list a svg { transition: transform .4s var(--ease); }
.srv-list a:hover svg { transform: translateX(6px); }
@media (max-width: 900px) { .services-teaser { grid-template-columns: 1fr; } }

.srv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(32px, 6vw, 96px); }
.srv { padding: 40px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 20px); }
.srv h2 { margin: 1rem 0 .9rem; }
.srv p { color: var(--muted); max-width: 52ch; }
.srv .link-arrow { margin-top: 1rem; }
.srv:target h2 { color: var(--accent); }
@media (max-width: 760px) { .srv-grid { grid-template-columns: 1fr; } }

/* ---------- CTA */
.cta { position: relative; overflow: hidden; padding-block: clamp(100px, 16vw, 220px); }
.cta-media { position: absolute; inset: 0; }
.cta-media img { width: 100%; height: 100%; object-fit: cover; }
.cta-shade { position: absolute; inset: 0; background: rgba(10, 10, 9, .66); }
.cta-content { position: relative; }
.cta .display { max-width: 14ch; margin-bottom: .4em; }
.cta .lead { margin-bottom: 2rem; color: #dcd9d2; }

/* ---------- progetto */
.project-info { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 48px clamp(40px, 7vw, 120px); align-items: start; }
.sheet { margin: 0; border-top: 1px solid var(--line); position: sticky; top: calc(var(--header-h) + 24px); }
.sheet div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sheet dt { font-size: var(--fs-xs); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding-top: .25em; }
.sheet dd { margin: 0; }
.prose { font-size: var(--fs-lead); font-weight: 300; line-height: 1.7; max-width: 68ch; }
.prose p:first-child::first-letter { float: left; font-size: 4.1em; line-height: .85; padding: .06em .12em 0 0; font-weight: 300; color: var(--accent); }
.prose-page { font-size: var(--fs-base); max-width: 72ch; }
.prose-page h2 { font-size: var(--fs-h3); margin: 2rem 0 .8rem; }
.prose-page p:first-child::first-letter, .prose-page p::first-letter { all: unset; }
.prose-page a { border-bottom: 1px solid var(--line-2); }
@media (max-width: 860px) { .project-info { grid-template-columns: 1fr; } .sheet { position: static; } }

/* galleria a griglia regolare: tre riquadri 3:2 per riga (griglia a 6 colonne, ogni riquadro ne occupa 2).
   Se l'ultima riga resta incompleta, l'immagine sola prende tutta la larghezza e la coppia metà ciascuna. */
.gg { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(8px, 1vw, 16px); }
.gg-item { grid-column: span 2; position: relative; display: block; overflow: hidden; border-radius: var(--radius); aspect-ratio: 3 / 2; cursor: zoom-in; background: var(--bg-3); }
.gg > .gg-item:last-child:nth-child(3n+1) { grid-column: span 6; aspect-ratio: 21 / 9; }
.gg > .gg-item:nth-last-child(2):nth-child(3n+1), .gg > .gg-item:last-child:nth-child(3n+2) { grid-column: span 3; }
.gg-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity .4s; }
.gg-item:hover img { transform: scale(1.04); }
.gg-light .gg-item { background: #fff; aspect-ratio: 4 / 3; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 10px 30px -12px rgba(0,0,0,.18); }
.gg-light > .gg-item:last-child:nth-child(3n+1) { aspect-ratio: 16 / 7; }
.gg-light .gg-item img { object-fit: contain; padding: 3%; }
.gg-light .gg-item:hover img { transform: scale(1.02); }
/* mosaico dei render: una grande e quattro piccole che si ripetono, la grande cambia lato a ogni gruppo */
.mo { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; gap: clamp(8px, 1vw, 14px); }
.mo-item { position: relative; display: block; overflow: hidden; border-radius: var(--radius); aspect-ratio: 3 / 2; cursor: zoom-in; background: var(--bg-3); }
.mo-big { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.mo-item:nth-child(10n + 6) { grid-column: 3 / span 2; }
.mo-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.mo-item:hover img { transform: scale(1.04); }
@media (max-width: 760px) {
  .mo { grid-template-columns: 1fr 1fr; }
  .mo-big, .mo-item:nth-child(10n + 6) { grid-column: span 2; grid-row: auto; aspect-ratio: 3 / 2; }
}

@media (max-width: 900px) {
  .gg { grid-template-columns: 1fr 1fr; }
  .gg > .gg-item, .gg > .gg-item:nth-last-child(2):nth-child(3n+1), .gg > .gg-item:last-child:nth-child(3n+2) { grid-column: span 1; aspect-ratio: 3 / 2; }
  .gg > .gg-item:last-child:nth-child(3n+1) { grid-column: span 1; aspect-ratio: 3 / 2; }
  .gg > .gg-item:last-child:nth-child(odd) { grid-column: span 2; }
  .gg-light > .gg-item { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) { .gg { grid-template-columns: 1fr; } .gg > .gg-item:last-child:nth-child(odd) { grid-column: span 1; } }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; }
.pn { position: relative; overflow: hidden; min-height: clamp(240px, 32vw, 440px); display: flex; align-items: flex-end; }
.pn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.pn:hover img { transform: scale(1.06); }
.pn-shade { position: absolute; inset: 0; background: rgba(10,10,9,.55); transition: background .5s; }
.pn:hover .pn-shade { background: rgba(10,10,9,.35); }
.pn-text { position: relative; padding: clamp(20px, 4vw, 56px); display: flex; flex-direction: column; gap: .4em; }
.pn-next .pn-text { margin-left: auto; text-align: right; }
.pn small { font-size: var(--fs-xs); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.pn strong { font-size: var(--fs-h3); font-weight: 400; }
@media (max-width: 640px) { .prevnext { grid-template-columns: 1fr; } }

/* ---------- render */
.grid-render { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: clamp(14px, 1.6vw, 24px); }
.rcard { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .4s; }
.rcard:hover { border-color: var(--line-2); }
.rcard-media { aspect-ratio: 16 / 10; overflow: hidden; }
.rcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.rcard:hover .rcard-media img { transform: scale(1.06); }
.rcard-body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.rcard-body p { color: var(--muted); font-size: var(--fs-sm); flex: 1; }
.rcard .link-arrow { color: var(--accent); }

/* prima / dopo */
.ba-list { display: grid; gap: clamp(28px, 4vw, 56px); max-width: 1100px; margin-inline: auto; }
.ba { margin: 0; }
.ba-stage { position: relative; aspect-ratio: var(--ar); overflow: hidden; border-radius: var(--radius); --pos: 50%; user-select: none; touch-action: pan-y; }
.ba-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; box-shadow: 0 0 20px rgba(0,0,0,.4); }
.ba-handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%;
  background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 1.2rem; letter-spacing: .1em; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.ba-tag { position: absolute; top: 16px; padding: 6px 12px; font-size: var(--fs-xs); letter-spacing: .2em; text-transform: uppercase; background: rgba(10,10,9,.6); backdrop-filter: blur(6px); border-radius: 999px; pointer-events: none; }
.ba-tag-l { left: 16px; } .ba-tag-r { right: 16px; }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-range:focus-visible + .ba-handle, .ba-stage:focus-within .ba-handle::after { outline: 2px solid var(--accent); }

/* video */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: clamp(20px, 2.4vw, 36px); }
.video { margin: 0; }
.video-btn, .video iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; background: #000; cursor: pointer; }
.video-btn img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease), opacity .4s; opacity: .85; }
.video-btn:hover img { transform: scale(1.04); opacity: 1; }
.video-play { position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--ink); transition: transform .4s var(--ease); }
.video-play svg { width: 28px; height: 28px; margin-left: 4px; }
.video-btn:hover .video-play { transform: scale(1.1); }
.video figcaption { margin-top: 14px; font-size: var(--fs-base); }
.note { margin-top: 32px; }

/* tour 360 */
.tour .chips { margin-bottom: 20px; }
.tour-stage { position: relative; aspect-ratio: 16 / 9; max-height: 78vh; width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; }
.tour-pano { position: absolute; inset: 0; }
.tour-start {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(10,10,9,.35) center / cover no-repeat; border: 0; cursor: pointer; font-size: var(--fs-sm); letter-spacing: .2em; text-transform: uppercase; color: #fff;
}
.tour-start[hidden] { display: none; }
.tour-start svg { width: 72px; height: 72px; stroke-width: 1; transition: transform .6s var(--ease); }
.tour-start:hover svg { transform: rotate(180deg); }
.tour-start span { background: rgba(10,10,9,.6); padding: 10px 18px; border-radius: 999px; backdrop-filter: blur(6px); }
.tour-scenes { display: flex; gap: 10px; margin: 14px 0; overflow-x: auto; }
.tour-scenes button { flex: none; width: 120px; aspect-ratio: 16 / 9; padding: 0; border: 2px solid transparent; border-radius: 3px; overflow: hidden; cursor: pointer; background: var(--bg-3); }
.tour-scenes button[aria-current] { border-color: var(--accent); }
.tour-scenes img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .tour-stage { aspect-ratio: 4 / 5; } }
.pnlm-hotspot.pnlm-scene { width: 44px !important; height: 44px !important; border-radius: 50%; background: rgba(255,255,255,.25) !important; border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 16px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

/* pdf */
.pdf-list { display: grid; gap: 14px; max-width: 820px; }
.pdf-card { display: flex; align-items: center; gap: 22px; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); transition: border-color .3s, background .3s; }
.pdf-card:hover { border-color: var(--accent); background: var(--bg-3); }
.pdf-card > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pdf-card strong { font-weight: 400; font-size: var(--fs-h3); }
.pdf-card small { color: var(--muted); }
.pdf-ico svg { width: 40px; height: 40px; stroke-width: 1.2; color: var(--accent); }

/* ---------- contatti */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ccard { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; }
.ccard-wide { grid-column: 1 / -1; }
.ccard h2 { font-size: var(--fs-xs); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.ccard-ico { color: var(--accent); }
.ccard-ico svg { width: 26px; height: 26px; }
.ccard-links { display: flex; flex-direction: column; gap: 4px; }
.ccard-links a { font-size: 1.1rem; overflow-wrap: anywhere; transition: color .3s; }
.ccard-links a:hover { color: var(--accent); }
.ccard-links .muted { font-size: var(--fs-sm); }
.ccard-social { flex-direction: row; flex-wrap: wrap; gap: 8px 22px; }
.social-link { display: inline-flex; align-items: center; gap: 10px; }
.social-link svg { width: 20px; height: 20px; stroke-width: 1.5; color: var(--accent); }
.site-footer .social-link svg { width: 18px; height: 18px; }
@media (max-width: 1000px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .contact-cards { grid-template-columns: 1fr; } }

.form { display: grid; gap: 16px; padding: clamp(24px, 3vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.form .h3 { margin-bottom: 8px; }
.form label { display: grid; gap: 6px; font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.form input, .form select, .form textarea {
  width: 100%; padding: 14px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--text); transition: border-color .3s;
}
.form select option { background: var(--bg-2); }
.form textarea { resize: vertical; min-height: 120px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .check { display: flex; gap: 10px; align-items: center; text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); }
.form .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form .check a { border-bottom: 1px solid var(--line-2); }
.form .btn { justify-self: start; margin-top: 8px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
/* campo trappola per lo spam: fuori dallo schermo, invisibile alle persone */
.form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; font-size: var(--fs-sm); color: var(--muted); min-height: 1.4em; }
.form-status.is-ok { color: #9fc79a; }
.form-status.is-err { color: #e29a8c; }
.form .btn:disabled { opacity: .6; cursor: wait; }

.map { position: relative; height: clamp(320px, 45vw, 520px); background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M40 0H0v40' fill='none' stroke='%23ffffff10'/%3E%3C/svg%3E"); display: grid; place-items: center; border-top: 1px solid var(--line); }
.map-consent { text-align: center; display: grid; justify-items: center; gap: 16px; color: var(--muted); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(.92) contrast(.9); }

.notfound .btn-row { margin-top: 2rem; }

/* ---------- footer */
.site-footer { background: #0a0a09; border-top: 1px solid var(--line); padding-top: clamp(56px, 7vw, 96px); font-size: var(--fs-sm); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr .8fr; gap: 40px; padding-bottom: 56px; }
.footer-brand img { width: 52px; height: 52px; margin-bottom: 16px; }
.footer-name { font-size: 1.1rem; letter-spacing: .04em; margin-bottom: 0; }
.footer-h { font-size: var(--fs-xs); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; font-weight: 400; }
.site-footer address { margin-bottom: 10px; }
.site-footer .plain li { margin-bottom: 6px; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-xs); letter-spacing: .04em; }
.footer-bottom p { margin: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 7, .96); display: grid; grid-template-rows: auto 1fr auto; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; touch-action: pan-y pinch-zoom; }
.lb.is-open { opacity: 1; visibility: visible; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 clamp(8px, 6vw, 96px); }
.lb-stage img { max-width: 100%; max-height: calc(100svh - 140px); width: auto; height: auto; object-fit: contain; transition: opacity .3s, transform .4s var(--ease); user-select: none; -webkit-user-drag: none; }
.lb-stage img.is-loading { opacity: .25; }
.lb-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(15,15,14,.6); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background .3s, border-color .3s; }
.lb-btn:hover { background: var(--text); color: var(--ink); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-prev { left: clamp(8px, 2vw, 28px); } .lb-next { right: clamp(8px, 2vw, 28px); }
.lb-bottom { height: 24px; }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; } .lb-bottom { height: 76px; } }
body.lb-open { overflow: hidden; }

/* ---------- animazioni di comparsa (solo con JS attivo) */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--rd, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero-slide img, .hero-slide.is-active img { transform: none; animation: none; }
  .quote .w { opacity: 1; }
  @view-transition { navigation: none; }
}
