/* Qualifications Page Styles - Light Theme (matching About page) */

/* Navigation override for light background - must target same specificity as home-overrides */
body .navbar {
  color: var(--text-dark) !important;
}

/* When scrolled, nav switches back to light text like other pages */
body .navbar.scrolled {
  color: var(--text-light) !important;
}

.quals-hero {
  padding: 18rem 0 8rem;
  background: #ffffff;
  position: relative;
  z-index: 20;
}

.quals-hero-content {
  text-align: center;
}

.quals-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-top: 1.5rem;
  background: linear-gradient(to bottom, #1d1d1f 60%, #434345 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sections */
.quals-section {
  padding: 8rem 0;
  background: #ffffff;
  position: relative;
  z-index: 20;
}

.quals-section:nth-child(even) {
  background: #fbfbfd;
}

.section-label {
  font-size: 0.75rem;
  letter-spacing: 6px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 3rem;
}

/* Education Timeline */
.education-timeline {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.education-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #a08c7c 0%, rgba(160, 140, 124, 0.2) 100%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding-bottom: 4rem;
  box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
  left: 0%;
  padding-right: 3.5rem;
  padding-left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 3.5rem;
  padding-right: 0;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Card Styling for Timeline Content */
.timeline-content {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 2.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
  text-align: left;
}

.timeline-content:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
}

/* Connector arrows */
.timeline-content::after {
  content: '';
  position: absolute;
  top: 24px;
  width: 0;
  height: 0;
  border-style: solid;
  transition: border-color 0.4s ease;
}

.timeline-item:nth-child(odd) .timeline-content::after {
  right: -10px;
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.7);
}

.timeline-item:nth-child(odd) .timeline-content:hover::after {
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.85);
}

.timeline-item:nth-child(even) .timeline-content::after {
  left: -10px;
  border-width: 10px 10px 10px 0;
  border-color: transparent rgba(255, 255, 255, 0.7) transparent transparent;
}

.timeline-item:nth-child(even) .timeline-content:hover::after {
  border-color: transparent rgba(255, 255, 255, 0.85) transparent transparent;
}

