html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

/* Variabili Tema */
:root {
  --bg-color: #f8f9fa;
  --grid-color: rgba(0, 0, 0, 0.08);
  --text-color: #1d1d1d;
  --card-bg: rgba(255, 255, 255, 0.750);
}

body.dark-mode {
  --bg-color: #191a1a;
  --grid-color: rgba(114, 114, 114, 0.3);
  --text-color: #ffffff;
  --card-bg: rgba(0, 0, 0, 0.6);
}

body {
  min-height: 100vh;
  background-color: var(--bg-color);
  background-image:
    linear-gradient(0deg,
      transparent 24%,
      var(--grid-color) 25%,
      var(--grid-color) 26%,
      transparent 27%,
      transparent 74%,
      var(--grid-color) 75%,
      var(--grid-color) 76%,
      transparent 77%,
      transparent),
    linear-gradient(90deg,
      transparent 24%,
      var(--grid-color) 25%,
      var(--grid-color) 26%,
      transparent 27%,
      transparent 74%,
      var(--grid-color) 75%,
      var(--grid-color) 76%,
      transparent 77%,
      transparent);
  background-size: 55px 55px;
  background-attachment: fixed;
  color: var(--text-color);
  font-family: "Segoe UI", Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
}

.main-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 40px;
  margin-top: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section {
  padding: 100px 0;
}

::selection {
  background: var(--text-color);
  color: var(--bg-color);
}

::-moz-selection {
  background: var(--text-color);
  color: var(--bg-color);
}

.section-line {
  width: 60px;
  height: 3px;
  background: var(--text-color);
  margin: 10px auto 0;
}

.no-interaction {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none; 
  -ms-user-select: none; 
  -webkit-user-drag: none;
}

/* Navbar */
.bottom-navbar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 15px;
  border-radius: 50px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.bottom-navbar ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.bottom-navbar a {
  position: relative;
  width: 70px;
  height: 70px;
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 30px;
  transition: all 0.3s ease;
}

.bottom-navbar a:hover {
  background: var(--text-color);
  color: var(--bg-color);
  transform: translateY(-5px);
}

.bottom-navbar a::after {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
  content: attr(data-label);
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-color);
  color: var(--bg-color);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.bottom-navbar a:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}


/* Home */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.hero-title {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
}

.hero-description {
  font-family: "Inter", sans-serif;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.7;
}

.scroll-indicator {
  margin-top: 40px;
  font-size: 2rem;
  color: var(--text-color);
  opacity: 0.7;
  animation: bounce 1.8s infinite;
}

@keyframes bounce {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Chi sono */
.about-image {
  width: 90%;
  margin: auto;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--grid-color);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.about-image img {
  width: 110%;
  height: 110%;
  object-fit: cover;
}

.info-title {
  margin-top: -50px;
  padding: 30px;
  font-size: 28px;
}

.info-grid {
  display: grid;
  grid-template-columns: 2fr 2fr;
  gap: 20px;
}

.info-item {
  padding: 10px 15px;
  background: var(--card-bg);
  border-radius: 12px;
}

.info-item span {
  font-size: 12px;
  opacity: 0.6;
  display: block;
}

.info-item p {
  margin: 0;
  font-weight: 500;
}

.about-text {
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 20px;
}

/* Skills */
.skills-wrapper {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.skills {
  margin-bottom: 40px;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.skill {
  background: var(--card-bg);
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid var(--grid-color);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 8px;
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: var(--grid-color);
  border-radius: 20px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--text-color);
  border-radius: 20px;
  transition: width 1s ease;
}

/* Studi */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 40px auto;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--grid-color);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 10px 40px;
  box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 30px;
  right: -8px;
  width: 16px;
  height: 16px;
  background: var(--text-color);
  border-radius: 50%;
}

.timeline-item:nth-child(even) .timeline-dot {
  left: -8px;
}

.timeline-content {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--grid-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.timeline-content h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.timeline-date {
  font-size: 14px;
  opacity: 0.7;
  display: block;
  margin-bottom: 10px;
}

.timeline-content p {
  margin: 5px;
  opacity: 0.85;
}

/* Progetti */
/* Contatti */
.contact-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--grid-color);
  border-radius: 16px;
  padding: 30px 20px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  height: 100%;
}

.contact-card i {
  font-size: 2rem;
  margin-bottom: 15px;
  color: var(--text-color);
}

.contact-card h5 {
  margin-bottom: 10px;
  font-family: "Inter", sans-serif;
}

.contact-card p {
  margin: 0;
  opacity: 0.8;
  font-weight: 500;
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
  color: var(--text-color);
}

.contact-card:visited,
.contact-card:active {
  color: var(--text-color);
  text-decoration: none;
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 20px 0;
  background: transparent;
  opacity: 0.7;
  font-size: 14px;
}


/* Impostazioni */
.settings-container {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 1100;
}

.settings-btn {
  width: 70px;
  height: 70px;
  background: var(--card-bg);
  color: var(--text-color);
  border: none;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--card-bg);
  transition: all 0.3s ease;
}

.settings-btn:hover {
  background: var(--card-bg);
  color: var(--text-color);
}
.settings-menu {
  position: absolute;
  top: 80px;
  right: 0;
  width: 260px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--grid-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: none;
  backdrop-filter: blur(10px);
}

.settings-menu.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.settings-title {
  font-family: "Inter", sans-serif;
  margin-bottom: 20px;
  text-align: center;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 14px;
}

.settings-item i {
  margin-right: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: 0.3s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background-color: var(--bg-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

body.large-text {
  font-size: 1.1rem;
}


/* Media Queries */
@media (max-width: 768px) {

  html, body {
    overflow-x: hidden;
  }

  /* Navbar */
  .bottom-navbar,
  .settings-container {
    display: none;
  }

  /* Chi sono */
  .info-grid {
    grid-template-columns: 1fr;
  }

  .about-text {
    margin: 10px;
  }
  
  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  /* Studi */
  .timeline::before {
    left: 0px;
    transform: none;
  }

  .timeline-item {
    margin-top: 80px;
    width: 100%;
    padding: 10px 20px;
  }
  
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
  }
  
  .timeline-dot {
    top: -8px;
    left: -6px;
  }
}

.menu-toggle,
.menu-overlay {
    display: none;
}

/* MOBILE NAVBAR */
@media (max-width: 768px) {
  .menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2100;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
  }

  .menu-toggle:active {
    transform: scale(0.9);
  }

  .menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    z-index: 2000;
  }

  .menu-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  .menu-box {
    background: var(--card-bg);
    width: 85%;
    max-width: 320px;
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  }

  .menu-overlay.active .menu-box {
    transform: translateY(0) scale(1);
  }

  .mobile-nav a {
    display: block;
    padding: 12px;
    margin: 5px 0;
    color: var(--text-color);
    text-decoration: none;
    font-size: 20px;
    font-weight: 500;
    font-family: "Inter", sans-serif;
    transition: opacity 0.2s;
  }

  .mobile-nav a:active {
    opacity: 0.5;
  }

  .menu-divider {
    margin: 25px 0;
    opacity: 0.1;
    border-color: var(--text-color);
  }
  .mobile-settings .settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
  }
}