/* HOME360 — Sistema Operativo per Ristrutturazioni
 * Estetica: console / precisione tecnica
 * Accento unico: #e50000
 */

:root {
  /* Palette austera */
  --bg-black:     #0A0A0A;
  --bg-antracite: #161617;
  --bg-system:    #2A2A2C;
  --bg-paper:     #F5F4F1;
  --bg-paper-2:   #ECEAE3;
  --fg-white:     #FFFFFF;
  --fg-dim:       rgba(255, 255, 255, 0.58);
  --fg-faint:     rgba(255, 255, 255, 0.34);
  --rule-dark:    rgba(255, 255, 255, 0.13);
  --rule-dark-2:  rgba(255, 255, 255, 0.06);

  --ink:          #0A0A0A;
  --ink-dim:      rgba(10, 10, 10, 0.64);
  --ink-faint:    rgba(10, 10, 10, 0.34);
  --rule-light:   rgba(10, 10, 10, 0.14);
  --rule-light-2: rgba(10, 10, 10, 0.05);

  /* Accent unico */
  --accent:       #e50000;
  --accent-dim:   rgba(229, 0, 0, 0.18);

  /* Tipografia */
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Misure */
  --maxw: 1440px;
  --gutter: clamp(20px, 4vw, 56px);
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg-white);
  background: var(--bg-black);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: var(--accent); color: var(--fg-white); }

/* ===== TYPOGRAPHY UTILITIES ===== */

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.label.--ink { color: var(--ink-dim); }
.label.--accent { color: var(--accent); }

.headline {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.02;
  font-size: clamp(36px, 5vw, 64px);
  text-wrap: balance;
}

.subhead {
  font-family: var(--display);
  font-size: clamp(19px, 1.5vw, 24px);
  line-height: 1.35;
  font-weight: 400;
  color: var(--fg-dim);
  letter-spacing: -0.008em;
  text-wrap: pretty;
}
.subhead.--ink { color: var(--ink-dim); }

.body-tech {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-dim);
  text-wrap: pretty;
}
.body-tech.--ink { color: var(--ink-dim); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ===== NAV (sticky multi-page) ===== */

.nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(10,10,10,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule-dark);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg-white);
  text-decoration: none;
}
.nav-brand .logo-slot {
  width: 28px; height: 28px;
  border: 1px solid var(--rule-dark);
  position: relative;
  background:
    linear-gradient(135deg, transparent 49%, var(--fg-dim) 49%, var(--fg-dim) 51%, transparent 51%);
}
.nav-brand .logo-slot::after {
  content: "logo";
  position: absolute;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--fg-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
  height: 100%;
}
.nav-list > li { position: relative; height: 100%; display: flex; align-items: center; }
.nav-list a, .nav-list .nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--fg-dim);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 400;
  position: relative;
  height: var(--nav-h);
  font: inherit;
  font-size: 14px;
}
.nav-list a:hover, .nav-list .nav-trigger:hover,
.nav-list a.active, .nav-list .nav-trigger.active { color: var(--fg-white); }
.nav-list a.active::after, .nav-list .nav-trigger.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px;
  bottom: 18px;
  height: 1px;
  background: var(--accent);
}
.nav-list .caret {
  width: 8px; height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}
.nav-list .open .caret { transform: rotate(225deg) translateY(-2px); }

/* Megamenu */
.megamenu {
  position: absolute;
  top: var(--nav-h);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(720px, 90vw);
  background: var(--bg-black);
  border: 1px solid var(--rule-dark);
  border-top: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 80;
}
.nav-list .open .megamenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.megamenu-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
}
.megamenu-side {
  padding: 28px;
  border-right: 1px solid var(--rule-dark);
  background: linear-gradient(to bottom, rgba(229,0,0,0.05), transparent);
}
.megamenu-side h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.megamenu-side p {
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.35;
  color: var(--fg-white);
  letter-spacing: -0.012em;
}
.megamenu-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.megamenu-list li { border-bottom: 1px solid var(--rule-dark); }
.megamenu-list li:nth-last-child(-n+2) { border-bottom: 0; }
.megamenu-list li:nth-child(2n) { border-left: 1px solid var(--rule-dark); }
.megamenu-list a {
  display: block;
  height: auto;
  padding: 20px 24px;
  text-decoration: none;
  color: var(--fg-white);
  transition: background 0.12s ease;
}
.megamenu-list a:hover { background: rgba(255,255,255,0.03); }
.megamenu-list .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.megamenu-list .ttl {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: -0.01em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.megamenu-list .ttl .arr {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg-faint);
  transition: color 0.15s, transform 0.15s;
}
.megamenu-list a:hover .arr { color: var(--accent); transform: translateX(3px); }

/* Right side of nav */
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-status {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}
.nav-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  display: inline-block;
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(229,0,0,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(229,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(229,0,0,0); }
}

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--rule-dark);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}
.lang-toggle button {
  background: transparent;
  color: var(--fg-dim);
  border: 0;
  padding: 4px 10px;
  cursor: pointer;
  font: inherit;
}
.lang-toggle button.active {
  background: var(--fg-white);
  color: var(--bg-black);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--fg-white);
  color: var(--bg-black);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.15s;
}
.nav-cta:hover { background: var(--accent); color: var(--fg-white); }
.nav-cta .arr { font-family: var(--mono); }

/* Mobile nav */
.nav-burger {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--rule-dark);
  background: transparent;
  position: relative;
  cursor: pointer;
}
.nav-burger span {
  position: absolute;
  left: 9px; right: 9px;
  height: 1px;
  background: var(--fg-white);
}
.nav-burger span:nth-child(1) { top: 13px; }
.nav-burger span:nth-child(2) { top: 18px; }
.nav-burger span:nth-child(3) { top: 23px; }

@media (max-width: 980px) {
  .nav-list, .nav-status, .lang-toggle { display: none; }
  .nav-burger { display: block; }
  .nav-mobile-open .nav-list {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-black);
    border-bottom: 1px solid var(--rule-dark);
    gap: 0;
    height: auto;
    padding: 12px var(--gutter);
    z-index: 95;
  }
  .nav-mobile-open .nav-list > li { width: 100%; height: auto; }
  .nav-mobile-open .nav-list a, .nav-mobile-open .nav-list .nav-trigger {
    width: 100%;
    height: auto;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule-dark);
    justify-content: space-between;
    font-size: 16px;
  }
  .nav-mobile-open .megamenu {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    width: 100%;
    border: 0;
    display: none;
  }
  .nav-mobile-open .nav-list .open .megamenu { display: block; }
  .megamenu-grid { grid-template-columns: 1fr; }
  .megamenu-side { border-right: 0; border-bottom: 1px solid var(--rule-dark); }
  .megamenu-list { grid-template-columns: 1fr; }
  .megamenu-list li:nth-child(2n) { border-left: 0; }
}