.timeline-marker {
  position: absolute;
  top: 22px;
  /* Aligns dot perfectly with the connector arrow */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a08c7c;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

/* Odd items sit LEFT of the center line — marker goes on the RIGHT edge */
.timeline-item:nth-child(odd) .timeline-marker {
  right: -7px;
  left: auto;
}

/* Even items sit RIGHT of the center line — marker goes on the LEFT edge */
.timeline-item:nth-child(even) .timeline-marker {
  left: -7px;
  right: auto;
}

/* Period outside — positioned on opposite side of timeline */
.timeline-period-outside {
  position: absolute;
  top: 20px;
  font-size: 1.05rem;
  color: #8a756a;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Odd items: content is on LEFT, period goes to the RIGHT (past center line) */
.timeline-item:nth-child(odd) .timeline-period-outside {
  left: 100%;
  margin-left: 1.5rem;
}

/* Even items: content is on RIGHT, period goes to the LEFT (past center line) */
.timeline-item:nth-child(even) .timeline-period-outside {
  right: 100%;
  margin-right: 1.5rem;
}

.timeline-header {
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
}

.timeline-period {
  font-size: 0.9rem;
  color: #888;
  white-space: nowrap;
  font-weight: 500;
}

.timeline-institution {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.timeline-grade {
  font-size: 0.95rem;
  color: #444;
  font-weight: 500;
  margin-bottom: 1rem;
}

.timeline-note {
  font-size: 0.85rem;
  color: #999;
  font-style: italic;
}

.timeline-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-details li {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
}

.timeline-details li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #a08c7c;
}

/* Skills Grid */
.skills-section {
  background: #fbfbfd;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.skill-category {
  background: #fff;
  padding: 2.5rem 2rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-category:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(160, 140, 124, 0.3);
}

.skill-category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skill-list li {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.8;
  padding-left: 1rem;
  position: relative;
}

.skill-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #a08c7c;
}

/* Certifications */
.certs-section {
  background: #fff;
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.cert-card {
  background: #fbfbfd;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-card:hover {
  background: #fff;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.cert-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.cert-institution {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.cert-date {
  font-size: 0.8rem;
  color: #999;
  font-weight: 500;
}

/* Awards */
.awards-section {
  background: #fbfbfd;
}

.awards-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.award-item {
  padding: 2rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.award-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.award-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
}

.award-year {
  font-size: 0.9rem;
  color: #888;
  font-weight: 500;
  white-space: nowrap;
}

/* CTA Section */
.quals-cta {
  padding: 10rem 0;
  background: #fbfbfd;
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 2.5rem;
  letter-spacing: -1px;
}

.cta-buttons {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

/* CTA buttons use standardized classes from home-overrides.css */

/* Responsive */
@media (max-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .awards-list {
    grid-template-columns: 1fr;
  }

  .education-timeline::before {
    left: 6px !important;
    transform: none !important;
  }

  .timeline-item {
    width: 100% !important;
    padding-left: 2.5rem !important;
    padding-right: 0 !important;
    left: 0 !important;
  }

  .timeline-content::after {
    display: none !important;
  }

  .timeline-item:nth-child(odd) .timeline-marker {
    left: 0 !important;
    right: auto !important;
  }

  .timeline-item:nth-child(even) .timeline-marker {
    left: 0 !important;
  }

  .timeline-period-outside {
    position: static;
    margin-bottom: 0.5rem;
  }

  .timeline-item:nth-child(odd) .timeline-period-outside,
  .timeline-item:nth-child(even) .timeline-period-outside {
    left: auto;
    right: auto;
  }
}

@media (max-width: 600px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

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

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}


/* ===================================
   APPLE-INSPIRED GALLERY STYLES
   For Skills Section (Horizontal Scroll)
   =================================== */

.skills-gallery-section {
  padding: 8rem 0 12rem 0;
  background: #fbfbfd;
  position: relative;
  z-index: 20;
}

.gallery-window {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
  overflow: visible;
  z-index: 30;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-left: 5% !important;
  /* Matches --site-padding when screen < 1100px */
  padding-right: 15vw !important;
  gap: 16px;
  scrollbar-width: none;
  padding-top: 6rem;
  padding-bottom: 5rem;
  margin-top: 2rem;
}

@media (min-width: 1100px) {
  .gallery-track {
    padding-left: calc((100vw - 1100px) / 2 + 5%) !important;
    /* Vertically aligns left edge of leftmost bento with the content title */
  }
}

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

.gallery-item {
  flex: 0 0 300px;
  height: 300px;
  position: relative;
  border-radius: 25px;
  overflow: hidden;
  background: transparent;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.gallery-item:hover {
  transform: scale(1.04) translateY(-10px);
}

/* Portrait Clip for Skill Cards */
.portrait-clip {
  position: absolute;
  inset: 0;
  border-radius: 25px;
  overflow: hidden;
  z-index: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .portrait-clip {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}

.portrait-blur-bg {
  position: absolute;
  inset: -15px;
  width: calc(100% + 30px);
  height: calc(100% + 30px);
  background-size: cover;
  background-position: center;
  filter: blur(30px);
  opacity: 0.45;
  z-index: 1;
}

.portrait-crisp {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 2;
  transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  opacity: 0.85;
}

.gallery-item:hover .portrait-crisp {
  transform: scale(1.08);
  opacity: 0.95;
}

/* Gallery Caption Overlay */
.gallery-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.2rem;
  background: transparent;
  opacity: 1;
  transition: opacity 0.5s ease;
  z-index: 10;
  pointer-events: none;
  text-align: center;
}

.caption-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .caption-header {
  transform: translateY(-15px);
}

.skill-card-title {
  color: #ffffff !important;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  line-height: 1.3;
  text-align: center;
}

.skill-card-desc {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 100%;
  margin: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(20px);
  text-align: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), margin-top 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.gallery-item:hover .skill-card-desc {
  opacity: 1;
  max-height: 80px;
  margin-top: 1rem;
  transform: translateY(0);
}

.caption-footer {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  justify-content: flex-end;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .caption-footer {
  transform: translateY(0);
}

/* Liquid Button */
.liquid-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d1d1f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  padding: 0;
  opacity: 1;
}

.liquid-button svg {
  width: 14px;
  height: 14px;
}

.liquid-button:hover {
  background: #f5f5f7;
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Gallery Navigation Buttons */
.gallery-controls {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  padding-right: 8%;
  margin: -1rem 0 0 0;
  position: relative;
  z-index: 31;
}

.gallery-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.gallery-nav-btn:hover {
  background: #f5f5f7;
  transform: scale(1.05);
  border-color: rgba(0, 0, 0, 0.2);
}

.gallery-nav-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.gallery-nav-btn:hover svg {
  transform: scale(1.1);
}

/* Abstract Icon Containers for Skills */
.skill-icon-placeholder {
  display: none;
}

.skill-icon-placeholder svg {
  width: 28px;
  height: 28px;
}

/* ===================================
   ENHANCED CERTIFICATIONS (Slick Card Style)
   =================================== */

.cert-card-enhanced {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 245, 0.85));
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03), inset 0 2px 0 rgba(255, 255, 255, 0.8);
  padding: 2rem 1.75rem;
  border-radius: 20px;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.cert-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #a08c7c, #c5bcb6, #a08c7c);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.cert-card-enhanced:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), inset 0 2px 0 rgba(255, 255, 255, 0.8);
  border-color: rgba(160, 140, 124, 0.3);
}

.cert-card-enhanced:hover::before {
  opacity: 1;
}

.cert-card-content {
  position: relative;
  z-index: 1;
}

.enhanced-cert-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.enhanced-cert-institution {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 0.2rem;
}

.enhanced-cert-date {
  font-size: 0.72rem;
  color: #999;
  font-weight: 500;
}

.cert-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #a08c7c;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-card-enhanced:hover .cert-arrow {
  opacity: 1;
  transform: translateY(0);
}

.cert-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.cert-card-enhanced:hover .cert-arrow svg {
  transform: translateX(4px);
}

/* Mockup 1: "View Credential" - action-oriented */
.cert-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #a08c7c;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1rem;
}

