:root {
  --bg-color: #0a0a0a;
  --text-color: #ffffff;
  --accent-color: #00ffff;
  --secondary-color: #1a1a1a;
  --spacing-unit: 1rem;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.8)),
    url("/img/background.jpeg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: -1;

  @media (max-width: 768px) {
    background: linear-gradient(rgba(10, 10, 10, 0.8), rgba(10, 10, 10, 0.8)),
      url("/img/background-mobile.jpeg");
    /* background-size: cover; */
    background-position: center;
    /* background-attachment: fixed; */
  }
  /*
  Alternative background options:
  - https://images.unsplash.com/photo-1517336714731-489689fd1ca8 - Macbook
  - https://images.unsplash.com/photo-1534972195531-d756b9bfa9f2 - Two monitors, code and mountains
  - https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0 - Person
  */
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(0, 255, 157, 0.15),
    rgba(0, 184, 255, 0.15)
  );
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

header {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--spacing-unit) * 4) 0;
  position: relative;
  @media (max-width: 768px) {
    padding-bottom: max(var(--spacing-unit) * 4, 150px);
  }
}
header.small {
  min-height: unset;
  padding: calc(var(--spacing-unit) * 1) 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--spacing-unit);
  background: linear-gradient(45deg, var(--accent-color), #00b8ff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--accent-color);
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: #ffffff;
  max-width: 600px;
  margin: 0 auto;
  margin-bottom: calc(var(--spacing-unit) * 2);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.hero-social {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 0.5);
  margin: calc(var(--spacing-unit) * 3) 0;
}

.social-links {
  display: flex;
  gap: calc(var(--spacing-unit) * 0.5);
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.social-links a {
  color: var(--text-color);
  text-decoration: none;
  padding: calc(var(--spacing-unit) * 0.3);
  border: 1px solid var(--secondary-color);
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--spacing-unit) * 0.5);
  flex: 1;
  min-width: 120px;
  max-width: 200px;
  text-align: center;
}

.social-links a i {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.social-links a:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.hero-nav {
  margin-top: calc(var(--spacing-unit) * 3);
}
.hero-nav.small {
  margin-top: var(--spacing-unit);
}

.hero-nav a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0 var(--spacing-unit);
  font-size: 1.1rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.hero-nav a:hover {
  opacity: 1;
  color: var(--accent-color);
}

section {
  padding: calc(var(--spacing-unit) * 4) 0;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  text-align: justify;
}

.timeline {
  position: relative;
  /* max-width: 800px; */
  margin: 0 auto;
}

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

.timeline-item {
  margin-bottom: calc(var(--spacing-unit) * 4);
  position: relative;
}

.timeline-content {
  background-color: var(--secondary-color);
  padding: var(--spacing-unit);
  border-radius: 8px;
  width: calc(50% - 30px);
  position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-left: auto;
}

.timeline-content::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: var(--accent-color);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
  left: -40px;
}

.timeline-item:nth-child(even) .timeline-content::before {
  right: -40px;
}

.timeline-content ul {
  list-style: none;
  padding: 0;
}

.timeline-content ul li::before {
  content: "•";
  color: var(--accent-color);
  margin-right: calc(var(--spacing-unit) * 0.5);
  display: inline-block;
}

.timeline-content ul li {
  margin-left: calc(var(--spacing-unit) * 0.5);
  padding-left: calc(var(--spacing-unit) * 0.5);
  text-indent: calc(-0.5 * var(--spacing-unit));
}

.timeline-date {
  color: var(--accent-color);
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

hr {
  height: 1px;
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  margin: calc(var(--spacing-unit) * 0.5) 0;
}

.timeline-content a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.timeline-content a:hover {
  opacity: 0.8;
}

.timeline-content > p {
  text-align: justify;
}

.section-nav {
  margin-top: calc(var(--spacing-unit) * 4);
  text-align: center;
}

.section-nav a {
  color: var(--text-color);
  text-decoration: none;
  margin: 0 var(--spacing-unit);
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.section-nav a:hover {
  opacity: 1;
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .hero-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
  }

  .hero-nav a {
    margin: 0;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-content {
    width: calc(100% - 30px);
    margin-left: 30px !important;
  }

  .timeline-content::before {
    left: -40px !important;
  }
}

footer {
  /* background-color: var(--secondary-color); */
  padding: calc(var(--spacing-unit) * 2) 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

.footer-content p {
  margin: calc(var(--spacing-unit) * 0.5) 0;
}

.footer-content a {
  color: var(--text-color);
  text-decoration: underline;
  transition: opacity 0.3s ease;
}

.footer-content a:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  footer {
    padding: var(--spacing-unit) 0;
  }
}

.scroll-down {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  animation: bounce 2s infinite;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 1;
  pointer-events: auto;
}

.scroll-down:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%) translateY(-5px);
}

.scroll-down i {
  color: var(--text-color);
  font-size: 1.5rem;
}

/* @media (max-width: 768px) {
  .scroll-down {
    bottom: 5px;
  }
} */

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.quote {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-color);
  margin: var(--spacing-unit) 0;
  text-align: justify;
  white-space: pre-wrap;
}
.quote-author {
  font-size: 1.25rem;
  color: var(--text-color);
  margin-top: calc(var(--spacing-unit) * 0.5);
}
.quote-author::before {
  content: "- ";
}
.quote-author::after {
  content: " -";
}

article {
  text-align: justify;
}

article hr {
  height: 1px;
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  margin: calc(var(--spacing-unit) * 0.5) 0;
}

article a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

article a:hover {
  opacity: 0.8;
}

article ul {
  list-style: none;
  padding: 0;
}

article ul li::before {
  content: "•";
  color: var(--text-color);
  margin-right: calc(var(--spacing-unit) * 0.5);
  display: inline-block;
}

article ul li {
  margin-left: calc(var(--spacing-unit) * 0.5);
  padding-left: calc(var(--spacing-unit) * 0.5);
  text-indent: calc(-0.5 * var(--spacing-unit));
}

article code {
  background-color: var(--secondary-color);
  padding: calc(var(--spacing-unit) * 0.2);
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  color: var(--text-color);
}
article pre {
  background-color: var(--secondary-color);
  padding: calc(var(--spacing-unit) * 0.5);
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  color: var(--text-color);
  overflow-x: auto;
}
article pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

article .center {
  text-align: center;
}

article blockquote {
  font-style: italic;
  color: var(--text-color);
  text-align: justify;
  margin: var(--spacing-unit) 0;
}

article .citazioneAutore {
  margin-left: var(--spacing-unit);
  display: block;
}

.alert {
  background-color: var(--secondary-color);
  padding: calc(var(--spacing-unit) * 0.5);
  border-radius: 4px;
  color: var(--text-color);
}

.alert-warning {
  background-color: #ffcc00;
  color: #000;
}
