/* ============================================================
   DANILO SCIMONE – PERSONAL WEBSITE
   style.css  |  Tema scuro professionale, stile "informatic"
   ============================================================ */

/* ──────────────────────────────────────────────────────────────
   0. RESET & VARIABILI GLOBALI
────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Palette colori */
  --bg:          #0d0d0d;       /* Sfondo principale (nero profondo) */
  --bg-alt:      #111111;       /* Sfondo alternativo sezioni */
  --surface:     #1a1a1a;       /* Sfondo card/elementi */
  --surface-alt: #222222;       /* Card hover */
  --border:      #2a2a2a;       /* Bordi sottili */

  --text:        #e8e8e8;       /* Testo principale */
  --text-muted:  #888888;       /* Testo secondario */

  --accent:      #00ff88;       /* Verde neon – accent color */
  --accent-dim:  rgba(0,255,136,.12); /* Versione trasparente accent */
  --accent-glow: 0 0 18px rgba(0,255,136,.35); /* Glow effect */

  /* Tipografia */
  --font: 'Inter', system-ui, sans-serif;

  /* Spaziatura */
  --section-py: 6rem;

  /* Transizioni */
  --ease: cubic-bezier(.4,0,.2,1);
  --duration: .3s;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* Migliore touch su mobile */
a, button { touch-action: manipulation; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar personalizzata */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* Selezione testo */
::selection { background: var(--accent); color: #000; }

/* ──────────────────────────────────────────────────────────────
   1. UTILITY
────────────────────────────────────────────────────────────── */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Colore accent (verde neon) */
.accent { color: var(--accent); }

/* Immagini responsive */
img { max-width: 100%; height: auto; }

/* Separatori tra sezioni */
.section-divider {
  width: 80%;
  max-width: 900px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 auto;
}

/* ──────────────────────────────────────────────────────────────
   2. ANIMAZIONI – fade-in (hero) e reveal (scroll)
────────────────────────────────────────────────────────────── */

/* Fade-in per la hero: parte da invisibile e scende */
.fade-in {
  animation: fadeInDown .9s var(--ease) both;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reveal: elementi che appaiono allo scroll */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* Classe aggiunta da JS quando l'elemento è visibile */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ──────────────────────────────────────────────────────────────
   3. NAVBAR
────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 5%;
  background: rgba(13,13,13,.85);
  /* Effetto vetro smerigliato */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease),
              background var(--duration) var(--ease);
}

/* Navbar con sfondo più solido dopo scroll (aggiunta da JS) */
.navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(13,13,13,.97);
}

/* Logo testuale */
.nav-logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -.02em;
  cursor: default;
  user-select: none;
}

/* Link di navigazione */
.nav-links {
  list-style: none;
  display: flex;
  gap: 2.2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color var(--duration);
  position: relative;
}

/* Sottolineatura animata al hover */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--duration) var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

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

/* Hamburger (mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--duration) var(--ease),
              opacity var(--duration);
}

/* Stato aperto hamburger */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ──────────────────────────────────────────────────────────────
   4. HERO – sezione iniziale
────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 5% 5rem;
  overflow: hidden;
}

/* Griglia decorativa di sfondo */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  /* Sfuma verso il basso */
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
}

/* Contenuto hero */
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

/* Badge stato */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0,255,136,.25);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.8rem;
}

/* Punto animato nel badge */
.dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,.5); }
  50%       { box-shadow: 0 0 0 6px rgba(0,255,136,0); }
}

/* Titolo principale */
.hero-title {
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
  margin-bottom: 1.4rem;
}

/* Sottotitolo tipo */
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

