/* Theme variables (colors, fonts) — keep here to control look & feel */
:root {
  /* Primary palette (dark-blue / dark-green accents) */
  --color-background: #fbfbfd; /* clean background (use for page background) */
  --color-dark: #071325; /* deep navy background (use for page footer or secondary elements backgrounds) */
  --color-surface: #fbfbfd; /* clean off-white surface*/
  --color-offWhite: hsl(240, 10%, 90%);
  --color-text: #0b1721; /* primary text color on off-white */

  /* Accents */
  --accent-color: #2289ce; /* brand blue (primary accent) */
  --accent-green: #1f7a5f; /* brand green (secondary accent) */
  --accent-green-rgb: 31, 122, 95;

  /* Utility */
  --muted: #747d83; /* subdued/muted text */
  --card: var(--color-surface);
  --bg: var(--color-background);

  /* Layout */
  --hero-height: 100vh;
  --header-height: 64px; /* used for scroll snapping offsets */

  /* Projects - controllable shapes */
  --project-height: 55vh;
  --project-width: calc(var(--project-height) * 2 / 3);

  --project-height-mobile: 60vh;
  --project-width-mobile: calc(var(--project-height-mobile) * 1 / 2);

  --project-border-radius: 12px;
  --project-gap: 18px;

  /* Footer and accessibility */
  --footer-bg: #051023;
  --on-footer: #ffffff;
  --on-accent: #ffffff;

  /* Fonts */
  --font-sans: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Merriweather", serif;
}

/* Main styles */
* {
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden; /* prevent accidental horizontal slippage */

  /* Hide scrollbars globally while keeping scrolling functional. */
  /* Firefox */
  scrollbar-width: none;
  /* IE 10+ */
  -ms-overflow-style: none;
}

/* WebKit browsers (Chrome, Safari, Edge) */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html,
body {
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--header-height);
  scroll-behavior: smooth;
}

/* snap targets */
.hero,
.bio {
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* NAVBAR SECTION */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  z-index: 60;
  background: transparent;
  transition: background-color 0.22s ease, box-shadow 0.22s ease,
    padding 0.18s ease, transform 0.2s ease;
}

/* When the page is scrolled, make the header solid and dark (better contrast) */
header.site-header.is-scrolled {
  background: var(--color-dark); /* default dark background on scroll */
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.18);
  padding: 18px 28px;
}

@media (max-width: 700px) {
  header.site-header.is-hidden-mobile {
    transform: translateY(-120%);
  }
}

header.site-header.is-scrolled .site-nav a,
header.site-header.is-scrolled .site-brand span {
  color: var(--on-footer); /* white text on dark header */
}

/* Desktop override: on wider screens prefer the light header-on-scroll behavior (white bg, dark text) */
@media (min-width: 700px) {
  header.site-header.is-scrolled {
    background: var(--bg); /* light background */
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.06);
  }
  header.site-header.is-scrolled .site-nav a,
  header.site-header.is-scrolled .site-brand span {
    color: var(--color-dark); /* dark text on light header */
  }
}

@media (max-width: 700px) {
  header.site-header {
    padding: 10px 10px;
    height: 50px;
  }
}