/* ===== LAYOUT PRIMITIVES ===== */

section {
  position: relative;
  padding: clamp(64px, 8vw, 128px) 0;
  border-top: 1px solid var(--rule-dark);
}
section.--paper {
  background: var(--bg-paper);
  color: var(--ink);
  border-top-color: var(--rule-light);
}
section.--antracite { background: var(--bg-antracite); }
section.--black { background: var(--bg-black); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.section-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: clamp(40px, 5vw, 72px);
  max-width: 1100px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-dark);
}
.--paper .section-tag { border-bottom-color: var(--rule-light); }

.section-tag::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--accent);
  display: inline-block;
}

/* Technical grid backdrop */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--rule-dark-2) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-dark-2) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
}
.--paper .grid-bg {
  background-image:
    linear-gradient(to right, var(--rule-light-2) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-light-2) 1px, transparent 1px);
}

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

.hero {
  position: relative;
  overflow: hidden;
  border-top: 0;
  padding: clamp(80px, 10vw, 140px) 0 clamp(56px, 7vw, 96px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: clamp(36px, 5vw, 56px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-dark);
}
.hero-kicker .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  color: var(--accent);
  text-transform: uppercase;
}
.hero-kicker .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.hero-headline {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.038em;
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 0.97;
  text-wrap: balance;
  max-width: 14ch;
}
.hero-headline em {
  font-style: normal;
  color: var(--fg-dim);
}
.hero-headline .mark {
  color: var(--accent);
  font-style: normal;
}

.hero-sub {
  margin-top: 28px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  color: var(--fg-dim);
  font-size: clamp(19px, 1.6vw, 26px);
  letter-spacing: -0.005em;
  max-width: 30ch;
}

.hero-cta {
  margin-top: clamp(36px, 5vw, 56px);
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-dark);
}
.hero-meta .kv .k {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 6px;
}
.hero-meta .kv .v {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--fg-white);
}
.hero-meta .kv .v small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  color: var(--fg-dim);
  margin-left: 6px;
  letter-spacing: 0.08em;
}
.hero-meta .kv.--accent .v { color: var(--accent); }

/* ===== GANTT — animated ===== */

.gantt {
  position: relative;
  font-family: var(--mono);
  border: 1px solid var(--rule-dark);
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.012), transparent 30%);
  padding: 20px 0 24px;
}
.gantt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--rule-dark);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.gantt-head .title {
  color: var(--fg-white);
  font-family: var(--mono);
}
.gantt-axis {
  position: relative;
  height: 22px;
  margin: 14px 20px 4px 152px;
  border-bottom: 1px dashed var(--rule-dark);
}
.gantt-axis span {
  position: absolute;
  top: 0;
  font-size: 9px;
  color: var(--fg-faint);
  letter-spacing: 0.1em;
  transform: translateX(-50%);
}
.gantt-rows {
  display: grid;
  gap: 0;
  margin: 0 20px;
}
.gantt-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 0;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-dark-2);
  position: relative;
}
.gantt-row:last-child { border-bottom: 0; }
.gantt-row .lbl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--fg-white);
  letter-spacing: 0.04em;
}
.gantt-row .lbl .n {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.gantt-track {
  position: relative;
  height: 22px;
  background: rgba(255,255,255,0.02);
}
.gantt-bar {
  position: absolute;
  top: 3px; bottom: 3px;
  background: var(--fg-white);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.9s cubic-bezier(.2,.7,.2,1);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--bg-black);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.gantt.in .gantt-bar { transform: scaleX(1); }
.gantt-bar.--accent { background: var(--accent); color: var(--fg-white); }

.gantt-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 20px 0;
  margin-top: 4px;
  border-top: 1px solid var(--rule-dark);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .gantt-axis { margin-left: 100px; }
  .gantt-row { grid-template-columns: 90px 1fr; }
  .gantt-row .lbl { font-size: 10px; gap: 6px; }
  .gantt-bar { font-size: 8px; padding: 0 4px; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: var(--fg-white);
  color: var(--bg-black);
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent); color: var(--fg-white); }
.btn .arrow {
  font-family: var(--mono);
  font-size: 14px;
  transition: transform 0.2s ease;
}
.btn:hover .arrow { transform: translateX(3px); }
.btn.--ghost {
  background: transparent;
  color: var(--fg-white);
  border: 1px solid var(--rule-dark);
}
.btn.--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.--accent { background: var(--accent); color: var(--fg-white); }
.btn.--accent:hover { background: var(--fg-white); color: var(--accent); }
.--paper .btn { background: var(--ink); color: var(--bg-paper); }
.--paper .btn:hover { background: var(--accent); color: var(--fg-white); }
.--paper .btn.--ghost { background: transparent; color: var(--ink); border-color: var(--rule-light); }
.--paper .btn.--ghost:hover { color: var(--accent); border-color: var(--accent); }

/* ===== DIAGNOSI ===== */

.diag-headline {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.025em;
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.02;
  max-width: 22ch;
  color: var(--ink);
}
.diag-headline b { font-weight: 600; }
.diag-stat {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(120px, 18vw, 220px);
  line-height: 0.86;
  letter-spacing: -0.06em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.diag-stat sup {
  font-size: 0.32em;
  vertical-align: top;
  margin-left: 0.1em;
  font-weight: 500;
  color: var(--ink-dim);
}
.diag-stat .underbar {
  display: block;
  width: 64px;
  height: 6px;
  background: var(--accent);
  margin-top: 18px;
}

.diag-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
@media (max-width: 860px) { .diag-grid { grid-template-columns: 1fr; } }

.errori-list {
  margin-top: clamp(56px, 7vw, 96px);
  border-top: 1px solid var(--rule-light);
}
.errore {
  display: grid;
  grid-template-columns: 80px minmax(0, 1.3fr) minmax(0, 2fr) auto;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule-light);
  align-items: baseline;
}
@media (max-width: 720px) {
  .errore { grid-template-columns: 60px 1fr; gap: 16px; padding: 20px 0; }
  .errore .err-desc { grid-column: 1 / -1; }
}
.errore .err-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.errore .err-title {
  font-family: var(--display);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: pretty;
}
.errore .err-desc {
  font-size: 15px;
  color: var(--ink-dim);
  line-height: 1.5;
  text-wrap: pretty;
}
.errore .err-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===== CATEGORIA (5 principi) ===== */

