/**
 * Responsive layer — fixed header stays readable outside the scaled canvas;
 * fluid rhythm for phones / tablets; carousel & footer tweaks on narrow widths.
 */

:root {
  --profile-header-clearance: clamp(72px, 14vw, 96px);
}

.skip-to-content {
  position: absolute;
  left: -999px;
  top: 12px;
  z-index: 10001;
  padding: 10px 18px;
  background: linear-gradient(135deg, #22d3ee 0%, #6366f1 55%, #a78bfa 100%);
  color: #041018;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.skip-to-content:focus {
  left: max(16px, env(safe-area-inset-left, 0px));
  outline: 2px solid rgba(248, 250, 252, 0.9);
  outline-offset: 3px;
}

html {
  scroll-padding-top: calc(
    var(--profile-header-clearance) + env(safe-area-inset-top, 0px)
  );
}

body {
  overflow-x: hidden;
}

/* Tablet — slightly tighter nav rhythm */
@media screen and (min-width: 600px) and (max-width: 1091px) {
  .app2 .navigation .about2,
  .app2 .navigation .skills2,
  .app2 .navigation .experience3,
  .app2 .navigation .education,
  .app2 .navigation .testimonials {
    font-size: clamp(14px, 1.55vw, 17px) !important;
    line-height: 1.35 !important;
  }

  .app2 .sunder-singh2 {
    font-size: clamp(15px, 1.8vw, 18px) !important;
  }

  .modern-profile-web-page .footer-bottom-row {
    flex-wrap: wrap;
    row-gap: 12px;
  }
}

/* Phone — readable tap targets & compact labels */
@media screen and (max-width: 599px) {
  .app2 {
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  .app2 .navigation {
    gap: 2px !important;
    justify-content: flex-end !important;
  }

  .app2 .navigation a[class^="link"]:not(.link13) {
    padding: 8px 10px !important;
    min-height: 44px !important;
    min-width: 44px;
  }

  .app2 .navigation .about2,
  .app2 .navigation .skills2,
  .app2 .navigation .experience3,
  .app2 .navigation .education,
  .app2 .navigation .testimonials {
    font-size: clamp(12px, 3.45vw, 15px) !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
  }

  .app2 .navigation a.link13 {
    padding: 10px 14px !important;
    margin-left: 6px !important;
    min-height: 44px !important;
  }

  .app2 .navigation a.link13 .let-s-talk {
    font-size: clamp(12px, 3.15vw, 14px) !important;
    white-space: nowrap;
  }

  .app2 .sunder-singh2 {
    font-size: clamp(14px, 4vw, 17px) !important;
    letter-spacing: -0.03em !important;
  }

  /* Pull carousel chrome inward when canvas is scaled narrow */
  .section6.section6--carousel {
    min-height: min(940px, 175vw) !important;
    padding-bottom: 48px !important;
  }

  .testimonials-carousel {
    top: clamp(260px, 58vw, 340px) !important;
    left: clamp(10px, 3vw, 24px) !important;
    width: calc(100% - clamp(20px, 6vw, 48px)) !important;
    max-width: none !important;
    min-height: 420px !important;
  }

  .testimonials-carousel__viewport {
    width: calc(100% - 92px) !important;
    min-height: 360px !important;
  }

  .modern-profile-web-page .footer-bottom-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .modern-profile-web-page .profile-text-link {
    align-self: flex-end;
  }
}

/* iPad-ish portrait */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .section6.section6--carousel {
    min-height: 980px !important;
  }

  .testimonials-carousel__viewport {
    min-height: 400px !important;
  }
}

/* Landscape phones — reserve vertical space */
@media screen and (max-height: 520px) and (orientation: landscape) {
  html {
    scroll-padding-top: calc(56px + env(safe-area-inset-top, 0px));
  }

  .app2 .navigation a[class^="link"]:not(.link13) {
    min-height: 40px !important;
    padding: 6px 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
