:root {
  --primary-color: #007bff;
  --secondary-color: #f8f8f8;
  --text-color-dark: #333;
  --text-color-medium: #555;
  --text-color-light: #666;
  --background-color-light: #fff;
  --background-color-grey: #f8f8f8;
  --shadow-light: 0 1px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 12px 25px rgba(0, 0, 0, 0.2);
  --container-max-width: 1200px;
  --header-height: 70px;
  --transition-timing: 0.2s ease;
}

body.dark-mode {
  --primary-color: #64ffda;
  --secondary-color: #1a1a1a;
  --text-color-dark: #e6e6e6;
  --text-color-medium: #b2b2b2;
  --text-color-light: #999;
  --background-color-light: #2a2a2a;
  --background-color-grey: #1a1a1a;
  --shadow-light: 0 1px 8px rgba(255, 255, 255, 0.05);
  --shadow-medium: 0 4px 12px rgba(255, 255, 255, 0.08);
  --shadow-hover: 0 12px 25px rgba(255, 255, 255, 0.15);
}

body.dark-mode #theme-toggle img {
  filter: invert(1);
}

body {
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background-color-light);
  color: var(--text-color-dark);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol";
  line-height: 1.7;
  margin: 0;
  padding-top: var(--header-height);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

.container {
  margin: 0 auto;
  max-width: var(--container-max-width);
  padding: 0 25px;
}

.site-header {
  background-color: var(--background-color-light);
  box-shadow: var(--shadow-light);
  left: 0;
  padding: 15px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.site-header .container {
  align-items: center;
  display: flex;
  justify-content: space-between;
  position: relative;
}

.back-button {
  background-color: var(--background-color-grey);
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  color: var(--text-color-dark);
  font-size: 1em;
  font-weight: 500;
  left: 0;
  margin-right: 20px;
  padding: 8px 15px;
  position: relative;
  text-decoration: none;
  top: auto;
  transform: none;
  transition: all 0.3s ease;
}

.back-button:hover {
  background-color: #e9ecef;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  color: var(--primary-color);
  text-decoration: none;
}

.back-button:active {
  background-color: #dee2e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateY(1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

#theme-toggle {
  align-items: center;
  background: none;
  border: none;
  color: var(--text-color-medium);
  cursor: pointer;
  display: flex;
  height: 30px;
  justify-content: center;
  padding: 5px;
  transition: color 0.3s ease;
  width: 30px;
}

#theme-toggle:hover {
  color: var(--primary-color);
}

#theme-toggle img {
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  width: 100%;
}

#theme-toggle #sun-icon {
  display: none;
}

body.dark-mode #theme-toggle #moon-icon {
  display: none;
}

body.dark-mode #theme-toggle #sun-icon {
  display: inline-block;
}

.site-main section {
  padding: 100px 0;
}

.section-title {
  color: var(--text-color-dark);
  font-size: 3em;
  margin-bottom: 20px;
  position: relative;
  text-align: center;
}

.project-section {
  background-color: var(--background-color-light);
  padding: 60px 0;
}

.project-title {
  color: var(--text-color-dark);
  font-size: 3em;
  margin-bottom: 40px;
  text-align: center;
}

.project-details {
  color: var(--text-color-medium);
  font-size: 1.1em;
  margin-bottom: 40px;
  text-align: center;
}

.project-description-section {
  color: var(--text-color-dark);
  margin-bottom: 40px;
}

.project-description-section p {
  margin-bottom: 20px;
  text-align: justify;
}

.project-description-section ul {
  color: var(--text-color-medium);
  list-style: disc;
  margin-left: 20px;
}

.project-description-section li {
  color: var(--text-color-medium);
  margin-bottom: 8px;
}

.project-description-section ul li::marker {
  color: var(--primary-color);
}

.project-image-section {
  margin-bottom: 40px;
}

.video-embed-container {
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  height: 0;
  margin-bottom: 20px;
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
  width: 100%;
}

.video-embed-container iframe {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.responsive-image-container {
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  height: 0;
  margin-bottom: 20px;
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
  width: 100%;
}

.responsive-image-container img {
  display: block;
  height: 100%;
  left: 0;
  object-fit: fill;
  position: absolute;
  top: 0;
  width: 100%;
}

.project-thumbnail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 2fr);
}

.project-thumbnail-grid img {
  box-shadow: var(--shadow-medium);
  border-radius: 8px;
  height: auto;
  width: 100%;
}

.project-image-section p {
  color: var(--text-color-light);
  font-size: 0.9em;
  margin-bottom: 20px;
  margin-top: 10px;
  text-align: center;
}

.project-image-section p:last-child {
  margin-bottom: 0;
}

.project-video-container {
  background-color: #000;
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  height: 0;
  margin-bottom: 20px;
  overflow: hidden;
  padding-bottom: 56.25%;
  position: relative;
  width: 100%;
}

.project-video-container video {
  display: block;
  height: 100%;
  left: 0;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
}

@media (max-width: 767px) {
  .project-section {
    padding: 40px 0;
  }

  .project-title {
    font-size: 2.5em;
    margin-bottom: 30px;
  }

  .project-details {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .project-description-section {
    margin-bottom: 30px;
  }

  .project-description-section p {
    text-align: justify;
  }

  .project-thumbnail-grid {
    gap: 15px;
    grid-template-columns: repeat(1, 1fr);
  }

  .back-button {
    margin-right: 15px;
  }

  .video-embed-container,
  .responsive-image-container,
  .project-video-container {
    margin-bottom: 15px;
  }
}

.site-footer {
  background-color: var(--background-color-light);
  color: var(--text-color-light);
  font-size: 0.9em;
  margin-top: 80px;
  padding: 40px 0;
  text-align: center;
}

.site-footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  text-decoration: underline;
}

a:focus,
button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.js-scroll {
  opacity: 0;
  transform: translateY(50px);
  will-change: opacity, transform;
}

.js-scroll.is-in-view {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.js-scroll:nth-child(odd).is-in-view {
  transition-delay: 0.1s;
}

.js-scroll:nth-child(even).is-in-view {
  transition-delay: 0.2s;
}
