@font-face {
  font-family: "Archivo";
  src: url("/assets/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #101214;
  --surface: #1b1f24;
  --steel: #6e7681;
  --text: #eceae6;
  --muted: #a3a9b1;
  --accent: #ff5b14;
  --ti: #4e5fd6;
  --line: rgba(236, 234, 230, 0.12);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(16px, 5vw, 80px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 "Archivo", system-ui, sans-serif; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.display {
  font-stretch: 125%; font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.015em; line-height: 0.94; margin: 0; text-wrap: balance;
}

/* ---------------------------------------------------------------- scena fissa */
#poster, #stage { position: fixed; top: 0; left: 0; width: 100vw; height: 100lvh; }
#poster { object-fit: cover; z-index: 0; transition: opacity 600ms ease; }
#stage { display: block; z-index: 1; opacity: 0; transition: opacity 900ms ease; }
.scene-ready #stage { opacity: 1; }
.scene-fallback #stage { display: none; }
#vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(16, 18, 20, 0.75) 0, rgba(16, 18, 20, 0) 18%),
    radial-gradient(120% 90% at 50% 45%, rgba(16, 18, 20, 0) 55%, rgba(16, 18, 20, 0.55) 100%);
}

/* ---------------------------------------------------------------- intro */
#intro {
  position: fixed; inset: 0; z-index: 50; background: var(--bg);
  display: grid; place-items: center; padding: var(--gutter);
  clip-path: inset(0 0 0 0); transition: clip-path 900ms var(--ease-in-out);
}
#intro.out { clip-path: inset(0 0 100% 0); }
#intro .mark { display: grid; gap: 14px; justify-items: start; width: min(1100px, 100%); }
#intro .word { font-size: clamp(56px, 13vw, 190px); white-space: nowrap; }
#intro .sub { font-stretch: 125%; font-weight: 600; letter-spacing: 0.32em; font-size: clamp(11px, 1.3vw, 15px); color: var(--muted); text-transform: uppercase; }
#intro .bar { width: 100%; height: 1px; background: var(--line); overflow: hidden; margin-top: 18px; }
#intro .bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 300ms var(--ease-out); }
#intro .word span { display: inline-block; opacity: 0; transform: translateY(18px); animation: rise 700ms var(--ease-out) forwards; }
#intro .word span:nth-child(2) { animation-delay: 50ms; } #intro .word span:nth-child(3) { animation-delay: 95ms; }
#intro .word span:nth-child(4) { animation-delay: 130ms; } #intro .word span:nth-child(5) { animation-delay: 160ms; }
@keyframes rise { to { opacity: 1; transform: none; } }
#flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: #dfe9ff; opacity: 0; }

/* ---------------------------------------------------------------- header */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  padding: 18px var(--gutter);
}
.top { transition: background-color 300ms ease, backdrop-filter 300ms ease; }
.top.solid { background: rgba(16, 18, 20, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand b { font-stretch: 125%; font-weight: 850; font-size: 20px; letter-spacing: -0.01em; }
.brand small { font-stretch: 125%; font-weight: 600; font-size: 10px; letter-spacing: 0.28em; color: var(--muted); }
.top nav { display: flex; gap: 24px; margin-left: auto; }
.top nav a { text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); position: relative; padding: 6px 0; transition: color 200ms ease; }
.top nav a[aria-current="page"] { color: var(--text); }
.top nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
@media (hover: hover) and (pointer: fine) { .top nav a:hover { color: var(--text); } }

.btn {
  --h: 48px; display: inline-flex; align-items: center; gap: 12px; height: var(--h); padding: 0 20px;
  background: var(--accent); color: #140a05; border: 0; border-radius: 2px; cursor: pointer;
  font: 700 15px/1 "Archivo", sans-serif; font-stretch: 112%; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.btn svg { width: 18px; height: 18px; transition: transform 200ms var(--ease-out); }
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #ff7438; } .btn:hover svg { transform: translateX(3px); } }
.btn.small { --h: 40px; font-size: 14px; padding: 0 16px; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: rgba(236, 234, 230, 0.06); } }

/* ---------------------------------------------------------------- storia */
#story { position: relative; z-index: 3; }
#story section { height: 150lvh; }
#story section:last-child { height: 120lvh; }

#copy { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.chap {
  position: absolute; left: var(--gutter); bottom: 14vh; width: min(640px, 44vw);
  visibility: hidden;
}
.chap.r { left: auto; right: calc(var(--gutter) + 150px); }
.chap.on { visibility: visible; pointer-events: auto; }
.chap::before {
  content: ""; position: absolute; inset: -30% -40% -30% -40%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(16, 18, 20, 0.72), rgba(16, 18, 20, 0));
  opacity: 0; transition: opacity 500ms ease;
}
.chap.on::before { opacity: 1; }
.chap .eyebrow { font-weight: 600; font-size: 13px; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 18px; }
.chap .eyebrow em { font-style: normal; color: var(--accent); }
.chap h2, .chap h1 { font-size: clamp(34px, 4.3vw, 76px); text-shadow: 0 2px 30px rgba(16, 18, 20, 0.6); }
.chap p.body { color: var(--muted); max-width: 44ch; margin: 22px 0 0; font-size: 17px; text-shadow: 0 1px 12px rgba(16, 18, 20, 0.9); }
.chap .actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.ln { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.ln > span { display: block; transform: translateY(105%); transition: transform 750ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.chap.on .ln > span { transform: none; }
.chap .fade { opacity: 0; transform: translateY(10px); transition: opacity 500ms ease, transform 600ms var(--ease-out); transition-delay: 220ms; }
.chap.on .fade { opacity: 1; transform: none; }
.chap.leaving .ln > span { transform: translateY(-105%); transition-duration: 300ms; transition-delay: 0ms; }
.chap.leaving .fade { opacity: 0; transition-duration: 200ms; transition-delay: 0ms; }
.chap.leaving { visibility: visible; }

/* ---------------------------------------------------------------- strumento (termometro / metri) */
#gauge {
  position: fixed; z-index: 20; right: var(--gutter); top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: auto auto; gap: 18px; align-items: stretch;
  transition: opacity 400ms ease;
}
#gauge.hide { opacity: 0; pointer-events: none; }
#gauge .track { position: relative; width: 2px; height: 42vh; background: var(--line); }
#gauge .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transform-origin: bottom; transform: scaleY(0); background: var(--steel); }
#gauge .read { display: grid; align-content: space-between; }
#gauge .num { font-stretch: 125%; font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: right; transition: color 300ms ease; }
#gauge .unit { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; letter-spacing: 0.08em; }
#gauge ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; justify-items: end; }
#gauge button {
  all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted);
  transition: color 200ms ease;
}
#gauge button i { display: block; width: 14px; height: 2px; background: currentColor; transition: width 300ms var(--ease-out), background-color 200ms ease; }
#gauge button[aria-current="step"] { color: var(--text); }
#gauge button[aria-current="step"] i { width: 26px; background: var(--accent); }
@media (hover: hover) and (pointer: fine) { #gauge button:hover { color: var(--text); } }
#gauge button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------------------------------------------------------------- dopo la storia */
.after { position: relative; z-index: 12; background: var(--bg); }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }
.sect { padding: clamp(88px, 14vw, 180px) 0; border-top: 1px solid var(--line); }
.kicker { font-weight: 600; font-size: 13px; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 20px; }
.h2 { font-size: clamp(34px, 4.6vw, 72px); }

