/* 1. VARIABILI GLOBALI */
:root {
  --gold: #947a4b;
  --gold-light: #bfa577;
  --gold-dark: #7a633d;
  --brand-900: #0f172a;
  --brand-800: #1e293b;
  --brand-50: #f8fafc;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --header-gradient: linear-gradient(90deg, #ffffff 0%, #faf9f7 35%, #f3f0ea 65%, #ffffff 100%);
}

/* 2. RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overflow-x: hidden;
}
body {
  margin: 0; padding: 0;
  overflow-x: hidden;
  width: 100%;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--brand-50);
  color: var(--brand-900);
}

/* 3. HEADER / NAVBAR */
#navbar, header {
  background: var(--header-gradient) !important;
  border-bottom: 1px solid rgba(148, 122, 75, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  transition: all 0.3s ease;
}
#mobile-menu {
  background: #ffffff;
  border-top: 1px solid rgba(148, 122, 75, 0.15);
}

/* 4. LAYOUT & CONTAINER */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
section, footer, header, main {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
img, video, iframe, svg { max-width: 100%; height: auto; display: block; }
.grid, .flex { min-width: 0; }

/* 5. SCROLL & SPZIATURE SEZIONI */
section[id], footer[id] { scroll-margin-top: 100px; }
@media (max-width: 768px) {
  html { scroll-padding-top: 80px; }
  section[id], footer[id] { scroll-margin-top: 80px; }
}

#presentation { min-height: 100vh; padding-top: 6rem; padding-bottom: 4rem; }
#chi-sono { padding-top: 5rem; padding-bottom: 6rem; }
#competenze { padding-top: 4rem; padding-bottom: 4rem; }
#ricerca { padding-top: 5rem; padding-bottom: 5rem; }
#pubblicazioni { padding-top: 6rem; padding-bottom: 6rem; }
#attivita { padding-top: 5rem; padding-bottom: 5rem; }
#outreach { padding-top: 6rem; padding-bottom: 6rem; }
#contatti { padding-top: 5rem; padding-bottom: 2.5rem; }

/* 6. ANIMAZIONI & REVEAL */
.section-animate {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s var(--transition-smooth), transform 0.6s var(--transition-smooth);
  will-change: transform, opacity;
}
.section-animate.visible { opacity: 1; transform: translateY(0); will-change: auto; }
.section-animate.delay-100 { transition-delay: 0.1s; }
.section-animate.delay-200 { transition-delay: 0.2s; }
.section-animate.delay-300 { transition-delay: 0.3s; }

.section-hidden { display: none !important; }
.section-reveal { animation: sectionFadeIn 0.6s ease-out forwards; }
@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   7.5 CARD DINAMICHE - Coppie Differenziate
   ============================================ */

/* 🔹 Coppia 1: Fluttuazione verticale (ideale per numeri/metriche) */
.card-dinamica-float {
    animation: card-float 6s var(--transition-smooth) infinite;
    will-change: transform, box-shadow;
}
@keyframes card-float {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    }
    50% {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(148, 122, 75, 0.12);
    }
}

/* 🔸 Coppia 2: Pulsazione del bordo (ideale per etichette/milestone) */
.card-dinamica-glow {
    animation: card-glow 5s var(--transition-smooth) infinite;
    will-change: border-color, box-shadow;
}
@keyframes card-glow {
    0%, 100% {
        border-color: rgba(148, 122, 75, 0.2);
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    }
    50% {
        border-color: rgba(148, 122, 75, 0.5);
        box-shadow: 0 6px 18px rgba(148, 122, 75, 0.1);
    }
}

/* 🖱️ Hover comune: ferma l'animazione e applica lo stato "attivo" */
.card-dinamica-float:hover,
.card-dinamica-glow:hover {
    animation-play-state: paused;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(148, 122, 75, 0.15);
    border-color: var(--gold);
}

