/* =================================================================
   Falegnameria e Restauro Francesco De Luca
   Palette dalle moodboard: noce scuro, marmo taupe, sabbia, avorio, ottone
   ================================================================= */

:root {
  --ink: #15100c;
  --ink-2: #1d1611;
  --walnut: #2a1d15;
  --wood: #5c3d29;
  --bronze: #b98f60;
  --bronze-deep: #7a5433;
  --sabbia: #c8b6a2;
  --sabbia-light: #d9cbba;
  --cream: #efe8de;
  --ivory: #f7f3ec;

  --text: #231a13;
  --text-muted: #5b4e44;
  --on-dark: #efe8de;
  --on-dark-muted: rgba(239, 232, 222, 0.72);
  --line-dark: rgba(35, 26, 19, 0.16);
  --line-light: rgba(239, 232, 222, 0.16);
  --error: #9b2c22;

  --f-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --f-caps: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1360px;
  --header-h: 84px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-locked { overflow: hidden; }
html.is-locked body { overflow: hidden; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--ivory); color: var(--ink);
  padding: 12px 18px; text-decoration: none; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ---------- Tipografia comune ---------- */
.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--f-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bronze-deep);
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7;
}
.eyebrow .num { font-family: var(--f-caps); letter-spacing: .08em; }

.h2 {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 5.6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-top: 22px;
  text-wrap: balance;
}
.h2 em, .hero__title em, .opera__title em, .manifesto__text em { font-style: italic; font-weight: 300; }

.section { padding-block: clamp(96px, 14vw, 200px); position: relative; }
.section--cream { background: var(--cream); color: var(--text); }
.section--sabbia { background: var(--sabbia-light); color: var(--text); }
.section--dark { background: var(--ink); color: var(--on-dark); }
.section--wood {
  color: var(--on-dark);
  background:
    radial-gradient(120% 80% at 85% 0%, rgba(185, 143, 96, 0.12), transparent 60%),
    linear-gradient(180deg, var(--walnut) 0%, #20160f 100%);
}
.section--dark .eyebrow, .section--wood .eyebrow { color: var(--bronze); }

.section-head { margin-bottom: clamp(48px, 7vw, 96px); }
.section-head--split {
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
  align-items: end;
}
.section-head__lead { max-width: 380px; color: var(--on-dark-muted); font-size: 1.0625rem; }
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1.4fr 1fr; }
  .section-head__lead { justify-self: end; }
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 52px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--f-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.btn__arrow {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .35s var(--ease-out);
}
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn:active { transform: scale(0.98); }

.btn--light { background: var(--ivory); color: var(--ink); }
.btn--light:hover { background: var(--bronze); color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--ivory); }
.btn--dark:hover { background: var(--wood); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-dark); }
.btn--ghost:hover { border-color: var(--text); }

/* =================================================================
   1 · INTRO
   ================================================================= */
