/* Cumani Impianti — una frase, un numero: chiama Max */
.skip-link { position: absolute; left: -9999px; } .skip-link:focus { left: 1rem; top: 1rem; z-index: 9999; }

:root {
  --paper: #f5f5f6;
  --ink: #101113;
  --ink-2: #1b1c1f;
  --accent: #e0001e;
  --accent-dark: #b80018;
  --soft: #55575c;
  --soft-on-ink: #b4b6bc;

  --step-small: clamp(0.875rem, 0.84rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-sub: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --step-lead: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-big: clamp(3.5rem, 9.6vw, 10rem);
  --step-display: clamp(3.75rem, 13vw, 12.5rem);

  --margin: clamp(20px, 3vw, 48px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-body);
  line-height: 1.45;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p, ul, figure, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2 { font-weight: 800; letter-spacing: -0.045em; line-height: 0.9; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.on-red :focus-visible, .on-ink :focus-visible { outline-color: #fff; }
::selection { background: var(--ink); color: #fff; }

/* ---------- pulsante ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  font-size: var(--step-sub);
  letter-spacing: -0.02em;
  text-decoration: none;
  padding: 22px 36px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s, color 0.25s;
}
.btn { white-space: nowrap; }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn:hover { background: var(--ink); color: #fff; transform: translateY(-3px); }
.btn:active { transform: translateY(1px) scale(0.98); }

.link { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 2px; transition: opacity 0.2s; }
.link:hover { opacity: 0.65; }

/* ---------- prima schermata ---------- */
:root {
  --navbar-h: clamp(48px, 4vw, 80px); /* altezza navbar — scala con il viewport */
}

.hero {
  position: relative;
  min-height: 100svh;
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: calc(var(--navbar-h) + 2.5vw) var(--margin) 3vw;
}

.bar { display: grid; grid-template-columns: 42% 1fr; align-items: center; height: var(--navbar-h); }
.bar--sticky { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 0 var(--margin); background: var(--accent); }
.bar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: var(--step-body); letter-spacing: -0.02em; }
.bar-brand img { width: 52px; height: 52px; margin: -4px; }
.bar-links { position: relative; display: flex; gap: 4px; margin-left: -20px; font-weight: 500; }
.bar-links a { position: relative; z-index: 1; padding: 11px 20px; text-decoration: none; transition: transform 0.3s var(--ease); }
.bar-links a:active { transform: scale(0.94); }
.bubble {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: var(--w, 0px); height: var(--h, 0px);
  background: var(--ink);
  border-radius: 999px;
  opacity: 0;
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(0.7);
  transition: transform 0.55s var(--ease), width 0.55s var(--ease), height 0.55s var(--ease), opacity 0.25s;
  pointer-events: none;
}
.bubble.on { opacity: 1; transform: translate3d(var(--x, 0px), var(--y, 0px), 0) scale(1); }
.bubble.jump { transition: none; }
.bar-menu { display: none; }

/* layout interno hero: testo sinistra, figura destra */
.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 0;
  position: relative;
  z-index: 1;
}
.hero-right {
    position: absolute;
    height: 90%;
    bottom: 0;
    right: 10vw;
    pointer-events: none;
    user-select: none;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}
.hero-right img {
  display: block;
  width: auto;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom right;
}

/* tutto il testo hero scala in vw per restare proporzionale */
.hero h1 { font-size: 7.5vw; line-height: 0.86; }
.mask { display: block; overflow: hidden; padding-top: 0.06em; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.mask > span { display: block; transform: translateY(108%); animation: rise 0.9s var(--ease) forwards; animation-delay: var(--d, 0.05s); }
@keyframes rise { to { transform: none; } }

.hero-title-row { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.hero-logo { width: 20vw; height: auto; flex-shrink: 0; }
.hero-foot { margin-top: auto; padding-top: 3vw; display: flex; justify-content: space-between; align-items: flex-end; gap: 2vw; }
.hero-foot > p { font-size: 1.4vw; line-height: 1.2; font-weight: 500; max-width: 32ch; }
.hero-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 1vw; text-align: right; }
.hero-cta small { font-size: 1.1vw; font-weight: 500; }
.hero-cta .btn { font-size: 1.4vw; padding: 1.5vw 2.5vw; gap: 1vw; }
.hero-fade { opacity: 0; animation: fadeup 0.8s var(--ease) 0.75s forwards; }
@keyframes fadeup { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- campi di colore ---------- */
.field {
  position: relative;
  min-height: 56svh;
  padding: 28px var(--margin);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  overflow: hidden;
}
.field--ink { background: var(--ink); color: #fff; }
.field--paper { background: var(--paper); color: var(--ink); }
.field--red { background: var(--accent); color: #fff; }
.field p { font-size: var(--step-body); line-height: 1.4; max-width: 30ch; margin-left: 58%; }
.field h2 { font-size: var(--step-big); line-height: 0.88; }
.field--r p { margin-left: 8%; }
.field--r h2 { text-align: right; }
.field p .link { font-weight: 700; }

/* ---------- foto a tutta larghezza ---------- */
.band--two { display: grid; grid-template-columns: repeat(3, 1fr); }
.band--two .pic { position: relative; overflow: hidden; }
.band { position: relative; height: 85svh; min-height: 420px; overflow: hidden; background: var(--ink); }
.band img {
  position: absolute; inset: -6% 0;
  width: 100%; height: 112%;
  object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0) scale(var(--s, 1));
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  will-change: transform;
}

/* ---------- chi sono ---------- */
.about {
  background: var(--paper);
  padding: 140px var(--margin);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
}
.about h2 { grid-column: 3 / 13; font-size: var(--step-head); margin-bottom: 56px; }
.facts { grid-column: 1 / 3; grid-row: 2; font-size: var(--step-small); display: flex; flex-direction: column; gap: 20px; align-self: start; }
.facts dt { color: var(--soft); }
.facts dd { font-weight: 700; font-size: var(--step-body); line-height: 1.25; }
.bio { grid-column: 3 / 13; grid-row: 2; font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; max-width: 38em; }
.bio p + p { margin-top: 1.6rem; color: var(--soft); font-size: var(--step-body); line-height: 1.45; letter-spacing: 0; font-weight: 400; max-width: 46ch; }
.portrait { float: left; width: 3.6em; height: 3.6em; margin: 0.12em 0.5em 0 0; background: var(--accent); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.portrait img { height: 100%; width: auto; max-width: none; object-fit: contain; object-position: bottom; }
.bio strong { font-weight: 800; }
.js-fill .w { color: var(--soft); transition: color 0.35s; }
.js-fill .w.on { color: var(--ink); }

#bio-paragraph { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; max-width: 38em; }

/* ---------- contatti: biglietto da visita sopra la foto ---------- */
.visit { position: relative; background: var(--paper); }
.visit .visit-photo { height: 100svh; min-height: 560px; }
.visit-card {
  position: absolute; top: 60px; right: 60px; z-index: 2;
  width: 380px; padding: 32px 32px 0;
  background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column; gap: 24px;
}
.visit-card h2 { font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.visit-card address { font-style: normal; font-size: var(--step-body); line-height: 1.35; }
.hours { display: flex; flex-direction: column; gap: 8px; font-size: var(--step-body); }
.hours div { display: flex; justify-content: space-between; gap: 16px; }
.hours dt { color: var(--soft); }
.hours dd { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.visit-links { display: flex; flex-direction: column; gap: 6px; font-size: var(--step-body); }
.visit-phone { font-size: var(--step-sub); font-weight: 800; letter-spacing: -0.02em; text-decoration: none; transition: color 0.2s; }
.visit-phone:hover { color: var(--accent); }
.visit-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 56px; margin: 0 -32px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 800; font-size: var(--step-body);
  transition: background-color 0.25s;
}
.visit-btn svg { width: 1.1em; height: 1.1em; }
.visit-btn:hover { background: var(--ink); }
.map { height: 420px; background: var(--ink); }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) contrast(1.05); }

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem var(--margin);
  text-align: center;
  background: var(--ink-2);
  color: var(--paper);
}

.map-placeholder p {
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 42ch;
  opacity: 0.7;
  margin: 0;
}

.map-placeholder p .link { color: inherit; }

.map-load-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.65em 1.5em;
  background: var(--paper);
  color: var(--ink);
  border: none;
  border-radius: 2em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.map-load-btn:hover,
.map-load-btn:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: none;
}

/* ---------- piede: il numero è il titolo ---------- */
.foot { background: var(--accent); color: #fff; min-height: 90svh; padding: 40px var(--margin) 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 64px; }
.foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; font-size: var(--step-body); font-weight: 500; }
.foot-top ul { display: grid; grid-template-columns: repeat(3, minmax(0, 24ch)); gap: 32px; }
.foot-big { display: block; font-size: var(--step-big); font-weight: 800; letter-spacing: -0.05em; line-height: 0.9; text-decoration: none; white-space: nowrap; margin-left: -0.04em; transition: opacity 0.25s; }
.foot-big:hover { opacity: 0.7; }
.foot-mail { display: inline-block; margin-top: 20px; font-size: var(--step-sub); font-weight: 600; }
.foot-meta { display: flex; justify-content: space-between; gap: 24px; font-size: var(--step-small); }
.foot-meta a { text-decoration: underline; text-underline-offset: 3px; }


/* ---------- entrate allo scroll ---------- */
.js .rv { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mask > span { animation: none; transform: none; }
  .hero-fade { animation: none; opacity: 1; }
  .js .rv { opacity: 1; transform: none; transition: none; }
}

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .about h2, .bio { grid-column: 1 / 13; }
  .hero-foot { flex-wrap: wrap; }
  .facts { grid-column: 1 / 13; grid-row: 3; flex-direction: row; flex-wrap: wrap; gap: 24px 40px; margin-top: 48px; }
  .field p { margin-left: 40%; }
  .field--r p { margin-left: 0; }
  .foot-top ul { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- telefono ---------- */
@media (max-width: 768px) {
  .hero { padding-top: 76px; padding-bottom: 28px; }
  .hero-body { max-width: 100%; }
  .hero-right { display: none; }
  .bar { grid-template-columns: 1fr auto; position: relative; }
  .bar-links { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--ink); z-index: 10; }
  .bar-links.open { display: flex; }
  .bar-links a { padding: 18px var(--margin); font-size: var(--step-sub); font-weight: 700; }
  .bubble { display: none; }
  .bar-menu { display: block; background: none; border: 0; color: #fff; font: inherit; font-weight: 800; padding: 12px 0 12px 12px; cursor: pointer; }
  .hero-logo { display: none; }
  .hero h1 { font-size: var(--step-display); margin-top: 12vh; }
  .hero-foot { flex-direction: column; align-items: stretch; gap: 28px; padding-top: 40px; }
  .hero-foot > p { font-size: var(--step-sub); }
  .hero-cta { align-items: stretch; text-align: left; gap: 14px; }
  .hero-cta small { font-size: var(--step-body); }
  .hero-cta .btn { font-size: var(--step-sub); padding: 22px 20px; gap: 16px; justify-content: center; }

  .field { min-height: 52svh; }
  .field p { margin-left: 0; max-width: 80%; }
  .field--r p { margin-left: auto; }
  .field--r h2 { text-align: left; font-size: var(--step-head); }

  .band { height: 60svh; }
  .band--two { grid-template-columns: 1fr; height: auto; }
  .band--two .pic { height: 44svh; }
  .about { padding: 96px var(--margin); }
  .portrait { width: 4em; height: 4em; }
  .map { height: 320px; }
  .visit .visit-photo { height: 70svh; min-height: 0; }
  .visit-card { position: relative; top: auto; right: auto; width: auto; margin: -80px 16px 0; }
  .visit-btn { height: 56px; }

  .foot { min-height: 80svh; }
  .foot-top { flex-direction: column; }
  .foot-big { font-size: 12.4vw; }
  .foot-meta { flex-direction: column; gap: 8px; }

}