/* 7. COMPONENTI & NAV LINKS */
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.animate-marquee { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.animate-marquee:hover { animation-play-state: paused; }

.logo-link { position: relative; display: inline-flex; align-items: center; text-decoration: none; }
.logo-dot { opacity: 0; transition: opacity 0.3s ease; }
.logo-link:hover .logo-dot { opacity: 1; }
.logo-underline { position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background: var(--gold); transition: width 0.4s ease; }
.logo-link:hover .logo-underline { width: 100%; }

.lux-link { position: relative; text-decoration: none; color: inherit; transition: color 0.3s ease; }
.lux-link::after { content: ''; position: absolute; width: 0; height: 1px; bottom: -2px; left: 0; background-color: var(--gold); transition: width 0.3s ease-in-out; }
.lux-link:hover::after { width: 100%; }
.lux-link:hover { color: var(--gold); }
.nav-link.active { color: var(--gold) !important; }

/* ✅ CONTATTO NAVBAR - Contorno Zero Layout Shift */
.nav-contact-outline {
  position: relative;
  color: var(--gold) !important;
  z-index: 1;
}
.nav-contact-outline::after { display: none; } /* Disabilita lux-link underline */
.nav-contact-outline::before {
  content: '';
  position: absolute;
  top: -4px; left: -5px; right: -5px; bottom: -4px;
  border: 1px solid rgba(148, 122, 75, 0.35);
  border-radius: 3px;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: -1;
}
.nav-contact-outline:hover::before {
  border-color: var(--gold);
  background: rgba(148, 122, 75, 0.06);
}

#ricerca article { transition: all 0.4s var(--transition-smooth); border-left: 1px solid rgba(255, 255, 255, 0.1); }
#ricerca article:hover { border-left: 1px solid var(--gold); background: rgba(255, 255, 255, 0.03); transform: translateY(-5px); }

.pub-card { transition: all 0.3s ease; }
.pub-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); }

#outreach { position: relative; overflow: hidden; }
#outreach::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(148, 122, 75, 0.1) 0%, transparent 50%);
  pointer-events: none;
}
.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.glass-card:hover { border-color: var(--gold); background: rgba(255, 255, 255, 0.08); }

.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: -9px; top: 1rem; width: 14px; height: 14px;
  background: var(--gold); border: 4px solid white; border-radius: 50%;
  transition: transform 0.3s ease; z-index: 1;
}
.timeline-item:hover .timeline-dot { transform: scale(1.2); }

.bg-brand-900 { animation: fadeInBg 1.5s ease-out; }
@keyframes fadeInBg {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 8. UTILITÀ & ACCESSIBILITÀ */
details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; cursor: pointer; }
::selection { background: var(--gold); color: white; }
/* ✅ Fix selettore Tailwind invalido -> CSS standard */
.group:hover .scale-110, .group:hover [class*="scale-110"] { transform: scale(1.1); }
a, button, .card, article { transition: all 0.3s ease; }

.skip-link {
  position: absolute; top: -100%; left: 0; background: var(--brand-900); color: white;
  padding: 10px 20px; z-index: 100; transition: top 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; text-decoration: none;
}
.skip-link:focus { top: 0; outline: 2px solid var(--gold); outline-offset: 2px; }

svg text[class*="fill-brand-900"] {
  fill: #0f172a !important; font-family: 'Cormorant Garamond', serif !important;
  font-style: italic !important; opacity: 1 !important; letter-spacing: -0.02em !important;
}

/* 9. SCROLLBAR PERSONALIZZATA */
body { scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-light); }

/* 10. BACK TO TOP (UNIFICATO) */
.back-to-top {
  position: fixed; bottom: 30px; left: 30px; right: auto;
  width: 50px; height: 50px; background: var(--brand-900);
  color: white; border: none; border-radius: 50%; cursor: pointer;
  z-index: 999; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; box-shadow: 0 4px 15px rgba(15, 23, 42, 0.4);
  transition: all 0.3s ease; opacity: 0; visibility: hidden; transform: translateY(20px);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--gold-dark); box-shadow: 0 6px 20px rgba(148, 122, 75, 0.6); transform: translateY(-3px); }
