:root{
  --bg:          #FAF7EC;
  --paper:       #FFFFFF;
  --dark:        #17150F;
  --dark-2:      #201C13;
  --ink:         #1B1A14;
  --ink-soft:    #4A4736;

  --yellow:      #FFDA47;
  --yellow-deep: #E6B816;
  --yellow-soft: #FFF3C2;

  --line:        rgba(27,26,20,.12);
  --line-dark:   rgba(255,255,255,.12);

  --shadow:      0 20px 50px -18px rgba(23,21,15,.3);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --ease: cubic-bezier(.22,1,.36,1);
}

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

html{
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3{
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -.01em;
}

p{ margin: 0; }
ul{ list-style: none; margin: 0; padding: 0; }
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
button{ font-family: inherit; cursor: pointer; }

::selection{ background: var(--yellow); color: var(--ink); }

:focus-visible{
  outline: 2px solid var(--yellow-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* NAVBAR */
.nav{
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 6vw;
  background: rgba(250,247,236,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav__brand{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.nav__links{
  display: flex;
  gap: 28px;
}

.nav__link{
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 2px;
  transition: color .25s var(--ease);
}

.nav__link::after{
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--yellow-deep);
  transition: width .3s var(--ease);
}

.nav__link:hover{ color: var(--ink); }
.nav__link:hover::after{ width: 100%; }

.nav__toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}

.nav__toggle span{
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* HERO / PASSPORT */
.hero{
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 110px 6vw 40px;
  overflow: hidden;
}

.hero__glow{
  position: absolute;
  top: -10%;
  left: 50%;
  width: 700px;
  height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--yellow-soft) 0%, rgba(255,218,71,0) 65%);
  pointer-events: none;
  z-index: 0;
}

.passport{
  position: relative;
  z-index: 1;
  width: min(840px, 100%);
  perspective: 1400px;
}

.passport__inner{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 8px;
  transform-style: preserve-3d;
  transition: transform .4s var(--ease);
}

.passport__topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px dashed var(--line);
}

.passport__country,
.passport__type{
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.passport__type{
  background: var(--yellow-soft);
  color: #6B5504;
  padding: 3px 8px;
  border-radius: 999px;
}

.passport__body{
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 22px 20px 24px;
}

.passport__photo{
  position: relative;
  background: linear-gradient(180deg, var(--yellow-soft), #FFFFFF 70%);
  border-radius: 14px;
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  min-height: 210px;
}

.passport__photo img{
  width: auto;
  height: 230px;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 12px rgba(23,21,15,.2));
}

.passport__stamp{
  position: absolute;
  top: 12px;
  right: -32px;
  transform: rotate(30deg);
  background: rgba(23,21,15,.9);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .1em;
  padding: 3px 35px;
}

.passport__data{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.passport__field{
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.passport__label{
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

.passport__value{
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.passport__value--big{
  font-size: 1.45rem;
}

.passport__value--available{
  color: #7A6300;
  position: relative;
  padding-left: 14px;
  font-size: .92rem;
}

.passport__value--available::before{
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--yellow-deep);
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

.passport__code{
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.hero__scroll-hint{
  margin-top: 24px;
  font-size: .78rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

/* SECTIONS - Ridotto lo spazio vuoto per compattare il layout */
.section{
  padding: 70px 6vw;
  max-width: 1120px;
  margin: 0 auto;
}

.section--dark{
  max-width: none;
  background: var(--dark);
  color: #F4F1E4;
  padding: 70px 6vw;
}

.section--dark .section__inner{
  max-width: 1120px;
  margin: 0 auto;
}

.section__head{
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 32px;
}

.section__index{
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--yellow-deep);
}

.section--dark .section__index{ color: var(--yellow); }

.section__title{
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 700;
}

/* reveal on scroll */
.reveal{
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ABOUT */
.about__grid{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: start;
}

.about__text{
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.about__text strong{ color: var(--ink); }

.about__facts{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fact{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.fact__icon{ font-size: 1.2rem; }

.fact__title{
  display: block;
  font-weight: 600;
  font-size: .92rem;
}

.fact__desc{
  display: block;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* PROJECTS SECTION */
.projects__grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}

.project-card:hover{
  transform: translateY(-3px);
  border-color: var(--yellow-deep);
}

.project-card__badge{
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .06em;
  color: #6B5504;
  background: var(--yellow-soft);
  padding: 3px 8px;
  border-radius: 999px;
  width: fit-content;
}

.project-card__title{
  font-size: 1.15rem;
  font-weight: 700;
}

.project-card__desc{
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.project-card__link{
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--yellow-deep);
  font-weight: 600;
  width: fit-content;
}

.project-card__link:hover{ text-decoration: underline; }

.project-card__tag{
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--ink-soft);
}

/* SKILLS */
.skills__grid{
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 40px;
}

.skills__subtitle{
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--yellow);
}

.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag{
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  color: #F4F1E4;
}

.skill-row{ margin-bottom: 16px; }
.skill-row:last-child{ margin-bottom: 0; }

.skill-row__head{
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  margin-bottom: 6px;
}

.skill-row__meta{
  color: rgba(244,241,228,.55);
  font-family: var(--font-mono);
  font-size: .72rem;
}

.skill-bar{
  height: 8px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 9%, rgba(255,255,255,0) 9% 10%), rgba(255,255,255,.06);
  overflow: hidden;
}

.skill-bar__fill{
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--yellow-deep), var(--yellow));
  transition: width 1.1s var(--ease);
}

/* PASSIONS + MUSIC PLAYER */
.passions__grid{
  display: grid;
  grid-template-columns: .9fr 1.3fr;
  gap: 30px;
  align-items: start;
}

.passion-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.passion-list__item{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .98rem;
  color: var(--ink-soft);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.passion-list__icon{ font-size: 1.1rem; }

.player{
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--dark);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.player__art{
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(155deg, var(--yellow), var(--yellow-deep));
  display: flex;
  align-items: center;
  justify-content: center;
}

.player__bars{
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}

.player__bars span{
  width: 3px;
  border-radius: 2px;
  background: var(--dark);
  height: 20%;
}

.player.is-playing .player__bars span{
  animation: bounce 1s ease-in-out infinite;
}

.player__bars span:nth-child(1){ animation-delay: 0s; }
.player__bars span:nth-child(2){ animation-delay: .12s; }
.player__bars span:nth-child(3){ animation-delay: .24s; }
.player__bars span:nth-child(4){ animation-delay: .08s; }
.player__bars span:nth-child(5){ animation-delay: .2s; }

@keyframes bounce{
  0%, 100%{ height: 20%; }
  50%{ height: 95%; }
}

.player__info{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player__eyebrow{
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--yellow);
  letter-spacing: .06em;
}

.player__title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #F4F1E4;
}

.player__artist{
  font-size: .84rem;
  color: rgba(244,241,228,.6);
  margin-bottom: 8px;
}

.player__controls{
  display: flex;
  align-items: center;
  gap: 12px;
}

.player__play{
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--yellow);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease);
}

.player__play:hover{ transform: scale(1.06); }

.player__seek{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.player__time{
  font-family: var(--font-mono);
  font-size: .68rem;
  color: rgba(244,241,228,.55);
  flex: none;
}

.player__range{
  flex: 1;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(244,241,228,.18);
  outline: none;
}

.player__range::-webkit-slider-thumb{
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
}

.player__note{
  margin-top: 8px;
  font-size: .7rem;
  color: rgba(244,241,228,.5);
}

.player__note code{
  font-family: var(--font-mono);
  background: rgba(244,241,228,.1);
  padding: 1px 4px;
  border-radius: 3px;
}

/* CONTACT */
.contact__lead{
  max-width: 50ch;
  color: rgba(244,241,228,.65);
  margin-top: 10px;
  font-size: .98rem;
}

.contact__cards{
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.contact-card{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line-dark);
  background: var(--dark-2);
  color: #F4F1E4;
  text-align: left;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}

.contact-card:hover{
  transform: translateY(-3px);
  border-color: var(--yellow-deep);
}

.contact-card__icon{
  color: var(--yellow);
  margin-bottom: 4px;
}

.contact-card__label{
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .06em;
  color: rgba(244,241,228,.55);
}

.contact-card__value{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  word-break: break-word;
}

.contact-card__hint{
  position: absolute;
  top: 16px; right: 16px;
  font-size: .68rem;
  font-family: var(--font-mono);
  color: var(--yellow);
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.contact-card--action:hover .contact-card__hint,
.contact-card--action.is-copied .contact-card__hint{
  opacity: 1;
}

/* FOOTER */
.footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw 30px;
  font-size: .8rem;
  color: var(--ink-soft);
}

.footer__top{
  font-family: var(--font-mono);
  transition: color .2s var(--ease);
}
.footer__top:hover{ color: var(--yellow-deep); }

/* RESPONSIVE */
@media (max-width: 860px){
  .about__grid,
  .skills__grid,
  .passions__grid,
  .projects__grid,
  .contact__cards{
    grid-template-columns: 1fr;
  }

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

  .passport__photo{ min-height: 180px; }
  .passport__photo img{ height: 200px; }
}

@media (max-width: 720px){
  .nav__links{
    position: fixed;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s var(--ease);
  }

  .nav__links.is-open{ max-height: 300px; }
  .nav__links li{ width: 100%; }

  .nav__link{
    display: block;
    padding: 14px 6vw;
    border-bottom: 1px solid var(--line);
  }

  .nav__toggle{ display: flex; }
  .hero{ padding-top: 100px; }
  .player{ flex-direction: column; align-items: flex-start; }
}