*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 
:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --border: #252525;
  --accent: #c8f060;
  --accent2: #60d0f0;
  --text: #e8e4dc;
  --muted: #6a6a6a;
  --card: #131313;
  --radius: 12px;
}
 
html { scroll-behavior: smooth; }
 
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
}
 
/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 4rem;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
 
.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}
 
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
 
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  font-family: 'DM Mono', monospace;
}
 
.nav-links a:hover { color: var(--text); }
 
/* ── MENU A TENDINA GIOCHI ── */

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);

  min-width: 180px;
  padding: 0.5rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;

  list-style: none;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

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

.nav-dropdown-menu li {
  margin: 0;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: var(--card);
  color: var(--accent);
}

/* Mostra il menu quando passi sopra "Giochi" */
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Ruota la freccia */
.nav-dropdown:hover .dropdown-arrow,
.nav-dropdown:focus-within .dropdown-arrow {
  transform: rotate(180deg);
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 8rem 4rem 4rem;
  position: relative;
  overflow: hidden;
}
 
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 80% 50%, rgba(200,240,96,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(96,208,240,0.04) 0%, transparent 70%);
  pointer-events: none;
}
 
.hero-grid-line {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 50%;
  border-left: 1px solid var(--border);
  pointer-events: none;
}
 
.hero-left {
  padding-right: 4rem;
  animation: fadeUp 0.9s ease both;
}
 
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
 
.hero-tag::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
 
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
 
.hero-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1rem;
}
 
.hero-name em {
  font-style: italic;
  color: var(--accent);
}
 
.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 420px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}
 
.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
 
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #0d0d0d;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.2s, box-shadow 0.2s;
}
 
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,240,96,0.25);
}
 
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s;
}
 
.btn-secondary:hover {
  border-color: var(--text);
}
 
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-left: 4rem;
  animation: fadeUp 0.9s 0.2s ease both;
}
 
.hero-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}
 
.hero-stat:hover { border-color: var(--accent); }
 
.stat-icon {
  font-size: 1.5rem;
  width: 40px;
  text-align: center;
}
 
.stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
 
.stat-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 400;
}
 
/* ── SECTIONS ── */
section {
  padding: 6rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}
 
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}
 
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 3rem;
  color: var(--text);
}
 
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  max-width: 1200px;
  margin: 0 auto;
}
 
/* ── ABOUT ── */
#about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
 
.about-left .section-title { margin-bottom: 1.5rem; }
 
.about-text {
  color: var(--muted);
  line-height: 1.85;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}
 
.about-text strong { color: var(--text); font-weight: 400; }
 
.about-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface);
  margin-bottom: 1rem;
}
 
.about-card-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
 
.about-card-body {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}
 
.edu-item { margin-bottom: 1rem; }
.edu-item:last-child { margin-bottom: 0; }
 
.edu-title {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
 
.edu-school {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
}
 
.edu-date {
  font-size: 0.75rem;
  color: var(--accent2);
  font-family: 'DM Mono', monospace;
}
 
.hobby-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
 
.hobby-tag {
  font-size: 0.8rem;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--muted);
}
 
/* ── SKILLS ── */
#skills { padding-top: 2rem; }
 
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
 
.skill-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface);
  transition: border-color 0.2s;
}
 
.skill-group-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
 
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
 
.skill-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
 
/* ── EXPERIENCE ── */
.exp-list { display: flex; flex-direction: column; gap: 1.25rem; }
 
.exp-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  transition: border-color 0.2s;
}
 
.exp-item:hover { border-color: var(--accent); }
 
.exp-role {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.25rem;
}
 
.exp-company {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent2);
  margin-bottom: 0.6rem;
}
 
.exp-desc {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.65;
}
 
.exp-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
 
/* ── CONTACT ── */
#contatti { padding-bottom: 8rem; }
 
.contact-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}
 
.contact-intro {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
 
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  margin: 0 auto;
}
 
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.87rem;
  transition: border-color 0.2s, color 0.2s;
  background: var(--surface);
}
 
.contact-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
 
.contact-link-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}
 
/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
 
.footer-left {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}
 
.footer-right {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
}
 
/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
 
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
 
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
 