.back-to-top.pulse { animation: pulseButton 1s infinite; }
@keyframes pulseButton {
  0% { box-shadow: 0 0 0 0 rgba(148, 122, 75, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(148, 122, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(148, 122, 75, 0); }
}
@media (max-width: 768px) {
  .back-to-top { bottom: 20px; left: 20px; width: 45px; height: 45px; font-size: 1rem; }
}

/* 11. CURSOR GLOW */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none; z-index: 2;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(148, 122, 75, 0.06) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.5s ease;
}
body:hover .cursor-glow { opacity: 1; }

/* 12. MEDIA QUERIES */
@media (max-width: 1024px) {
  .glass-card { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
}
@media (max-width: 768px) {
  #presentation { padding-top: 5rem; padding-bottom: 3rem; min-height: 85vh; }
  #chi-sono, #ricerca, #attivita, #outreach { padding-top: 4rem; padding-bottom: 4rem; }
  #pubblicazioni { padding-top: 5rem; padding-bottom: 5rem; }
  #contatti { padding-top: 4rem; padding-bottom: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .section-animate { opacity: 1; transform: none; }
  .cursor-glow { display: none; }
}
@media print {
  .no-print, header, footer, nav, #mobile-menu { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  a { text-decoration: underline; color: black; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
  section { page-break-inside: avoid; }
}
/* HERO SECTION BACKGROUND - STILE ACACEMICO FADED */
#presentation {
    background: 
        linear-gradient(to right, 
            rgba(255, 255, 255, 0.99) 0%,
            rgba(255, 255, 255, 0.93) 50%,
            rgba(248, 250, 252, 0.70) 100%
        ),
        url('banner.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #ffffff;
}



        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --parchment: #f5f0e8;
            --parchment-dark: #e8e0d0;
            --ink: #2c2416;
            --ink-light: #5a4d3a;
            --gold: #b8963e;
            --gold-light: #d4b86a;
            --gold-glow: rgba(184, 150, 62, 0.3);
            --crimson: #8b2e2e;
            --crimson-light: #a84040;
            --shadow: rgba(44, 36, 22, 0.12);
            --shadow-strong: rgba(44, 36, 22, 0.25);
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
            background: var(--parchment);
            color: var(--ink);
            min-height: 100vh;
            overflow-x: hidden;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(ellipse at 20% 50%, rgba(184, 150, 62, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(139, 46, 46, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(184, 150, 62, 0.05) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }

        /* Noise texture overlay */
        body::after {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0.03;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
            pointer-events: none;
            z-index: 0;
        }

        /* Header */
        .header {
            position: relative;
            z-index: 1;
            text-align: center;
            padding: 4rem 2rem 2rem;
        }

        .header-ornament {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            opacity: 0;
            animation: fadeInDown 1s ease 0.2s forwards;
        }

        .ornament-line {
            width: 80px;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--gold), transparent);
        }

        .ornament-diamond {
            width: 8px;
            height: 8px;
            background: var(--gold);
            transform: rotate(45deg);
            flex-shrink: 0;
        }

        .header-label {
            font-family: 'Inter', sans-serif;
            font-size: 0.75rem;
            font-weight: 500;
            letter-spacing: 0.3em;
            text-transform: uppercase;
            color: var(--gold);
            margin-bottom: 0.5rem;
            opacity: 0;
            animation: fadeInDown 1s ease 0.4s forwards;
        }

        .header-title {
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-size: clamp(3rem, 8vw, 6rem);
            font-weight: 300;
            letter-spacing: 0.05em;
            color: var(--ink);
            line-height: 1;
            margin-bottom: 0.3rem;
            opacity: 0;
            animation: fadeInDown 1s ease 0.6s forwards;
        }

        .header-folio {
            font-family: 'Inter', sans-serif;
            font-size: 0.85rem;
            font-weight: 400;
            color: var(--ink-light);
            letter-spacing: 0.15em;
            opacity: 0;
            animation: fadeInDown 1s ease 0.8s forwards;
        }

        .header-folio span {
            color: var(--gold);
            font-weight: 600;
        }

        /* Proemio Banner */
        .proemio-banner {
            position: relative;
            z-index: 1;
            max-width: 700px;
            margin: 2rem auto 3rem;
            padding: 1.5rem 2rem;
            background: linear-gradient(135deg, rgba(184, 150, 62, 0.08), rgba(184, 150, 62, 0.03));
            border: 1px solid rgba(184, 150, 62, 0.2);
            border-radius: 4px;
            text-align: center;
            opacity: 0;
            animation: fadeInUp 1s ease 1s forwards;
        }

        .proemio-label {
            font-family: 'Inter', sans-serif;
            font-size: 0.65rem;
            font-weight: 600;
            letter-spacing: 0.35em;
            text-transform: uppercase;
            color: var(--gold);
            margin-bottom: 0.4rem;
        }

        .proemio-text {
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-size: 1.25rem;
            font-weight: 400;
            font-style: italic;
            color: var(--ink-light);
        }

        /* Navigation */
        .nav-bar {
            position: sticky;
            top: 0;
            z-index: 100;
            background: rgba(245, 240, 232, 0.92);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(184, 150, 62, 0.15);
            padding: 0.75rem 1rem;
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            transition: box-shadow 0.3s ease;
        }

        .nav-bar.scrolled {
            box-shadow: 0 4px 20px var(--shadow);
        }

        .nav-btn {
            font-family: 'Inter', sans-serif;
            font-size: 0.7rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--ink-light);
            background: transparent;
            border: 1px solid transparent;
            padding: 0.4rem 0.8rem;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
        }

        .nav-btn:hover, .nav-btn.active {
            color: var(--gold);
            border-color: rgba(184, 150, 62, 0.3);
            background: rgba(184, 150, 62, 0.05);
        }

        /* Timeline Container */
        .timeline-container {
            position: relative;
            z-index: 1;
            max-width: 900px;
            margin: 0 auto;
            padding: 2rem 1.5rem 4rem;
        }

        /* Progress indicator */
        .timeline-progress {
            position: absolute;
            left: 50%;
            top: 2rem;
            bottom: 4rem;
            width: 2px;
            background: var(--parchment-dark);
            transform: translateX(-50%);
        }

        .timeline-progress-fill {
            width: 100%;
            height: 0%;
            background: linear-gradient(to bottom, var(--gold-light), var(--gold));
            transition: height 0.3s ease;
            border-radius: 1px;
        }

        /* Chapter Card */
        .chapter-block {
            position: relative;
            margin-bottom: 3rem;
            opacity: 0;
            transform: translateY(30px);
            transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .chapter-block.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .chapter-header {
            display: flex;
            align-items: center;
            gap: 1.5rem;
            margin-bottom: 1rem;
            cursor: pointer;
            user-select: none;
        }

        .chapter-number {
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-size: 1rem;
            font-weight: 600;
            color: var(--gold);
            letter-spacing: 0.1em;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .chapter-title-group {
            flex: 1;
        }

        .chapter-title {
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-size: clamp(1.3rem, 3vw, 1.7rem);
            font-weight: 400;
            color: var(--ink);
            line-height: 1.3;
            transition: color 0.3s ease;
        }

        .chapter-title em {
            font-style: italic;
            color: var(--ink-light);
        }

        .chapter-toggle {
            width: 32px;
            height: 32px;
            border: 1px solid rgba(184, 150, 62, 0.3);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.3s ease;
        }

        .chapter-toggle svg {
            width: 14px;
            height: 14px;
            stroke: var(--gold);
            transition: transform 0.3s ease;
        }

        .chapter-block.open .chapter-toggle svg {
            transform: rotate(180deg);
        }

        .chapter-block.open .chapter-toggle {
            background: rgba(184, 150, 62, 0.1);
            border-color: var(--gold);
        }

        /* Folio Cards */
        .folio-cards {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .chapter-block.open .folio-cards {
            max-height: 800px;
        }

        .folio-grid {
            display: grid;
            gap: 0.5rem;
            padding-left: 2.5rem;
            padding-right: 1rem;
        }

        .folio-card {
            display: flex;
            align-items: stretch;
            background: white;
            border: 1px solid rgba(44, 36, 22, 0.08);
            border-radius: 4px;
            overflow: hidden;
            transition: all 0.3s ease;
            opacity: 0;
            transform: translateX(-10px);
        }

        .chapter-block.open .folio-card {
            opacity: 1;
            transform: translateX(0);
        }

        .folio-card:nth-child(1) { transition-delay: 0.1s; }
        .folio-card:nth-child(2) { transition-delay: 0.15s; }
        .folio-card:nth-child(3) { transition-delay: 0.2s; }
        .folio-card:nth-child(4) { transition-delay: 0.25s; }
        .folio-card:nth-child(5) { transition-delay: 0.3s; }
        .folio-card:nth-child(6) { transition-delay: 0.35s; }

        .folio-card:hover {
            border-color: rgba(184, 150, 62, 0.3);
            box-shadow: 0 4px 16px var(--shadow);
            transform: translateY(-1px);
        }

        .folio-marker {
            width: 56px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(184, 150, 62, 0.1), rgba(184, 150, 62, 0.04));
            border-right: 1px solid rgba(44, 36, 22, 0.06);
            flex-shrink: 0;
        }

        .folio-marker-text {
            font-family: 'Inter', sans-serif;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--gold);
            letter-spacing: 0.05em;
        }

        .folio-body {
            flex: 1;
            padding: 0.75rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .folio-status {
            font-family: 'Inter', sans-serif;
            font-size: 0.65rem;
            font-weight: 500;
            letter-spacing: 0.2em;
            text-transform: uppercase;
        }

        .folio-status.start {
            color: var(--crimson);
        }

        .folio-status.end {
            color: var(--crimson-light);
        }

        .folio-status.mid {
            color: var(--ink-light);
            opacity: 0.5;
        }

        .folio-status.transition {
            color: var(--gold);
        }

        .folio-desc {
            font-family: 'EB Garamond', Georgia, serif;
            font-size: 0.95rem;
            color: var(--ink-light);
            line-height: 1.5;
        }

        /* Transition badge */
        .transition-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            font-family: 'Inter', sans-serif;
            font-size: 0.6rem;
            font-weight: 500;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--gold);
            background: rgba(184, 150, 62, 0.08);
            padding: 0.15rem 0.5rem;
            border-radius: 2px;
            margin-top: 0.15rem;
        }

        .transition-badge svg {
            width: 10px;
            height: 10px;
            stroke: var(--gold);
        }

        /* Folio range indicator */
        .folio-range {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0;
            margin-top: 0.75rem;
            padding-left: 2.5rem;
        }

        .folio-range-bar {
            flex: 1;
            height: 3px;
            background: var(--parchment-dark);
            border-radius: 2px;
            position: relative;
            overflow: hidden;
        }

        .folio-range-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--gold-light), var(--gold));
            border-radius: 2px;
            transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .folio-range-label {
            font-family: 'Inter', sans-serif;
            font-size: 0.65rem;
            font-weight: 500;
            color: var(--ink-light);
            letter-spacing: 0.1em;
            white-space: nowrap;
        }

        /* Decorative divider */
        .chapter-divider {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            padding: 1rem 0;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        .chapter-divider.visible {
            opacity: 1;
        }

        .divider-dot {
            width: 4px;
            height: 4px;
            background: var(--gold-light);
            border-radius: 50%;
        }

        .divider-line {
            width: 40px;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(184, 150, 62, 0.3), transparent);
        }

        /* Footer */
        .footer {
            position: relative;
            z-index: 1;
            text-align: center;
            padding: 3rem 2rem;
            border-top: 1px solid rgba(184, 150, 62, 0.15);
        }

        .footer-ornament {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .footer-text {
            font-family: 'Inter', sans-serif;
            font-size: 0.7rem;
            font-weight: 400;
            color: var(--ink-light);
            letter-spacing: 0.1em;
        }

        .footer-folio-summary {
            font-family: 'Cormorant Garamond', Georgia, serif;
            font-size: 1.1rem;
            font-weight: 400;
            color: var(--ink);
            margin-top: 0.5rem;
        }

        .footer-folio-summary span {
            color: var(--gold);
            font-weight: 600;
        }

        /* Scroll to top */
        .scroll-top {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: var(--ink);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.3s ease;
            z-index: 50;
            box-shadow: 0 4px 20px rgba(44, 36, 22, 0.3);
        }

        .scroll-top.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .scroll-top svg {
            width: 18px;
            height: 18px;
            stroke: var(--parchment);
        }

        .scroll-top:hover {
            background: var(--gold);
            transform: translateY(-2px);
        }

        /* Animations */
        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes shimmer {
            0% { background-position: -200% center; }
            100% { background-position: 200% center; }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .header {
                padding: 3rem 1.5rem 1.5rem;
            }

            .timeline-container {
                padding: 1.5rem 1rem 3rem;
            }

            .chapter-header {
                gap: 1rem;
            }

            .folio-grid {
                padding-left: 1rem;
                padding-right: 0;
            }

            .folio-range {
                padding-left: 1rem;
            }

            .nav-btn {
                font-size: 0.6rem;
                padding: 0.35rem 0.5rem;
            }

            .folio-marker {
                width: 44px;
            }
        }

        @media (max-width: 480px) {
            .chapter-number {
                font-size: 0.85rem;
            }

            .chapter-title {
                font-size: 1.15rem;
            }

            .proemio-banner {
                margin: 1.5rem 1rem 2rem;
            }
        }

        /* Expanded all button */
        .expand-all-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin: 0 auto 2rem;
            font-family: 'Inter', sans-serif;
            font-size: 0.7rem;
            font-weight: 500;
            letter-spacing: 0.2em;
            text-transform: uppercase;
            color: var(--gold);
            background: transparent;
            border: 1px solid rgba(184, 150, 62, 0.3);
            padding: 0.6rem 1.5rem;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .expand-all-btn:hover {
            background: rgba(184, 150, 62, 0.08);
            border-color: var(--gold);
        }

        .expand-all-btn svg {
            width: 14px;
            height: 14px;
            stroke: var(--gold);
            transition: transform 0.3s ease;
        }

        .expand-all-btn.expanded svg {
            transform: rotate(180deg);
        }

        /* View mode toggle */
        .view-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.25rem;
            margin-bottom: 2rem;
        }

        .view-btn {
            width: 36px;
            height: 36px;
            border: 1px solid rgba(184, 150, 62, 0.2);
            background: transparent;
            border-radius: 3px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .view-btn.active {
            background: rgba(184, 150, 62, 0.1);
            border-color: var(--gold);
        }

        .view-btn svg {
            width: 16px;
            height: 16px;
            stroke: var(--ink-light);
        }

        .view-btn.active svg {
            stroke: var(--gold);
        }

        /* Compact view */
        .timeline-container.compact .chapter-block {
            margin-bottom: 1.5rem;
        }

        .timeline-container.compact .folio-cards {
            display: none;
        }

        .timeline-container.compact .folio-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            padding-left: 2.5rem;
        }

        .timeline-container.compact .chapter-block.open .folio-cards {
            max-height: 800px;
            display: block;
        }

        .timeline-container.compact .chapter-block.open .folio-grid {
            display: grid;
        }

        .timeline-container.compact .folio-card {
            flex-direction: column;
        }

        .timeline-container.compact .folio-marker {
            width: 100%;
            border-right: none;
            border-bottom: 1px solid rgba(44, 36, 22, 0.06);
            padding: 0.25rem;
        }

        /* Timeline vertical line - mobile hide */
        @media (max-width: 768px) {
            .timeline-progress {
                left: 1.5rem;
            }
        }