.intro { display: none; }
.js .intro {
  display: grid;
  position: fixed; inset: 0; z-index: 100;
  place-items: center;
}
.intro::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 50% 40%, #d3c2ae 0%, rgba(211, 194, 174, 0) 70%),
    radial-gradient(120% 90% at 50% 45%, #c6b39e 0%, #b8a48f 100%);
  transition: opacity 1.1s var(--ease-inout);
}
.intro__stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(18px, 3.2vh, 34px);
  padding: 24px;
  text-align: center;
}
.intro__mark {
  width: clamp(150px, 26vh, 280px);
  height: auto;
  transform-origin: 0 0;
  filter: drop-shadow(0 18px 30px rgba(60, 38, 22, 0.28));
  will-change: transform, opacity;
  opacity: 0;
}
.intro__word { color: #3a281b; }
.intro__kicker {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-family: var(--f-caps);
  font-size: clamp(0.7rem, 1.35vw, 0.95rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0;
}
.intro__kicker small { font-size: .78em; letter-spacing: .2em; }
.intro__rule { width: clamp(28px, 6vw, 90px); height: 1px; background: currentColor; opacity: .55; }
.intro__name {
  font-family: var(--f-caps);
  font-weight: 500;
  font-size: clamp(1.9rem, 5.2vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 6px;
  text-shadow: 0 1px 0 rgba(255, 244, 228, 0.35), 0 10px 24px rgba(60, 38, 22, 0.18);
  opacity: 0;
}
.intro__flag {
  display: flex; align-items: center; justify-content: center; gap: 0;
  margin-top: 12px; opacity: 0;
}
.intro__flag span { width: clamp(60px, 16vw, 230px); height: 1px; background: currentColor; opacity: .5; margin-inline: 12px; }
.intro__flag i { width: 22px; height: 3px; }
.intro__flag i:nth-of-type(1) { background: #2f7a4b; }
.intro__flag i:nth-of-type(2) { background: #f4efe6; }
.intro__flag i:nth-of-type(3) { background: #b33a3a; }
.intro__tag {
  margin-top: 14px;
  font-family: var(--f-caps);
  font-size: clamp(0.62rem, 1.1vw, 0.8rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
}
.intro__tag b { font-weight: 400; margin-inline: .7em; }
.intro__skip {
  position: absolute; right: var(--gutter); bottom: max(24px, env(safe-area-inset-bottom));
  background: none; border: 0; cursor: pointer;
  min-height: 44px; padding: 10px 4px;
  font-size: 0.75rem; letter-spacing: .2em; text-transform: uppercase; color: #3a281b;
  opacity: 0; transition: opacity .6s .9s;
}
.intro.is-playing .intro__skip { opacity: .7; }
.intro__skip:hover { opacity: 1; }

/* sequenza di entrata */
.intro.is-playing .intro__mark { animation: introMark 1.6s var(--ease-out) forwards; }
.intro.is-playing .intro__kicker { animation: introUp 1.1s .55s var(--ease-out) forwards; }
.intro.is-playing .intro__name { animation: introName 1.4s .7s var(--ease-out) forwards; }
.intro.is-playing .intro__flag { animation: introUp 1.1s 1s var(--ease-out) forwards; }
.intro.is-playing .intro__tag { animation: introUp 1.1s 1.15s var(--ease-out) forwards; }

@keyframes introMark {
  from { opacity: 0; transform: translateY(18px) scale(0.94); filter: blur(10px) drop-shadow(0 18px 30px rgba(60, 38, 22, 0)); }
  to   { opacity: 1; transform: none; filter: blur(0) drop-shadow(0 18px 30px rgba(60, 38, 22, 0.28)); }
}
@keyframes introUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes introName {
  from { opacity: 0; letter-spacing: 0.22em; filter: blur(6px); }
  to   { opacity: 1; letter-spacing: 0.04em; filter: blur(0); }
}

/* uscita: lo sfondo sfuma, la scritta scende, il monogramma vola nella barra */
.intro.is-leaving { pointer-events: none; }
.intro.is-leaving::before { opacity: 0; }
.intro.is-leaving .intro__word { animation: introOut .7s var(--ease-inout) forwards; }
.intro.is-leaving .intro__skip { opacity: 0; transition-delay: 0s; }
.intro.is-leaving .intro__mark,
.intro.is-leaving .intro__kicker,
.intro.is-leaving .intro__name,
.intro.is-leaving .intro__flag,
.intro.is-leaving .intro__tag { opacity: 1; animation: none; }
@keyframes introOut {
  to { opacity: 0; transform: translateY(24px); filter: blur(6px); }
}
.intro.is-done { display: none; }

/* =================================================================
   HEADER + MENU
   ================================================================= */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--header-h);
  padding-inline: var(--gutter);
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--on-dark);
  transition: background-color .5s var(--ease-out), transform .6s var(--ease-out), backdrop-filter .5s;
}
.header::before {
  content: ""; position: absolute; inset: 0 0 -40px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(21, 16, 12, 0.55), rgba(21, 16, 12, 0));
  transition: opacity .5s;
}
.header.is-solid {
  background: rgba(21, 16, 12, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.header.is-solid::before { opacity: 0; }
.header.is-hidden { transform: translateY(-100%); }

.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none;
  min-height: 44px;
}
.brand__mark { width: 50px; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--f-caps); font-weight: 500;
  font-size: 1.02rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.brand__sub {
  font-size: 0.625rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--on-dark-muted); margin-top: 3px;
}

.header__actions { display: flex; align-items: center; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(239, 232, 222, 0.55);
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none;
  transition: background-color .3s, color .3s, border-color .3s;
}
.pill:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }

.burger {
  width: 48px; height: 48px; border: 0; background: none; cursor: pointer;
  display: grid; place-content: center; gap: 7px; position: relative; z-index: 2;
}
.burger span {
  display: block; width: 28px; height: 1.5px; background: currentColor;
  transition: transform .45s var(--ease-inout);
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

/* stato durante l'intro: header invisibile, il monogramma arriva in volo */
.js .header { opacity: 0; }
.js .header .brand__mark { opacity: 0; }
.header.is-in { opacity: 1; transition: opacity .8s .35s var(--ease-out), background-color .5s, transform .6s var(--ease-out); }
.header.has-mark .brand__mark { opacity: 1; }

.menu {
  position: fixed; inset: 0; z-index: 55;
  background: var(--ink);
  color: var(--on-dark);
  display: grid; align-content: center; gap: 48px;
  padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
  overflow-y: auto;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .8s var(--ease-inout), visibility 0s .8s;
}
.menu.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path .8s var(--ease-inout), visibility 0s 0s;
}
.menu__nav a {
  display: flex; align-items: baseline; gap: 18px;
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(1.9rem, min(6.2vh, 9.6vw), 4.2rem); line-height: 1.12;
  text-decoration: none;
  padding-block: 2px;
  opacity: 0; transform: translateY(24px);
  transition: color .3s, opacity .5s, transform .6s var(--ease-out);
}
.menu__nav a span { font-family: var(--f-caps); font-size: .8rem; color: var(--bronze); letter-spacing: .1em; }
.menu__nav a:hover { color: var(--bronze); font-style: italic; }
.menu.is-open .menu__nav a { opacity: 1; transform: none; }
.menu.is-open .menu__nav li:nth-child(1) a { transition-delay: .25s; }
.menu.is-open .menu__nav li:nth-child(2) a { transition-delay: .3s; }
.menu.is-open .menu__nav li:nth-child(3) a { transition-delay: .35s; }
.menu.is-open .menu__nav li:nth-child(4) a { transition-delay: .4s; }
.menu.is-open .menu__nav li:nth-child(5) a { transition-delay: .45s; }
.menu.is-open .menu__nav li:nth-child(6) a { transition-delay: .5s; }
.menu.is-open .menu__nav li:nth-child(7) a { transition-delay: .55s; }
.menu__info { display: grid; gap: 8px; color: var(--on-dark-muted); font-size: .95rem; }
.menu__info .eyebrow { color: var(--bronze); margin-top: 10px; }
.menu__info a { text-decoration: none; }
.menu__info a:hover { color: var(--ivory); }
@media (min-width: 900px) {
  .menu { grid-template-columns: 1.5fr 1fr; align-items: end; padding-inline: calc(var(--gutter) * 1.6); }
}

/* =================================================================
   2 · HERO
   ================================================================= */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: hidden;
  color: var(--on-dark);
  background: #2a2019;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 64%;
  transform: scale(1.14);
  transform-origin: 50% 60%;
}
.hero.is-in .hero__media img {
  animation: heroSettle 2.6s var(--ease-out) forwards, heroDrift 22s 2.6s ease-in-out infinite alternate;
}
@keyframes heroSettle { to { transform: scale(1.02); } }
@keyframes heroDrift { from { transform: scale(1.02); } to { transform: scale(1.09) translate3d(-1%, -1%, 0); } }

.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(21,16,12,.4) 0%, rgba(21,16,12,0) 24%),
    radial-gradient(70% 55% at 85% 100%, rgba(21,16,12,.55) 0%, rgba(21,16,12,0) 100%),
    linear-gradient(0deg, rgba(21,16,12,.88) 0%, rgba(21,16,12,.5) 34%, rgba(21,16,12,0) 64%);
}
@media (max-width: 999px) {
  .hero__shade {
    background:
      linear-gradient(180deg, rgba(21,16,12,.4) 0%, rgba(21,16,12,0) 20%),
      linear-gradient(0deg, rgba(21,16,12,.92) 0%, rgba(21,16,12,.62) 45%, rgba(21,16,12,0) 78%);
  }
}
.hero__content {
  position: absolute; inset: auto 0 0 0;
  padding: 0 var(--gutter) clamp(88px, 12vh, 128px);
  display: grid; gap: 28px;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
}
.hero__eyebrow { color: var(--sabbia-light); }
.hero__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(3rem, min(9.4vw, 14vh), 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line > span { display: inline-block; }
.hero__aside { display: grid; gap: 22px; max-width: 420px; }
.hero__aside p { color: rgba(247, 243, 236, 0.9); font-size: 1.0625rem; text-shadow: 0 1px 12px rgba(21, 16, 12, 0.5); }
@media (min-width: 1000px) {
  .hero__content { grid-template-columns: 1fr auto; align-items: end; column-gap: 64px; }
  .hero__eyebrow { grid-column: 1 / -1; }
  .hero__aside { padding-bottom: 12px; }
}

.js [data-hero] { opacity: 0; transform: translateY(30px); }
.js .hero__title [data-hero] { opacity: 1; transform: translateY(105%); }
.hero.is-in [data-hero] { opacity: 1; transform: none; transition: opacity 1s var(--ease-out), transform 1.3s var(--ease-out); }
.hero.is-in .hero__eyebrow { transition-delay: .15s; }
.hero.is-in .hero__title .line:nth-child(1) [data-hero] { transition-delay: .25s; }
.hero.is-in .hero__title .line:nth-child(2) [data-hero] { transition-delay: .38s; }
.hero.is-in .hero__aside { transition-delay: .6s; }
.hero.is-in .scroll-cue { transition-delay: 1s; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; margin-left: -22px;
  width: 44px; height: 56px;
  display: grid; justify-items: center;
}
.scroll-cue__line {
  position: relative; width: 1px; height: 48px; overflow: hidden;
  background: rgba(239, 232, 222, 0.25);
}
.scroll-cue__line::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--ivory);
  animation: cue 2.2s var(--ease-inout) infinite;
}
@keyframes cue { to { top: 100%; } }
@media (min-width: 1000px) { .scroll-cue { left: 50%; } }