/* Navbar Prime Solutions name */
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}
.site-brand img {
  height: 50px;
  filter: brightness(1.2);
}
.site-brand span {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Navbar Pages */
.site-nav a {
  color: #fff;
  margin-left: 18px;
  text-decoration: none;
  font-weight: 400;
}

/* Mobile controls default: hidden on desktop */
.mobile-toggle {
  display: none;
}
.mobile-nav {
  display: none;
  visibility: hidden;
}

/* HERO SECTION */

.hero {
  position: relative;
  height: var(--hero-height);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero .slides {
  position: absolute;
  inset: 0;
}

.hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1s ease, transform 8s ease;
  filter: brightness(60%);
}

.hero .slide.visible {
  opacity: 1;
  transform: scale(1);
}

.hero .overlay {
  position: relative;
  z-index: 10;
  text-align: center;
  color: var(--on-accent);
  padding: 24px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 6vw, 72px);
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.hero p {
  margin-top: 10px;
  font-size: clamp(14px, 2.2vw, 20px);
  opacity: 0.95;
}

/* BIO ABOUT US SECTION */
.bio {
  position: relative;
  padding: 40px 24px;
  background: var(--color-offWhite);
  text-align: center;
  box-shadow: 0 16px 40px rgba(7, 19, 37, 0.08);
  border: 1px solid rgba(7, 19, 37, 0.04);
  overflow: visible;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bio .container {
  position: relative;
  z-index: 2;
}

.bio .container {
  max-width: 65vw;
  margin: 0 auto;
}

.bio h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  margin: 0;
  font-size: 28px;
  color: var(--color-text);
  line-height: 2;
}

.bio .bio-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-height: 90%;
  height: auto;
  width: auto;
  max-width: 48vw;
  opacity: 0.08;
  filter: grayscale(50%) brightness(1.2);
  pointer-events: none;
  z-index: 1;
}

/* PROJECTS REEL */
.projects {
  padding: 24px 2px 18px;
  background-color: var(--color-dark);
  margin-top: 0%;
  padding: 5vh 0 10vh;
}

.projects .container {
  max-width: 1600px;
  width: min(1600px, 96%);
  margin: 0 auto;
}

.projects h3 {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 500;
  color: var(--on-footer);
  margin: 4px 0 10px;
}

