/* =============================================
   ABOUT SECTION
   ============================================= */
#about {
  position: relative;
  padding: 40px 0 10px;
  overflow: hidden;
  z-index: 5;
  /* Removed heavy -webkit-mask-image to prevent rendering stutter */
}
 
/* top divider line */
/* #about::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(91,163,208,0.2) 30%,
    rgba(91,163,208,0.2) 70%,
    transparent);
} */
 
.about-wrap {
  max-width: 1160px;
  margin: 0 auto 0 75px;
  padding: 0 clamp(16px, 3vw, 40px);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 100px;
  align-items: center;
}
 
/* ── LEFT: stacked photos ── */
.about-photos {
  position: relative;
  height: 480px;
  opacity: 0;
  transform: translate3d(-30px, 0, 0); /* Hardware acceleration */
  will-change: opacity, transform;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.about-photos.visible,
.about-text.visible {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
  animation: none !important; /* Kills the 1.4s delay instantly */
}
 
/* large card — behind, lower-right */
.photo-card-lg {
  position: absolute;
  bottom: 0; right: 0;
  width: 78%;
  aspect-ratio: 3/4;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(179,207,229,0.13);
  box-shadow: 0 28px 64px rgba(0,0,0,0.55);
  background: rgba(11,24,48,0.5);
}
 
/* small card — front, upper-left, slight tilt */
.photo-card-sm {
  position: absolute;
  top: 0; left: 0;
  width: 58%;
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(179,207,229,0.18);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  background: rgba(11,24,48,0.5);
  transform: rotate(-3deg);
  transition: transform 0.5s var(--ease);
  z-index: 2;
}
.photo-card-sm:hover { transform: rotate(0deg) scale(1.02); }
 
/* corner bracket on large card */
.photo-card-lg::before,
.photo-card-lg::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 1.5px solid rgba(91,163,208,0.5);
  z-index: 3; pointer-events: none;
}
.photo-card-lg::before { top: 12px; left: 12px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.photo-card-lg::after  { bottom: 12px; right: 12px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }
 
/* photo image inside card */
.about-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
 
/* placeholder inside each card */
.about-img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 40%,
    rgba(91,163,208,0.09) 0%, transparent 65%),
    rgba(8,16,34,0.6);
}
.about-img-placeholder svg { opacity: 0.55; }
.about-img-placeholder span {
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(91,163,208,0.55);
  letter-spacing: 2px;
  text-transform: uppercase;
}
 
/* experience badge — floats bottom-left of small card */
.about-exp-badge {
  position: absolute;
  bottom: 32px; left: -18px;
  background: rgba(9,20,44,0.85);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(91,163,208,0.28);
  border-radius: 14px;
  padding: 12px 18px;
  z-index: 5;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: badgeFloat 4.5s ease-in-out infinite;
}
.exp-num {
  font-family: var(--mono);
  font-size: 22px; font-weight: 700;
  color: var(--c-frost); line-height: 1;
  margin-bottom: 3px;
}
.exp-lbl {
  font-size: 10px;
  color: rgba(179,207,229,0.5);
  letter-spacing: 0.5px;
}
 
/* dot pattern — decorative, top-right of photo area */
.about-dots {
  position: absolute;
  top: -16px; right: -16px;
  width: 90px; height: 90px;
  background-image: radial-gradient(circle, rgba(91,163,208,0.28) 1px, transparent 1px);
  background-size: 12px 12px;
  z-index: 0;
  pointer-events: none;
}
 
/* glow behind photos */
.about-photo-glow {
  position: absolute;
  bottom: 60px; right: 30px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(74,127,167,0.15) 0%, transparent 70%);
  filter: blur(32px);
  pointer-events: none;
  z-index: 0;
}
 
/* ── RIGHT: text content ── */
.about-text {
  opacity: 0;
  margin-left: 50px;
  transform: translate3d(30px, 0, 0); /* Hardware acceleration */
  will-change: opacity, transform;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s,
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.about-text.visible {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) !important;
}
/* Fallback reveal — guarantees visibility even if the JS observer
   never fires (script error, race condition, etc.). If the .visible
   class is added normally, its !important rules win instantly and
   this animation becomes a no-op. If it never fires, this ensures
   the photo and text still appear after a short delay instead of
   staying invisible forever. */