/* =================================================================
   3 · HERO 2 — porta a scorrimento
   ================================================================= */
.opera {
  position: relative;
  height: 560vh;
  background: var(--ink);
  color: var(--on-dark);
}
.opera__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: radial-gradient(90% 70% at 50% 40%, #241b14 0%, var(--ink) 70%);
}
.opera__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.opera__fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.js .opera__fallback { display: none; }
.opera__veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(21,16,12,.82) 0%, rgba(21,16,12,.35) 34%, rgba(21,16,12,0) 58%),
    linear-gradient(90deg, rgba(21,16,12,.45) 0%, rgba(21,16,12,0) 50%);
  opacity: var(--veil, 1);
}
.opera__caption {
  position: absolute;
  left: var(--gutter); right: var(--gutter); bottom: clamp(56px, 11vh, 120px);
  max-width: 780px;
  pointer-events: none;
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
}
.opera__caption.is-active { opacity: 1; transform: none; pointer-events: auto; }
.is-intro .opera__caption.is-active { opacity: 0; transform: translateY(26px); }
.is-intro .opera__hint { opacity: 0; }
.opera__caption .eyebrow { color: var(--sabbia-light); }
.opera__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 5.4vw, 5rem);
  line-height: 1;
  margin-top: 18px;
  text-wrap: balance;
}
.opera__caption--end {
  max-width: none;
  display: grid; gap: 22px;
  bottom: clamp(28px, 6vh, 72px);
}
.opera__caption--end .opera__title { font-size: clamp(2rem, 4.4vw, 4rem); }
.opera__end-copy { display: grid; gap: 20px; max-width: 460px; }
.opera__end-copy p { color: var(--on-dark-muted); }
@media (min-width: 1000px) {
  .opera__caption--end { grid-template-columns: 1fr auto; align-items: end; column-gap: 64px; }
  .opera__end-copy { grid-template-columns: 1fr; }
}
.opera__progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(239, 232, 222, 0.08);
}
.opera__progress span {
  display: block; height: 100%; width: 100%;
  background: var(--bronze);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}