.reel {
  position: relative;
  overflow: hidden;
  width: 99vw;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.reel .reel-track {
  position: relative;
  padding: 12px 6vw;
  margin-bottom: 10px;
  overflow: hidden;
}

.reel-track-inner {
  display: flex;
  align-items: center;
  gap: var(--project-gap);
  white-space: nowrap;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.reel-tail {
  display: flex;
  align-items: center;
  gap: var(--project-gap);
  pointer-events: none;
}

/* Gallery Grid Styles */

.gallery-section {
  position: relative;
  overflow: hidden;
  width: 100vw;
  background-color: var(--color-background);
}

.gallery-section .container {
  max-width: 1600px;
  width: min(1600px, 96%);
  margin: 0 auto;
}

.gallery-section h3 {
  text-align: center;
  padding-top: 5vh;
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 500;
  color: var(--color-text);
  margin-top: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  padding: 0px 5vh 5vh;
}

.gallery-card {
  overflow: hidden;
  border-radius: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(30px);
}

.gallery-card.in-view {
  animation: slideInGallery 0.6s ease-out forwards;
}

@keyframes slideInGallery {
  from {
    opacity: 0;
    transform: translateY(300px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.gallery-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background-color: var(--accent-green);
}

.gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .gallery-image img {
  filter: brightness(0.8);
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 70%,
    transparent 100%
  );
  color: white;
  transition: background 0.3s ease;
}

.gallery-card:hover .gallery-caption {
  background: rgba(0, 0, 0, 0.75);
}

.gallery-caption h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-heading);
  color: white;
  line-height: 1.3;
}

.gallery-details {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  font-family: var(--font-sans);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.gallery-card:hover .gallery-details {
  max-height: 200px;
  opacity: 1;
  margin-top: 8px;
}

@media (max-width: 700px) {
  .bio .bio-logo {
    max-height: 70%;
    height: auto;
    width: auto;
    opacity: 0.06;
    left: 50%;
    top: 46%;
  }
  /* Mobile font adjustments: reel captions slightly smaller, gallery details slightly larger */
  .project {
    height: var(--project-height-mobile);
    width: var(--project-width-mobile);
  }
  .project .cap {
    min-height: auto; /* allow caption to expand if title wraps */
  }
  .project .cap strong {
    font-size: 12px;
    line-height: 1.2;
  }
  .project .cap span {
    font-size: 10px;
  }
  .project .cap p {
    font-size: 13px;
  }
  .gallery-caption h4 {
    font-size: 20px;
  }
  .gallery-details {
    font-size: 200px;
  }
}

.reel-track::-webkit-scrollbar {
  display: none;
}

.reel-track {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.project {
  width: var(--project-width);
  height: var(--project-height);
  flex: 0 0 auto;
  background: var(--card);
  border-radius: var(--project-border-radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(11, 23, 33, 0.06);
  position: relative;
}

/* Small index badge on top-left of each project card */
.project::before {
  content: attr(data-index);
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 10px;
  z-index: 2;
}

.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 14px;
  font-size: 18px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.5) 70%,
    transparent 100%
  );
  line-height: 1.1;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project .cap strong {
  display: block;
  font-size: 25px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: #ffffff;
  /* Allow long titles to wrap to a second line and grow the caption */
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.15;
}

/* Keep location line to a single line everywhere */
.project .cap span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: rgba(255, 255, 255, 0.9);
}

.reel-track::-webkit-scrollbar {
  height: 8px;
}

.reel-track::-webkit-scrollbar-thumb {
  background: var(--color-offWhite);
  border-radius: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.2s;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: clamp(1200px, 85vw, 5000px);
  height: clamp(675px, 85vh, 2000px);
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  gap: 20px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.modal-content img {
  height: auto;
  width: clamp(500px, 100%, 70vw);
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
  border-radius: 0;
}

.modal-content > div {
  padding: 20px;
  margin-right: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  min-width: 260px;
  max-width: 40%;
  overflow: auto;
}

.reel .project .cap p {
  display: none;
}

.modal .caption {
  max-width: 100%;
}

.modal .caption .cap,
.modal .caption {
  width: 100%;
  text-align: left;
}

.modal .caption strong {
  display: block;
  margin-bottom: 8px;
  text-align: left;
  font-size: 22px;
  font-family: var(--font-heading);
  color: var(--color-text);
}

.modal .caption p {
  display: block;
  margin: 0;
  margin-top: 12px;
  text-align: left;
  line-height: 1.6;
  color: var(--muted);
}

.modal-content > div .cap {
  width: 100%;
  text-align: left;
}

.modal-content > div .cap strong {
  display: block;
  margin-bottom: 8px;
  text-align: left;
}

.modal-content > div .cap p {
  margin: 0;
  text-align: justify;
  line-height: 1.5;
  color: var(--muted);
}

@media (max-width: 700px) {
  .modal-content {
    flex-direction: column;
    align-items: center;
    height: 100vh;
    width: 100vw;
    max-width: 100vw;
    padding: 0;
    gap: 0;
  }

  .modal-content img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    touch-action: pan-x pan-y;
    overscroll-behavior: contain;
    cursor: grab;
  }

  .modal-content > div {
    max-width: 100%;
    width: 100%;
    padding: 12px;
    margin-right: 0;
    position: sticky;
    bottom: 0;
  }
  .modal .caption {
    color: var(--color-dark);
  }
}

body.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* FOOTER SECTION */
.footer {
  background: var(--footer-bg);
  color: var(--on-footer);
  padding: 48px 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 32px;
}

.footer-branding {
  text-align: left;
}

.footer-logo strong {
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.footer-contact {
  text-align: right;
}

.footer-contact p {
  margin: 0 0 8px;
  font-size: 14px;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.footer-bottom p {
  margin: 0;
}

.footer .lead-form {
  display: none; /* moved to contact section */
}

.footer input[type="email"] {
  display: none;
}

.footer button {
  display: none;
}

/* Contact section */
.contact {
  padding: 60px 20px;
  position: relative;
  overflow: hidden;
}
.contact-bg {
  position: absolute;
  inset: 0;
  filter: blur(10px);
  transform: scale(1.05);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.contact-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.contact .container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.contact h3 {
  font-family: var(--font-heading);
  font-size: 60px;
  font-weight: 500;
  color: var(--color-background);
  margin: 20px 0 20px;
  text-align: center;
}
.contact-card {
  background: #ffffff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(7, 19, 37, 0.08);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
}
.contact-card.in-view {
  animation: slideInCard 0.6s ease-out forwards;
}
@keyframes slideInCard {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.contact .lead-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.contact .lead-form .form-row-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.contact .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact label {
  font-size: 13px;
  color: var(--muted);
}
.contact input[type="text"],
.contact input[type="email"],
.contact input[type="tel"],
.contact textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(7, 19, 37, 0.1);
  /* Use a neutral system sans for numeric clarity */
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}
.contact button {
  align-self: start;
  background: var(--accent-color);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.contact button.is-busy,
.contact button:disabled {
  opacity: 0.7;
  cursor: wait;
}
.contact .form-status {
  color: #5c6770;
  margin-top: 8px;
}
.contact-info-card {
  background: #ffffff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(7, 19, 37, 0.08);
  opacity: 0;
  transform: translateY(20px);
}
.contact-info {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.info-item {
  text-align: center;
  font-size: 14px;
}
.info-item strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-item a {
  color: var(--accent-color);
  font-size: 18px;
  text-decoration: none;
}
.info-item a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  :root {
    --project-height: 44vh;
    --project-width: clamp(200px, calc(var(--project-height) * 2 / 3), 420px);
    --hero-height: 100vh; /* mobile hero occupies full viewport */
  }

  .reel-track-inner {
    gap: 12px;
  }

  /* Header & nav adjustments for touch */
  header.site-header {
    padding: 12px 16px;
  }
  .site-brand img {
    height: 28px;
  }

  /* Hide desktop nav and show mobile toggle */
  .site-nav {
    display: none;
  }
  /* place hamburger on the right side of the header */
  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: transparent;
    border: 0;
    color: var(--on-footer);
    padding: 8px 10px;
    cursor: pointer;
    position: relative;
    margin-left: auto;
    transition: transform 0.18s ease;
  }
  .mobile-toggle.open {
    transform: rotate(90deg);
  }

  /* Mobile sidebar (dark, slides from right) with fade-in overlay */
  .mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(2, 6, 23, 0); /* transparent by default */
    display: flex;
    align-items: stretch;
    justify-content: flex-end; /* align inner sidebar to the right */
    transition: background 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .mobile-nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: rgba(2, 6, 23, 0.45);
  }
  .mobile-nav-inner {
    width: 280px;
    background: var(--color-dark); /* dark background */
    color: var(--on-footer);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.24);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateX(100%); /* start off-canvas to the right */
    transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.2, 1);
  }
  .mobile-nav.open .mobile-nav-inner {
    transform: translateX(0);
  }
  .mobile-nav-close {
    background: transparent;
    border: 0;
    font-size: 18px;
    align-self: flex-end;
    cursor: pointer;
    color: var(--on-footer);
  }
  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mobile-nav-links a {
    text-decoration: none;
    color: var(--on-footer);
    padding: 8px 6px;
    font-weight: 600;
  }

  /* Hero sizing tweaks */
  .hero {
    height: var(--hero-height);
  }
  .hero h1 {
    font-size: clamp(28px, 8vw, 40px);
  }
  .hero p {
    font-size: 14px;
  }

  /* Bio sizing: fit within viewport height (subtract header) */
  .bio {
    height: calc(100vh - var(--header-height));
    padding: 20px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-margin-top: 100px;
  }
  .bio .container {
    max-width: 92%;
    margin: 0 auto;
  }
  .bio h2 {
    font-size: clamp(15px, 2.8vh, 30px);
    line-height: 1.9;
    margin: 0;
  }
  .bio .bio-logo {
    max-width: 60%;
    opacity: 0.05;
    left: 50%;
    top: 50%;
  }

  /* Project card sizing and caption behavior */
  .project {
    width: var(--project-width-mobile);
    height: var(--project-height-mobile);
    border-radius: 10px;
  }
  .project .cap {
    padding: 8px;
    min-height: auto;
    overflow: visible;
  }
  .project .cap span {
    display: block;
    font-size: 13px;
    color: #ffffff; /* default white on mobile reel */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Larger touch targets for modal controls */
  .modal-close {
    padding: 10px 12px;
    font-size: 18px;
    border-radius: 8px;
  }
  .modal-content {
    padding: 12px;
    gap: 12px;
  }
  .modal .caption {
    padding: 8px 4px;
  }
  .modal-content > div {
    max-height: calc(80vh - 60px);
    overflow: auto;
  }
}

@media (max-width: 480px) {
  /* Gallery responsiveness on mobile */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-caption {
    padding: 10px 8px;
  }

  .gallery-caption p {
    font-size: 12px;
  }
}

@media (min-width: 800px) {
  .footer .container {
    gap: 32px;
  }
}

/* Load More Button */
.load-more-btn {
  display: none;
  margin: 22px auto 32px;
  padding: 14px 32px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.load-more-btn:hover {
  background-color: #094d7a;
  transform: translateY(-2px);
}

.load-more-btn:active {
  transform: translateY(0);
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background-color: #094d7a;
  transform: translateY(-3px);
}

.scroll-top-btn:active {
  transform: translateY(-1px);
}

/* Mobile specific gallery changes */
@media (max-width: 700px) {
  .gallery {
    grid-template-columns: 1fr !important;
    gap: 20px;
    padding: 20px;
  }

  /* Hide cards beyond first 5 by default on mobile */
  .gallery .gallery-card:nth-child(n + 6) {
    display: none;
  }

  .load-more-btn {
    display: block;
  }

  .scroll-top-btn {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* Consolidated mobile overrides */
@media (max-width: 700px) {
  .project .cap strong {
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: 1.25;
  }
  .project .cap span {
    color: #ffffff; /* reel stays white; modal overrides below */
    font-size: 12px;
  }
  .project .cap p {
    font-size: 13px;
  }

  /* Gallery caption detail slightly larger */
  .gallery-caption h4 {
    font-size: 16px;
  }
  .gallery-details {
    max-height: none !important;
    opacity: 1 !important;
    margin-top: 8px !important;
  }
  /* Increase specificity so mobile override wins over `.gallery-caption p` rules */
  .gallery-caption p.gallery-details {
    font-size: 15px !important;
    line-height: 1.15 !important;
  }

  /* Disable hover effects for gallery on mobile while keeping desktop behavior */
  .gallery-card:hover .gallery-image img {
    filter: none !important;
    transform: none !important;
  }
  .gallery-card:hover .gallery-caption {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0.4) 70%,
      transparent 100%
    ) !important;
  }
  .gallery-card:hover .gallery-details {
    max-height: none !important;
    opacity: 1 !important;
    margin-top: 8px !important;
  }

  .modal-content {
    height: 70vh;
    width: 80vw;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .modal-content p {
    font-size: 14px;
    margin-top: 0;
    padding: 0;
  }

  .modal-content span {
    margin-top: 0;
    padding: 0;
  }
  .modal-content img {
    width: 100%;
    height: auto;
    max-height: 55vh; /* leave room for caption */
    object-fit: contain;
    touch-action: auto; /* disable pan hint */
    cursor: default;
  }
  .modal-content > div {
    max-width: 100%;
    width: 100%;
    padding: 12px 16px;
    margin-right: 0;
    position: sticky;
    bottom: 0;
    background: none; /* remove gradients */
  }
  .modal .caption {
    color: var(--color-dark);
  }
  .modal .caption span {
    color: var(--color-dark);
  }

  .footer .container {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-links {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
  }

  .footer-contact {
    text-align: center;
  }
}