.principi {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule-dark);
}
.principio {
  display: grid;
  grid-template-columns: 110px minmax(0, 1.6fr) minmax(0, 1.4fr);
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(28px, 4vw, 48px) 0;
  border-bottom: 1px solid var(--rule-dark);
  align-items: baseline;
  position: relative;
}
@media (max-width: 860px) {
  .principio { grid-template-columns: 60px 1fr; gap: 16px; padding: 28px 0; }
  .principio .p-conseg { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--rule-dark-2); margin-top: 8px; }
}
.principio .p-num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.principio .p-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--fg-white);
  text-wrap: balance;
}
.principio .p-conseg {
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-dim);
  font-family: var(--display);
  letter-spacing: -0.005em;
}
.principio .p-conseg b {
  color: var(--fg-white);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.principio:hover { background: rgba(229,0,0,0.03); }
.principio:hover .p-num { color: var(--fg-white); }

.cat-quote {
  margin-top: clamp(48px, 6vw, 80px);
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--fg-dim);
  line-height: 1.35;
  max-width: 60ch;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
}
.cat-quote b { color: var(--fg-white); font-weight: 500; font-style: normal; }

/* ===== PROTOCOLLO ===== */

.protocollo-stats {
  display: flex;
  gap: clamp(32px, 5vw, 80px);
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 4vw, 56px);
  padding-top: 32px;
  border-top: 1px solid var(--rule-light);
}
.protocollo-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.protocollo-stats .stat .v {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(48px, 6vw, 84px);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.protocollo-stats .stat .l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.proto-hint {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 12px 16px;
  border: 1px solid var(--rule-light);
  background: var(--bg-paper-2);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.proto-hint .arrow-down {
  display: inline-block;
  width: 12px;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.fasi-diagram { position: relative; margin-top: 0; }
.fasi-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding-top: 32px;
  border-top: 1px solid var(--rule-light);
}
.fasi-rail::before {
  content: "";
  position: absolute;
  top: 60px; left: 7.14%; right: 7.14%;
  border-top: 1px dashed var(--rule-light);
  pointer-events: none;
}

.fase {
  position: relative;
  text-align: left;
  padding: 0 12px 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font: inherit;
  color: inherit;
  border-right: 1px solid var(--rule-light);
  transition: background 0.15s;
}
.fase:last-child { border-right: 0; }
.fase:hover { background: var(--bg-paper-2); }

.fase .num-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.fase .node {
  width: 14px; height: 14px;
  border: 1px solid var(--ink);
  background: var(--bg-paper);
  position: relative;
  transition: all 0.2s ease;
}
.fase[aria-expanded="true"] .node {
  background: var(--accent);
  border-color: var(--accent);
}
.fase[aria-expanded="true"] .node::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid var(--accent);
}
.fase[aria-expanded="true"] { background: var(--bg-paper-2); }
.fase .f-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.18;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.fase .f-out {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.3;
}

.fase-detail {
  margin-top: 0;
  background: var(--bg-paper-2);
  border: 1px solid var(--rule-light);
  border-top: 0;
  padding: clamp(24px, 4vw, 48px);
  display: none;
  position: relative;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.fase-detail.open { display: grid; }
@media (max-width: 860px) {
  .fase-detail { grid-template-columns: 1fr; }
  .fasi-rail { grid-template-columns: repeat(2, 1fr); gap: 24px 0; padding-top: 24px; }
  .fasi-rail::before { display: none; }
  .fase { border-right: 0; border-bottom: 1px solid var(--rule-light); padding-bottom: 18px; }
}
.fase-detail h4 {
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.022em;
  margin-bottom: 14px;
  color: var(--ink);
  line-height: 1.05;
}
.fase-detail .meta-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-light);
}
.fase-detail p {
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.55;
}
.fase-detail ul { list-style: none; font-size: 14px; color: var(--ink); }
.fase-detail ul li {
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule-light);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--display);
}
.fase-detail ul li:last-child { border-bottom: 0; }
.fase-detail ul li .mono { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }

.fase-detail .durata {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(40px, 4vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fase-detail .durata small {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  margin-left: 4px;
  text-transform: uppercase;
}

/* ===== SISTEMA ===== */

.sistema-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
}
@media (max-width: 720px) { .sistema-stats { grid-template-columns: 1fr; } }
.sistema-stats .s {
  padding: 32px 28px;
  border-right: 1px solid var(--rule-dark);
}
.sistema-stats .s:last-child { border-right: 0; }
.sistema-stats .s .v {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(56px, 7vw, 96px);
  letter-spacing: -0.05em;
  line-height: 0.88;
  color: var(--fg-white);
  font-variant-numeric: tabular-nums;
}
.sistema-stats .s .l {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-top: 16px;
}

.sistema-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-dark);
}
@media (max-width: 720px) { .sistema-cols { grid-template-columns: 1fr; } }
.sistema-cols .col {
  padding: 32px 28px 36px;
  border-right: 1px solid var(--rule-dark);
}
.sistema-cols .col:last-child { border-right: 0; }
.sistema-cols .col .col-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-dark);
}
.sistema-cols .col h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -0.018em;
  color: var(--fg-white);
  margin-bottom: 24px;
  line-height: 1.1;
}
.sistema-cols .col ul { list-style: none; }
.sistema-cols .col ul li {
  padding: 14px 0;
  border-bottom: 1px dotted var(--rule-dark);
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--fg-white);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: baseline;
}
.sistema-cols .col ul li:last-child { border-bottom: 0; }
.sistema-cols .col ul li .ix {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.sistema-cols .col ul li .sub {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ===== LOG OPERATIVI ===== */

.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: var(--rule-light);
  border-top: 1px solid var(--rule-light);
  border-bottom: 1px solid var(--rule-light);
}
.log-card {
  background: var(--bg-paper);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.log-card:hover { background: var(--bg-paper-2); }

.log-card .img {
  aspect-ratio: 4/3;
  background:
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(10,10,10,0.045) 18px 19px),
    var(--bg-paper-2);
  border: 1px solid var(--rule-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.log-card .img::after {
  content: attr(data-img-label);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--bg-paper);
  padding: 6px 10px;
  border: 1px solid var(--rule-light);
}

.log-card .code-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-light);
}
.log-card .code-row .code { color: var(--accent); }

