/* RESET + FONT */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Josefin Sans", sans-serif;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: #111; /* tema dark */
  color: #f0f0f0;
  transition: background 0.5s, color 0.5s;
}

/* ===== HERO ===== */
#hero {
  padding: 120px 20px 60px;
  text-align: center;
}

#hero-logo {
  width: 120px;
  margin-bottom: 15px;
}

#hero h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

#hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.4;
}

/* ====== NAVBAR ====== */
nav {
  position: fixed;
  width: 95%;
  max-width: 1200px;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  z-index: 1000;
  transition: all 0.4s ease;
}

nav.scrolled {
  background: rgba(0, 0, 0, 0.95);
  padding: 0.5rem 1.2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

nav .logo {
  font-size: 1.4rem;
  font-weight: bold;
  color: #f0f0f0;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}

nav ul li a {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: #8e8e8e;
}

/* Hamburger menu per mobile */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle div {
  width: 25px;
  height: 3px;
  background: #f0f0f0;
  border-radius: 2px;
  transition: all 0.3s;
}

/* MENU DESKTOP BASE */
#menu {
  display: flex;
  flex-direction: row;
}

/* ====== SECTIONS ====== */
section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* più respiro sopra/sotto, come richiesto */
  padding: clamp(2.5rem, 5vw, 4rem) 2rem;
  transition: background 0.5s, color 0.5s;
}

#hero {
  background: linear-gradient(to bottom, #222, #111);
  font-size: 2.2rem;
}

#about {
  background: linear-gradient(to bottom, #111, #1a1a1a);
}

#services {
  background: linear-gradient(to bottom, #1a1a1a, #222);
}

#contact {
  background: linear-gradient(to bottom, #222, #111);
}

h1,
h2 {
  margin-bottom: 1rem;
}

p {
  max-width: 700px;
  line-height: 1.6;
  margin: auto;
}

/* ====== ABOUT SLIDER ====== */
.about-slider {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 2rem auto 0;
  overflow: visible;
  /* base */
  min-height: clamp(260px, 38vw, 420px);
}

.about-card {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s ease;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem 1.8rem;
  text-align: left;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

/* Centrare contenuti nelle cards "Chi sono" */
.about-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.about-card img {
  max-width: 80px;
  margin-bottom: 15px;
}

.about-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  position: absolute;
  z-index: 2;
}

.about-card h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.about-card p,
.about-card ul {
  line-height: 1.7;
  font-size: 1rem;
  color: #e5e5e5;
}

.poetry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #222, #444);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.poetry-btn:hover {
  background: linear-gradient(135deg, #333, #555);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
}

.poetry-btn:active {
  transform: scale(0.96);
}


/* Lightbox poesia */
.poetry-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.poetry-lightbox.open {
  display: flex;
}

.poetry-lightbox .lightbox-inner {
  max-width: min(92vw, 1400px);
  max-height: 90vh;
  position: relative;
}

.poetry-lightbox .lightbox-inner img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.6);
  display: block;
}

.poetry-lightbox .lightbox-close {
  position: absolute;
  top: 12px;       /* spostata dentro l'immagine */
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  padding: 0.3rem 0.6rem;
  border-radius: 50%;
  cursor: pointer;  /* fa comparire il simbolo click */
  transition: background 0.2s ease;
}

.poetry-lightbox .lightbox-close:hover {
  background: rgba(0,0,0,0.85); /* effetto hover */
}



/* Liste (senza puntini/triangolini) */
.about-card ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* override per togliere i triangolini personalizzati */
.about-card ul li::before {
  content: none !important;
}

.about-card ul li {
  margin: 0.4rem 0;
  padding-left: 0; /* niente indentazione extra */
  position: relative;
}

/* Frecce laterali */
.about-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s, transform 0.3s;
  z-index: 10;
  line-height: 1;
}

#about-prev {
  left: -64px;
}

#about-next {
  right: -64px;
}

.about-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.15);
}

/* Pallini */
.about-dots {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.about-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

.about-dots button.active {
  background: #fff;
  transform: scale(1.2);
}

/* Link nella card "Progetti" (no blu/sottolineato, sì bold) */
.about-card a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
}

/* Light mode */
body.light .about-card {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #222;
}

body.light .about-card ul li::before {
  content: none !important;
}

body.light .about-arrow {
  background: rgba(0, 0, 0, 0.1);
  color: #111;
}

