:root {
  --bg: #ffffff;
  --fg: rgb(0, 0, 0);
  --muted: #6b7280;
  --accent: rgb(0, 0, 0);
  --brand: #13ff6e;
  --radius: 20px;
  --container: 1200px;
  --section-pad: clamp(24px, 3vw, 48px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*{box-sizing:border-box}

/* Correzione per la barra sticky: rimosso height 100% */
html { scroll-behavior: smooth; }
body {
  margin:0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--fg);
  background:var(--bg);
  line-height:1.5;
}

/* TOPBAR - Rimane sempre visibile durante lo scroll */
.topbar{
  position: sticky; 
  top: 0; 
  z-index: 100; /* Aumentato per stare sopra a tutto */
  background: #fff; 
  color: var(--fg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  margin: 0 auto;
  width: 100%;
  max-width: min(96vw, var(--container));
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 20px;
}
.logo{font-weight: 800; letter-spacing: .5px}
.logo img {
  height: 35px;
  width: auto;
  display: block;
}
.hamburger{ all: unset; cursor: pointer; display: grid; gap: 4px; }
.hamburger span{ display:block; height:2px; width:28px; background:#111; border-radius:2px }
.hamburger:focus-visible{ outline: 2px solid #222; outline-offset: 4px }

/* MAQRUEE */
.marquee{ overflow: hidden; white-space: nowrap; border-bottom: 1px solid #e5e7eb; }
.marquee-track{ display: inline-block; padding: 10px 0; animation: scroll 30s linear infinite; }
.marquee-track strong { font-weight:800 }
@keyframes scroll{ from{ transform: translateX(0) } to{ transform: translateX(-50%) } }

/* HERO */
.hero{
  background:rgb(0, 0, 0);
  color:#fff;
  padding-block: clamp(48px, 8vw, 120px);
  position: relative;
  overflow:hidden
}
.hero-inner{ max-width: min(96vw, var(--container)); margin: 0 auto; padding: 0 16px; }
.hero-graphic{
  height: clamp(240px, 55vw, 520px);
  display: grid;
  place-items: center;
}
.hero-graphic img {
    max-width: 120%; 
    height: auto;
    display: block;
    object-fit: contain; 
}
.hero-sub{
  margin: 16px 0 0;
  color: #e5e7eb;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
}
.hero-sub p {
  display: inline-block;
  margin: 0;
  padding-block: 8px;
  animation: scroll 50s linear infinite;
}

/* SELECTIONS */
section{ padding: var(--section-pad) 0; }
.container{ max-width: min(96vw, var(--container)); margin: 0 auto; padding: 0 16px; }

/* SELECTION DIVERSO */
.divider{ overflow:hidden; }
.divider .track{ display:flex; gap: 24px; align-items: center; animation: scroll 40s linear infinite; }
.divider-img img {
  height: clamp(80px, 14vw, 160px);
  width: auto;
  flex-shrink: 0;
}

.sub-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0;
  margin-bottom: 4px;
}

/* ABOUT & PORTFOLIO INTRO */
.about, .split {
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(16px, 4vw, 40px);
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.about-graphic img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}
h2 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 8px;
}
#about h2 {
  white-space: nowrap;
}
h3 {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 8px;
}
.about p, .split p { color: var(--fg); max-width: 60ch; }
.portfolio-image {
  width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
}

/* PULSANTI */
.btn{
  display:inline-block;
  margin-top: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing:.02em;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration:none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  background: #fff;
  color: #000;
  border: 1.5px solid #000;
  box-shadow: 0 4px 0 0 #000;
}
.btn:hover {
  background: #000;
  color: #fff;
  box-shadow: none;
  transform: translateY(4px);
}

/* PROGETTI */
#progetti {
  padding: var(--section-pad) 0;
}
.project-item {
    display: flex;
    flex-direction: column;
    gap: 12px; 
    margin-bottom: clamp(40px, 6vw, 80px);
}
.project-item:last-child { margin-bottom: 0; }
.project-gallery-scroller {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    width: 100%;
}
.project-gallery-scroller.active { cursor: grabbing; }
.project-gallery-scroller::-webkit-scrollbar { display: none; }
.project-gallery {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    padding: 40px clamp(24px, 3vw, 40px);
}
.project-gallery img, .project-gallery .media-placeholder, .project-gallery video {
    height: clamp(320px, 42vw, 500px);
    width: auto;
    border-radius: 24px;
    flex-shrink: 0;
    user-select: none;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 0 #000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}
.project-gallery img:hover, .project-gallery .media-placeholder:hover, .project-gallery video:hover {
    transform: scale(1.1);
    box-shadow: none;
    z-index: 10;
}
.media-placeholder {
    aspect-ratio: 4/3;
    background: #000;
}
.project-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}
.project-info > div:first-child {
    margin-left: -8%;
}
.project-info h3 {
  font-size: clamp(40px, 5vw, 50px);
  margin-bottom: 8px;
}
.project-info p {
  margin-top: 4px;
  margin-bottom: 12px;
  max-width: 60ch;
}
.project-info .btn {
  margin-top: 0;
}
.project-info .meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  white-space: normal;
  padding-top: 6px;
  flex-shrink: 0;
  margin-right: 0;
}

