html {
  scroll-behavior: smooth;
}

/* --- GLOBAL RESET & BASE --- */
:root {
  --hendi-purp: #6B52FF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  width: 100%;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
  background: #1f2026;
  color: #eaeaf0;
  line-height: 1.6;
  font-size: 1.15rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- NAV --- */
/* Ensure Nav stays on top of everything */
.nav {
  position: relative;
  z-index: 999;
  height: 8vh;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1vw;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.nav-brand:hover {
  opacity: 0.7;
}

.nav-logo {
  height: 6vh;
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 100%;
  width: auto;
}

.nav-name {
  display: flex;
  flex-direction: column;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  text-align: left;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.3s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

/* --- UPDATED HERO SLIDESHOW & OVERLAY STYLES --- */

.hero {
  position: relative;
  width: 100vw;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #1f2026;
  z-index: 1;
  /* Keeps the whole section behind the Nav */
}

.hero-slideshow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* Lowest layer inside the hero */
  overflow: hidden;
}

/* 3. Style individual slides for full coverage and smooth transitions */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
}

/* 5. Hide the old static grid image and the complex CSS shape */
.hero-image,
.hero-text {
  clip-path: none;
  /* Disables the original triangle shape */
}

.hero-image {
  display: none;
  /* Fully hides the old static grid */
}

/* Ensure the text and buttons inside are legible */
.hero-title,
.hero-description,
.hero-cta {
  position: relative;
  z-index: 6;
}

.hero-text {
  position: relative;
  z-index: 5;
  /* Moves this layer ABOVE the slideshow (z-index 1) */
  min-height: 80vh;
  width: 100%;
  /* Takes full width so it doesn't artificially cut the background */
  padding: 6vh 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-text::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  background-image: url('../imgs/Header-Img.png');
  /* Width forces horizontal reach (guaranteed 90vw minimum), auto height strictly prevents any warping */
  /* Because height is auto, it naturally bleeds off the top/bottom depending on the monitor shape */
  background-size: max(1400px, 90vw) auto;
  background-repeat: no-repeat;
  background-position: left center;
  z-index: -1;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 15px;
}

.hero-title,
.hero-cta {
  /* Dynamically constrained to strictly a percentage of the viewport width so it never exceeds the 90vw background */
  max-width: max(300px, 35vw);
}

.highlight {
  color: #000000;
}

.hero-description {
  font-size: 1.25rem;
  line-height: 1.5;
  color: #ffffff;
  max-width: max(250px, 28vw);
  margin-bottom: 25px;
}

.hero-image {
  position: absolute;
  top: 0;
  right: 0;
  width: 60vw;
  height: 100%;
  background: url('../imgs/Header-Imgv2.png');
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-cta {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.btn-hero {
  display: inline-block;
  padding: 12px 28px;
  background-color: #cfcdf8;
  color: #000;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-hero:hover {
  background-color: #fff;
  transform: translateY(-2px);
}

/* --- HOME OVERLAP --- */
.home-overlap {
  position: relative;
  z-index: 10;
  margin-top: 0;
  /* Pass W3C Validation */
  background: #1f2026;
  border-radius: 40px 40px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  padding-top: 20px;
}

/* --- PROJECT GRID --- */
.section {
  padding: 6vh 6vw;
}

.section h2 {
  font-size: 3rem;
  margin-bottom: 4vh;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  display: block;
  aspect-ratio: 1 / 1;
  background: #2b2c35;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
  text-decoration: none;
}

.card:hover {
  transform: scale(1.02);
}

/* --- CTA SECTION --- */
.cta-row {
  padding: 6vh 6vw;
  display: flex;
  gap: 3vw;
}

.cta {
  width: 50%;
  height: 60vh;
  background: #2a2b34;
  padding: 4vh 3vw;
  border-radius: 2vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.cta h3 {
  font-size: 1.5rem;
  margin-bottom: 2vh;
  text-align: center;
}

.cta-image {
  width: 100%;
  height: 38vh;
  background-size: cover;
  border-radius: 1.5vw;
  margin-bottom: 2vh;
}

button {
  padding: 12px 30px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  border-radius: 8px;
  border: none;
  background: #cfcdf8;
  color: #1f2026;
  cursor: pointer;
  transition: transform 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
}

/* --- ABOUT & CONTACT --- */
.about,
.contact {
  padding: 6vh 6vw;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.about-text,
.contact-form,
.about-image,
.contact-image {
  width: 100%;
}

.contact-form h2 {
  font-size: 2.5rem;
  margin-bottom: 2vh;
}

.about-image,
.contact-image {
  height: 80vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 20px;
}

input,
textarea {
  width: 100%;
  margin-bottom: 1.5vh;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #eaeaf0;
}

/* --- PROJECT PAGE SPECIFIC --- */

.project-hero-full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 5%;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
}

.project-container.card-overlap {
  background: #2a2b34;
  width: calc(100% - 8vw);
  /* CHANGE THIS */
  margin: 0 auto;
  margin-top: -150px;
  padding: 6vh 2vw;
  border-radius: 2.5vw 2.5vw 0 0;
  position: relative;
  z-index: 10;
  box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.6);
}

.project-split {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 4vw;
  width: 100%;
  padding: 6vh 6vw;
}

/* Prevent double horizontal padding when .project-split is nested inside .section */
.section .project-split {
  padding-left: 0;
  padding-right: 0;
}

.split-text {
  flex: 1;
}

.split-text h2 {
  font-size: 2.5rem;
  margin-bottom: 2vh;
}

.split-image-container {
  flex: 1;
  position: relative;
  min-height: 300px;
  /* Fallback for very short text columns */
}

.split-image-container img,
.split-image-container .responsive-audit-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 1vw;
  display: block;
}

.responsive-audit-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 1vw;
  display: block;
}

/* Specific ID for LOTW Card Back image */
#card-back-img {
  max-width: 60%;
  display: block;
  margin: 0 auto;
}

