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

:root {
  --bg:           #0a0910;
  --bg-alt:       #0f0d1a;
  --border:       rgba(255, 255, 255, 0.08);
  --accent:       #b89ff0;
  --accent-dim:   rgba(184, 159, 240, 0.12);
  --text-1:       #f0ecff;
  --text-2:       #a09ab8;
  --text-3:       #5a5472;
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --max-w:        1080px;
  --pad:          40px;
  --transition:   0.25s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

a {
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--text-1); }

/* ============================================
   NOISE
   ============================================ */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ============================================
   PRELOADER
   ============================================ */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pre-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  width: 280px;
}

.pre-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-1);
  letter-spacing: 0.01em;
}

.pre-bar {
  width: 100%;
  height: 1px;
  background: var(--border);
}

.pre-fill {
  height: 1px;
  width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}

/* ============================================
   REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ============================================
   LAYOUT
   ============================================ */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--border);
}

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

.hero-glow {
  position: absolute;
  top: -160px;
  left: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse at center,
    rgba(155, 127, 232, 0.1) 0%,
    transparent 65%);
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  bottom: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(155, 127, 232, 0.06) 0%,
    transparent 65%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-left {}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  opacity: 0.85;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text-1);
  margin-bottom: 12px;
}

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

.hero-role {
  font-size: 1rem;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 36px;
}

.hero-bio {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text-2);
  font-weight: 300;
  max-width: 480px;
  margin-bottom: 48px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8125rem;
  color: var(--text-2);
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.hero-link:hover {
  border-color: rgba(184, 159, 240, 0.3);
  color: var(--text-1);
  background: rgba(184, 159, 240, 0.05);
}

.hero-link.primary {
  background: rgba(184, 159, 240, 0.1);
  border-color: rgba(184, 159, 240, 0.25);
  color: var(--text-1);
}

.hero-link.primary:hover {
  background: rgba(184, 159, 240, 0.18);
  border-color: rgba(184, 159, 240, 0.5);
}

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero-info-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.hero-info-block:first-child {
  padding-top: 0;
  border-top: 1px solid var(--border);
}

.hero-info-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.hero-info-value {
  font-size: 0.9375rem;
  color: var(--text-1);
  font-weight: 400;
}

.hero-info-value a {
  color: var(--text-1);
}

.hero-info-value a:hover {
  color: var(--accent);
}

/* ============================================
   INTRO (rimosso, sostituito da hero)
   ============================================ */

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 80px 0;
}

.section-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 60px;
  align-items: start;
}

.section-label {
  position: sticky;
  top: 40px;
}

.label-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-1);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ============================================
   LIST
   ============================================ */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.list-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition);
}

.list-item:first-child {
  padding-top: 0;
}

.list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.list-item:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.item-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.3;
}

.item-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.item-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.9;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.item-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 8px;
}

.item-desc {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.8;
  font-weight: 300;
  margin-top: 10px;
}

.item-stack {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* ============================================
   SKILLS
   ============================================ */
.skill-group {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.skill-group:first-child {
  padding-top: 0;
}

.skill-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.inline-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}

.inline-list li {
  font-size: 0.9375rem;
  color: var(--text-2);
  font-weight: 300;
}

.inline-list li:not(:last-child)::after {
  content: ',';
  margin-right: 7px;
  color: var(--text-3);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 44px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-2);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
}

.footer-links a {
  color: var(--text-3);
}

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

.footer-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--text-3);
  border-radius: 4px;
}

::selection {
  background: rgba(184, 159, 240, 0.25);
  color: var(--text-1);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .hero-right {
    border-top: 1px solid var(--border);
    padding-top: 0;
  }

  .hero-info-block:first-child {
    border-top: none;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .section-label {
    position: static;
  }
}

@media (max-width: 640px) {
  :root { --pad: 20px; }

  .hero {
    min-height: auto;
    padding: 80px 0 70px;
  }

  .hero-name {
    font-size: 2.5rem;
  }

  .section { padding: 56px 0; }

  .item-head {
    flex-direction: column;
    gap: 4px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}