.log-card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.018em;
  color: var(--ink);
}
.log-card .zona {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.log-data {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-light);
}
.log-data .kv .k {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.log-data .kv .v {
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.log-data .kv .v.--ok { color: var(--ink); }
.log-data .kv .v.--alert { color: var(--accent); }

.log-card .open-link {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.log-card:hover .open-link { color: var(--accent); }

.log-foot {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ===== COMUNICAZIONE ===== */

.com-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 900px) { .com-grid { grid-template-columns: 1fr; } }

.com-points {
  display: grid;
  gap: 4px;
  margin-top: 32px;
  border-top: 1px solid var(--rule-dark);
}
.com-point {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule-dark);
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: baseline;
}
.com-point .ix {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.com-point .t {
  font-family: var(--display);
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--fg-white);
}
.com-point .d {
  margin-top: 6px;
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.5;
}

.email-mock {
  background: var(--bg-paper);
  color: var(--ink);
  border: 1px solid var(--rule-dark);
  font-family: var(--sans);
  font-size: 13px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.7), 0 8px 20px -8px rgba(0,0,0,0.5);
}
.email-mock .email-bar {
  background: var(--bg-paper-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-light);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  gap: 12px;
  align-items: center;
}
.email-mock .email-bar .dots { display: flex; gap: 6px; }
.email-mock .email-bar .dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-faint);
  display: inline-block;
}
.email-mock .email-head { padding: 22px 26px 18px; border-bottom: 1px solid var(--rule-light); }
.email-mock .email-head .from {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}
.email-mock .email-head .subj {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.2;
}
.email-mock .email-head .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.email-mock .email-body {
  padding: 24px 26px 28px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.email-mock .email-body p { margin-bottom: 14px; }
.email-mock .email-body h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-light);
}
.email-mock .email-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 8px;
}
.email-mock .email-body table td {
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule-light);
  letter-spacing: 0.04em;
}
.email-mock .email-body table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.email-mock .email-body table td .ok { color: var(--ink); }
.email-mock .email-body table td .alert { color: var(--accent); font-weight: 600; }
.email-mock .stamp {
  margin: 18px 0 0;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 10px;
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ===== APERTURA PRATICA ===== */

.pratica-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 900px) { .pratica-grid { grid-template-columns: 1fr; } }

.pratica-side .meta-list {
  margin-top: 32px;
  border-top: 1px solid var(--rule-light);
}
.pratica-side .meta-list .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-light);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.pratica-side .meta-list .row .v { color: var(--ink); }

.pratica-counter {
  margin-top: 40px;
  padding: 24px 28px;
  border: 1px solid var(--accent);
  background: var(--bg-paper-2);
  position: relative;
}
.pratica-counter::before {
  content: "";
  position: absolute;
  top: -1px; right: -1px;
  width: 12px; height: 12px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}
.pratica-counter .l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.pratica-counter .v {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.form-mod {
  background: var(--bg-paper);
  border: 1px solid var(--rule-light);
  position: relative;
}
.form-mod .form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--rule-light);
  background: var(--bg-paper-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.form-mod .form-head .stamp {
  border: 1px solid var(--accent);
  padding: 4px 10px;
  color: var(--accent);
}
.form-mod .form-body {
  padding: 32px;
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) { .form-mod .form-body { grid-template-columns: 1fr; padding: 22px; } }

.form-mod .field { display: flex; flex-direction: column; gap: 6px; }
.form-mod .field.--full { grid-column: 1 / -1; }
.form-mod .field label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
}
.form-mod .field label .req { color: var(--accent); }
.form-mod .field input,
.form-mod .field select,
.form-mod .field textarea {
  font: 15px/1.4 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 6px 0 8px;
  outline: none;
  border-radius: 0;
}
.form-mod .field input:focus,
.form-mod .field select:focus,
.form-mod .field textarea:focus {
  border-bottom-color: var(--accent);
}
.form-mod .field textarea {
  resize: vertical;
  min-height: 84px;
  border-bottom: 0;
  border: 1px solid var(--rule-light);
  padding: 10px;
}
.form-mod .field textarea:focus { border-color: var(--accent); }
.form-mod .field .hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-top: 4px;
}

.form-mod .form-foot {
  padding: 22px 32px 28px;
  border-top: 1px solid var(--rule-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--bg-paper-2);
}
.form-mod .form-foot .leg {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  max-width: 36ch;
}

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

footer.colofon {
  background: var(--bg-black);
  color: var(--fg-dim);
  padding: clamp(56px, 6vw, 96px) 0 32px;
  font-size: 13px;
  border-top: 1px solid var(--rule-dark);
}
footer.colofon .colofon-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 900px) { footer.colofon .colofon-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { footer.colofon .colofon-grid { grid-template-columns: 1fr; } }

footer.colofon h6 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-dark);
}
footer.colofon ul { list-style: none; }
footer.colofon ul li { padding: 5px 0; }
footer.colofon a { color: var(--fg-dim); text-decoration: none; }
footer.colofon a:hover { color: var(--fg-white); }

footer.colofon .descr {
  font-family: var(--display);
  font-size: 16px;
  color: var(--fg-white);
  letter-spacing: -0.01em;
  line-height: 1.4;
  max-width: 40ch;
  margin-bottom: 14px;
}

.colofon-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-dark);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ===== TWEAKS PANEL ===== */

#tweaks {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 280px;
  background: var(--bg-black);
  color: var(--fg-white);
  border: 1px solid var(--rule-dark);
  box-shadow: 0 30px 60px -10px rgba(0,0,0,0.6);
  z-index: 100;
  font-family: var(--sans);
  font-size: 13px;
}
#tweaks.open { display: block; }
#tweaks .tw-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-dark);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
#tweaks .tw-head button {
  background: none; border: 0; color: var(--fg-dim); cursor: pointer; font: inherit; padding: 4px;
}
#tweaks .tw-body { padding: 16px; display: grid; gap: 18px; }
#tweaks .tw-row .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}
#tweaks .seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--rule-dark);
}
#tweaks .seg button {
  background: transparent;
  color: var(--fg-dim);
  border: 0;
  padding: 8px;
  cursor: pointer;
  font: inherit;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#tweaks .seg button.on { background: var(--accent); color: var(--fg-white); }

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ===== SUB-PAGE GENERIC ===== */
.page-head {
  padding: clamp(80px, 9vw, 140px) 0 clamp(40px, 5vw, 64px);
  border-bottom: 1px solid var(--rule-dark);
}
.page-head .crumb {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.page-head .crumb a { color: var(--fg-dim); text-decoration: none; }
.page-head .crumb a:hover { color: var(--accent); }
.page-head .crumb .sep { color: var(--fg-faint); }
.page-head h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(48px, 7vw, 96px);
  letter-spacing: -0.035em;
  line-height: 0.97;
  text-wrap: balance;
  max-width: 18ch;
}
.page-head h1 .mark { color: var(--accent); }
.page-head .lede {
  margin-top: 28px;
  font-family: var(--display);
  font-size: clamp(19px, 1.6vw, 26px);
  color: var(--fg-dim);
  max-width: 60ch;
  letter-spacing: -0.005em;
  line-height: 1.35;
  text-wrap: pretty;
}