.project-info .meta-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.project-info .meta a {
    display: inline-block;
    height: 20px;
    width: 20px;
}
.project-info .meta img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}
.project-info .creators {
    font-weight: 700;
    color: var(--fg);
    font-size: 12px;
    line-height: 1.4;
}

/* CONTACT */
.contact{ 
  display:grid; 
  grid-template-columns: 1fr 1fr; 
  gap: clamp(16px, 4vw, 40px); 
  align-items:center; 
}
.contact-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-content: center;
}

/* FOTO PROFILO RITAGLIATA A CERCHIO CON BORDO E OMBRA NETTA */
.contact-avatar {
  grid-column: 1 / -1;
  justify-self: center;
  margin-bottom: 8px;
}
.contact-avatar img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
  box-shadow: 0 4px 0 0 #000;
  display: block;
}

.contact-links .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 14px;
  width: 100%;
  margin-top: 0;
}

.btn-icon {
  margin-right: 12px;
  height: 20px; 
  width: 20px; 
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon img {
  height: 100%;
  width: auto;
}
.icon-hover {
  display: none;
}
.btn:hover .icon-default {
  display: none;
}
.btn:hover .icon-hover {
  display: inline-block;
}

.btn-full-width {
  grid-column: 1 / -1;
}
.contact-graphic-img { 
  width: 100%; 
  height: auto; 
  max-width: 400px; 
  display: block; 
  margin: 0 auto; 
}

/* FOOTER - Aggiornato senza icone sociali */
footer{
  background: var(--bg);
  padding: clamp(60px, 8vw, 120px) 16px;
}
.footer-container {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(60px, 10vw, 100px);
}

.footer-main-graphic {
  width: 100%;
  max-width: clamp(500px, 60vw, 700px);
  height: auto;
}
.footer-main-graphic img {
  width: 100%;
  height: auto;
  display: block;
}
.footnav{
  display:flex;
  gap: clamp(24px, 4vw, 50px);
  justify-content:center;
  font-weight: 900;
  flex-wrap: wrap;
}
.footnav a {
  color: #000;
  text-decoration: none;
  font-size: clamp(16px, 2.5vw, 20px);
}

/* INFO CORSO FOOTER */
.course-info-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.course-logo {
  max-height: 45px;
  width: auto;
}
.logo-isia {
  max-height: 35px; 
}
.course-text-details {
  text-align: center;
  flex-shrink: 0;
  padding: 0 20px;
}
.course-text-details p {
  margin: 2px 0;
  font-size: 13px;
  color: var(--fg);
}

/* Menu OVERLAY */
.overlay{ position: fixed; inset: 0; background: #fff; color:#111; display: none; z-index: 150; overflow: hidden; }
.overlay.open{ display:block }
.overlay .bar{
  position: sticky; top: 0;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  margin: 0 auto;
  max-width: min(96vw, var(--container));
}
.overlay .content{ padding: 24px 0; max-width: 100%; margin: 0 auto; }
.menu-line{ overflow: hidden; padding-block: 0; }
.menu-line a { display: block; opacity: 0.2; transition: opacity 0.3s ease; padding-block: 8px; }
.menu-line a:hover { opacity: 1; }
.menu-line .track { display: flex; gap: 24px; align-items: center; animation: scroll 40s linear infinite; }
.menu-line img { height: clamp(80px, 14vw, 160px); width: auto; flex-shrink: 0; }
.overlay .close{ all: unset; cursor: pointer; font-size: 28px }

/* RESPONSIVE */
@media (max-width: 1000px){
  .about, .split, .contact{ grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr; }
  .contact-graphic-img { max-width: 250px; }
  .footer-container { gap: clamp(40px, 8vw, 80px); }
  .about-graphic, .split figure { order: -1; }
  .contact figure { order: -1; }
  .project-info { flex-direction: column; gap: 24px; align-items: flex-start; }
  .project-info > div:first-child { margin-left: 0; }
  .project-info .meta { align-items: flex-start; text-align: left; padding-top: 0; width: 100%; margin-right: 0; }
  .project-info p { max-width: none; }
  .menu-line a { opacity: 1; }
}

@media (max-width: 768px) {
  .course-info-bar { flex-direction: column; gap: 20px; }
}

@media (max-width: 640px){
  .footnav a { font-size: 12px; }
  .footnav { gap: 16px; }
  .hero-graphic { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
  .hero-graphic img { width: 150%; max-width: none; padding: 0; }
  .about-graphic img, .portfolio-image { width: 100%; max-width: 100%; }
  .menu-line img { height: 140px; }
}