body.light .about-dots button {
  background: rgba(0, 0, 0, 0.2);
}

body.light .about-dots button.active {
  background: #111;
}

/* ====== SERVIZI ====== */

/* Messaggio sopra i servizi */
.services-hint {
  text-align: center;
  font-size: 1.2rem;
  margin: 10px auto 30px;
  color: #ddd;
  font-style: italic;
}

.services-grid {
  width: 100%;
  max-width: 1100px;
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.service-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.service-link:visited {
  color: inherit;
}

.service-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.service-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.service-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.service-card h3 {
  margin-top: 0.4rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.service-card p {
  font-size: 0.95rem;
  color: #d9d9d9;
}

/* ====== CONTATTI ====== */
.contact-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 600px;
  margin: auto;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.contact-item,
.instagram-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s, transform 0.3s;
  color: inherit;
  text-decoration: none;
}

.contact-item:hover,
.instagram-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.contact-item a {
  color: inherit;
  font-weight: bold;
  text-decoration: none;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.form-title {
  margin-bottom: 8px;
}

.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #f0f0f0;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #aaa;
}

.contact-form button {
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  background: #333;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}

.contact-form button:hover {
  background: #555;
}

/* ====== FOOTER ====== */
footer {
  background: #000;
  color: #aaa;
  text-align: center;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-social img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  transition: transform 0.3s, filter 0.3s;
}

.footer-social img:hover {
  transform: scale(1.2);
  filter: brightness(0.8) invert(1);
}

.footer-text {
  font-size: 0.9rem;
}

/* ====== LOGHI ====== */
#nav-logo {
  width: 20px;
  height: auto;
  margin-top: 5px;
  transition: all 0.3s;
}

#hero-logo {
  width: 120px;
  margin-bottom: 1rem;
}

/* ====== LIGHT THEME ====== */
body.light {
  background: #f9f9f9;
  color: #111;
}

body.light nav {
  background: rgba(255, 255, 255, 0.9);
}

body.light nav ul li a:hover {
  color: #8e8e8e;
}

body.light #hero {
  background: linear-gradient(to bottom, #e0e0e0, #f9f9f9);
}

body.light #about {
  background: linear-gradient(to bottom, #f9f9f9, #ededed);
}

body.light #services {
  background: linear-gradient(to bottom, #ededed, #e0e0e0);
}

body.light #contact {
  background: linear-gradient(to bottom, #e0e0e0, #f9f9f9);
}

body.light footer {
  background: #f0f0f0;
  color: #444;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
  #about-prev {
    left: -40px;
  }

  #about-next {
    right: -40px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  nav {
    padding: 0.6rem 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  /* MENU MOBILE con transizione */
  #menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 10px;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-radius: 10px;
    width: 200px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
  }

  #menu.open {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  #menu li {
    text-align: right;
  }

  /* frecce un po' più piccole */
  .about-arrow {
    font-size: 1.6rem;
    padding: 0.45rem 0.7rem;
  }

  #about-prev {
    left: -25px;
  }

  #about-next {
    right: -25px;
  }

  .about-card {
    padding: 1.5rem;
  }

  /* più altezza allo slider per contenuti lunghi (Competenze) */
  .about-slider {
    min-height: 520px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    max-width: 90%;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 0.4rem 0.6rem;
  }

  /* frecce ancora più piccole */
  .about-arrow {
    font-size: 1.4rem;
    padding: 0.4rem 0.6rem;
  }

  #about-prev {
    left: -18px;
  }

  #about-next {
    right: -18px;
  }

  .about-card {
    padding: 1rem;
    font-size: 0.95rem;
  }

  /* ancora più spazio per la card “Competenze” su schermi piccoli */
  .about-slider {
    min-height: 560px;
  }

  .service-card {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .footer-text {
    font-size: 0.8rem;
  }
}

/* ===== HERO RESPONSIVE ===== */
@media (max-width: 768px) {
  #hero {
    height: 70vh;
    padding: 1.5rem;
  }

  #hero-logo {
    max-width: 180px;
  }

  #hero h1 {
    font-size: 2rem;
  }

  #hero p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  #hero {
    height: 60vh;
    padding: 1rem;
  }

  #hero-logo {
    max-width: 150px;
  }

  #hero h1 {
    font-size: 1.6rem;
  }

  #hero p {
    font-size: 0.9rem;
  }
}