.project-card-full {
  width: 100%;
  margin-bottom: 4vh;
}

.project-card-full img {
  width: 100%;
  height: auto;
  border-radius: 1vw;
  display: block;
  margin-bottom: 20px;
}

.spec-box {
  background: rgba(207, 205, 248, 0.1);
  padding: 2.5vh 2vw;
  border-left: 4px solid #cfcdf8;
  margin-top: 3vh;
}

.spec-box h3 {
  font-size: 1.5rem;
  margin-bottom: 1vh;
  color: #cfcdf8;
}

/* Specifically enlarge the 'About Me' spec-box header to match h2 scale */
.about .spec-box h3 {
  font-size: 2.5rem;
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.project-gallery img {
  width: 100%;
  border-radius: 1.5vw;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.spread-row {
  display: flex;
  width: 100%;
  gap: 0;
  border-radius: 1.5vw;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.spread-row img {
  width: 50%;
  height: auto;
  display: block;
  border-radius: 0;
}

.caption {
  font-family: 'Lora', serif;
  font-size: 1rem;
  text-align: center;
  margin-top: 2vh;
  opacity: 0.7;
}

/* --- PROCESS LIST & LINK STYLING --- */
.process-list {
  margin: 3vh 0;
  padding-left: 20px;
  list-style-type: disc;
}

.process-list li {
  margin-bottom: 15px;
  font-size: 0.95rem;
  color: #eaeaf0;
  line-height: 1.5;
}

.process-list strong {
  color: #cfcdf8;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
}

.project-link {
  background: rgba(207, 205, 248, 0.05);
  padding: 15px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 20px;
  border-left: 3px solid #cfcdf8;
}

.project-link a {
  color: #cfcdf8;
  text-decoration: underline;
  word-break: break-all;
}

.project-link a:hover {
  color: #ffffff;
  text-decoration: none;
}

/* --- GALLERY VIDEO STYLING --- */
.gallery-item iframe {
  width: 100%;
  height: 100%;
  border-radius: 1vw;
  border: none;
}

.single-item-grid {
  grid-template-columns: 1fr !important;
  margin: 4vh 0 !important;
}

.responsive-audit-video {
  width: 100%;
  height: 100%;
  min-height: 350px;
  border-radius: 1vw;
  border: none;
  display: block;
}

.vertical-video-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 9 / 16;
  max-width: 400px;
  margin: 0 auto;
}

.responsive-vertical-video {
  width: 100%;
  height: 100%;
  border-radius: 1.5vw;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* --- 3D MODEL GRID --- */
.model-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.model-item {
  background: #2a2b33;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
}

model-viewer {
  width: 100%;
  height: 300px;
  background-color: #1e1f26;
  border-radius: 8px;
  margin-bottom: 15px;
}

model-viewer::part(poster) {
  background-size: cover;
  background-position: center;
}

model-viewer::part(progress-bar) {
  background-color: #cfcdf8;
}

.model-caption {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #cfcdf8;
}

/* --- LIGHTBOX STYLING --- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.lightbox-content {
  max-width: 95%;
  max-height: 90%;
  border-radius: 4px;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 60px;
  cursor: pointer;
}

.close-lightbox:hover {
  color: #cfcdf8;
}

.responsive-audit-img,
.project-card-full img,
.project-gallery img,
.spread-row img {
  cursor: zoom-in;
}

.email-link {
  color: #cfcdf8;
  text-decoration: none;
  font-weight: bold;
}

/* --- CHARACTER GALLERY GRID (5 Columns) --- */
.character-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
}

.character-grid .gallery-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #2a2b33;
}

.character-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

.character-grid img:hover {
  transform: scale(1.05);
}

/* --- FOOTER --- */
.site-footer {
  width: 100vw;
  background: #cfcdf8;
  padding: 4vh 6vw;
  display: block;
}

.site-footer br {
  display: none;
  /* Hide structural breaks */
}

.footer-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  flex: 1;
  justify-content: flex-start;
}