/* Service-page specific */
.svc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
@media (max-width: 900px) { .svc-grid { grid-template-columns: 1fr; } }

.svc-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  margin: 24px 0 32px;
}
.svc-stats .s {
  padding: 22px 24px 22px 0;
  border-right: 1px solid var(--rule-dark);
}
.svc-stats .s:nth-child(2n) { border-right: 0; padding-left: 24px; padding-right: 0; }
.svc-stats .v {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(36px, 4vw, 56px);
  letter-spacing: -0.03em;
  color: var(--fg-white);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.svc-stats .v small { font-size: 0.4em; color: var(--fg-dim); margin-left: 4px; }
.svc-stats .l {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-top: 10px;
}

.faq {
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--rule-dark);
}
.faq details {
  border-bottom: 1px solid var(--rule-dark);
  padding: 22px 0;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--display);
  font-size: clamp(18px, 1.7vw, 22px);
  letter-spacing: -0.012em;
  color: var(--fg-white);
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin-top: 14px;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.55;
  max-width: 70ch;
}

.checklist {
  list-style: none;
  margin-top: 24px;
}
.checklist li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-dark);
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: baseline;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: -0.005em;
  color: var(--fg-white);
}
.checklist li::before {
  content: "✕";
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.checklist.--inverse li { color: var(--ink); border-bottom-color: var(--rule-light); }
.checklist.--inverse li::before { content: "●"; color: var(--accent); }

/* Service zone chips */
.zone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.zone-chips a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  border: 1px solid var(--rule-dark);
  padding: 6px 12px;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.15s;
}
.zone-chips a:hover { color: var(--fg-white); border-color: var(--accent); }
.--paper .zone-chips a { color: var(--ink-dim); border-color: var(--rule-light); }
.--paper .zone-chips a:hover { color: var(--accent); border-color: var(--accent); }

/* Filters bar (Progetti) */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0;
  margin-bottom: 32px;
  border-top: 1px solid var(--rule-light);
  border-bottom: 1px solid var(--rule-light);
  align-items: center;
}
.filters .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 8px;
}
.filters button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  border: 1px solid var(--rule-light);
  background: transparent;
  color: var(--ink-dim);
  padding: 6px 12px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
}
.filters button:hover { color: var(--ink); }
.filters button.on { background: var(--accent); color: var(--fg-white); border-color: var(--accent); }

/* ===== NAV LOGO ===== */
.nav-logo { display: block; width: auto; }
.footer-logo { opacity: 0.85; }

/* ===== GANTT RUNNER LINE ===== */
.gantt-runner {
  position: absolute;
  top: 0; bottom: 0;
  left: 152px; /* allineato con gantt-axis */
  width: 1px;
  background: rgba(255,255,255,0.55);
  pointer-events: none;
  opacity: 0;
}
.gantt.in .gantt-runner {
  animation: gantt-run 1.4s cubic-bezier(.4,0,.6,1) forwards;
}
@keyframes gantt-run {
  0%   { left: 152px; opacity: 1; }
  85%  { opacity: 1; }
  100% { left: calc(100% - 20px); opacity: 0; }
}

/* ===== GARANZIA — diag-split ===== */
.diag-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
}
@media (max-width: 860px) { .diag-split { grid-template-columns: 1fr; } }

.diag-stat-col { display: flex; flex-direction: column; }

.diag-caption-red {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.6;
  margin-top: 16px;
}

/* breakdown IN RIGA (3 colonne) */
.diag-breakdown-v {
  display: flex;
  flex-direction: row;
  gap: 0;
}
.diag-breakdown-item-v {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 3vw, 36px) clamp(16px, 2vw, 28px);
  border-right: 1px solid var(--rule-light);
}
.diag-breakdown-item-v:last-child { border-right: none; }
@media (max-width: 600px) {
  .diag-breakdown-v { flex-direction: column; }
  .diag-breakdown-item-v { border-right: none; border-bottom: 1px solid var(--rule-light); }
  .diag-breakdown-item-v:last-child { border-bottom: none; }
}

.db-icon-v { color: var(--ink-dim); margin-bottom: 12px; }

.db-num-v {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 44px);
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1;
}
.db-num-v sup {
  font-size: 0.48em;
  font-weight: 600;
  vertical-align: super;
  letter-spacing: 0;
}

.db-lbl-v {
  font-family: var(--sans);
  font-size: clamp(12px, 1vw, 14px);
  color: var(--ink-dim);
  line-height: 1.45;
  margin-top: 8px;
}

/* progress bar garanzia — più spessa, sotto il 98% */
.diag-bar-row { }

.diag-bar-outer {
  position: relative;
  height: 14px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
  border-radius: 2px;
}
.diag-bar-inner {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 1.4s cubic-bezier(.2,.8,.2,1);
  border-radius: 2px;
}
.diag-split.in .diag-bar-inner { width: 98%; }

.diag-bar-label {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

/* ===== SOPRALLUOGO — 50/50 layout ===== */
.sopralluogo-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 860px) { .sopralluogo-layout { grid-template-columns: 1fr; } }

.sopralluogo-left { display: flex; flex-direction: column; }

.sopralluogo-list {
  list-style: none;
  padding: 0;
  margin: clamp(24px, 3vw, 36px) 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sopralluogo-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(14px, 1.1vw, 16px);
  color: var(--ink-dim);
}
.sl-dot {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.sopralluogo-right { position: relative; }
.booking-widget { border: 1px solid var(--rule-light); background: #fff; }

/* ===== PERIMETRO — testi scuri su --paper ===== */
.--paper .principio .p-title { color: var(--ink); }
.--paper .principio .p-conseg { color: var(--ink-dim); }
.--paper .principio .p-conseg b { color: var(--ink); }
.--paper .principio:hover { background: rgba(229,0,0,0.04); }
.--paper .principio:hover .p-num { color: var(--accent); }

/* ===== PAGE-HEAD HERO con foto sfondo ===== */
.page-head--hero {
  position: relative;
  background-size: cover;
  background-position: center 30%;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 0 !important;
}
.page-head-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.72) 55%,
    #0a0a0a 100%
  );
  pointer-events: none;
}
.page-head--hero .wrap { position: relative; z-index: 1; padding-top: 80px; }

/* ===== CTA HERO sezione con foto sfondo ===== */
.cta-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  padding: clamp(80px, 12vw, 160px) 0;
  text-align: center;
  overflow: hidden;
}
.cta-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.cta-hero .wrap { position: relative; z-index: 1; }
.cta-hero h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 600;
  color: var(--fg-white);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: clamp(16px, 2vw, 24px);
}
.cta-hero p {
  font-size: clamp(15px, 1.2vw, 18px);
  color: rgba(255,255,255,0.7);
  max-width: 44ch;
  margin: 0 auto clamp(28px, 4vw, 40px);
  line-height: 1.6;
}

