:root {
  --text-color: #131313;
  --light-text-color: #909090;
  --text-color-hover: #007bff;
  --scrollbar-width: 0px; /* Updated via JS */
}

/* Base Typography & Reset */
html {
  font-size: 14px;
}

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

body, html, #lightbox {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--text-color);
}

p {
  font-size: 1.4rem;
}

.black-bg {
  background-color: black;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
header {
  color: #e5e5e5;
  display: flex;
  position: absolute;
  padding: 0 1rem;
  height: 60px;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  top: 0;
  z-index: 1000;
}

h1 {
  font-size: 5rem;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

/* Navigation */
#nav-bar ul {
  list-style-type: none;
  display: flex;
}

#nav-bar li a {
  color: #fff;
  padding: 0.75rem;
  transition: color 0.3s ease;
}

#nav-bar li a:hover {
  color: var(--text-color-hover);
}

/* Logo */
#logo {
  font-family: "Playfair Display", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 4rem;
}

/* Carousel */
.carousel {
  position: relative;
  width: calc(100vw - var(--scrollbar-width));
  height: 90vh;
  overflow: hidden;
  cursor: pointer;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 100%;
  width: calc(100vw - var(--scrollbar-width));
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: left 0.5s ease;
}

.carousel-slide.active {
  left: 0;
  display: block;
}

.carousel-content {
  position: absolute;
  text-align: right;
  width: calc(100vw - var(--scrollbar-width));
  bottom: 10%;
  right: 5vw;
  color: #fff;
}

.carousel-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.carousel-control {
  background: none;
  border-radius: 50%;
  width: 4rem;
  height: 4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #fff;
  z-index: 10;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-size: 3rem;
  border-radius: 50%;
}

.carousel-control.prev { left: 20px; }
.carousel-control.next { right: 20px; }

.carousel-control:hover {
  color: var(--text-color-hover);
  transition: all 0.3s ease-in-out;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 1;
}

.carousel-indicator {
  width: 6px;
  height: 6px;
  display: inline-block;
  background-color: #eee;
  opacity: 65%;
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-indicator.active { 
  background-color: #007bff; 
  opacity: 100%;
}

/* Portfolio */
.portfolio-grid {
  display: grid;
  
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.portfolio-item {
  margin-top: 1rem;
  overflow: hidden;
}

.portfolio-item:hover {
  transform: scale(1.1);
  transition: all 0.6s ease;
}

.portfolio-item h3 {
  font-weight: 400;
  color: #fff;
}

.portfolio-item a {
  display: block;
  color: var(--text-color);
}

.portfolio-item:hover h3 {
  color: var(--text-color-hover);
  transition: all 0.6s ease;
}

.portfolio-thumbnail {
  border-radius: 0.5rem;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Footer */
footer {
  width: 100%;
  color: var(--light-text-color);
  text-align: left;
  padding: 1rem 2rem;
  margin-top: 6rem;
}

#projects {
  margin-top: 4rem;
  padding: 0 2rem;
}

.preloader {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 2s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

p a {
  color: #007bff;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 768px) {
  html {
    font-size: 12px;
  }

  .carousel-content {
    text-align: center;
    width: 50%;
    bottom: 8%;
    right: 0;
    transform: translate(-50%, -50%);
  }

  #hero-carousel {
    height: 70vh;
  }

  .carousel-control {
    display: none;
  }

  .carousel-video {
    width: 100%;
    object-fit: cover;
  }

  #projects {
    padding: 0 1rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}