.services { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); }
.services .lead { position: sticky; top: 120px; align-self: start; }
.services .lead p { color: var(--muted); max-width: 40ch; margin: 24px 0 0; }
.svc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.svc li { display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); position: relative; }
.svc h3 { margin: 0; font-stretch: 112%; font-weight: 750; font-size: 21px; line-height: 1.2; }
.svc p { margin: 0; color: var(--muted); font-size: 16px; }
.svc li.star h3 { color: var(--text); }
.svc li.star h3::after { content: "La specialità"; display: block; margin-top: 8px; font-stretch: 100%; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--accent); }
.svc li::before { content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .svc li:hover::before { transform: scaleX(1); } }

.statement { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.statement blockquote { margin: 0; font-size: clamp(36px, 5vw, 80px); }
.statement blockquote b { color: var(--accent); font-weight: inherit; }
.facts { display: grid; gap: 28px; }
.facts div { border-left: 2px solid var(--ti); padding-left: 18px; }
.facts h3 { margin: 0 0 6px; font-stretch: 112%; font-weight: 700; font-size: 18px; }
.facts p { margin: 0; color: var(--muted); font-size: 16px; }

.bridge { display: grid; grid-template-columns: 1fr 1.3fr; min-height: 70vh; text-decoration: none; background: var(--surface); overflow: hidden; }
.bridge .txt { padding: clamp(32px, 5vw, 72px); display: grid; align-content: space-between; gap: 40px; }
.bridge .txt p { color: var(--muted); max-width: 36ch; margin: 18px 0 0; }
.bridge .go { display: inline-flex; align-items: center; gap: 14px; font-weight: 700; font-stretch: 112%; }
.bridge .go svg { width: 22px; transition: transform 300ms var(--ease-out); }
.bridge figure { margin: 0; overflow: hidden; }
.bridge img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .bridge:hover img { transform: scale(1.06); } .bridge:hover .go svg { transform: translateX(6px); } }