/* ===== PROGETTI CARD — stile card ===== */
.progetti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(32px, 4vw, 48px);
}
@media (max-width: 900px) { .progetti-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .progetti-grid { grid-template-columns: 1fr; } }

.progetto-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  border: 1px solid var(--rule-light);
  background: var(--bg-paper);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.progetto-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }

.progetto-card .ph {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #eee;
}
.progetto-card .ph img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.progetto-card:hover .ph img { transform: scale(1.04); }

.progetto-card .meta {
  padding: clamp(16px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.progetto-card .meta .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}
.progetto-card .meta h3 {
  font-family: var(--display);
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}
.progetto-card .meta .meta-row {
  font-size: 13px;
  color: var(--ink-dim);
  margin-top: 2px;
}
.progetto-card .meta .open-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-top: auto;
  padding-top: 14px;
}

/* ===== GALLERIA SINGOLO PROGETTO ===== */
.pg-gallery-section {
  background: var(--black);
  padding: clamp(40px, 6vw, 72px) 0;
}
.pg-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 720px) { .pg-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pg-gallery { grid-template-columns: 1fr; } }
.pg-gallery figure {
  margin: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: #111;
  aspect-ratio: 4/3;
}
.pg-gallery figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s, transform 0.45s cubic-bezier(.22,1,.36,1);
}
.pg-gallery figure:hover img { opacity: 0.82; transform: scale(1.04); }

/* ===== LIGHTBOX ===== */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.lb.--open { display: flex; }
.lb-img-wrap {
  max-width: 88vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  user-select: none;
}
.lb-close {
  position: absolute;
  top: 22px; right: 28px;
  background: none; border: none;
  color: rgba(255,255,255,0.55);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.15s;
  padding: 8px;
}
.lb-close:hover { color: #fff; }
.lb-prev, .lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: rgba(255,255,255,0.4);
  font-size: 36px; line-height: 1;
  cursor: pointer;
  padding: 16px 20px;
  transition: color 0.15s;
}
.lb-prev:hover, .lb-next:hover { color: #fff; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-counter {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.35);
}

/* ===== PROTOCOLLO-STATS — griglia rivista ===== */
.protocollo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: clamp(32px, 4vw, 56px);
  border: 1px solid var(--rule-light);
}
@media (max-width: 700px) { .protocollo-stats { grid-template-columns: repeat(2, 1fr); } }

.protocollo-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(24px, 3vw, 36px) clamp(20px, 2.5vw, 32px);
  border-right: 1px solid var(--rule-light);
}
.protocollo-stats .stat:last-child { border-right: none; }
.protocollo-stats .stat.--accent { background: rgba(229,0,0,0.06); }

/* ===== SERVIZI — content-pillar layout ===== */
.svc-article { padding: clamp(48px, 7vw, 96px) 0; }
.svc-body {
  max-width: 76ch;
  margin: 0 auto;
  color: var(--ink);
}
.svc-lead {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.65;
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: -0.01em;
  margin-bottom: clamp(32px, 4vw, 48px);
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}
.svc-body h2 {
  font-family: var(--display);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: clamp(36px, 5vw, 56px) 0 16px;
}
.svc-body h3 {
  font-family: var(--display);
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 28px 0 12px;
}
.svc-body p {
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.7;
  color: var(--ink-dim);
  margin-bottom: 20px;
}
.svc-body ul {
  padding-left: 0;
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.svc-body ul li {
  font-size: clamp(14px, 1vw, 16px);
  color: var(--ink-dim);
  line-height: 1.55;
  padding-left: 20px;
  position: relative;
}
.svc-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}
.svc-img {
  margin: clamp(28px, 4vw, 44px) 0;
  border-radius: 2px;
  overflow: hidden;
}
.svc-img img {
  width: 100%;
  height: clamp(220px, 30vw, 440px);
  object-fit: cover;
  display: block;
}
.svc-img figcaption {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 10px 0 0;
}
.svc-cta-box {
  background: var(--ink);
  color: var(--fg-white);
  padding: clamp(24px, 3vw, 36px);
  margin: clamp(40px, 6vw, 64px) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.svc-cta-box h3 {
  font-family: var(--display);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  color: var(--fg-white);
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.svc-cta-box p { font-size: 14px; color: rgba(255,255,255,0.6); margin: 0; line-height: 1.45; }

/* blog correlati */
.svc-blog { padding: clamp(40px, 6vw, 80px) 0; }
.svc-blog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule-light);
}
.svc-blog-header h2 {
  font-family: var(--display);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
@media (max-width: 760px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule-light);
  text-decoration: none;
  transition: box-shadow 0.2s ease;
}
.blog-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.blog-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.blog-card-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.blog-card h3 {
  font-family: var(--display);
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 8px;
}
.blog-card p {
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: 0 0 auto;
}
.blog-card-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--rule-light);
}

/* ===================================================================
   WOW ANIMATIONS — global + service pages
   =================================================================== */

/* --- Page fade-in su caricamento --- */
body { animation: bodyIn 0.35s ease both; }
@keyframes bodyIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- Page-head: sweep + entrances --- */
.page-head {
  position: relative;
  overflow: hidden;
}
.page-head::after {
  content: '';
  position: absolute;
  inset: 0 0 0 auto;
  width: 45%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.022) 50%, transparent 100%);
  transform: translateX(-300%);
  animation: headSweep 1.3s cubic-bezier(.22,1,.36,1) 0.05s forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes headSweep {
  to { transform: translateX(300%); }
}
.page-head .crumb {
  opacity: 0;
  animation: headEl 0.7s cubic-bezier(.22,1,.36,1) 0.05s both;
}
.page-head h1 {
  opacity: 0;
  animation: headEl 0.8s cubic-bezier(.22,1,.36,1) 0.15s both;
}
.page-head .lede {
  opacity: 0;
  animation: headEl 0.8s cubic-bezier(.22,1,.36,1) 0.3s both;
}
@keyframes headEl {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Svc image: parallax + reveal --- */
.svc-img {
  height: clamp(220px, 30vw, 440px); /* height lives on container now */
  overflow: hidden;
}
.svc-img img {
  width: 100%;
  height: 110%;       /* extra room for parallax travel */
  margin-top: -5%;    /* vertically center the overflow */
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.04) translateY(12px);
  will-change: transform, opacity;
  transition: opacity 1s ease, transform 1.1s cubic-bezier(.22,1,.36,1);
}
.svc-img.in img {
  opacity: 1;
  transform: scale(1.04) translateY(0);
}

