/* ==========================================
   1. CSS Reset, Variables & Base Styles
   ========================================== */
:root {
  /* Royal Orchid Colors (Purple Theme) */
  --bg-color: #090610;
  --bg-gradient: linear-gradient(135deg, #090610 0%, #160e25 100%);
  --accent-color: #d946ef;
  --accent-gradient: linear-gradient(90deg, #8b5cf6 0%, #d946ef 100%);
  --accent-glow: rgba(217, 70, 239, 0.15);
  --accent-rgb: 217, 70, 239;
  --focus-outline: #00ff87;
  /* High contrast lime/mint outline */

  /* Common Colors and Typography */
  --card-bg: rgba(255, 255, 255, 0.02);
  --card-bg-hover: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 255, 255, 0.18);

  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-title: 'Oswald', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 0 1.5rem;
  transition: background-color 0.8s ease, color 0.3s ease;
  position: relative;
}

/* Ambient Orbs Background styling */
.ambient-orbs-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.08;
  mix-blend-mode: screen;
  transition: background-color 0.8s ease, transform 0.1s ease;
}

.orb-1 {
  top: -10%;
  left: -10%;
  width: 45vw;
  height: 45vw;
  background-color: var(--accent-color);
  animation: floatOrb1 25s infinite alternate ease-in-out;
}

.orb-2 {
  bottom: 10%;
  right: -5%;
  width: 50vw;
  height: 50vw;
  background-color: #8b5cf6;
  animation: floatOrb2 30s infinite alternate ease-in-out;
}

.orb-3 {
  top: 40%;
  left: 50%;
  width: 35vw;
  height: 35vw;
  background-color: var(--accent-color);
  opacity: 0.05;
  animation: floatOrb3 20s infinite alternate ease-in-out;
}

@keyframes floatOrb1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(8vw, 12vh) scale(1.1);
  }
}

@keyframes floatOrb2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-10vw, -8vh) scale(0.9);
  }
}

@keyframes floatOrb3 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-5vw, 15vh) scale(1.05);
  }
}

body.motion-paused .ambient-orb {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .ambient-orb {
    animation: none !important;
  }
}

/* Screen reader only utility class for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================
   2. Layout & Header Containers
   ========================================== */
.hero-header {
  width: 100%;
  max-width: 900px;
  margin-bottom: 2rem;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
}

/* Container to keep regular nav and social nav in the same line */
.nav-container {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 900px;
  background-color: rgba(9, 6, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: -2rem;
  margin-bottom: 2rem;
  padding: 2.25rem 2rem 1.5rem 2rem;
  border: 1px solid var(--card-border);
  border-top: none;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}



.content-wrapper {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.content-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: border-color 0.3s ease;
}

/* ==========================================
   3. Navigation Styling
   ========================================== */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}

.main-nav a:hover {
  color: var(--text-primary);
}

/* Accessible focus styling */
.main-nav a:focus-visible {
  outline: 2px dashed var(--focus-outline);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Active Page Indicator styling */
.main-nav a[aria-current="page"] {
  color: var(--accent-color);
  font-weight: 600;
}

.main-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.social-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================
   4. Icon Links (with 44px target area)
   ========================================== */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  /* Ensure icons match light on dark theme */
  opacity: 0.85;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Hover and Focus States */
.icon:hover {
  transform: translateY(-3px);
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
}

.icon:hover img {
  opacity: 1;
  filter: none;
  /* Shows original brand colors on hover! Beautiful micro-interaction */
}

.icon:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 3px;
}

/* ==========================================
   5. Branding & Section Headers
   ========================================== */
.branding-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 35px var(--accent-glow);
  transition: text-shadow 0.8s ease;
}

.subtitle {
  font-family: var(--font-title);
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.15em;
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  transition: color 0.8s ease;
}

.location-tag {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.section-header {
  border-left: 3px solid var(--accent-color);
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

.section-subtitle {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ==========================================
   6. Bio Section & Grid Layout
   ========================================== */
.bio-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
  width: 100%;
}

.bio-image-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.bio-headshot {
  width: 100%;
  max-width: 240px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  aspect-ratio: 1;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.lead-text {
  font-size: 1.3rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-primary);
  border-left: 3px solid var(--accent-color);
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

#home p {
  font-weight: 300;
}

/* ==========================================
   7. Portfolio Grid & Filters
   ========================================== */
.filter-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.filter-btn.active {
  background: var(--accent-gradient);
  color: var(--bg-color);
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  position: relative;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
    border-color 0.3s ease,
    box-shadow 0.4s ease,
    opacity 0.4s ease;
  outline: none;
}

/* Card Mouse-Follow Radial Glow Effect */
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(400px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
      rgba(var(--accent-rgb), 0.12),
      transparent 40%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
}

.project-card:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 3px;
  border-color: var(--focus-outline);
  z-index: 10;
}

/* Ensure contents stay on top of the card's pseudo glow layer */
.project-card-image,
.project-card-info {
  position: relative;
  z-index: 2;
}

/* Skill Matcher Highlights */
.project-card.matched-highlight {
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.25), 0 10px 30px rgba(0, 0, 0, 0.6);
  transform: translateY(-6px) scale(1.02);
  z-index: 5;
}

