html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  background: url('/assets/synapse1.jpg') no-repeat center center fixed;
  background-size: cover;
  background-color: #1a1a1a;
  z-index: 0;
  margin: 0;
  padding: 0;
  padding-top: 60px; /* Account for fixed header */
  height: auto;
  overflow-y: visible;
  color: white;
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
}

body:where([href="index.html"], [href="projects.html"]) {
  height: 100vh;
  overflow: hidden;
}

body[href="about.html"] {
  height: auto;
  overflow-y: auto;
  padding-top: 40px; /* Smaller header for about page */
}

body[href="about.html"] .menu-bar {
  height: 40px; /* Reduced header height for about page */
}

body[href="about.html"] .content-block {
  min-height: auto;
  opacity: 1;
  transform: translateY(0);
}

.about-contact-wrapper {
  display: flex;
  justify-content: space-between;
  padding: 18vh 8vw 10vh 8vw;
  margin-bottom: 0;
  align-items: flex-start;
}

.about-block {
  max-width: 45%;
  padding: 0;
  box-sizing: border-box;
}

.contact-block {
  max-width: 45%;
  padding: 0;
  box-sizing: border-box;
  text-align: right;
}

.contact-block .text-container {
  display: inline-block;
  text-align: left;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: black;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.scroll-container {
  position: relative;
  z-index: 10;
  padding-top: 0; /* Removed - body now has padding-top: 60px */
}

.content-blocks {
  padding-top: 0;
}

.content-block {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4vw;
  padding: 25vh 8vw 10vh 8vw;
  min-height: 100vh;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: relative;
  z-index: 60;
  scroll-snap-align: start;
}

.content-block.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Alternate layout: media on right (default) */
.content-block:has(.media-container) {
  flex-direction: row;
}

/* Alternate layout: media on left (only for blocks WITH media) */
.content-block:nth-child(even):has(.media-container) {
  flex-direction: row-reverse;
}

.text-container {
  flex: 0 1 480px;
  min-width: 300px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  padding: 40px;
  backdrop-filter: blur(10px);
  align-self: flex-start;
}

/* Typography System - Based on Patriot Page Standards */
.text-container h1 {
  font-size: 2.5em;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 20px;
  line-height: 1.2;
}

.text-container h2 {
  font-size: 1.8em;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.text-container h2:first-child {
  margin-top: 0;
}

.text-container h3 {
  font-size: 1.4em;
  font-weight: 500;
  margin-top: 30px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.text-container h3:first-child {
  margin-top: 0;
}

.text-container p {
  font-size: 1.1em;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 16px;
  margin-top: 0;
}

.text-container p:first-child {
  margin-top: 0;
}

.text-container ul, .text-container ol {
  font-size: 1.1em;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 16px;
}

.media-container {
  flex: 1 1 auto;
  min-width: 320px;
  max-width: 850px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.video-background {
  position: relative;
  height: 100vh;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 25vh 8vw 10vh 8vw;
  scroll-snap-align: start;
}

.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 55;
  background-color: #000000; /* Black background for any letterboxing */
}

.background-video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Show full video without cropping */
  object-position: top center; /* Align to top, bars appear at bottom/sides */
  opacity: 0.8;
}

.video-background .content {
  position: relative;
  max-width: 700px;
  z-index: 60;
}

.video-background .content .text-container {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 40px;
  backdrop-filter: blur(10px);
  margin-top: 0;
}

.video-background .content .text-container h1 {
  margin-top: 0;
}

.video-background .content .text-container p:first-child {
  margin-top: 0;
}

.menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.website-name {
  margin-left: 20px;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
}

.website-name:hover {
  opacity: 0.7;
}

.menu-button {
  display: none;
  margin-right: 20px;
  width: 24px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.menu-button .line {
  width: 100%;
  height: 2px;
  background-color: white;
  transition: all 0.3s ease;
}

.menu-button.open .line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-button.open .line:nth-child(2) {
  opacity: 0;
}

.menu-button.open .line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-links {
  margin-right: 20px;
}

.menu-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

.menu-links li {
  position: relative;
}

.menu-links a {
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 15px;
  transition: opacity 0.2s ease;
}

.menu-links a:hover {
  opacity: 0.7;
}

.menu-links .dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background-color: rgba(0, 0, 0, 0.9);
  min-width: 220px;
  z-index: 110;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  transition-delay: 0.1s;
  pointer-events: none;
}

.menu-links .dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.dropdown-content li {
  margin: 0;
}

.dropdown-content a {
  padding: 10px 20px;
  display: block;
  font-size: 13px;
  text-align: left;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.custom-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.custom-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 15px;
  font-size: inherit; /* Inherit from text-container (1.1em) */
  font-weight: 300;
  line-height: 1.7; /* Match paragraph line-height */
  text-align: left;
}

.custom-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #00aaff;
  font-size: 18px;
}

.resume-link {
  color: #00aaff;
  text-decoration: none;
}

.resume-link:hover {
  text-decoration: underline;
}

.social-links {
  margin-top: 20px;
  display: flex;
  gap: 15px;
}

.social-logo {
  width: 24px;
  height: 24px;
  transition: opacity 0.2s ease;
}

.social-logo:hover {
  opacity: 0.7;
}

.cta-button {
  display: inline-block;
  padding: 10px 20px;
  margin-top: 20px;
  border: 2px solid white;
  color: white;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cta-button:hover {
  opacity: 0.7;
  text-decoration: none;
}

.content-block--half {
  max-width: 45%;
  padding: 40px;
  box-sizing: border-box;
}

.contact-me-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
}

.profile-image {
  position: static;
  width: 200px;
  aspect-ratio: 2959 / 3699;
  margin-top: 20px;
  align-self: flex-end;
}

.animation-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.animation-canvas.visible {
  opacity: 1;
}

.loading-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top: 3px solid #00aaff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 200;
}

