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

:root {
  --ui-font-size: 18px;
  --ui-line-height: 1.2;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  background-color: #ffffff;
  color: #000000;
  line-height: 1.4;
  cursor: none;
  overflow-x: hidden; /* taglia lo sforamento orizzontale */
  
}

/* INTRO / HERO */

.intro {
  position: relative;
  min-height: 100vh;
  padding: 80px 60px;
  overflow: hidden;
}

/* PARTE INTERATTIVA BLOB COLOR BACKGROUND (P5) */

#p5-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#p5-background canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* TITOLO IN ALTO A SINISTRA */

   .intro-title {
    position: fixed;
    top: 12px;
    left: 12px;
    display: inline-block;
    padding: 8px 14px; /* più spazio per il contorno */
    font-size: var(--ui-font-size);
    line-height: var(--ui-line-height);
    font-weight: 800;
    letter-spacing: -0.01em;
    background: none; /* nessun riempimento */
    color: #000; /* testo nero di default */
    border: 2px solid #000; /* contorno nero di default */
    border-radius: 30px;
    z-index: 1000;
    pointer-events: auto;
    transition: all 0.3s ease;
  }
  
  /* link logo */
  .intro-title a,
  .intro-title a:visited,
  .intro-title a:hover,
  .intro-title a:active {
    color: inherit; /* eredita il colore della .intro-title */
    text-decoration: none;
  }
/* META / MENU (ALTO A DESTRA) */

.intro-meta {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  font-size: var(--ui-font-size);
  font-weight: 400;
  text-align: right;
  color: #fff;
  mix-blend-mode: difference;
  z-index: 1000;
}

.intro-meta .subtitle {
  font-weight: 800;
}

.intro-meta .menu {
  display: flex;
  gap: 18px;
}

.intro-meta .menu a {
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.intro-meta .menu a:hover {
  opacity: 0.6;
}

/* testo tipo MANIFESTO */

.intro-manifesto {
  position: absolute;
  left: 24px;
  top: clamp(400px, 14vh, 170px);
  width: calc(100vw - 48px);
  max-width: 1200px;
  font-weight: medium;
  font-size: clamp(28px, 5.6vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-align: left;
  pointer-events: none;
}

/* SEZIONI GENERALI */

.section {
  min-height: 100vh;
  padding: 80px 60px;
}

h2 {
  font-size: 25px;
  font-weight: bold;
  margin-bottom: 40px;
}

/* >>> TESTO DI PRESENTAZIONE (subito sotto h2) <<< */
.section h2 + p {
  font-size: 25px;
  line-height: 1.50;
}

/* NO SPAZIO TRA PRESENTATION E CURRICULUM */

#presentation,
#curriculum {
  min-height: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 10px;
  padding-bottom: 0;
  padding-left: 60px;
  padding-right: 60px;
}

/* PROGETTI */

.projects {
  margin-bottom: 50px;
}

.project-header {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: baseline;
  gap: 16px;
  max-width: 900px;
  margin-bottom: 24px;
}

.project-header .year {
  font-size: 20px;
  font-weight: bold;
  color: #ff00c8;
}

.project-header .category {
  font-size: 20px;
  color: #666;
}

.project-header h3 {
  font-size: 20px;
  font-weight: bold;
  color: #666;
}

/* GALLERY */

.project .gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 16px;

  /*  gallery estesa fino ai bordi della viewport */
  margin-left: -60px;
  margin-right: -60px;
  width: calc(100% + 120px);
  box-sizing: content-box; /* evita tagli */
}

/* Gallery responsive */
@media (max-width: 768px) {
  .project .gallery {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
}

.gallery img {
  width: 560px;
  height: 560px;
  object-fit: cover;
  flex-shrink: 0;
  scroll-snap-align: start;
  display: block;
}

.gallery::-webkit-scrollbar {
  display: none;
}

/* FRECCIA SOTTO IMMAGINE */

.project .arrow-container {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  margin-left: -60px;
  margin-right: -60px;
  width: calc(100% + 120px);
}

@media (max-width: 768px) {
  .project .arrow-container {
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
  }
}

/* SCROLL INDICATOR (ARROW) */

.scroll-indicator {
  position: relative;
  width: 100%;
  height: 24px;
  margin-top: 8px;
  pointer-events: none;
}

.scroll-indicator::after {
  content: "→";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: #000000;
  opacity: 0.6;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.scroll-indicator.is-hidden::after {
  opacity: 0;
  transform: translate(12px, -50%);
}

/* CTA e FOOTER */

.cta p {
  max-width: 500px;
  margin-bottom: 40px;
  font-size: 18px;
}

.cta-link {
  font-size: 20px;
  text-decoration: none;
  color: #000;
  border-bottom: 2px solid #000;
  padding-bottom: 4px;
}

footer {
  padding: 40px 60px;
  font-size: 14px;
  color: #666;
}

/* CUSTOM CURSOR */

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 2147483647;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition:
    width 0.3s ease,
    height 0.3s ease,
    opacity 0.15s ease;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  :root {
    --ui-font-size: 16px;
  }

  .intro,
  .section {
    padding: 60px 20px;
  }

  .intro-manifesto {
    left: 16px;
    top: 120px;
    width: calc(100vw - 32px);
    font-size: clamp(26px, 8.5vw, 44px);
    line-height: 1.02;
  }

  .section h2 + p {
    font-size: 18px;
    line-height: 1.45;
  }

  .intro-meta {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 60%;
  }

  .gallery img {
    width: 340px;
    height: 340px;
  }
}

/* BANNER NERO */

.scroll-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  z-index: 9999;
}

