:root {
  /* Toni di sfondo — stacchi sottili in scala monocroma */
  --bg-0: #0F1115;        /* base */
  --bg-1: #131822;        /* un gradino sopra (più freddo) */
  --bg-2: #0C0E14;        /* un gradino sotto (più scuro) */

  --bg: var(--bg-0);

  --text-main: #F2F2F2;
  --text-secondary: #B6B6B6;
  --text-muted: #7A7E88;
  --accent: #C0392B;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  --max-width: 1100px;
}

/* RESET */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-0);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* LAYOUT */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 120px 0;
  position: relative;
}

/* TONI DI SEZIONE — stacchi tonali sottili */
.tone-a { background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%); }
.tone-b { background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%); }
.tone-c { background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-2) 100%); }
.tone-d { background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-0) 100%); }
.tone-flat { background: var(--bg-0); }

/* NAV */
.nav-main {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-main);
  border: none;
  padding: 0;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  border: none;
  padding: 0;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-main);
  opacity: 1;
}

.nav-links a.current {
  color: var(--text-main);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* HERO */
.hero {
  min-height: calc(100vh - 64px);
  background-size: cover;
  background-position: center;
}

.hero .overlay {
  min-height: calc(100vh - 64px);
  background: linear-gradient(180deg, rgba(15, 17, 21, 0.65) 0%, rgba(15, 17, 21, 0.85) 100%);
  display: flex;
  align-items: center;
}

.hero h1 {
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  max-width: 900px;
  margin-bottom: 32px;
}

/* TESTI */
h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  margin-bottom: 32px;
}

p {
  font-size: 18px;
  max-width: 720px;
  margin-bottom: 24px;
}

.secondary {
  color: var(--text-secondary);
}

/* LINK */
a {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

a:hover {
  opacity: 0.8;
}

/* NAV STEP (link narrativi tra sezioni / pagine) */
.nav-step {
  margin-top: 40px;
  font-size: 16px;
}

.nav-step a {
  letter-spacing: 0.02em;
}

.nav-step.back {
  margin-top: 0;
  margin-bottom: 40px;
  font-size: 14px;
}

.nav-step.back a {
  color: var(--text-secondary);
  border-bottom: none;
}

.nav-step.back a:hover {
  color: var(--text-main);
  opacity: 1;
}

/* STATEMENT VISIVO */
.key-statement {
  border-left: 2px solid var(--accent);
  padding-left: 24px;
  margin: 56px 0;
  font-size: 20px;
  max-width: 700px;
}

/* BANDA GRAFICA */
.visual-break {
  height: 260px;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

/* PROFILO */
.profile {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  align-items: start;
}

.profile-image {
  border-left: 2px solid var(--text-secondary);
  padding-left: 16px;
}

.profile img {
  width: 100%;
  border-radius: 4px;
  filter: grayscale(100%);
}

.profile.editorial {
  align-items: center;
}

/* CTA */
.cta p {
  font-size: 19px;
}

/* ALBERO SPEZZATO (SVG container) */
.broken-tree {
  display: flex;
  justify-content: center;
  margin: 0 auto 40px;
  max-width: 280px;
  opacity: 0.9;
}

.broken-tree svg {
  width: 100%;
  height: auto;
  color: var(--text-secondary);
}

/* GRIGLIA METRICHE */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 56px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.metric-cell {
  padding: 48px 28px;
  border-right: 1px solid var(--hairline);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-number {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.metric-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.metric-bar {
  margin-top: 16px;
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.metric-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.metric-bar.in-view .metric-bar-fill {
  width: var(--bar-width, 18%);
}

/* DIAGRAMMA CAUSE */
.cause-diagram {
  margin: 48px 0 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.cause-node {
  border: 1px solid var(--hairline-strong);
  padding: 16px 22px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.cause-node.broken {
  border-color: var(--accent);
  color: var(--text-secondary);
  position: relative;
}

.cause-node.broken::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 1px;
  background: var(--accent);
  transform: rotate(-8deg);
}

.cause-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

/* PLAYBOOK MINI-CARDS */
.playbook-cards {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.playbook-card {
  border: 1px solid var(--hairline);
  padding: 24px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.2s;
}

.playbook-card:hover {
  border-color: var(--hairline-strong);
}

.playbook-status {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.playbook-status.active {
  color: var(--accent);
}

.playbook-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

/* SOCIAL BAR */
.social-bar {
  padding: 60px 0 80px;
  border-top: 1px solid var(--hairline);
  background: var(--bg-2);
}

.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 28px;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--text-secondary);
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  padding: 0;
  transition: color 0.2s, border-color 0.2s;
}

.social-list a:hover {
  color: var(--text-main);
  border-color: var(--accent);
  opacity: 1;
}

/* CONTACT LIST */
.contact-list {
  margin: 32px 0;
  padding-left: 20px;
  max-width: 720px;
}

.contact-list li {
  margin-bottom: 12px;
  font-size: 18px;
}

/* REVEAL ON SCROLL */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .metric-bar-fill {
    transition: none;
  }
}

/* MOBILE */
@media (max-width: 768px) {
  section {
    padding: 80px 0;
  }

  .hero h1 {
    font-size: 34px;
  }

  .profile {
    grid-template-columns: 1fr;
  }

  .profile img {
    max-width: 140px;
  }

  .nav-inner {
    height: 56px;
  }

  .nav-brand {
    font-size: 11px;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .hero,
  .hero .overlay {
    min-height: calc(100vh - 56px);
  }

  .social-list {
    gap: 20px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-cell {
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    padding: 36px 0;
  }

  .metric-cell:last-child {
    border-bottom: none;
  }

  .cause-diagram {
    flex-direction: column;
    align-items: flex-start;
  }

  .cause-arrow {
    transform: rotate(90deg);
  }
}
