/* Layout and spacing overrides (chips, cards, sections, type, contact) */

/* 4. Chips / badge grid: 4 → 2×2, 6 → 2×3, 7 → 2×3 + 1 */
.project_badge-group {
  display: grid;
  grid-auto-flow: row;
  justify-content: start;
  align-items: start;
  column-gap: 0.5rem;
  row-gap: 0.5rem;
  width: max-content;
  max-width: 100%;
}

.project_badge-group:has(> :nth-child(1):last-child) {
  grid-template-columns: max-content;
}

.project_badge-group:has(> :nth-child(2):last-child),
.project_badge-group:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(2, max-content);
}

.project_badge-group:has(> :nth-child(3):last-child),
.project_badge-group:has(> :nth-child(5):last-child),
.project_badge-group:has(> :nth-child(6):last-child),
.project_badge-group:has(> :nth-child(7):last-child) {
  grid-template-columns: repeat(3, max-content);
}

.project_badge-group.is-count-4 {
  grid-template-columns: repeat(2, max-content);
}

.project_badge-group.is-count-5,
.project_badge-group.is-count-6,
.project_badge-group.is-count-7 {
  grid-template-columns: repeat(3, max-content);
}

.project_badge {
  width: max-content;
  justify-content: center;
}

/* 5. Micro spacing: 40px between main blocks inside cards */
.project_card {
  gap: 2.5rem;
}

.project_content-wrapper {
  gap: 2.5rem;
}

.project_text-block,
.project_meta-block,
.skills_card-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.skills_card {
  gap: 2.5rem;
}

.process_hybrid-content {
  gap: 2.5rem;
}

.process_steps-list {
  gap: 2.5rem;
}

.contact_links {
  gap: 2.5rem;
  margin-top: 0;
}

/* 6. Macro spacing: tighter gaps between major sections */
.section_about > .padding-section-large,
.section_projects > .padding-section-large,
.section_process > .padding-section-large,
.section_skills > .padding-section-large,
.section_contact > .padding-section-large {
  padding-top: 2.75rem;
  padding-bottom: 2.75rem;
}

.section_projects > .padding-section-large {
  padding-bottom: 2.5rem;
}

.section_process > .padding-section-large,
.section_skills > .padding-section-large {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.section_contact > .padding-section-large {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* 7. Keep key phrases on one line */
.process_header {
  max-width: none;
}

.process_subtitle {
  max-width: 44rem;
}

@media screen and (min-width: 992px) {
  .process_header .heading-style-h2 {
    white-space: nowrap;
    font-size: clamp(2.1rem, 2.4vw, 3rem);
  }
}

.text-nowrap {
  white-space: nowrap;
}

/* 8. Contact stack: email → status → button */
.contact_links {
  flex-direction: column;
  align-items: flex-start;
}

@media screen and (max-width: 991px) {
  .section_about > .padding-section-large,
  .section_projects > .padding-section-large,
  .section_process > .padding-section-large,
  .section_skills > .padding-section-large,
  .section_contact > .padding-section-large {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
}

@media screen and (max-width: 767px) {
  .section_about > .padding-section-large,
  .section_projects > .padding-section-large,
  .section_process > .padding-section-large,
  .section_skills > .padding-section-large,
  .section_contact > .padding-section-large {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .project_card,
  .project_content-wrapper,
  .skills_card,
  .process_hybrid-content,
  .process_steps-list,
  .contact_links {
    gap: 2.5rem;
  }

  .process_header .heading-style-h2 {
    white-space: normal;
  }
}

/* 9. About section: portrait + overlapping certificate card, bio, highlights */
.section_about {
  z-index: 2;
  background-color: transparent;
  position: relative;
}

.about_component {
  display: flex;
  flex-direction: column;
  row-gap: 3.5rem;
  width: 100%;
}

.about_header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 1rem;
  max-width: 44rem;
}

.about_subtitle {
  color: #ffffff9e;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.about_grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  column-gap: 4rem;
  row-gap: 2.5rem;
  align-items: center;
  width: 100%;
}

.about_media {
  position: relative;
  width: 100%;
  max-width: 26rem;
  padding-bottom: 4rem;
}

.about_portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background-color: #121218b8;
  border: 1px solid #ffffff14;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px #00000073;
}

.about_portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, #08080c00 55%, #08080cb8 100%);
  pointer-events: none;
}

.about_portrait-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}

.about_certificate {
  position: absolute;
  right: -1.25rem;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 38%;
  min-width: 8rem;
  max-width: 10rem;
  padding: 0.5rem;
  background-color: #121218f2;
  border: 1px solid #ffffff1a;
  border-radius: 14px;
  box-shadow: 0 18px 40px #0000008c;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.about_certificate:hover,
.about_certificate:focus-visible {
  transform: translateY(-6px);
  border-color: #ff5e3a66;
  box-shadow: 0 22px 48px #ff5e3a2e;
}

.about_certificate-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
}

.about_certificate-label {
  color: #ff5e3a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.3;
}

.about_content {
  display: flex;
  flex-direction: column;
  row-gap: 1.25rem;
}

.about_text {
  color: #ffffff9e;
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.about_highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.about_highlight {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 0.35rem;
  background-color: #121218b8;
  border: 1px solid #ffffff14;
  border-radius: 16px;
  padding: 1.75rem;
}

.about_highlight-title {
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.about_highlight-label {
  color: #ffffff9e;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 10. Certificate lightbox */
.about_lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.5rem 1.5rem;
}

.about_lightbox.is-open {
  display: flex;
  animation: aboutLightboxFade 0.25s ease-out;
}

@keyframes aboutLightboxFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.about_lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: #040408e0;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.about_lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 32rem;
  max-height: 100%;
}

.about_lightbox-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  max-height: calc(100dvh - 12rem);
  object-fit: contain;
  border: 1px solid #ffffff1a;
  border-radius: 12px;
}

.about_lightbox-caption {
  color: #ffffffb8;
  flex: none;
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.about_lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: #ffffffb8;
  background-color: #ffffff0a;
  border: 1px solid #ffffff1a;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.about_lightbox-close:hover,
.about_lightbox-close:focus-visible {
  color: #fff;
  border-color: #ff5e3a;
  background-color: #ff5e3a1f;
}

@media (prefers-reduced-motion: reduce) {
  .about_certificate,
  .about_lightbox.is-open {
    transition: none;
    animation: none;
  }

  .about_certificate:hover,
  .about_certificate:focus-visible {
    transform: none;
  }
}

@media screen and (max-width: 991px) {
  .about_component {
    row-gap: 3rem;
  }

  .about_grid {
    grid-template-columns: 1fr;
    row-gap: 3rem;
  }

  .about_media {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .about_certificate {
    right: 0;
  }
}

@media screen and (max-width: 767px) {
  .about_media {
    max-width: 100%;
    padding-bottom: 0;
  }

  .about_portrait {
    aspect-ratio: 1 / 1;
  }

  .about_certificate {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    max-width: none;
    margin-top: 1rem;
    padding: 0.75rem;
    text-align: left;
  }

  .about_certificate-image {
    flex: none;
    width: 4rem;
  }

  .about_text {
    font-size: 0.95rem;
  }

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

@media screen and (max-width: 479px) {
  .about_highlight {
    padding: 1.35rem;
  }

  .about_lightbox {
    padding: 3.5rem 1rem 1rem;
  }
}
