/* ================================
   Alessio Bertolini - Personal Website
   Refined Dark Minimal Theme
   ================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sora:wght@300;400;500;600;700&display=swap');

:root {
  /* Colors - Refined palette */
  --bg-primary: #09090b;
  --bg-secondary: #0f0f12;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-card-solid: #111114;
  --bg-card-hover: rgba(255, 255, 255, 0.04);
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  
  /* Accent - Warm gold/amber */
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dim: rgba(245, 158, 11, 0.1);
  --accent-glow: rgba(245, 158, 11, 0.15);
  
  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(245, 158, 11, 0.3);
  
  /* Gradients */
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-glow: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(245, 158, 11, 0.1);
  --shadow-glow-strong: 0 0 80px rgba(245, 158, 11, 0.2);
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-medium: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
  
  /* Blur */
  --blur-sm: 8px;
  --blur-md: 20px;
  --blur-lg: 40px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================================
   Background Effects
   ================================ */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 80% 50% at 20% -20%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(255, 255, 255, 0.01) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Subtle noise texture */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: -1;
}

/* ================================
   Typography
   ================================ */
h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 500;
}

h4 {
  font-size: 1rem;
  font-weight: 500;
}

p {
  color: var(--text-secondary);
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================================
   Layout
   ================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-narrow {
  max-width: 750px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ================================
   Navigation
   ================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border-bottom: 1px solid transparent;
  transition: var(--transition-medium);
}

.nav.scrolled {
  background: rgba(9, 9, 11, 0.85);
  border-bottom-color: var(--border);
}

.nav-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition-fast);
  letter-spacing: -0.01em;
}

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

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

.nav-links a {
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--text-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gradient-accent);
  transition: var(--transition-medium);
  border-radius: 1px;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.nav-toggle:hover {
  background: var(--bg-card);
}

.nav-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: var(--transition-fast);
}

/* Mobile Nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--blur-lg));
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: var(--transition-medium);
    border-left: 1px solid var(--border);
  }
  
  .nav-links.open {
    right: 0;
  }
  
  .nav-links a {
    font-size: 1.1rem;
  }
}

/* ================================
   Hero Section (Home)
   ================================ */
.hero-linktree {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
}

/* Hero glow effect */
.hero-linktree::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: var(--gradient-glow);
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.5;
}

.hero-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: fadeInScale 0.8s var(--ease-out) forwards;
  box-shadow: 
    0 0 0 4px var(--bg-primary),
    var(--shadow-glow);
  position: relative;
  z-index: 1;
}

.hero-name {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.1s forwards;
}

.hero-name .accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s forwards;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ================================
   Link Buttons
   ================================ */
.linktree-links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  background: var(--gradient-card);
  backdrop-filter: blur(var(--blur-sm));
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition-medium);
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) forwards;
  position: relative;
  overflow: hidden;
}

.link-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition-medium);
}

.link-btn:nth-child(1) { animation-delay: 0.3s; }
.link-btn:nth-child(2) { animation-delay: 0.4s; }
.link-btn:nth-child(3) { animation-delay: 0.5s; }
.link-btn:nth-child(4) { animation-delay: 0.6s; }

.link-btn:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.link-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  transition: var(--transition-fast);
  position: relative;
  z-index: 1;
}

.link-btn span,
.link-btn {
  position: relative;
  z-index: 1;
}

.link-btn.primary {
  background: var(--gradient-accent);
  border-color: transparent;
  color: var(--bg-primary);
  font-weight: 600;
}

.link-btn.primary svg {
  stroke: var(--bg-primary);
}

.link-btn.primary:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-3px) scale(1.02);
}

/* ================================
   Social Links
   ================================ */
.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.8s forwards;
}

.social-link {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: var(--transition-medium);
}

.social-link:hover {
  border-color: var(--border-accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

.social-link svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  transition: var(--transition-fast);
}

.social-link:hover svg {
  stroke: var(--accent);
}

/* ================================
   Page Header
   ================================ */
.page-header {
  padding: 9rem 2rem 4rem;
  text-align: center;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: var(--gradient-glow);
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.4;
}

.page-header h1 {
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) forwards;
  position: relative;
}

.page-header p {
  font-size: 1.05rem;
  max-width: 550px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-out) 0.1s forwards;
  position: relative;
}

/* ================================
   Sections
   ================================ */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.section-title h2::before,
.section-title h2::after {
  content: '';
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover));
}

.section-title h2::after {
  background: linear-gradient(90deg, var(--border-hover), transparent);
}