.opera__hint {
  position: absolute; right: var(--gutter); bottom: 22px; margin: 0;
  font-size: .72rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--on-dark-muted);
  opacity: var(--hint, 1);
  transition: opacity .4s;
}

@media (max-width: 699px) {
  .opera__veil {
    background: linear-gradient(0deg, rgba(21,16,12,1) 0%, rgba(21,16,12,.9) 28%, rgba(21,16,12,0) 44%);
  }
  .opera__caption { bottom: clamp(40px, 8vh, 72px); }
  .opera__caption--end { bottom: 28px; }
  .opera__caption--end .opera__end-copy p { font-size: .95rem; }
  .opera__hint { right: 0; left: 0; bottom: 12px; text-align: center; font-size: .66rem; }
}

/* =================================================================
   4 · MANIFESTO
   ================================================================= */
.manifesto__text {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin-top: 34px;
  max-width: 22ch;
  max-width: 1180px;
  text-wrap: pretty;
}
.manifesto__text .w { transition: opacity .25s linear, color .25s linear; opacity: var(--o, 1); }
.js .manifesto__text .w { opacity: .16; }
.js .manifesto__text .w.is-lit { opacity: 1; }

.stats {
  margin-top: clamp(72px, 10vw, 140px);
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line-dark);
}
.stats li {
  padding: 28px 18px 8px 0;
  display: grid; gap: 10px; align-content: start;
}
.stats__num {
  font-family: var(--f-display); font-weight: 300;
  font-variant-numeric: lining-nums;
  font-size: clamp(3rem, 6vw, 5.4rem); line-height: 1;
  color: var(--walnut);
}
.stats__num small { font-size: .5em; margin-left: 2px; }
.stats__label { font-size: .9rem; color: var(--text-muted); max-width: 22ch; }
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats li + li { border-left: 1px solid var(--line-dark); padding-left: 28px; }
}
@media (max-width: 899px) {
  .stats li:nth-child(even) { border-left: 1px solid var(--line-dark); padding-left: 18px; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line-dark); }
}