.project-card.matched-dim {
  opacity: 0.25;
  transform: scale(0.96);
  pointer-events: none;
  filter: grayscale(0.5);
}

.project-card-image {
  height: 200px;
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.5s ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.05);
}

.project-card-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.project-card-tag {
  font-family: var(--font-title);
  color: var(--accent-color);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-card-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.3rem;
}

.project-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.view-details-indicator {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-color);
  margin-top: auto;
  align-self: flex-start;
  transition: transform 0.2s ease;
}

.project-card:hover .view-details-indicator {
  transform: translateX(4px);
}

/* Motion Card Custom Styling has been removed to unify card layout */

.motion-skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.motion-skill-tag {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.15);
  color: var(--accent-color);
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  font-weight: 400;
  border-radius: 4px;
}

/* ==========================================
   8. About & Skills Panels
   ========================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.about-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-card h3,
.skills-block h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.accreditation-badges {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.badge-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.badge-img:hover {
  transform: scale(1.05);
}

.accreditation-highlight {
  font-family: var(--font-title);
  color: var(--accent-color);
  font-size: 1.2rem;
  line-height: 1.4;
}

.accreditation-desc {
  font-size: 1rem;
  font-weight: 300;
}

.skills-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skills-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 0.45rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  outline: none;
}

.skill-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.skill-pill:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.skill-pill[aria-pressed="true"] {
  background: var(--accent-gradient);
  color: var(--bg-color);
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* ==========================================
   9. Contact Section Styling
   ========================================== */
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  gap: 1.5rem;
}

.contact-lead {
  font-size: 1.25rem;
  max-width: 600px;
  color: var(--text-primary);
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: var(--bg-color);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--accent-glow);
}

.contact-button:focus-visible {
  outline: 3px solid var(--focus-outline);
  outline-offset: 3px;
}

/* ==========================================
   10. Accessible Modal (Details Expander)
   ========================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: #0f1218;
  border: 1px solid var(--card-border);
  width: 90%;
  max-width: 850px;
  border-radius: 16px;
  position: relative;
  padding: 2.5rem 2.5rem 2rem 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.open .modal-content {
  transform: scale(1);
}

.close-button {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
  z-index: 10;
}

.close-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.close-button:focus-visible {
  outline: 2px solid var(--focus-outline);
}

/* Modal Body styling */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-header-section {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1rem;
}

.modal-project-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-primary);
}

.modal-project-subtitle {
  font-family: var(--font-title);
  color: var(--accent-color);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 2rem;
}

.modal-media-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal-project-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.modal-project-image:hover {
  border-color: var(--accent-color);
}

.modal-project-image:focus-visible {
  outline: 2px solid var(--focus-outline);
}

.modal-details-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.details-section h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.details-section p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-secondary);
}

.metadata-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.metadata-grid h4,
.details-section h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.metadata-grid p {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-primary);
}

.tools-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.tool-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 4px;
}

.modal-reflection-section {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1.5rem;
}

.modal-reflection-section h3 {
  font-family: var(--font-display);
  color: var(--accent-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.modal-reflection-section p {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==========================================
   11. Footer & Media Queries
   ========================================== */
footer {
  width: 100%;
  max-width: 900px;
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: auto;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bio-image-container {
    max-width: 180px;
    margin: 0 auto;
  }

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

  .modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .modal-content {
    padding: 1.75rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .main-nav ul {
    gap: 1rem;
  }

  .content-container {
    padding: 1.5rem;
  }

  .modal-content {
    width: 95%;
    padding: 1.25rem;
  }

  .close-button {
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* ==========================================
   12. Slideshow Carousel Styles
   ========================================== */
.slideshow-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
  align-items: center;
}

.slideshow-image-wrapper {
  width: 100%;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.slideshow-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.slideshow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 18, 24, 0.6);
  backdrop-filter: blur(4px);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  z-index: 10;
}

.slideshow-btn:hover {
  background: rgba(15, 18, 24, 0.9);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.slideshow-btn:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.prev-btn {
  left: 1rem;
}

.next-btn {
  right: 1rem;
}

.slideshow-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 18, 24, 0.7);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border: 1px solid var(--card-border);
  z-index: 10;
}

.modal-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
}

.modal-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
  background-color: var(--card-border);
  border-radius: 3px;
}

.modal-thumbnail-btn {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s;
}

.modal-thumbnail-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-thumbnail-btn:hover {
  border-color: var(--text-muted);
}

.modal-thumbnail-btn.active {
  border-color: var(--accent-color);
}

.modal-thumbnail-btn:focus-visible {
  outline: 2px solid var(--focus-outline);
}

/* ==========================================
   13. Video Showcase Grid
   ========================================== */
.videos-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  width: 100%;
}