.loading-indicator span {
  display: none;
}

.scroll-arrow {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
}

.scroll-arrow.visible {
  opacity: 1;
}

.scroll-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #00aaff;
  stroke-width: 2;
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

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

/* Content blocks without media should position text to match video background text positioning */
.content-block:not(:has(.media-container)) {
  justify-content: flex-start;
  align-items: flex-start;
}

.content-block:not(:has(.media-container)) .text-container {
  max-width: 700px;  /* Match video background text width */
  flex: 1 1 auto;
  /* No margin-left - uses parent padding (8vw) to match video pages */
}

.project-image, .project-video {
  width: 100%;
  min-height: 40vh;
  max-height: 70vh;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.project-media {
  border: 2px solid var(--theme-color);
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40vh;
  max-height: 70vh;
}

.media-container .project-media {
  height: auto;
}

.image-stack {
  position: relative;
  width: 100%;
  min-height: 40vh;
  max-height: 70vh;
  height: 50vh;
  display: inline-block;
}

.stack-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease;
  border-radius: 8px;
  object-fit: contain;
}

/* Color Themes */
body.non-arkane-project {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), linear-gradient(rgba(0, 170, 255, 0.1), rgba(0, 170, 255, 0.1)), url('/assets/synapse1.jpg') no-repeat center center fixed;
  background-size: cover, cover, cover;
  background-blend-mode: multiply, overlay;
  --theme-color: #00aaff;
}

body.arkane-project {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), linear-gradient(rgba(255, 77, 77, 0.1), rgba(255, 77, 77, 0.1)), url('/assets/synapse1.jpg') no-repeat center center fixed;
  background-size: cover, cover, cover;
  background-blend-mode: multiply, overlay;
  --theme-color: #ff4d4d;
}

.non-arkane-project .custom-list li::before,
.non-arkane-list li::before {
  color: #00aaff;
}

.arkane-project .custom-list li::before,
.arkane-list li::before {
  color: #ff4d4d;
}

.non-arkane-project a:hover {
  text-decoration-color: #00aaff;
}

.arkane-project a:hover {
  text-decoration-color: #ff4d4d;
}

.non-arkane-project .scroll-arrow svg {
  stroke: #00aaff;
}

.arkane-project .scroll-arrow svg {
  stroke: #ff4d4d;
}

.non-arkane-project .resume-link {
  color: #00aaff;
}

.arkane-project .resume-link {
  color: #ff4d4d;
}

@media (max-width: 768px) {
  .menu-button {
    display: flex;
  }

  .menu-links {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 100;
  }

  .menu-links.open {
    display: block;
  }

  .menu-links ul {
    flex-direction: column;
    padding: 20px;
    align-items: flex-start;
  }

  .menu-links li {
    margin: 15px 0;
  }

  .menu-links a {
    font-size: 16px;
    padding: 10px 0;
  }

  .menu-links .dropdown-content {
    display: none;
    position: static;
    background-color: transparent;
    box-shadow: none;
    z-index: 100;
    transition: none;
    pointer-events: auto;
  }

  .content-block {
    flex-direction: column !important;
    padding: 15vh 5vw 8vh 5vw;
    min-height: auto;
    gap: 4vh;
    align-items: stretch;
  }

  .text-container {
    max-width: 100%;
    min-width: auto;
    padding: 30px 24px;
    flex: 1 1 auto;
  }

  /* Mobile Typography - Scaled down proportionally */
  .text-container h1 {
    font-size: 2em;
  }

  .text-container h2 {
    font-size: 1.5em;
  }

  .text-container h3 {
    font-size: 1.25em;
  }

  .text-container p {
    font-size: 1em;
  }

  .text-container ul, .text-container ol {
    font-size: 1em;
  }

  .media-container {
    max-width: 100%;
    min-width: auto;
    width: 100%;
  }

  .project-image, .project-video {
    min-height: 30vh;
    max-height: 50vh;
  }

  .image-stack {
    min-height: 30vh;
    max-height: 50vh;
    height: 40vh;
  }

  .video-background {
    padding: 15vh 5vw 8vh 5vw;
    justify-content: flex-start;
  }

  .video-background .content {
    max-width: 100%;
  }

  .video-background .content .text-container {
    padding: 30px 24px;
  }

  .profile-image {
    width: 150px;
    align-self: center;
  }

  .about-contact-wrapper {
    flex-direction: column;
    padding: 15vh 5vw 8vh 5vw;
  }

  .about-block,
  .contact-block {
    max-width: 100%;
    padding: 0;
  }

  .contact-block {
    text-align: left;
  }
}