@keyframes about-force-reveal {
  to { opacity: 1; transform: translateY(0); }
}
.about-photos,
.about-text {
  animation: about-force-reveal 0.6s ease forwards;
  animation-delay: 1.4s;
}
 
/* "About Me" eyebrow */
.about-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 20px;
}
.about-eyebrow::before {
  content: '';
  display: inline-block;
  width: 3px; height: 18px;
  background: var(--c-accent);
  border-radius: 2px;
}
 
/* main heading */
.about-heading {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--c-frost);
  margin-bottom: 6px;
}
.about-heading .name-accent {
  color: var(--c-accent);
}
 
/* typed role line */
.about-role-line {
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--c-frost);
  margin-bottom: 10px;
}
.about-role-line .role-accent {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(179,207,229,0.45);
}
 
/* location */
.about-location {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: rgba(179,207,229,0.52);
  margin-bottom: 28px;
  font-family: var(--mono);
  letter-spacing: 0.5px;
}
.about-location svg { width: 14px; height: 14px; color: var(--c-accent); }
 
/* divider */
.about-divider {
  width: 48px; height: 2px;
  background: linear-gradient(90deg, var(--c-accent), transparent);
  border-radius: 2px;
  margin-bottom: 24px;
}
 
/* bio paragraphs */
.about-bio {
  font-size: 14.5px;
  line-height: 1.88;
  color: rgba(179,207,229,0.62);
  margin-bottom: 16px;
  margin-right: -80px;
}
.about-bio:last-of-type { margin-bottom: 32px; }
.about-bio strong { color: var(--c-frost); font-weight: 600; }
 
/* social + CTA row */
.about-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
 
/* social icon buttons */
.about-social {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.04) 50%,
    rgba(91,163,208,0.08) 100%
  );
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.35),
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset;
  color: rgba(179,207,229,0.75);
  text-decoration: none;
  transition: all 0.25s ease;
}
.about-social:hover {
  border-color: rgba(91,163,208,0.55);
  color: var(--c-frost);
  background: rgba(91,163,208,0.1);
  transform: translateY(-3px);
  box-shadow: 0 0 12px rgba(91,163,208,0.5), 0 0 24px rgba(91,163,208,0.2);
}
.about-social svg { width: 17px; height: 17px; }
 
/* divider dot between socials and CTA */
.actions-sep {
  width: 1px; height: 28px;
  background: rgba(179,207,229,0.15);
  margin: 0 4px;
}
 
/* CTA button */
.about-cta {
  display: inline-flex;
  align-items: center; gap: 8px;
  padding: 11px 24px;
  background: transparent;
  color: var(--c-steel);
  border: 1.5px solid rgba(91,163,208,0.35);
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  font-family: var(--font);
}
.about-cta:hover {
  border-color: var(--c-vivid);
  color: var(--c-frost);
  background: rgba(56,189,248,0.06);
  transform: translateY(-2px);
}
.about-cta svg { width: 15px; height: 15px; }
@media (max-width: 900px) {
  .about-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
    margin: 0 auto;
    padding: 0 20px;
  }

  .about-photos {
    width: 100%;
    max-width: 320px;
    height: 380px; /* Force concrete container height */
    margin: 0 auto;
    position: relative;
    /* Force mobile visibility fallback if JS is delayed */
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .photo-card-lg {
    width: 82%;
    height: 300px;
  }

  .photo-card-sm {
    width: 62%;
    height: 220px;
    z-index: 3;
  }

  .about-exp-badge {
    left: 0px; /* Pull badge into viewport */
    z-index: 4;
  }
}
 
@media (max-width: 900px) {
  .about-wrap { grid-template-columns: 1fr; gap: 60px; margin: 0 auto; }
  .about-photos { height: 380px; max-width: 360px; margin: 0 auto; transform: translateY(36px); }
  .about-photos.visible { transform: translateY(0); }
  .about-text { margin-left: 0; transform: translateY(36px); }
  .about-text.visible { transform: translateY(0); }
  .about-bio { margin-right: 0; }

  /* Fallback for browsers without aspect-ratio support — gives the
     cards a real pixel height so they can never collapse to 0px */
  @supports not (aspect-ratio: 1 / 1) {
    .photo-card-lg { height: 374px; }
    .photo-card-sm { height: 278px; }
  }
}