/* --- H2 underline draw (inside svc-body only) --- */
.svc-body h2 {
  position: relative;
  padding-bottom: 10px;
}
.svc-body h2::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  height: 1.5px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 70%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(.22,1,.36,1);
}
.svc-body h2.in::after {
  transform: scaleX(1);
}

/* --- Lead paragraph fade-in --- */
.svc-lead {
  opacity: 0;
  transition: opacity 0.95s ease 0.12s;
}
.svc-lead.in { opacity: 1; }

/* --- Article blocks stagger (assigned by JS) --- */
.svc-anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(.22,1,.36,1);
}
.svc-anim.in { opacity: 1; transform: none; }

/* --- CTA box entrance --- */
.svc-cta-box {
  opacity: 0;
  transform: translateY(24px);
  border-left: 3px solid var(--accent);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.22,1,.36,1);
}
.svc-cta-box.in { opacity: 1; transform: none; }

/* --- Stats stagger --- */
.svc-stats .s {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.22,1,.36,1);
}
.svc-stats.in .s { opacity: 1; transform: none; }
.svc-stats.in .s:nth-child(2) { transition-delay: 90ms; }
.svc-stats.in .s:nth-child(3) { transition-delay: 180ms; }
.svc-stats.in .s:nth-child(4) { transition-delay: 270ms; }

/* --- FAQ details smooth open --- */
details > p, details > div {
  animation: detailsOpen 0.32s cubic-bezier(.22,1,.36,1) both;
}
@keyframes detailsOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Blog card 3D tilt (transition managed by JS) --- */
.blog-card { transform-style: preserve-3d; will-change: transform; }

/* --- Checklist items stagger inside svc-body --- */
.svc-body .checklist { opacity: 0; transition: opacity 0.3s ease; }
.svc-body .checklist.in { opacity: 1; }
.svc-body .checklist.in li {
  animation: liIn 0.45s cubic-bezier(.22,1,.36,1) both;
}
.svc-body .checklist.in li:nth-child(1)  { animation-delay:  30ms; }
.svc-body .checklist.in li:nth-child(2)  { animation-delay:  80ms; }
.svc-body .checklist.in li:nth-child(3)  { animation-delay: 130ms; }
.svc-body .checklist.in li:nth-child(4)  { animation-delay: 180ms; }
.svc-body .checklist.in li:nth-child(5)  { animation-delay: 230ms; }
.svc-body .checklist.in li:nth-child(6)  { animation-delay: 280ms; }
.svc-body .checklist.in li:nth-child(7)  { animation-delay: 330ms; }
.svc-body .checklist.in li:nth-child(8)  { animation-delay: 380ms; }
.svc-body .checklist.in li:nth-child(9)  { animation-delay: 430ms; }
.svc-body .checklist.in li:nth-child(10) { animation-delay: 480ms; }
@keyframes liIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --- Count-up numbers --- */
[data-count] { tabular-nums: normal; }

/* --- Reduced motion safety --- */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .page-head::after { animation: none; }
  .page-head .crumb, .page-head h1, .page-head .lede { animation: none; opacity: 1; }
  .svc-img img, .svc-lead, .svc-anim, .svc-cta-box, .svc-body h2::after { transition: none; }
  .svc-img img, .svc-lead, .svc-anim, .svc-cta-box { opacity: 1; transform: none; }
  .svc-stats .s { opacity: 1; transform: none; }
  details > p, details > div { animation: none; }
  .svc-body .checklist { opacity: 1; }
  .svc-body .checklist.in li { animation: none; }
}

/* ===== MISSION / VISION (chi-siamo.html) ===== */
.mv-block {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: clamp(32px, 4vw, 64px);
  padding: clamp(48px, 6vw, 80px) 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  align-items: start;
}
.mv-block:first-of-type { border-top: 1px solid rgba(255,255,255,0.1); }
@media (max-width: 640px) { .mv-block { grid-template-columns: 1fr; gap: 18px; } }
.mv-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  padding-top: 8px;
}
.mv-tag::before {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 10px;
}
.mv-body h2 {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 600;
  color: var(--fg-white);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 22px;
}
.mv-body p {
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.68;
  color: var(--fg-dim);
  max-width: 60ch;
}

/* ===== SERVICE PAGE — SIDEBAR LAYOUT ===== */
.svc-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 1080px) {
  .svc-layout { grid-template-columns: 1fr; }
  .svc-sidebar { display: none; }
}
.svc-layout .svc-body { max-width: none; margin: 0; }

.svc-sidebar-inner {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.svc-sb-block {
  border: 1px solid var(--rule-light);
  padding: 18px 20px;
  background: #fff;
}
.svc-sb-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.svc-sb-stats { display: flex; flex-direction: column; }
.svc-sb-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-light);
  gap: 8px;
}
.svc-sb-stats > div:last-child { border-bottom: none; padding-bottom: 0; }
.svc-sb-stats dt { font-size: 12px; color: var(--ink-dim); flex: 1; line-height: 1.3; }
.svc-sb-stats dd { font-size: 12px; font-weight: 600; color: var(--ink); font-family: var(--display); letter-spacing: -0.01em; text-align: right; white-space: nowrap; }

.svc-sb-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.svc-sb-list li { font-size: 13px; color: var(--ink-dim); padding-left: 16px; position: relative; line-height: 1.4; }
.svc-sb-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); font-size: 10px; top: 2px; }

.svc-sb-cta { background: var(--ink); padding: 20px; }
.svc-sb-cta-title { font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--fg-white); line-height: 1.35; margin-bottom: 6px; }
.svc-sb-cta-text { font-size: 12px; color: var(--fg-dim); line-height: 1.5; margin-bottom: 14px; }
.svc-sb-cta .btn { display: block; width: 100%; text-align: center; font-size: 12px; padding: 10px 16px; }

.svc-sb-nav { list-style: none; display: flex; flex-direction: column; }
.svc-sb-nav a {
  font-size: 13px; color: var(--ink-dim); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--rule-light);
  transition: color 0.15s;
}
.svc-sb-nav a:hover { color: var(--accent); }
.svc-sb-nav li:last-child a { border-bottom: none; padding-bottom: 0; }
.svc-sb-nav a::before { content: '→'; font-family: var(--mono); font-size: 10px; color: var(--ink-faint); flex-shrink: 0; transition: color 0.15s; }
.svc-sb-nav a:hover::before { color: var(--accent); }

/* ===== PROGETTO — pagina dettaglio ===== */