/* =================================================================
   5 · BOTTEGA
   ================================================================= */
.bottega__grid {
  display: grid; gap: clamp(48px, 7vw, 120px);
  align-items: center;
}
@media (min-width: 900px) { .bottega__grid { grid-template-columns: 1fr 1fr; } }
.bottega__media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; }
.bottega__media img { width: 100%; height: 118%; object-fit: cover; object-position: 50% 30%; margin-top: -9%; }
.bottega__media figcaption {
  position: absolute; left: 0; bottom: 0; right: 0;
  padding: 40px 20px 16px;
  font-size: .8125rem; color: rgba(247,243,236,.85);
  background: linear-gradient(0deg, rgba(21,16,12,.7), transparent);
}
.bottega__copy { display: grid; gap: 22px; max-width: 520px; }
.bottega__copy .h2 { margin-top: 0; margin-bottom: 10px; }
.bottega__copy p:not(.eyebrow):not(.signature) { color: var(--on-dark-muted); font-size: 1.0625rem; }
.signature {
  font-family: var(--f-caps); font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bronze);
  padding-top: 22px; margin-top: 8px;
  border-top: 1px solid var(--line-light);
}

/* =================================================================
   6 · COSA REALIZZIAMO
   ================================================================= */
.section--cream .section-head__lead { color: var(--text-muted); }

.works {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px 28px;
}
.work { min-width: 0; }
.work__media {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 100%;
  overflow: hidden;
  background: var(--sabbia);
}
.work__media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.work__body { display: grid; gap: 10px; justify-items: start; padding-top: 24px; }
.work__head { display: flex; align-items: baseline; gap: 14px; }
.work__num { font-family: var(--f-caps); font-size: .8rem; letter-spacing: .1em; color: var(--bronze-deep); }
.work__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(1.75rem, 2.4vw, 2.3rem); line-height: 1.08;
  transition: color .3s;
}
.work__body p { color: var(--text-muted); max-width: 40ch; }
.work__link {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; color: var(--text);
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out), color .3s;
}
.work__link .btn__arrow { width: 16px; height: 16px; }
.work__link:hover { background-size: calc(100% - 26px) 1px; color: var(--wood); }
.work__link:hover .btn__arrow { transform: translateX(4px); }

