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

:root {
  --navbar-h:       56px;
  --color-bg:       #0d0d0d;
  --color-surface:  #161616;
  --color-surface2: #1e1e1e;
  --color-accent:   #6c63ff;
  --color-accent2:  #ff6584;
  --color-text:     #e8e8e8;
  --color-muted:    #888;
  --color-border:   #2a2a2a;
  --radius:         12px;
  --transition:     0.3s ease;
  --font:           'Segoe UI', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

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

/* =============================================
   NAVBAR
   ============================================= */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 1px;
}

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

.nav-links a {
  font-size: 0.95rem;
  color: var(--color-muted);
  transition: color var(--transition);
  cursor: pointer;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* =============================================
   HERO
   ============================================= */
#hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--navbar-h) + 2rem) 3rem 2rem;
  background: radial-gradient(ellipse at 40% 50%, rgba(108,99,255,0.14) 0%, transparent 65%),
              radial-gradient(ellipse at 80% 20%, rgba(255,101,132,0.08) 0%, transparent 50%);
  position: relative;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  max-width: 860px;
  width: 100%;
}

/* ── Foto ── */
.hero-photo {
  flex-shrink: 0;
  animation: heroPhotoIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.avatar-placeholder {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: var(--color-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

/* Se usi un <img> invece del placeholder: */
.hero-photo img {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ── Testo ── */
.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  /* Animazione sul contenitore: il testo sfumato viene rasterizzato
     una sola volta → niente scatti sul nome col gradiente */
  animation: heroSlideIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.16s both;
}

.hero-name {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--color-muted);
  max-width: 420px;
  line-height: 1.6;
}

/* ── Animazioni hero ── */
@keyframes heroPhotoIn {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes heroSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.8rem 2.2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* =============================================
   LOADER (AJAX simulato)
   ============================================= */
#loader {
  display: none;
}

#hero.hidden {
  display: none;
}

#main-content {
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  bottom: 0;
}

/* =============================================
   SEZIONI
   ============================================= */
.section {
  height: 100%;
  padding: 1.5rem 2rem 1rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.section::-webkit-scrollbar {
  width: 5px;
}

.section::-webkit-scrollbar-track {
  background: transparent;
}

.section::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

.section.hidden {
  display: none;
}

.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

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

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

.section.leaving,
#hero.leaving {
  animation: fadeOut 0.4s ease forwards;
  pointer-events: none;
}

.section.entering,
#hero.entering {
  animation: fadeIn 0.55s ease both;
}

.section-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  border-radius: 999px;
}

/* =============================================
   CHI SONO
   ============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.about-text p + p {
  margin-top: 0.5rem;
}

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

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.18);
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* =============================================
   TIMELINE
   ============================================= */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0.55rem;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 0.8rem;
}

.timeline-dot {
  position: absolute;
  left: -2.05rem;
  top: 0.45rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.25);
}

.timeline-date {
  font-size: 0.7rem;
  color: var(--color-accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.15rem;
}

.timeline-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  transition: border-color var(--transition);
}

.timeline-content:hover {
  border-color: var(--color-accent);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(108,99,255,0.15);
}

.timeline-content h3 {
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
}

.timeline-content p {
  color: var(--color-muted);
  font-size: 0.8rem;
}

/* =============================================
   HOBBY — CARD GRID
   ============================================= */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.hobby-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.hobby-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.18);
}

.hobby-card-icon {
  font-size: 2rem;
  line-height: 1;
}

.hobby-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
}

.hobby-card-desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.55;
  flex: 1;
}

.hobby-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.hobby-tag {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* =============================================
   PERCORSO IT — JOURNEY
   ============================================= */
.journey-steps {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.journey-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.2rem;
  align-items: start;
}

.journey-step-year {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-top: 0.75rem;
  text-align: right;
}

.journey-step-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.journey-step-content:hover {
  border-color: var(--color-accent);
  transform: translateX(4px);
  box-shadow: 0 4px 18px rgba(108,99,255,0.15);
}

.journey-step-content h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.journey-step-content p {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tech-badge {
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* =============================================
   OBIETTIVI & ASPIRAZIONI
   ============================================= */
.goals-intro {
  color: var(--color-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.goal-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.goal-card:hover {
  border-color: var(--color-accent);
  transform: translateX(5px);
  box-shadow: 0 4px 18px rgba(108,99,255,0.15);
}

.goal-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.3;
}

.goal-text h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.goal-text p {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.5;
}


/* =============================================
   LGBT & ME
   ============================================= */
#lgbt {
  background: linear-gradient(
    160deg,
    rgba(255,30,0,0.35)    0%,
    rgba(255,140,0,0.32)   20%,
    rgba(255,230,0,0.28)   38%,
    rgba(0,200,60,0.28)    54%,
    rgba(0,80,255,0.32)    72%,
    rgba(160,0,255,0.38)   100%
  ), var(--color-bg);
}

#lgbt .section-title {
  background: linear-gradient(135deg, #FF0018, #FFA52C, #FFFF41 45%, #008018, #0000F9, #8B00FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#lgbt .section-title::after {
  background: linear-gradient(90deg, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #8B00FF);
  width: 100%;
}

.lgbt-story {
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin-bottom: 1.2rem;
  background: linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
              linear-gradient(135deg, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #8B00FF) border-box;
  border: 2px solid transparent;
}

.lgbt-story h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  background: linear-gradient(90deg, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #8B00FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.lgbt-story p + p {
  margin-top: 0.5rem;
}

.lgbt-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  background: linear-gradient(90deg, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #8B00FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.flag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.flag-card {
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  background: linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
              linear-gradient(135deg, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #8B00FF) border-box;
  border: 2px solid transparent;
}

.flag-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(139,0,255,0.2);
}

.flag-visual {
  display: flex;
  flex-direction: column;
  height: 80px;
}

.flag-visual div {
  flex: 1;
}

.flag-info {
  padding: 0.7rem 1rem;
}

.flag-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.flag-info ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.flag-info li {
  font-size: 0.78rem;
  color: var(--color-muted);
}

/* =============================================
   CONTATTI
   ============================================= */
.contact-intro {
  color: var(--color-muted);
  margin-bottom: 0.8rem;
  font-size: 0.88rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.contact-card:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.2);
}

.contact-icon {
  font-size: 1.1rem;
}

/* =============================================
   FOOTER
   ============================================= */
#footer {
  text-align: center;
  padding: 2rem;
  color: var(--color-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-surface);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
    gap: 1rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 1.8rem;
  }

  .hero-text {
    align-items: center;
  }

  .avatar-placeholder,
  .hero-photo img {
    width: 140px;
    height: 140px;
  }

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

  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .stat-card {
    min-width: 130px;
  }

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

  .journey-step {
    grid-template-columns: 60px 1fr;
    gap: 0.8rem;
  }
}