/* Cover: foto panoramica come sfondo dell'header */
.pg-cover {
  position: relative;
  height: clamp(520px, 78vh, 960px);
  overflow: hidden;
  background: var(--ink);
}
.pg-cover > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.80) 100%);
}
.pg-cover-body {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding-bottom: clamp(44px, 6.5vw, 80px);
}
.pg-cover-body .crumb a,
.pg-cover-body .crumb .sep,
.pg-cover-body .crumb span { color: rgba(255,255,255,0.50); }
.pg-cover-body .crumb a:hover { color: rgba(255,255,255,0.92); }
.pg-cover-body h1 { color: var(--fg-white); margin-bottom: 12px; }
.pg-cover-body .lede { color: rgba(255,255,255,0.70); max-width: 680px; }

/* Grid: sidebar (1fr) | feature (2.2fr) in alto + strip full-width in basso */
.pg-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 2.2fr;
  grid-template-rows: clamp(380px, 48vw, 620px) clamp(260px, 32vw, 420px);
  margin: clamp(40px, 5.5vw, 64px) 0 clamp(52px, 7vw, 88px);
}
.pg-grid .pg-main,
.pg-grid figure { overflow: hidden; background: var(--bg-paper-2); position: relative; }
.pg-grid .pg-main { grid-column: 2; grid-row: 1; }
.pg-grid > figure:first-of-type { grid-column: 1; grid-row: 1; }
.pg-grid > figure:last-of-type { grid-column: 1 / -1; grid-row: 2; }

/* v-1: immagine singola */
.pg-grid.v-1 { grid-template-columns: 1fr; grid-template-rows: clamp(380px, 50vw, 600px); }
.pg-grid.v-1 > figure { grid-column: 1; grid-row: 1; }

/* v-2eq: 2 colonne uguali */
.pg-grid.v-2eq { grid-template-columns: 1fr 1fr; grid-template-rows: clamp(320px, 42vw, 540px); }
.pg-grid.v-2eq > figure:first-of-type { grid-column: 1; grid-row: 1; }
.pg-grid.v-2eq > figure:last-of-type { grid-column: 2; grid-row: 1; }

/* v-3eq: 3 colonne uguali */
.pg-grid.v-3eq { grid-template-columns: repeat(3, 1fr); grid-template-rows: clamp(280px, 36vw, 460px); }
.pg-grid.v-3eq > figure { grid-row: 1; }

/* immagini */
.pg-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.65s cubic-bezier(.22,1,.36,1); }

/* overlay + zoom all'hover */
.pg-grid .pg-main::after, .pg-grid figure::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: rgba(0,0,0,0); transition: background 0.4s ease; pointer-events: none;
}
.pg-grid .pg-main:hover::after, .pg-grid figure:hover::after { background: rgba(0,0,0,0.09); }
.pg-grid .pg-main:hover img, .pg-grid figure:hover img { transform: scale(1.06); }

@media (max-width: 720px) {
  .pg-cover { height: clamp(340px, 62vw, 540px); }
  .pg-grid,
  .pg-grid.v-1,
  .pg-grid.v-2eq,
  .pg-grid.v-3eq { grid-template-columns: 1fr; grid-template-rows: auto; }
  .pg-grid .pg-main,
  .pg-grid > figure:first-of-type,
  .pg-grid > figure:last-of-type,
  .pg-grid.v-2eq > figure:first-of-type,
  .pg-grid.v-2eq > figure:last-of-type,
  .pg-grid.v-3eq > figure { grid-column: 1; grid-row: auto; aspect-ratio: 4/3; }
}

.progetto-sheet { display: grid; grid-template-columns: 1fr 260px; gap: clamp(32px,5vw,64px); align-items: start; padding: clamp(40px,6vw,72px) 0; border-top: 1px solid var(--rule-light); }
@media (max-width: 860px) { .progetto-sheet { grid-template-columns: 1fr; } }
.progetto-desc h2 { font-family: var(--display); font-size: clamp(20px,2vw,28px); font-weight: 600; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 18px; }
.progetto-desc p { font-size: clamp(15px,1.1vw,17px); color: var(--ink-dim); line-height: 1.7; margin-bottom: 16px; }

.progetto-meta { position: sticky; top: calc(var(--nav-h) + 20px); border: 1px solid var(--rule-light); padding: 20px; background: var(--bg-paper-2); }
.progetto-meta-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--accent); margin-bottom: 16px; text-transform: uppercase; }
.progetto-meta dl { display: flex; flex-direction: column; }
.progetto-meta dl > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--rule-light); }
.progetto-meta dl > div:last-child { border-bottom: none; padding-bottom: 0; }
.progetto-meta dt { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase; }
.progetto-meta dd { font-size: 13px; color: var(--ink); font-family: var(--display); font-weight: 500; line-height: 1.4; }

.progetto-nav-more { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--rule-light); }
.progetto-nav-more a { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--ink-dim); text-decoration: none; border: 1px solid var(--rule-light); padding: 8px 14px; text-transform: uppercase; transition: all 0.15s; }
.progetto-nav-more a:hover { color: var(--accent); border-color: var(--accent); }

/* ===== SOCIAL PROOF in service pages ===== */
.svc-proof { padding: clamp(48px,7vw,80px) 0; }
.svc-proof-header { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: clamp(20px,2.5vw,32px); padding-bottom: 14px; border-bottom: 1px solid var(--rule-dark); }
.svc-proof-title { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); }
.svc-proof-link { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--fg-faint); text-decoration: none; white-space: nowrap; transition: color 0.15s; }
.svc-proof-link:hover { color: var(--accent); }
.--paper .svc-proof-header { border-bottom-color: var(--rule-light); }
.--paper .svc-proof-title { color: var(--ink-dim); }
.--paper .svc-proof-link { color: var(--ink-faint); }
.svc-proof-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: clamp(6px,0.8vw,10px); }
@media (max-width: 640px) { .svc-proof-grid { grid-template-columns: repeat(2,1fr); } }
.svc-proof-item { display: block; text-decoration: none; overflow: hidden; position: relative; aspect-ratio: 3/4; }
.svc-proof-item.landscape { aspect-ratio: 16/9; grid-column: span 2; }
.svc-proof-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(.22,1,.36,1); }
.svc-proof-item:hover img { transform: scale(1.04); }
.svc-proof-item-label { position: absolute; bottom:0; left:0; right:0; padding: 10px 12px; background: linear-gradient(to top, rgba(10,10,10,0.65) 0%, transparent 100%); font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--fg-white); text-transform: uppercase; opacity: 0; transition: opacity 0.22s ease; }
.svc-proof-item:hover .svc-proof-item-label { opacity: 1; }