/* Frase d'impatto */
.hero-tagline {
  font-size: clamp(.95rem, 1.8vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2.8rem;
  font-style: italic;
}

/* Bottoni CTA */
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 2rem;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #00e07a;
  box-shadow: var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Freccia scroll */
.scroll-arrow {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  text-decoration: none;
  animation: bounce 2s ease-in-out infinite;
  transition: color var(--duration);
}

.scroll-arrow:hover { color: var(--accent); }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ──────────────────────────────────────────────────────────────
   5. SEZIONI GENERALI
────────────────────────────────────────────────────────────── */
.section {
  padding: var(--section-py) 0;
}

/* Alterna lo sfondo delle sezioni */
.skills, .goals {
  background: var(--bg-alt);
}

/* Titolo di sezione */
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
  /* Piccola linea accent a sinistra */
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

/* Sottotitolo descrittivo */
.section-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 3.5rem;
  padding-left: 1.1rem;
}

/* ──────────────────────────────────────────────────────────────
   6. CHI SONO
────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 3rem;
}

/* Avatar */
.about-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-frame {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -.04em;
  position: relative;
  z-index: 1;
  transition: border-color var(--duration);
}

.avatar-frame:hover {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

/* Immagine profilo circolare */
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Anello decorativo */
.avatar-ring {
  position: absolute;
  width: 190px; height: 190px;
  border-radius: 50%;
  border: 1px dashed rgba(0,255,136,.2);
  animation: spin 20s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Testo bio */
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about-text p strong { color: var(--text); }

/* Info rapide */
.quick-info {
  list-style: none;
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.quick-info li {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.quick-info li i { width: 16px; }

/* ──────────────────────────────────────────────────────────────
   7. COMPETENZE
────────────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 1.8rem;
  transition: border-color var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
  /* Delay per il reveal in cascade (aggiunto da JS) */
}

.skill-card:hover {
  border-color: rgba(0,255,136,.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}

.skill-icon {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.skill-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--text);
}

/* Lista tag tecnologie */
.skill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.skill-tag {
  display: inline-block;
  padding: .3rem .85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .8rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  transition: border-color var(--duration), color var(--duration);
}

.skill-card:hover .skill-tag {
  border-color: rgba(0,255,136,.2);
  color: var(--text);
}

/* ──────────────────────────────────────────────────────────────
   8. ESPERIENZE – TIMELINE
────────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  margin-top: 1.5rem;
  padding-left: 2.5rem;
}

/* Linea verticale della timeline */
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

/* Singola voce */
.timeline-item {
  position: relative;
  margin-bottom: 2.8rem;
}

/* Punto sulla linea */
.timeline-dot {
  position: absolute;
  left: -2.5rem;
  top: .45rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: var(--accent-glow);
  transition: background var(--duration);
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
}

/* Contenuto card */
.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem 1.8rem;
  transition: border-color var(--duration), transform var(--duration) var(--ease);
}

.timeline-content:hover {
  border-color: rgba(0,255,136,.35);
  transform: translateX(4px);
}

.timeline-date {
  font-size: .78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: .5rem;
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .7rem;
}

.timeline-content p {
  color: var(--text-muted);
  font-size: .92rem;
  margin-bottom: 1rem;
}

.timeline-content p strong { color: var(--text); }

/* Badge tipo esperienza */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,255,136,.2);
  padding: .25rem .85rem;
  border-radius: 999px;
}

/* ──────────────────────────────────────────────────────────────
   9. OBIETTIVI
────────────────────────────────────────────────────────────── */
.goals-wrapper {
  max-width: 820px;
  margin: 2.5rem auto 0;
}

.goal-quote {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 1.4rem;
  margin-bottom: 2.5rem;
  font-style: normal;
  letter-spacing: -.01em;
}

.goals-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.goals-text p strong { color: var(--text); }
.goals-text p em { color: var(--accent); font-style: normal; }

/* Milestone */
.milestones {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.milestone {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .95rem;
  color: var(--text-muted);
  transition: color var(--duration);
}

.milestone:hover { color: var(--text); }
.milestone i { font-size: 1.1rem; width: 20px; }

/* ──────────────────────────────────────────────────────────────
   10. CONTATTI
────────────────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

/* Card contatto (link) */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: all var(--duration) var(--ease);
}