.footer-name {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2026;
  text-align: left;
}

.footer-social {
  display: flex;
  gap: 4vw;
  justify-content: center;
  align-items: center;
  flex: 1;
  position: relative;
  top: 45px;
  /* Pull down slightly more to align vertically */
}

.social-icon {
  width: 32px;
  height: 32px;
  transition: opacity 0.3s ease;
}

.social-icon img {
  width: 100%;
  height: auto;
}

.social-icon:hover {
  opacity: 0.7;
}

.footer-meta {
  flex: 1;
  text-align: right;
  margin-left: 0;
}

.footer-meta p {
  font-size: 0.75rem;
  color: #1f2026;
  opacity: 0.7;
}

/* --- Back TO top BTN --- */
#backToTop {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 99;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #1f2026;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.3s ease;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
}

/* --- MEDIA QUERIES --- */

/* TABLET & UP (768px+) */
@media screen and (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .about,
  .contact {
    flex-direction: row;
    align-items: center;
    gap: 4vw;
  }

  .about-text {
    width: 20%;
  }

  .contact-form {
    width: 50%;
  }

  .about-image {
    width: 80%;
    height: 60vh;
  }

  .contact-image {
    width: 50%;
    height: 60vh;
  }

  .project-split {
    align-items: flex-start;
    gap: 4vw;
  }

  .responsive-audit-img {
    height: auto;
    object-fit: contain;
  }
}

/* TABLET SPECIFIC (MAX 1024px) */
@media screen and (max-width: 1024px) {

  /* Prevent overlap from hiding CTA */
  .card-overlap,
  .home-overlap {
    margin-top: -50px;
  }

  .hero-title,
  .hero-cta {
    max-width: 70vw;
  }

  .hero-description {
    max-width: 60vw;
  }
}

/* MOBILE FIX (MAX 767px) */
@media screen and (max-width: 767px) {
  .hero-text::before {
    display: none;
    /* Hide the complex shape on mobile to save vertical space */
  }

  .hero-text {
    width: 100vw;
    /* Standard full-width mobile view */
    background-color: var(--hendi-purp);
    /* Revert to a solid purple background */
    border-radius: 0;
    /* Match standard mobile cards */
  }

  .hero-title,
  .hero-cta {
    max-width: 100%;
  }

  .hero {
    height: auto;
    flex-direction: column;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-description {
    max-width: 100%;
  }

  .hero-image {
    display: none;
  }

  .about,
  .contact,
  .project-split,
  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-image,
  .contact-image {
    height: 40vh;
    width: 100%;
  }

  .cta,
  .about-text,
  .contact-form,
  .split-image-container {
    width: 100%;
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .model-grid {
    grid-template-columns: 1fr;
  }

  .responsive-audit-video {
    height: 300px;
    margin-top: 20px;
  }

  #card-back-img {
    max-width: 80%;
  }

  /* Override structural footer on mobile to stack naturally */
  .footer-content {
    flex-direction: column;
    gap: 30px;
    justify-content: center;
    align-items: center;
  }

  .footer-brand,
  .footer-social,
  .footer-meta {
    flex: none;
    justify-content: center;
    text-align: center;
  }

  .footer-name {
    text-align: center;
  }

  .footer-social {
    top: 0;
  }
}

/* DESKTOP (1024px+) */
@media screen and (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-split {
    align-items: stretch;
  }

  .responsive-audit-img {
    height: 100%;
    object-fit: cover;
  }
}

.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 4vh 0;
}

.gallery-item {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1vw;
  background: #2a2b33;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* --- PROJECT PAGE NAVIGATION pls update --- */
.project-nav {
  display: flex;
  width: calc(100% - 12vw);
  margin: 0 auto;
  height: 30vh;
  min-height: 200px;
  border-radius: 1vw;
  overflow: hidden;
}

.project-nav-btn {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: flex 0.4s ease;
}

.project-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  transition: background 0.3s ease;
}

.project-nav-btn:hover::before {
  background: rgba(0, 0, 0, 0.3);
}

.project-nav-btn:hover {
  flex: 1.15;
}

.project-nav-label {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  text-align: center;
  padding: 0 2vw;
}

.project-nav-label span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.project-nav-label small {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  opacity: 0.8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Divider between the two nav buttons */
.project-nav-btn+.project-nav-btn {
  border-left: 2px solid rgba(255, 255, 255, 0.2);
}