.scroll-banner-track {
  display: inline-flex;
  white-space: nowrap;
  animation: scroll-banner 10s linear infinite;
  will-change: transform;
}

.scroll-banner-text {
  color: #ff00bf;
  font-weight: bold;
  font-size: 20px;
  padding-right: 50px;
  transition: letter-spacing 0.2s ease;
  will-change: letter-spacing;
  }


@keyframes scroll-banner {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

#gallery,
#cta {
  min-height: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 10px;
  padding-bottom: 0;
  padding-left: 60px;
  padding-right: 60px;
}

/* DARK MODE */

body.dark-mode { background-color: #0f0f0f; color: #ffffff; }

body.dark-mode .project { border-color: rgba(0,0,0,0.15); }

body.dark-mode .project-header h3 { color: #fff; }

body.dark-mode .category,
body.dark-mode .year { color: #aaa; }

body.dark-mode .arrow { color: #fff; }

body.dark-mode img { filter: brightness(0.9) contrast(1.1); }


/* Dark mode */
body.dark-mode .intro-title {
  color: #ffffff; /* testo bianco in dark mode */
  border-color: #fff; /* contorno bianco */
}


.scroll-banner.dark {
  background: #000000;
  color: #fff;
  border-top: 1px solid #fff;
}

/* DARK MODE TOGGLE — DOT */

.dark-mode-toggle {
  position: fixed;
  bottom: 50px;
  right: 24px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #000000;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease;
}

.dark-mode-toggle:hover { transform: scale(1.5); }

body.dark-mode .dark-mode-toggle { background: #fff; }

/* ABOUT, EDITORIAL */

#presentation { padding-top: 120px; padding-bottom: 160px; }

#presentation h2 {
  font-size: 20px;
  font-weight: lighter;
  margin-bottom: 30px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

#presentation p {
  font-size: clamp(32px,5.5vw,72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 1200px;
}

#presentation p br {
  display: block;
  content: "";
  margin-bottom: 0.6em;
}

/* CURRICULUM, EDITORIAL */

#curriculum { padding-top: 60px; padding-bottom: 160px; }

#curriculum h2 {
  font-size: 20px;
  font-weight: lighter;
  margin-bottom: 30px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

#curriculum p {
  font-size: clamp(32px,5.5vw,72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 1200px;
}

#curriculum p br {
  display: block;
  content: "";
  margin-bottom: 0.6em;
}

#curriculum .year {
  color: #ff00c8;
  font-weight: medium;
}

.break::before {
  content: "";
  display: block;
  margin: 1em 0;
}

/* PROJECTS & CONTACTS */

/* PROJECTS — stile titolo e testo grande */
#projects h2 {
  font-size: 20px;
  font-weight: lighter;
  margin-bottom: 30px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

/* stesso stile di #presentation/#curriculum al contenitore dei progetti */
#projects .my-text {
  font-size: clamp(32px, 5.5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 1200px;
}

#projects .my-text br {
  display: block;
  content: "";
  margin-bottom: 0.6em;
}

/* CONTACTS stile titolo e testo grande */
#contacts h2 {
  font-size: 20px;
  font-weight: lighter;
  margin-bottom: 30px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

#contacts .my-text {
  font-size: clamp(32px, 5.5vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 1200px;
}

#contacts .my-text br {
  display: block;
  content: "";
  margin-bottom: 0.6em;
}

/* IMAGE BOX GENERICO */
.image-box {
  flex: 0 0 auto;
  background-color: #000; /* fondo nero uniforme */
}

/* SIDE MENU — VERTICAL PILLS */

.side-menu {
  position: fixed;
  top: 14%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 1000;
}

/* pill navigazione */
.side-menu a {
  display: inline-block;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;

  color: #000;
  border: 2px solid #000;
  border-radius: 999px;
  background: none;

  transition: 
    transform 0.2s ease,
    opacity 0.2s ease,
    background 0.2s ease;
}

.side-menu a:hover {
  transform: translateX(-6px);
  opacity: 0.7;
}

/* PILL ATTIVA */
.side-menu a.active {
  background: #000;
  color: #fff;
}

/* DARK MODE */
body.dark-mode .side-menu a,
body.dark-mode .side-menu-name {
  color: #fff;
  border-color: #fff;
}

body.dark-mode .side-menu a.active {
  background: #fff;
  color: #000;
}

/* MOBILE */
@media (max-width: 768px) {
  .side-menu {
    right: 10px;
    gap: 12px;
  }

  .side-menu a,
  .side-menu-name {
    font-size: 12px;
    padding: 8px 14px;
  }
}
#contacts {
  min-height: auto;       
  padding-bottom: 40px;
  padding-top: 10px;
}
#contacts a {
  color: inherit;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s ease;
}

#contacts a:hover {
  opacity: 0.6;
}