.video-showcase-item {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.video-showcase-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 242, 254, 0.05);
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.showcase-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-title {
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  border-top: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

/* Responsive constraints */
@media (max-width: 768px) {
  .slideshow-image-wrapper {
    height: 300px;
  }
}

/* Desktop fixed height, internal scrolling layout */
@media (min-width: 769px) {
  .modal-content {
    height: 90vh;
    max-height: 720px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
  }

  .modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
    gap: 2rem;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
  }

  .modal-media-col {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
  }

  .slideshow-container {
    width: 100%;
    /* Wrap naturally to prevent vertical empty space stretching */
  }

  .slideshow-image-wrapper {
    height: 420px;
    /* Optimal height for desktop layouts */
  }

  .modal-details-col {
    overflow-y: auto;
    height: 100%;
    min-height: 0;
    padding-right: 0.75rem;
  }
}

/* ==========================================
   14. Lightbox Zoom Overlay Styles
   ========================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.lightbox-content {
  width: 90vw;
  height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.lightbox-content img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  z-index: 2010;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent-color);
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  z-index: 2010;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.lightbox-btn:focus-visible,
.lightbox-close:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

/* Custom scrollbar styling for detail elements on desktop */
.modal-details-col::-webkit-scrollbar {
  width: 6px;
}

.modal-details-col::-webkit-scrollbar-track {
  background: transparent;
}

.modal-details-col::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 3px;
}

.modal-details-col::-webkit-scrollbar-thumb:hover {
  background: var(--card-border-hover);
}

/* ==========================================
   15. Mobile & Tablet Responsiveness
   ========================================== */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem 0 1rem;
    font-size: 1rem;
  }

  .content-wrapper {
    gap: 2.5rem;
  }

  .content-container {
    padding: 1.5rem;
    gap: 1.25rem;
  }

  /* Navigation container centered on tablets/mobile */
  .nav-container {
    padding: 1.5rem 1.5rem;
    margin-top: -1.5rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
    justify-content: center;
    align-items: center;
  }

  .main-nav ul {
    gap: 1.2rem;
    justify-content: center;
  }

  /* Center Gabe Laveso and subtitle */
  .branding-container {
    text-align: center;
    align-items: center;
  }

  /* Bio grid stacks vertically */
  .bio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .bio-image-container {
    justify-content: center;
  }

  .lead-text {
    border-left: none;
    border-top: 3px solid var(--accent-color);
    padding-left: 0;
    padding-top: 0.75rem;
    font-size: 1.15rem;
  }

  /* Projects grid responsive sizing */
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }

  /* About panel stacks vertically & centers accreditation */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-card {
    text-align: center;
    align-items: center;
  }

  .accreditation-badges {
    justify-content: center;
  }

  /* Modal responsive stacking & scrollability */
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .modal-content {
    width: 95%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
  }

  /* Custom scrollbar for modal content container on mobile */
  .modal-content::-webkit-scrollbar {
    width: 6px;
  }

  .modal-content::-webkit-scrollbar-track {
    background: transparent;
  }

  .modal-content::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
  }

  .modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--card-border-hover);
  }

  .modal-project-title {
    font-size: 1.6rem;
  }

  .close-button {
    top: 0.75rem;
    right: 0.75rem;
  }
}

@media (max-width: 500px) {

  /* Phone specific header & nav stacking */
  .nav-container {
    flex-direction: column;
    padding: 1.25rem 1rem;
    margin-top: -1.5rem;
    gap: 0.75rem;
    align-items: center;
  }

  .main-nav ul {
    gap: 0.85rem;
    justify-content: center;
  }

  .main-nav a {
    font-size: 0.95rem;
  }

  .social-nav {
    gap: 0.25rem;
    justify-content: center;
  }

  .icon {
    min-width: 38px;
    min-height: 38px;
    padding: 6px;
  }

  .icon img {
    width: 16px;
    height: 16px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card-image {
    height: 180px;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

}