@media (max-width: 560px) {
  .about-photos { height: 330px; max-width: 300px; }
  .about-exp-badge { left: -8px; }
  .about-actions { gap: 10px; }

  @supports not (aspect-ratio: 1 / 1) {
    .photo-card-lg { height: 312px; }
    .photo-card-sm { height: 232px; }
  }
}
@media (max-width: 560px) {
  .about-photos {
    height: 330px;
    max-width: 280px; /* Reduces width so badges don't overflow screen edge */
    margin: 0 auto;
  }
  
  .about-exp-badge {
    left: 0px; /* Pulls badge back within viewport boundary */
    bottom: 12px;
  }

  .photo-card-sm {
    width: 62%; /* Ensures small card remains well-proportioned */
  }
}/* Bring the About photos closer to the hero on small screens. */
@media (max-width: 600px) {
  #about { padding-top: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .about-heading .name-accent { animation: hero-label-color 8s ease-in-out infinite; }
}
/* One-time, viewport-triggered details; existing color and hover animations remain intact. */
@media (prefers-reduced-motion: no-preference) {
  #about .about-entered { animation: about-detail-entrance .7s cubic-bezier(.22,1,.36,1) both; }
  @keyframes about-detail-entrance {
    from { opacity: 0; translate: 0 18px; }
    to { opacity: 1; translate: 0 0; }
  }
}
/* Each detail waits for its own viewport entry, retaining its existing color animation. */
@media (prefers-reduced-motion: no-preference) {
  #about .about-photos, #about .about-text { opacity: 1 !important; transform: none !important; animation: none !important; }
  #about .about-pending, #about .about-entered {
    transition: opacity .7s cubic-bezier(.22,1,.36,1), translate .7s cubic-bezier(.22,1,.36,1);
  }
  #about .about-pending { opacity: 0; translate: 0 22px; }
  #about .about-entered { animation: none; opacity: 1; translate: 0 0; }
  #about .about-eyebrow.about-entered { animation: hero-label-color 8s ease-in-out infinite; }
  #about .about-pending:focus-within { opacity: 1; translate: 0 0; }
}
/* Give each About detail its own subtle movement while retaining viewport triggers. */
@media (prefers-reduced-motion: no-preference) {
  #about .about-pending, #about .about-entered {
    transition: opacity .8s cubic-bezier(.22,1,.36,1), translate .8s cubic-bezier(.22,1,.36,1), scale .8s cubic-bezier(.22,1,.36,1);
  }
  #about .photo-card-lg.about-pending { translate: -20px 18px; scale: .96; }
  #about .photo-card-sm.about-pending { translate: 14px 20px; scale: .95; }
  #about .about-eyebrow.about-pending { translate: -16px 0; }
  #about .about-heading.about-pending { translate: 0 18px; scale: .97; transform-origin: left center; }
  #about .about-role-line.about-pending { translate: 18px 0; }
  #about .about-location.about-pending { translate: -12px 0; }
  #about .about-divider.about-pending { translate: 0 0; scale: .2 1; transform-origin: left center; }
  #about .about-bio.about-pending { translate: 0 16px; }
  #about .about-actions.about-pending { translate: 0 12px; scale: .97; transform-origin: left center; }
  #about .about-entered, #about .about-pending:focus-within { translate: 0 0; scale: 1; }
}
/* Reveal the social links in sequence, followed by the CV button. */
@media (prefers-reduced-motion: no-preference) {
  #about .about-actions.about-entered .about-social {
    animation: about-social-entrance .55s cubic-bezier(.22,1,.36,1) both;
  }
  #about .about-actions.about-entered .about-social:nth-of-type(2) { animation-delay: .18s; }
  #about .about-actions.about-entered .about-social:nth-of-type(3) { animation-delay: .36s; }
  #about .about-actions.about-entered .about-cta {
    animation: about-cv-entrance .6s cubic-bezier(.22,1,.36,1) .6s both;
  }
  #about .about-actions.about-entered :is(.about-social, .about-cta):focus-visible {
    animation: none; opacity: 1; translate: none;
  }
  @keyframes about-social-entrance {
    from { opacity: 0; translate: 0 16px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes about-cv-entrance {
    from { opacity: 0; translate: 18px 0; }
    to { opacity: 1; translate: 0 0; }
  }
}