/* ================================
   Cards
   ================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--gradient-card);
  backdrop-filter: blur(var(--blur-sm));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  transition: var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
  opacity: 0;
  transition: var(--transition-medium);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 14px;
  margin-bottom: 1.25rem;
}

.card-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ================================
   Tech Stack Tags
   ================================ */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.tech-tag {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 450;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.tech-tag:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ================================
   Gallery
   ================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9,9,11,0.9) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: var(--transition-medium);
}

.gallery-item:hover {
  border-color: var(--border-hover);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ================================
   Timeline
   ================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 2rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 11px;
  height: 11px;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translateX(0);
  box-shadow: 0 0 0 4px var(--bg-primary);
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.375rem;
  letter-spacing: 0.02em;
}

.timeline-item h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.timeline-item > p:last-child {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ================================
   Contact Cards
   ================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: var(--transition-medium);
}

.contact-card:hover {
  border-color: var(--border-accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.contact-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 12px;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.contact-card:hover .contact-icon {
  background: var(--accent);
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  transition: var(--transition-fast);
}

.contact-card:hover .contact-icon svg {
  stroke: var(--bg-primary);
}

.contact-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-info strong {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.promo-btn.coming-soon {
  background: linear-gradient(135deg, #444 0%, #555 100%);
  color: #aaa;
  cursor: default;
  pointer-events: none;
}

/* ================================
   Footer
   ================================ */
.footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: var(--bg-secondary);
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

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

/* ================================
   Animations
   ================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s var(--ease-out) forwards;
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s var(--ease-out) forwards;
}

/* Stagger */
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.35s; }

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
  .container, .container-narrow {
    padding: 0 1.25rem;
  }
  
  .page-header {
    padding: 8rem 1.25rem 3rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .cards-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline {
    padding-left: 1.5rem;
  }
  
  .timeline::before {
    left: 4px;
  }
  
  .section-title h2::before,
  .section-title h2::after {
    display: none;
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
  }
}

/* ================================
   Utilities
   ================================ */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Selection */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   LIBRO 3D - SOLO ANIMAZIONE AUTOMATICA
   ═══════════════════════════════════════════════════════════ */

.book-3d-container {
  perspective: 1500px;
  width: 280px;
  height: 400px;
}

.book-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: book-float 6s ease-in-out infinite;
}

@keyframes book-float {
  0%, 100% { 
    transform: rotateY(-25deg) rotateX(5deg) translateY(0px); 
  }
  50% { 
    transform: rotateY(-15deg) rotateX(3deg) translateY(-15px); 
  }
}

.book-face {
  position: absolute;
  backface-visibility: hidden;
}

/* Copertina frontale */
.book-front {
  width: 280px;
  height: 400px;
  transform: translateZ(12px);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.book-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Retro */
.book-back {
  width: 280px;
  height: 400px;
  transform: translateZ(-12px) rotateY(180deg);
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 8px 0 0 8px;
}

/* Dorso */
.book-spine {
  width: 24px;
  height: 400px;
  left: -12px;
  transform: rotateY(-90deg) translateZ(0px);
  background: linear-gradient(to right, #1a1a1a, #333, #1a1a1a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-spine::after {
  content: 'Ricordami così';
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: #f5f0e8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
}

/* Pagine (lato destro) - CORRETTO */
.book-pages {
  width: 24px;
  height: 390px;
  top: 5px;
  left: 268px;
  transform: rotateY(90deg);
  background: linear-gradient(to right, 
    #f5f0e8 0%, #fff 10%, #f5f0e8 20%,
    #fff 30%, #f5f0e8 40%, #fff 50%,
    #f5f0e8 60%, #fff 70%, #f5f0e8 80%,
    #fff 90%, #f5f0e8 100%
  );
}

/* Sopra */
.book-top {
  width: 280px;
  height: 24px;
  top: -12px;
  transform: rotateX(90deg) translateZ(0);
  background: linear-gradient(to bottom, #f5f0e8, #e8e0d0);
}

/* Sotto */
.book-bottom {
  width: 280px;
  height: 24px;
  bottom: -12px;
  transform: rotateX(-90deg) translateZ(0);
  background: linear-gradient(to top, #f5f0e8, #e8e0d0);
}

/* Ombra */
.book-shadow {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%) rotateX(90deg);
  width: 250px;
  height: 80px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.4) 0%, transparent 70%);
  filter: blur(10px);
}

/* Glow candela */
.candle-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 180, 80, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  animation: flicker 3s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@media (max-width: 900px) {
  .book-3d-container {
    width: 220px;
    height: 320px;
  }
  .book-front, .book-back {
    width: 220px;
    height: 320px;
  }
  .book-spine {
    height: 320px;
  }
  .book-pages {
    height: 310px;
    left: 208px;
    transform: rotateY(90deg);
  }
  .book-top, .book-bottom {
    width: 220px;
  }
}