.who { display: grid; grid-template-columns: 4fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.who .photo { aspect-ratio: 4 / 5; background: var(--surface); display: grid; place-items: center; color: var(--steel); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; box-shadow: inset 0 0 0 1px var(--line); }
.who p { color: var(--muted); max-width: 52ch; }
.who p.big { color: var(--text); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.3; font-stretch: 105%; font-weight: 500; }

.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps li { padding: 28px 24px 0 0; position: relative; }
.steps li::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--accent); }
.steps h3 { margin: 0 0 10px; font-stretch: 112%; font-weight: 750; font-size: 19px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }

.split2 { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 96px); margin-top: 56px; }
.split2 > div { border-top: 2px solid var(--text); padding-top: 24px; }
.split2 > div + div { margin-top: 18vh; border-top-color: var(--steel); }
.split2 h3 { margin: 0 0 12px; font-size: clamp(28px, 3vw, 44px); }
.split2 ul { margin: 0; padding: 0; list-style: none; color: var(--muted); }
.split2 li { padding: 12px 0; border-bottom: 1px solid var(--line); }

.contact { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.contact .h2 { font-size: clamp(44px, 7vw, 120px); }
.contact dl { margin: 0; display: grid; gap: 22px; }
.contact dt { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.contact dd { margin: 4px 0 0; font-size: 18px; }
.contact .note { color: var(--muted); font-size: 14px; margin: 14px 0 0; }

footer.foot { position: relative; z-index: 12; background: var(--surface); min-height: 100lvh; display: grid; grid-template-rows: 1fr auto; overflow: hidden; }
.foot .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-top: clamp(80px, 12vw, 160px); }
.foot h4 { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--accent); } }
.foot .giant { font-size: 25.5vw; line-height: 0.78; margin: 0 0 -0.04em -0.04em; color: var(--bg); white-space: nowrap; user-select: none; }

/* sfondi di riserva per capitolo (niente WebGL, movimento ridotto) */
.scene-fallback #poster { opacity: 1 !important; }

/* ---------------------------------------------------------------- telefono */
@media (max-width: 820px) {
  .top { padding: 14px 16px; }
  .top nav { display: none; }
  .top .btn { margin-left: auto; }
  .brand small { display: none; }
  .chap, .chap.r { left: 16px; right: 16px; width: auto; bottom: auto; top: auto; }
  .chap.vb { bottom: 9vh; }
  .chap.vt { top: 92px; }
  .chap h2, .chap h1 { font-size: clamp(34px, 10vw, 52px); }
  .chap p.body { font-size: 16px; margin-top: 14px; }
  .chap .eyebrow { margin-bottom: 12px; }
  #gauge { top: 64px; right: 16px; transform: none; grid-template-columns: auto; }
  #gauge .track, #gauge ol { display: none; }
  #gauge .num { font-size: 22px; }
  .services, .statement, .who, .contact, .split2 { grid-template-columns: 1fr; }
  .services .lead { position: static; }
  .svc li { grid-template-columns: 1fr; gap: 8px; }
  .bridge { grid-template-columns: 1fr; }
  .bridge figure { aspect-ratio: 4 / 3; order: -1; }
  .steps { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--line); margin-left: 4px; }
  .steps li { padding: 0 0 28px 24px; }
  .steps li::before { top: 6px; left: -5px; }
  .split2 > div + div { margin-top: 0; }
  .foot .cols { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ln > span, .chap .fade { transition: opacity 300ms ease; transform: none !important; }
  #intro { transition: opacity 300ms ease; }
  #intro.out { clip-path: none; opacity: 0; pointer-events: none; }
}
