:root {
  --ferrari-red: #e10600;
  --mercedes-muted: #009e94;
}

#cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

#typewriter {
  font-family: 'Orbitron', sans-serif;
}

h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

h3 {
  font-family: 'Tillium Web', sans-serif;
}

/********************/
/* NAVIGATION START */
/********************/

.navbar {
  background-color: transparent;
  padding: 2rem 0rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%; /* Make it span the whole screen */
  z-index: 1000;
  display: flex;
  justify-content: center; /* keep the nav centered */
  background-color: rgba(255, 255, 255, 0.95); /* soft white */
  backdrop-filter: blur(6px); /* frosted glass effect */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* soft shadow */
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 3rem;
  max-width: 800px;
  padding: 0;
  margin: 0 auto;
  width: 100%;
  justify-content: center;
}

.navbar a {
  color: var(--mercedes-muted); /* hsl(236, 33%, 58%); /*  soft indigo */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

@media (max-width: 760px) {
  .navbar ul {
    display: block;
    text-align: right;
    padding-right: 2rem;
    width: 100%;
  }

  #about {
    padding-top: 5rem;
  }
}

/******************/
/* NAVIGATION END */
/******************/

.warning {
  background-color: rgba(0, 158, 148, .25);
  border-radius: 5px;
  padding: 1em;
}

body a {
  color: var(--mercedes-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, border-bottom 0.2s ease;
  border-bottom: 1px dotted transparent;
}

.body-link:hover {
  color: #4bc0c8;
  border-bottom: 1px dotted #4bc0c8;
  text-shadow: 0 0 0.5px #ccc, 0 0 3px rgba(255, 255, 255, 0.15);
}

html {
  scroll-behavior: smooth;
  margin: 0;
  body: 0;
}

#writing, #projects, #photos, #photos {
  scroll-margin-top: 100px;
}

#technical-docs, #editorial-content {
  scroll-margin-top: 110px;
}

.bio-container {
  padding-top: 6rem;
  margin: 0 auto;
  text-align: left;
  max-width:800px;
}

.intro-list {
  margin-top: 1.5rem;
  padding-left: 2.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  list-style-type: disc;
}

.intro-list li {
  margin-bottom: 0.3rem;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  background-color: #fff;
  margin: 0;
  padding: 0 0 2rem 0;
  text-decoration: none;
}

/* F1 START */

.f1-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2.5rem auto;
  width: 100%;
  padding-top: 1.75rem;
}

.f1-car-container {
  position: relative;
  width: 200px; /* Same as checkered board width */
  height: 40px;
}

.f1-car-container.divider {
  margin-top: -1rem;
  padding-bottom: 1rem;
}

.checkered-board {
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(45deg, #000 25%, transparent 25%), 
    linear-gradient(-45deg, #000 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #000 75%), 
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  background-color: #fff;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}

.f1-car {
  font-size: 2rem;
  position: absolute;
  top: 0;
  left: 110%; /* was 100%, now starts just off to the right */
  z-index: 2;
  /* animation: carMove 2s ease-out forwards; */
}

.f1-car.drive {
  animation: driveAcross 2s ease forwards;
}

.f1-puff.drive {
  animation: puffMove 2s ease-out forwards;
}

@keyframes driveAcross {
  from {
    transform: translateX(0); /* adjust this as needed */
  }
  to {
    transform: translateX(-550%);
  }
}

@keyframes carMove {
  0% {
    left: 95%; /* still starts slightly off to the right */
  }
  100% {
    left: -15%; /* ends just a little to the left of the board */
  }
}

.f1-puff {
  font-size: 1.5rem;
  position: absolute;
  top: 0.2rem;
  left: 127%; /* car starts at 110%, puff slightly behind */
  opacity: 0;
  /* animation: puffMove 2s ease-out forwards; */
  z-index: 1;
}

@keyframes puffMove {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateX(-30px);
    opacity: 0;
  }
}

/* F1 END */

.f1-divider {
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(45deg, #000 25%, transparent 25%), 
    linear-gradient(-45deg, #000 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #000 75%), 
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  background-color: #fff;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}

.section {
  padding: 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.writing-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: hsl(236, 33%, 58%);
  font-family: 'Inter', sans-serif;
}

.writing-list article {
  margin-bottom: 2rem;
}

.writing-list h3 a {
  font-size: 1.2rem;
  color: hsl(236, 33%, 58%);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.writing-list h3 a:hover {
  color: hsla(241, 57%, 45%, 0.93);
}

.writing-list p {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.6;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 2rem;
  text-decoration: none;
  z-index: 1000;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.7;
}

.back-to-top:hover {
  transform: scale(1.2) rotate(-15deg);
  opacity: 1;
}

@keyframes popBottle {
  0% {
    transform: scale(1) rotate(0deg);
  }
  30% {
    transform: scale(1.3) rotate(-20deg);
  }
  60% {
    transform: scale(1.1) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 2rem;
  text-decoration: none;
  z-index: 1000;
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.project-button {
  background-color: transparent;
  color: var(--mercedes-muted);
  border: 2px solid var(--mercedes-muted);
  padding: 0.5rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  margin-right: 0.75rem;
  margin-top: 0.5rem;
}

.project-button:hover {
  background-color: var(--mercedes-muted);
  color: white;
  box-shadow: 0 0 10px rgba(0, 158, 148, 0.4);
}

.back-to-top:hover {
  transform: scale(1.2) rotate(-15deg);
  opacity: 1;
}

.back-label {
  font-size: 0.65rem;
  color: hsl(236, 33%, 58%);
  font-weight: 600;
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

@media (max-width: 900px) {
  .back-to-top {
    display: none;
  }

  .social-footer, .social-footer a, .social-footer i {
    display: none;
  }

}

/* CAROUSEL */

.carousel-container {
  width: 100%;
  max-width: 800px;
  max-height: 520px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000; /* optional background fill */
}

.carousel-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  background-color: rgba(0, 0, 0, 0.25);
  border: none;
  font-size: 1.5rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  z-index: 2;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
}

.carousel-btn:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

/* Footer */

.social-footer {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  gap: 1rem;
  font-size: 2rem;
  z-index: 999;
  padding: 0 0 1.5rem 1.5em;
}

.social-footer a {
  color: var(--mercedes-muted);
  transition: color 0.3s ease;
}

.social-footer a:hover {
  color: #4bc0c8;
  text-shadow: 0 0 0.5px #ccc, 0 0 3px rgba(255, 255, 255, 0.15);
}


/* The End */

#the-end {
  padding-top: 0.5rem;
}

.special-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  text-align: center;
  display: block;
}

#lights-out {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  text-align: center;
  display: block;
}

.f1-inline.end {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2.5rem auto;
  width: 100%;
  padding-top: 1.75rem;
}

.f1-car-container.end {
  position: relative;
  width: 200px; /* Same as checkered board width */
  height: 40px;

.f1-car.end {
  font-size: 2rem;
  position: absolute;
  top: 0;
  left: 110%; /* was 100%, now starts just off to the right */
  z-index: 2;
  animation: carMove 1s linear infinite;
}

.f1-puff.end {
  font-size: 1.5rem;
  position: absolute;
  top: 0.2rem;
  left: 127%; /* car starts at 110%, puff slightly behind */
  opacity: 0;
  animation: puffMove 1s ease-out infinite;
  z-index: 1;
}