.cert-card-enhanced:hover .cert-action {
  opacity: 1;
  transform: translateY(0);
}

.cert-action span {
  position: relative;
  padding-bottom: 2px;
  transition: transform 0.25s ease, color 0.25s ease;
}

.cert-action:hover span {
  transform: translateY(-2px);
  color: #8a756a;
}

.cert-action:hover span::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(160, 140, 124, 0.4);
}

.cert-action svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.cert-card-enhanced:hover .cert-action svg {
  transform: translateX(4px);
}

/* ===================================
   EXPANDED AWARDS GRID (3-column)
   =================================== */

.awards-section {
  background: #fff;
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.award-card {
  background: #fbfbfd;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.award-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #a08c7c, #c5bcb6, #a08c7c);
  transform: scaleX(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.award-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.award-card:hover::before {
  transform: scaleX(1);
}

.award-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.award-year-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a08c7c;
  background: rgba(160, 140, 124, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.award-description {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.award-card:hover .award-description {
  opacity: 1;
  max-height: 200px;
}

/* Responsive for Awards */
@media (max-width: 900px) {
  .awards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .awards-grid {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   DETAIL EXPAND — HORIZONTAL EXPANSION
   =================================== */

/* Trigger — clickable, visible on hover */
.detail-trigger {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(29, 29, 31, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 0.75rem;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}

.expandable-skill:hover .detail-trigger {
  opacity: 1;
}

.expandable-skill:hover .detail-trigger:hover {
  background: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Card — CSS grid: full card is either caption (closed) or detail (open) */
.expandable-skill.gallery-item,
.gallery-item.expandable-skill {
  display: grid !important;
  overflow: hidden !important;
  height: 300px !important;
  max-height: 300px !important;
  min-height: 300px;
  flex: 0 0 300px;
  transition: flex 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Caption covers full card when closed */
.expandable-skill .gallery-caption {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Expanded: caption hides, detail takes full width, restore gradient background */
.expandable-skill.is-expanded.gallery-item,
.gallery-item.expandable-skill.is-expanded {
  flex: 0 0 450px;
  transform: scale(1.02) translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  z-index: 20;
  position: relative;
  background: linear-gradient(135deg, #F2EDE9 0%, #E6DED9 100%) !important;
}

/* skill-card-4 (Biology & Lab) expanded — grey-green */
.skill-card-4.is-expanded.gallery-item,
.gallery-item.expandable-skill.is-expanded.skill-card-4 {
  background: linear-gradient(135deg, #9EA7A3 0%, #8A948F 100%) !important;
}

/* skill-card-5 expanded background — warm brown */
.skill-card-5.is-expanded.gallery-item,
.gallery-item.expandable-skill.is-expanded.skill-card-5 {
  background: linear-gradient(135deg, #C9B7A8 0%, #B5A190 100%) !important;
}

/* skill-card-6 (Languages) expanded — warm cream */
.skill-card-6.is-expanded.gallery-item,
.gallery-item.expandable-skill.is-expanded.skill-card-6 {
  background: linear-gradient(135deg, #F2EDE9 0%, #E6DED9 100%) !important;
}

.expandable-skill.is-expanded .gallery-caption {
  display: none;
}

/* Trigger — clickable, visible on hover */
.detail-trigger {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(29, 29, 31, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 0.75rem;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}

.expandable-skill:hover .detail-trigger {
  opacity: 1;
}

.expandable-skill:hover .detail-trigger:hover {
  background: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.expandable-skill .detail-trigger {
  pointer-events: auto;
}

/* Detail panel — always in DOM; disappears instantly on collapse, appears after expansion */
.detail-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  padding: 2.5rem;
  /* Collapse: instant (0s) — no fade, text vanishes immediately when class removed */
  transition: opacity 0s;
}

/* Expand: wait for card expansion to finish (0.5s), then fade in */
.expandable-skill.is-expanded .detail-panel {
  opacity: 1;
  transition: opacity 0.4s ease 0.5s;
}

/* Hide portrait-clip when expanded so detail panel is visible */
.expandable-skill.is-expanded .portrait-clip {
  display: none;
}

/* Detail text — heading + body per item */
.detail-text {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-heading {
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.3;
  margin: 0;
  letter-spacing: 0.01em;
}

.detail-body {
  font-size: 0.86rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
  margin: 0;
}