/* --- RESET & GLOBAL TYPOGRAPHY --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0d0d0d;
  color: #ffffff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* --- HEADER & NAVIGATION --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 2rem 3rem;
  z-index: 100;
  mix-blend-mode: difference;
}

.logo {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

nav a {
  font-weight: 700;
  font-size: 0.9rem;
  margin-left: 2rem;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

nav a:hover {
  opacity: 0.6;
}

/* --- PAGE SECTIONS --- */
.page-section {
  display: none;
  min-height: 100vh;
  padding-top: 100px;
}

.page-section.active {
  display: block;
}

/* --- HOME: DEMO REEL BUTTON (16:9) --- */
#home {
  display: none;
  align-items: center;
  justify-content: center;
}

#home.active {
  display: flex;
}

.reel-container {
  width: 80vw;
  max-width: 1000px;
}

.reel-button {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background-color: #1a1a1a;
  cursor: pointer;
  overflow: hidden;
  border-radius: 4px;
}

.reel-button img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-button .state-hover {
  display: none;
}

.reel-button:hover .state-idle {
  display: none;
}

.reel-button:hover .state-hover {
  display: block;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 12px 24px;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: background 0.2s;
}

.reel-button:hover .play-overlay {
  background: #ffffff;
  color: #000000;
}

/* --- WORK: CARGO STYLE INDEX & GRID LAYOUT --- */
.cargo-container {
  display: flex;
  padding: 2rem 3rem;
  gap: 3rem;
  align-items: flex-start;
}

/* Sidebar Index */
.project-index {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 120px;
}

.project-index h3 {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: #666;
}

.project-index ul.index-tree {
  list-style: none;
}

.project-index li {
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.project-index a:hover {
  opacity: 0.5;
}

.index-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.index-title {
  cursor: pointer;
}

.toggle-btn {
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}

.index-sublist {
  list-style: none;
  padding-left: 0.75rem;
  margin-top: 0.5rem;
  border-left: 1px solid #333;
}

.index-sublist.hidden {
  display: none;
}

.index-sublist li {
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.index-sublist li a::before {
  content: "• ";
  color: #666;
}

/* Right Side Content Area */
.grid-content-area {
  flex-grow: 1;
  width: 100%;
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
}

.grid-item {
  cursor: pointer;
}

.thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  background: #111;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail .hover {
  display: none;
}

.grid-item:hover .idle {
  display: none;
}

.grid-item:hover .hover {
  display: block;
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
}

.item-title {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Submenu Container (Nested inside content area) */
.submenu-container {
  width: 100%;
}

.submenu-container h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.submenu-description {
  font-size: 0.9rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 2rem;
  max-width: 600px;
  font-weight: 500;
}

.submenu-container.hidden {
  display: none;
}

.back-btn {
  background: none;
  border: none;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* --- ABOUT PAGE --- */
.about-content {
  max-width: 800px;
  padding: 4rem 3rem;
}

.about-content h1 {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

/* Profile Image Styling (Fixed to 540x670 proportion) */
.profile-image-container {
  width: 100%;
  max-width: 375px;
  aspect-ratio: 375 / 465;
  overflow: hidden;
  margin-bottom: 2rem;
  background-color: #111;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bio {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3rem;
  color: #ccc;
}

.about-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.experience-lists {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-details h3 {
  font-size: 0.75rem;
  font-weight: 900;
  color: #666;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.about-details p {
  font-weight: 700;
  line-height: 1.5;
}

/* --- LIGHTBOX OVERLAY PLAYER (FIXED SCROLLING & ACCESSIBLE CLOSE BUTTON) --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  overflow-y: auto; /* Allows smooth scrolling if content expands past screen height */
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  width: 90vw;
  max-width: 1100px;
  margin: auto 0;
}

/* Sticky Close Button - Stays locked to top-right even when scrolling long descriptions */
.close-btn {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1010;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  font-size: 1.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: background 0.2s, color 0.2s;
}

.close-btn:hover {
  background: #fff;
  color: #000;
}

.video-aspect-ratio {
  clear: both;
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
  background: #000;
}

.video-aspect-ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Lightbox Metadata & Expandable Info */
.player-info-container {
  margin-top: 1.25rem;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
  padding-bottom: 2rem;
}

.meta-primary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.meta-line strong {
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.more-info-btn {
  background: none;
  border: 1px solid #444;
  color: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 12px;
  margin-top: 1.25rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.more-info-btn:hover {
  background: #fff;
  color: #000;
}

.more-info-content {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.more-info-content.hidden {
  display: none;
}

.info-block h4 {
  font-size: 0.7rem;
  color: #666;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.info-block p {
  color: #ccc;
  font-weight: 400;
  white-space: pre-line;
}

/* --- RESPONSIVE / MOBILE STYLES --- */
@media (max-width: 768px) {
  header {
    padding: 1.5rem;
  }

  .project-index {
    display: none;
  }

  .cargo-container, .submenu-container, .about-content {
    padding: 1.5rem;
  }

  .about-content h1 {
    font-size: 2.5rem;
  }

  .about-details {
    grid-template-columns: 1fr;
  }
}

/* --- CENTER FIX FOR TWITTER / X EMBEDS --- */
.video-aspect-ratio iframe[src*="twitter.com"] {
  left: 50% !important;
  transform: translateX(-50%);
  max-width: 550px;
}