.work:hover .work__title { color: var(--wood); }
.js .works .reveal-img.is-visible img,
.js .works .reveal-img.is-visible.is-settled img { transition: transform 2s var(--ease-out), scale 1.4s var(--ease-out); }
.work:hover .work__media img { scale: 1.05; }

@media (min-width: 640px) {
  .works { grid-template-columns: repeat(2, 1fr); }
  .work:nth-child(even) { margin-top: 80px; }
}
@media (min-width: 1000px) {
  .works { grid-template-columns: repeat(3, 1fr); column-gap: clamp(24px, 2.6vw, 44px); row-gap: 88px; }
  .work:nth-child(even) { margin-top: 0; }
  .work:nth-child(3n + 2) { margin-top: 120px; }
}

/* =================================================================
   7 · METODO
   ================================================================= */
.steps { display: grid; gap: 0; border-top: 1px solid var(--line-light); }
.step {
  padding: 34px 0;
  border-bottom: 1px solid var(--line-light);
  display: grid; gap: 12px;
}
.step__num { font-family: var(--f-caps); color: var(--bronze); font-size: .85rem; letter-spacing: .12em; }
.step__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 3vw, 2.6rem); line-height: 1.05; }
.step p { color: var(--on-dark-muted); max-width: 34ch; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line-light); }
  .step { border-bottom: 0; padding: 40px 32px 48px 0; }
  .step + .step { border-left: 1px solid var(--line-light); padding-left: 32px; }
  .step__title { margin-top: 56px; }
}

/* =================================================================
   8 · RESTAURO
   ================================================================= */
.restauro {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(255,255,255,.35), transparent 60%),
    linear-gradient(135deg, #ddd0bf 0%, #cdbba6 100%);
}
.restauro__grid { display: grid; gap: 48px; }
@media (min-width: 1000px) { .restauro__grid { grid-template-columns: 1.3fr 1fr; align-items: end; } }
.restauro__copy { display: grid; gap: 28px; justify-items: start; }
.restauro__copy > p { color: var(--text-muted); font-size: 1.0625rem; max-width: 46ch; }
.restauro__list { width: 100%; border-top: 1px solid var(--line-dark); }
.restauro__list li {
  padding: 16px 0; border-bottom: 1px solid var(--line-dark);
  font-family: var(--f-display); font-size: 1.5rem; line-height: 1.2;
  display: flex; gap: 14px; align-items: baseline;
}
.restauro__list li::before { content: "—"; color: var(--bronze-deep); font-size: 1rem; }

/* =================================================================
   9 · CONTATTI
   ================================================================= */
.contatti__grid { display: grid; gap: clamp(56px, 7vw, 110px); }
@media (min-width: 1000px) { .contatti__grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.contatti__lead { margin-top: 28px; color: var(--text-muted); font-size: 1.0625rem; max-width: 44ch; }

.contact-list { margin-top: 48px; border-top: 1px solid var(--line-dark); }
.contact-list > div {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line-dark);
  align-items: baseline;
}
.contact-list dt { font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--bronze-deep); }
.contact-list dd a {
  font-variant-numeric: lining-nums;
  font-family: var(--f-display); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.2;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out);
  overflow-wrap: anywhere;
}
.contact-list dd a:hover { background-size: 100% 1px; }

.form {
  background: var(--ivory);
  padding: clamp(24px, 4vw, 48px);
  display: grid; gap: 22px;
  box-shadow: 0 30px 60px -40px rgba(42, 29, 21, 0.35);
}
.form__summary { padding: 14px 16px; border-left: 3px solid var(--error); background: #f6e6e2; color: var(--error); font-size: .95rem; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: .8125rem; font-weight: 600; letter-spacing: .06em; color: var(--text); padding: 0; }
.optional { font-weight: 400; color: var(--text-muted); }
.field input[type="text"], .field textarea {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--text);
  background: transparent;
  border: 0; border-bottom: 1px solid rgba(35, 26, 19, 0.35);
  border-radius: 0;
  padding: 10px 0;
  min-height: 44px;
  transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--wood); box-shadow: 0 1px 0 var(--wood); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--error); }
