/* Custom styles - gradient text, animations, JS-toggled states */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Outfit', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* Skip link (a11y + SEO crawl paths) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
}

/* Safe area for devices with notches (iPhone X+, etc.) */
header {
  padding-top: env(safe-area-inset-top);
}

footer.footer-safe-area {
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  footer.footer-safe-area {
    padding-bottom: 3rem;
  }
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cursor blink */
.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Hero background */
.hero-grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

@media (min-width: 640px) {
  .hero-grid-bg {
    background-size: 60px 60px;
  }
}

.hero-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.35;
}

.hero-orb--indigo {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  background-color: #6366f1;
  top: -4rem;
  right: -4rem;
}

.hero-orb--purple {
  width: min(220px, 55vw);
  height: min(220px, 55vw);
  background-color: #a855f7;
  bottom: -2rem;
  left: -2rem;
}

@media (min-width: 768px) {
  .hero-orb--indigo {
    width: 400px;
    height: 400px;
    top: -6rem;
    right: -6rem;
    opacity: 0.4;
  }

  .hero-orb--purple {
    width: 300px;
    height: 300px;
    bottom: -3rem;
    left: -3rem;
    opacity: 0.4;
  }
}

/* Hero orbs animation */
@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -30px) scale(1.05);
  }
}

.animate-float {
  animation: float 15s ease-in-out infinite;
}

.animate-float-reverse {
  animation: float 12s ease-in-out infinite reverse;
}

/* Typewriter – wrap on small screens instead of overflowing */
.typewriter-line {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 639px) {
  .typewriter-line {
    font-size: clamp(0.95rem, 4.2vw, 1.125rem);
    line-height: 1.4;
  }
}

/* Hero code snippet */
.code-snippet-card {
  max-width: 100%;
}

.code-snippet-pre {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.code-snippet-pre code {
  display: block;
  min-width: min(100%, 16rem);
}

/* Social icon buttons */
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.social-icon-btn:hover {
  color: #818cf8;
  border-color: #818cf8;
  transform: translateY(-0.25rem);
}

.social-icon-btn--lg {
  width: 3rem;
  height: 3rem;
}

@media (min-width: 640px) {
  .social-icon-btn {
    width: 3rem;
    height: 3rem;
  }
}

/* Scroll bounce */
@keyframes bounce-scroll {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.animate-bounce-scroll {
  animation: bounce-scroll 2s ease-in-out infinite;
}

/* Nav menu mobile - JS toggles .show */
@media (max-width: 767px) {
  .nav-menu-mobile {
    background-color: #0f172a;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.35s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-menu-mobile.show {
    transform: translateX(0);
    z-index: 100;
  }

  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
  }
}

/* Hamburger to X */
#nav-menu.show ~ #nav-toggle span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

#nav-menu.show ~ #nav-toggle span:nth-child(2) {
  opacity: 0;
}

#nav-menu.show ~ #nav-toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Nav link active state */
.nav__link.active-link {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.1);
}

/* Header scroll shadow */
#header.scroll-header {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Section containers – prevent horizontal bleed */
section {
  max-width: 100vw;
}

/* Experience timeline – narrow phones */
@media (max-width: 380px) {
  #experience .relative.pl-8 {
    padding-left: 1.5rem;
  }
}

.timeline-item--last .timeline-line {
  display: none;
}

/* Certification tech icons (SVG fallbacks when Boxicons lacks brand) */
.cert-tech-icon {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  color: inherit;
}

/* Project card meta rows */
#work article .flex.justify-between {
  row-gap: 0.5rem;
}

/* Contact form full width on small screens */
@media (max-width: 639px) {
  #contact form button[type='submit'] {
    width: 100%;
    justify-content: center;
  }
}

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

  .animate-float,
  .animate-float-reverse,
  .animate-bounce-scroll,
  .cursor {
    animation: none !important;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
