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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top, #0f2e1f, #020617);
  color: #e6f4ea;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(5, 20, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(34,197,94,0.1);
  z-index: 1000;
}

.nav-container {
  max-width: 1000px;
  margin: auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  font-size: 1.2rem;
  color: #86efac;
}

.nav-links a {
  position: relative;
  margin-left: 20px;
  text-decoration: none;
  color: #9ca3af;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: #4ade80;
  text-shadow: 0 0 6px rgba(34,197,94,0.4);
}

.nav-links a:hover::after {
  width: 100%;
}

/* ===== HEADER ===== */
header {
  text-align: center;
  padding: 120px 20px 80px;
}

h1 {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 1px;
}

header p {
  margin-top: 10px;
  color: #9ca3af;
}

/* ===== PROFILE IMAGE ===== */
.profile-img {
  width: 250px;
  height: 250px;
  border-radius: 60%;
  object-fit: cover;
  margin: -40px 0 40px;

  will-change: transform, box-shadow;
  animation: pulseGlow 3.5s ease-in-out infinite;
  transition: all 0.35s ease;
}

.profile-img:hover {
  transform: scale(1.15);

  box-shadow:
    0 0 40px rgba(34,197,94,0.7),
    0 0 80px rgba(34,197,94,0.5),
    0 0 120px rgba(34,197,94,0.3);

  border-color: #22c55e;
}

/* glow animation */
@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 50px rgba(34,197,94,0.2),
      0 0 100px rgba(34,197,94,0.1);
  }

  50% {
    transform: scale(1.05);
    box-shadow:
      0 0 150px rgba(34,197,94,0.5),
      0 0 180px rgba(34,197,94,0.25);
  }
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

.vertical {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

#typing-text::after {
  content: "|";
  margin-left: 5px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

/* ===== CARD ===== */
.card {
  background: rgba(10, 30, 20, 0.6);
  border-radius: 18px;
  padding: 30px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(34,197,94,0.08);
  transition: all 0.35s ease;
  scroll-margin-top: 100px;
}

.card:hover {
  transform: none;
  border-color: rgba(34,197,94,0.2);

  box-shadow:
    0 0 25px rgba(34,197,94,0.15);
}

.card h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.card p {
  color: #9ca3af;
  font-size: 0.95rem;
}

/* ===== CARD LINK ===== */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* ===== LINKS ===== */
.card a {
  color: #4ade80;
  text-decoration: none;
  position: relative;
}

.card a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 1px;
  background: #22c55e;
  transition: width 0.3s;
}

.card a:hover::after {
  width: 100%;
}

/* ===== TAG ===== */
.tag {
  display: inline-block;
  margin-top: 10px;
  margin-right: 5px;
  padding: 5px 10px;
  background: rgba(34,197,94,0.1);
  border-radius: 8px;
  font-size: 0.75rem;
  transition: 0.3s;
}

.tag:hover {
  background: rgba(34,197,94,0.25);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 50px 20px;
  color: #6b7280;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ===== SCROLL ANIMATION ===== */

.card {
  opacity: 0;
  transform: translateY(60px) scale(0.96);
  filter: blur(6px);

  transition: 
    opacity 0.6s ease,
    transform 0.6s ease,
    filter 0.6s ease;
}

.card.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* popup nascosto */
.skills-popup {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;

  transition: all 0.5s ease;
}

/* quando attivo */
.skills-popup.active {
  max-height: 300px;
  opacity: 1;
  margin-top: 20px;
}

/* immagine responsive */
.skills-popup img {
  width: 100%;
  display: block;
  margin: auto;
}

/* header della card */
.skills-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* freccia */
.arrow {
  font-size: 1.5rem;
  color: #389e5d;
  transition: transform 0.4s ease;
}

/* quando aperta */
.arrow.open {
  transform: rotate(90deg);
}

/* grid progetti */
.projects-grid {
  margin-top: 20px;
  display: grid;
  gap: 20px;
}

/* card progetto */
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;

  border-radius: 14px;
  padding: 20px;

  background: rgba(15, 40, 25, 0.6);
  border: 1px solid rgba(34,197,94,0.1);

  transition: all 0.35s ease;
}

/* hover elegante */
.project-card:hover {
  transform: translateY(-5px);

  border-color: rgba(34,197,94,0.4);

  box-shadow:
    0 10px 30px rgba(0,0,0,0.5),
    0 0 25px rgba(34,197,94,0.15);
}

/* titolo */
.project-content h3 {
  margin-bottom: 5px;
}

/* descrizione */
.project-content p {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* tags */
.project-tags {
  margin-top: 10px;
}

.project-tags span {
  font-size: 0.7rem;
  padding: 4px 8px;
  margin-right: 5px;

  background: rgba(34,197,94,0.1);
  border-radius: 6px;
}

/* container skills */
.skills-grid {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

/* icone più grandi */
.skills-grid img {
  width: 100%;
  max-width: 650px; /* aumenta questo valore */
  transition: 0.3s ease;
}

/* hover leggero */
.skills-grid img:hover {
  transform: scale(1.02);
}

.main-container {
  border-radius: 20px;
  padding: 30px;

  background: rgba(10, 30, 20, 0.6);

  border: 1px solid rgba(22, 137, 64, 0.2);

  box-shadow:
    0 0 30px rgba(24, 140, 67, 0.12),
    inset 0 0 20px rgba(34,197,94,0.05);

  backdrop-filter: blur(10px);
}

/* testo about */
.about-text p {
  color: #9ca3af;
  line-height: 1.7;
  margin-bottom: 15px;
}

/* ultima riga senza spazio */
.about-text p:last-child {
  margin-bottom: 0;
}

/* header progetto con bottone */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* bottone github */
.github-btn {
  display: flex;
  align-items: center;
  gap: 6px;

  padding: 6px 12px;
  font-size: 0.75rem;

  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 999px;

  color: #4ade80;
  text-decoration: none;

  transition: all 0.3s ease;
}

/* hover */
.github-btn:hover {
  background: rgba(34,197,94,0.25);
  transform: scale(1.05);
}

/* icona */
.github-btn svg {
  fill: currentColor;
}

.github-btn::after {
  display: none !important;
}

.skills-grid {
  margin-top: 50px;
  margin-bottom: 30px;

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 25px;

  justify-items: center;
}

.skill {
  position: relative;
  display: flex;
  justify-content: center;
}

/* icone */
.skill img {
  width: 65px;
  transition: transform 0.25s ease;
}

/* testo */
.skill span {
  position: absolute;
  opacity: 0;

  font-size: 0.9rem;
  color: #9ca3af;

  white-space: nowrap;
  pointer-events: none;

  transition: all 0.25s ease;
}

/* hover icona */
.skill:hover img {
  transform: scale(1.15);
}

/* mostra testo */
.skill:hover span {
  opacity: 1;
}

/* sopra */
.skill.top span {
  bottom: 120%;
  transform: translateY(-5px);
}

/* sotto */
.skill.bottom span {
  top: 120%;
  transform: translateY(5px);
}