@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Spectral:ital,wght@0,300;0,400;0,500;1,300;1,400&family=JetBrains+Mono:wght@300;400&display=swap');

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #1a1a18;
  --ink-soft:  #4a4a44;
  --ink-muted: #8a8a80;
  --paper:     #f7f5f0;
  --paper-warm:#eeebe3;
  --accent:    #8b3a2a;
  --accent-lt: #c4614e;
  --rule:      #d4d0c4;
  --rule-soft: #e8e4d8;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Spectral', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  --max-w: 1080px;
  --col-text: 680px;
}

html { font-size: 18px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 300; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.4rem; font-weight: 500; }
h4 { font-size: 1.1rem; font-weight: 500; font-style: italic; }

p { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

em { font-style: italic; }
strong { font-weight: 500; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
a:hover { border-color: var(--accent-lt); }

/* ─── LAYOUT ─── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.container--narrow {
  max-width: var(--col-text);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ─── NAVIGATION ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247, 245, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  border: none;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, var(--paper-warm) 100%);
  pointer-events: none;
}

.hero-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1.5rem;
}

.hero-title {
  margin-bottom: 1.5rem;
}

.hero-title em {
  color: var(--accent);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 0;
}

.hero-statement {
  background: var(--paper-warm);
  border-left: 3px solid var(--accent);
  padding: 2rem 2.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink);
  position: relative;
}

.hero-statement::before {
  content: '\201C';
  font-size: 5rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.25;
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  font-family: var(--font-display);
}

.hero-statement p { margin: 0; }

/* ─── SECTION BASE ─── */
section {
  padding: 6rem 0;
}

section + section {
  border-top: 1px solid var(--rule-soft);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 3rem;
}

/* ─── PERCORSO (timeline) ─── */
.percorso-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0 4rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.percorso-sidebar {
  padding-top: 0.4rem;
}

.percorso-sidebar h2 { margin-bottom: 1.5rem; }

.percorso-sidebar p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}

.timeline-item {
  padding-left: 2rem;
  padding-bottom: 3rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.5s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--rule);
  transition: border-color 0.2s, background 0.2s;
}

.timeline-item:hover::before {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
  display: block;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.timeline-body {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0;
}

/* ─── LE CONNESSIONI ─── */
.connessioni-bg {
  background: var(--paper-warm);
}

.connessioni-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 3rem;
}

.connessione-card {
  background: var(--paper);
  padding: 2.5rem 2rem;
  transition: background 0.2s;
}

.connessione-card:hover {
  background: #fff;
}

.connessione-number {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 300;
  color: var(--rule);
  line-height: 1;
  margin-bottom: 1rem;
  display: block;
}

.connessione-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--ink);
  line-height: 1.3;
}

.connessione-card p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.75;
  margin: 0;
}

.connessione-tag {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}

/* ─── SMARTFOLIO ─── */
.smartfolio-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.smartfolio-text p {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.8;
}

.smartfolio-highlight {
  background: var(--ink);
  color: var(--paper);
  padding: 3rem;
}

.smartfolio-highlight h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--paper);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.smartfolio-highlight p {
  font-size: 0.9rem;
  color: rgba(247,245,240,0.65);
  line-height: 1.8;
  margin: 0;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(247,245,240,0.15);
}

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

.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--paper);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.45);
  margin-top: 0.4rem;
}

/* ─── PUBBLICAZIONI ─── */
.pub-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.pub-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.15s;
}

.pub-item:hover {
  background: var(--paper-warm);
  margin: 0 -1.5rem;
  padding: 1.8rem 1.5rem;
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  padding-top: 0.2rem;
  letter-spacing: 0.05em;
}

.pub-content {}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.3rem;
  font-style: italic;
}

.pub-journal {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.pub-if {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

/* ─── FOOTER ─── */
footer {
  background: var(--ink);
  color: rgba(247,245,240,0.45);
  padding: 3rem 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-name {
  color: rgba(247,245,240,0.7);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .hero-grid,
  .smartfolio-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .percorso-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .connessioni-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .pub-item {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  html { font-size: 16px; }

  .nav-links { display: none; }

  .hero { padding: 90px 0 60px; min-height: auto; }

  section { padding: 4rem 0; }

  .container, .container--narrow,
  .percorso-layout, .smartfolio-layout { padding: 0 1.25rem; }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .pub-item:hover {
    margin: 0 -0.5rem;
    padding: 1.8rem 0.5rem;
  }

  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }

  .stat-row { grid-template-columns: 1fr 1fr; }
}