.contact-card i {
  font-size: 1.8rem;
  color: var(--text-muted);
  transition: color var(--duration), transform var(--duration) var(--ease);
}

.contact-card:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-4px);
  box-shadow: 0 10px 35px rgba(0,0,0,.4);
}

.contact-card:hover i {
  color: var(--accent);
  transform: scale(1.15);
}

/* ──────────────────────────────────────────────────────────────
   11. FOOTER
────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2.5rem 5%;
  text-align: center;
}

.footer-logo {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: .5rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: .3rem;
}

.footer-made {
  color: var(--text-muted);
  font-size: .8rem;
  opacity: .6;
}

/* ──────────────────────────────────────────────────────────────
   12. RESPONSIVE – adattamento mobile
────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --section-py: 3.5rem; }

  /* Navbar mobile */
  .nav-links {
    display: none;
    position: fixed;
    top: 0; right: 0;
    height: 100svh;
    width: min(80vw, 320px);
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    gap: 1.8rem;
    border-left: 1px solid var(--border);
    z-index: 999;
    /* Slide dal bordo destro */
    transform: translateX(100%);
    transition: transform .35s var(--ease);
  }

  .nav-links.open {
    display: flex;
    transform: translateX(0);
  }

  /* Link più grandi per touch */
  .nav-links a {
    font-size: 1rem;
    padding: .5rem 0;
  }

  .hamburger { display: flex; z-index: 1001; }

  /* Hero: meno padding */
  .hero {
    padding: 6rem 5% 4rem;
    min-height: 100svh;
  }

  .hero-tagline { margin-bottom: 2rem; }

  /* Hero bottoni verticali */
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  /* About: layout verticale */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-avatar {
    justify-content: center;
  }

  /* About text: migliore leggibilità */
  .about-text p {
    font-size: .93rem;
  }

  /* Section title: padding ridotto su mobile */
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2.2rem);
  }

  .section-sub {
    font-size: .9rem;
    margin-bottom: 2.5rem;
  }

  /* Skills cards: padding ridotto */
  .skill-card {
    padding: 1.5rem 1.3rem;
  }

  /* Timeline: meno padding */
  .timeline { padding-left: 2rem; }

  .timeline-content {
    padding: 1.3rem 1.4rem;
  }

  .timeline-content h3 {
    font-size: 1rem;
  }

  .timeline-content p {
    font-size: .88rem;
  }

  /* Goals quote più piccola */
  .goal-quote { font-size: 1.15rem; }

  /* Goals wrapper */
  .goals-wrapper { margin-top: 1.5rem; }

  /* Contact: 2 colonne su tablet, stack su mobile */
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .contact-card {
    padding: 1.5rem 1rem;
  }

  /* Footer */
  .footer {
    padding: 2rem 5%;
  }
}

@media (max-width: 480px) {
  :root { --section-py: 3rem; }

  .container { width: 92%; }

  .avatar-frame { width: 130px; height: 130px; font-size: 2rem; }
  .avatar-ring  { width: 158px; height: 158px; }

  /* Hero: ancora più compatto */
  .hero {
    padding: 5.5rem 5% 3rem;
  }

  .badge {
    font-size: .72rem;
    padding: .3rem .8rem;
  }

  /* Bottoni più piccoli */
  .btn {
    padding: .75rem 1.5rem;
    font-size: .85rem;
  }

  /* Quick info */
  .quick-info li {
    font-size: .85rem;
  }

  /* Skills grid: una colonna */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Contact: una colonna su schermi piccoli */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline: meno spazio */
  .timeline {
    padding-left: 1.8rem;
  }

  .timeline-item {
    margin-bottom: 2rem;
  }

  .timeline-dot {
    left: -1.8rem;
    width: 12px; height: 12px;
  }

  /* Milestones */
  .milestone {
    font-size: .88rem;
  }
}