.field__hint { font-size: .8125rem; color: var(--text-muted); }
.field__error { font-size: .8125rem; color: var(--error); min-height: 0; }
.field__error:empty { display: none; }

.chips__wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-dark); border-radius: 999px;
  font-size: .875rem; white-space: nowrap;
  transition: background-color .25s, color .25s, border-color .25s;
}
.chip:hover span { border-color: var(--text); }
.chip input:checked + span { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--bronze); outline-offset: 2px; }

.form__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.form__note { font-size: .8125rem; color: var(--text-muted); }

/* =================================================================
   FOOTER
   ================================================================= */
.footer { background: var(--ink); color: var(--on-dark); padding-block: clamp(72px, 9vw, 120px) 32px; }
.footer__top {
  display: grid; gap: 48px;
  padding-bottom: 56px; border-bottom: 1px solid var(--line-light);
}
@media (min-width: 900px) { .footer__top { grid-template-columns: 1.4fr 1fr 1fr; align-items: start; } }
.footer__brand { display: flex; gap: 20px; align-items: center; text-decoration: none; }
.footer__brand img { width: 84px; height: auto; }
.footer__brand > span { display: grid; gap: 4px; }
.footer__kicker, .footer__tag { font-family: var(--f-caps); font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; color: var(--on-dark-muted); }
.footer__name { font-family: var(--f-caps); font-size: clamp(1.3rem, 2.4vw, 1.75rem); letter-spacing: .05em; text-transform: uppercase; }
.footer__nav { display: grid; gap: 4px; }
.footer__nav a, .footer__contact a { text-decoration: none; color: var(--on-dark-muted); transition: color .3s; }
.footer__nav a { min-height: 36px; display: inline-flex; align-items: center; }
.footer__nav a:hover, .footer__contact a:hover { color: var(--ivory); }
.footer__contact { font-style: normal; color: var(--on-dark-muted); line-height: 2; }
.footer__bottom {
  padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  font-size: .8125rem; color: var(--on-dark-muted);
}
.footer__flag { display: inline-flex; }
.footer__flag i { width: 18px; height: 3px; }
.footer__flag i:nth-child(1) { background: #2f7a4b; }
.footer__flag i:nth-child(2) { background: #f4efe6; }
.footer__flag i:nth-child(3) { background: #b33a3a; }

/* =================================================================
   REVEAL on scroll
   ================================================================= */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-img { clip-path: inset(12% 0 0 0); transition: clip-path 1.6s var(--ease-out); }
.js .reveal-img img { transform: scale(1.12); transition: transform 2s var(--ease-out); }
.js .reveal-img.is-visible { clip-path: inset(0 0 0 0); }
.js .reveal-img.is-visible img { transform: translate3d(0, var(--py, 0px), 0); transition: transform 2s var(--ease-out); }
.js .reveal-img.is-visible.is-settled img { transition: none; }

/* ---------- Schermi piccoli ---------- */
@media (max-width: 699px) {
  .menu { align-content: start; gap: 36px; }
  .intro__kicker { font-size: .66rem; letter-spacing: .26em; gap: 10px; }
  .intro__rule { width: 22px; }
  .intro__name { font-size: min(1.9rem, 6.5vw); white-space: nowrap; letter-spacing: .02em; }
  .intro__flag span { width: 22vw; margin-inline: 8px; }
  .intro__tag { font-size: .6rem; letter-spacing: .2em; max-width: 30ch; line-height: 2; text-wrap: balance; }
  :root { --header-h: 68px; }
  body { font-size: 1rem; }
  .brand { gap: 10px; }
  .brand__mark { width: 40px; }
  .brand__name { font-size: .88rem; }
  .brand__sub { font-size: .56rem; letter-spacing: .2em; }
  .pill { display: none; }
  .hero__title { font-size: clamp(2.8rem, 13vw, 4.2rem); }
  .contact-list > div { grid-template-columns: 1fr; gap: 4px; }
  .form__actions .btn { width: 100%; }
}
@media (max-width: 359px) {
  .brand__sub { display: none; }
}

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .hero__media img { transform: none !important; }
}