/* ── MOBILE ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.2rem; }
 
  #hero {
    grid-template-columns: 1fr;
    padding: 7rem 1.5rem 3rem;
    min-height: auto;
  }
 
  .hero-grid-line { display: none; }
  .hero-left { padding-right: 0; }
  .hero-right { padding-left: 0; }
 
  #about {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 4rem 1.5rem;
  }
 
  section { padding: 4rem 1.5rem; }
 
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
 
  footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1.5rem; }
 
  .exp-item { grid-template-columns: 1fr; }
  .exp-date { text-align: left; }
}
 
 
/* ============================================================
   EFFETTI JS — aggiunto da main.js
   ============================================================ */
 
/* ── SCROLL PROGRESS BAR ── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 9999;
  transition: width 0.05s linear;
}
 
/* ── HAMBURGER MENU ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}
 
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
 
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
 
@media (max-width: 768px) {
  .hamburger { display: flex; }
 
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: 70vw;
    max-width: 300px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 150;
  }
 
  .nav-links.nav-open { right: 0; }
 
  .nav-links a {
    font-size: 1.2rem;
    color: var(--text);
  }
}
 
/* ── TYPING EFFECT ── */
.typing-role {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  min-height: 1.4em;
  letter-spacing: 0.02em;
}
 
.typing-role::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: var(--accent2);
}
 
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
 
/* ── REVEAL CON DIREZIONI ── */
.reveal[data-reveal-dir="left"] {
  transform: translateX(-40px);
  opacity: 0;
}
.reveal[data-reveal-dir="right"] {
  transform: translateX(40px);
  opacity: 0;
}
.reveal[data-reveal-dir="up"] {
  transform: translateY(30px);
  opacity: 0;
}
 
.reveal.visible {
  transform: translate(0, 0) !important;
  opacity: 1;
}
 
/* ── CURSORE PERSONALIZZATO ── */
#custom-cursor {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s, background 0.2s;
  mix-blend-mode: normal;
}
 
#cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
 
#custom-cursor.cursor-hover {
  width: 56px;
  height: 56px;
  border-color: var(--accent2);
  background: rgba(200, 240, 96, 0.06);
}
 
#cursor-dot.cursor-hover {
  background: var(--accent2);
  width: 7px;
  height: 7px;
}
 
/* Nascondi cursore nativo solo su desktop */
@media (pointer: fine) {
  body { cursor: none; }
  a, button { cursor: none; }
}
 
/* ── GLITCH EFFECT ── */
@keyframes glitch1 {
  0%   { clip-path: inset(10% 0 80% 0); transform: translate(-4px, 0); }
  20%  { clip-path: inset(60% 0 20% 0); transform: translate(4px, 0); }
  40%  { clip-path: inset(30% 0 50% 0); transform: translate(-2px, 0); }
  60%  { clip-path: inset(80% 0 5%  0); transform: translate(3px, 0); }
  80%  { clip-path: inset(5%  0 70% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(40% 0 40% 0); transform: translate(0, 0); }
}
 
@keyframes glitch2 {
  0%   { clip-path: inset(50% 0 30% 0); transform: translate(4px, 0); color: var(--accent2); }
  25%  { clip-path: inset(10% 0 60% 0); transform: translate(-4px, 0); }
  50%  { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); color: var(--accent); }
  75%  { clip-path: inset(20% 0 65% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(45% 0 45% 0); transform: translate(0, 0); }
}
 
.hero-name.glitch {
  position: relative;
}
 
.hero-name.glitch::before,
.hero-name.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}
 
.hero-name.glitch::before {
  color: var(--accent);
  animation: glitch1 0.5s steps(2) forwards;
}
 
.hero-name.glitch::after {
  color: var(--accent2);
  animation: glitch2 0.5s steps(2) forwards;
}
 
/* ── NAV ACTIVE LINK ── */
.nav-links a.nav-active {
  color: var(--accent);
}
 
 
/* ── TEMA CHIARO ── */
body.light {
  --bg: #f5f2ee;
  --surface: #ffffff;
  --border: #e0dbd4;
  --accent: #5a8a00;
  --accent2: #0080a8;
  --text: #1a1a1a;
  --muted: #7a7a7a;
  --card: #eeebe6;
}
 
body.light nav {
  background: rgba(245, 242, 238, 0.88);
}
 
/* ── THEME TOGGLE BUTTON ── */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, transform 0.3s;
  flex-shrink: 0;
}
 
#theme-toggle:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: rotate(20deg);
}
 
@media (max-width: 768px) {
  #theme-toggle { cursor: pointer; }
}