/* ================================================
   CSS Custom Properties & Reset
   ================================================ */
:root {
  --clr-bg:        #0f0f1a;
  --clr-bg-alt:    #161625;
  --clr-surface:   #1e1e30;
  --clr-border:    #2a2a40;
  --clr-text:      #e4e4f0;
  --clr-text-muted:#9090a8;
  --clr-primary:   #7c5cfc;
  --clr-primary-hover:#9b80ff;
  --clr-accent:    #00d4aa;
  --clr-card:      #1a1a2e;
  --clr-danger:    #ff8787;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,.35);
  --transition: .3s cubic-bezier(.4,0,.2,1);
  --max-width:  1140px;
  --nav-h:      72px;

  /* Fluid spacing — scales smoothly from phone to desktop */
  --gutter:      clamp(16px, 4vw, 24px);
  --section-pad: clamp(56px, 9vw, 100px);
  --card-pad:    clamp(20px, 4vw, 32px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;          /* safety net against sideways scroll */
}

/* Freeze the page behind the open mobile drawer */
body.nav-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--clr-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-primary-hover); }
ul  { list-style: none; }

/* Long words / emails wrap instead of pushing the layout sideways */
h1, h2, h3, h4, p, a, li, span { overflow-wrap: break-word; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard skip link */
.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 2000;
  background: var(--clr-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; color: #fff; }

/* Visible focus ring for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  min-height: 44px;            /* comfortable touch target */
  max-width: 100%;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--clr-primary);
  color: #fff;
}
.btn-outline {
  border-color: var(--clr-border);
  color: var(--clr-text);
  background: transparent;
}
/* Lift effects only where a real pointer exists — they stick on touch */
@media (hover: hover) {
  .btn-primary:hover {
    background: var(--clr-primary-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124,92,252,.35);
  }
  .btn-outline:hover {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
    transform: translateY(-2px);
  }
}
.btn-sm   { padding: 10px 20px; font-size: .85rem; min-height: 40px; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: .75; cursor: not-allowed; }

/* ================================================
   Navbar
   ================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  background: rgba(15,15,26,.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
  padding-top: env(safe-area-inset-top);
}
.navbar.scrolled {
  border-bottom-color: var(--clr-border);
  background: rgba(15,15,26,.92);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-h);
}
.logo {
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.5px;
  white-space: nowrap;
}
.logo:hover { color: var(--clr-text); }
.accent { color: var(--clr-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 32px);
}
.nav-links a {
  color: var(--clr-text-muted);
  font-weight: 500;
  font-size: .9rem;
  position: relative;
  transition: color var(--transition), transform .2s ease;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--clr-primary);
  transition: width var(--transition);
}
.nav-links a:not(.btn).active { color: var(--clr-text); }
.nav-links a:not(.btn).active::after { width: 100%; }
@media (hover: hover) {
  .nav-links a:not(.btn):hover { color: var(--clr-text); transform: translateY(-1px); }
  .nav-links a:not(.btn):hover::after { width: 100%; }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1201;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Backdrop behind the open drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--transition);
}
.nav-backdrop.show { opacity: 1; }

/* ================================================
   Hero
   ================================================ */
.hero {
  min-height: 100vh;           /* fallback */
  min-height: 100svh;          /* small viewport — never clipped by mobile UI */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124,92,252,.12), transparent),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(0,212,170,.08), transparent),
    var(--clr-bg);
  overflow: hidden;
}
.hero-content {
  width: 100%;
  padding: calc(var(--nav-h) + clamp(40px, 10vh, 72px)) var(--gutter) clamp(72px, 12vh, 96px);
}
.hero-greeting {
  font-size: clamp(.95rem, 2.6vw, 1.1rem);
  color: var(--clr-accent);
  font-weight: 500;
  margin-bottom: 12px;
}
.hero-name {
  font-size: clamp(2.1rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: clamp(-2px, -.4vw, -1px);
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--clr-text) 40%, var(--clr-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--clr-text-muted);
  margin-bottom: 20px;
  font-weight: 500;
  min-height: 1.6em;           /* reserves space so typing doesn't shift layout */
}
.hero-description {
  max-width: 540px;
  margin: 0 auto clamp(28px, 5vw, 36px);
  color: var(--clr-text-muted);
  font-size: clamp(.95rem, 2.4vw, 1.05rem);
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px;
  animation: bounce 2s infinite;
}
.scroll-arrow {
  display: block;
  width: 24px; height: 24px;
  border-right: 2px solid var(--clr-text-muted);
  border-bottom: 2px solid var(--clr-text-muted);
  transform: rotate(45deg);
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(10px); }
}

/* ================================================
   Sections
   ================================================ */
.section     { padding: var(--section-pad) 0; }
.section-alt { background: var(--clr-bg-alt); }
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.section-subtitle {
  text-align: center;
  color: var(--clr-text-muted);
  margin-bottom: clamp(32px, 6vw, 56px);
  font-size: clamp(.95rem, 2.4vw, 1.05rem);
}

/* ================================================
   About
   ================================================ */
.about-grid {
  display: grid;
  /* minmax(0,…) stops wide content from blowing the track out */
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 60px);
  align-items: start;
  margin-top: clamp(32px, 5vw, 48px);
}
.about-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--clr-surface);
  border: 2px dashed var(--clr-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  overflow: hidden;
  color: var(--clr-text-muted);
  font-size: .9rem;
}
.about-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius) - 4px);
}
.about-text h3 {
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}
.about-text p {
  color: var(--clr-text-muted);
  margin-bottom: 16px;
}
.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--clr-border);
}
.stat { text-align: center; }
.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-primary);
  line-height: 1;
}
.stat-number::after { content: "+"; }
.stat-label {
  font-size: .8rem;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  display: block;
}

/* ================================================
   Skills
   ================================================ */
.skills-categories {
  display: grid;
  /* min() keeps a track from ever exceeding a narrow viewport */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(20px, 3vw, 32px);
}
.skill-category {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  transition: transform .35s ease, box-shadow .35s ease;
}
@media (hover: hover) {
  .skill-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}
.skill-category-title {
  font-size: clamp(1.05rem, 2.5vw, 1.15rem);
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-icon { font-size: 1.3rem; }
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.skill-tag {
  background: var(--clr-surface);
  color: var(--clr-text);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid var(--clr-border);
  transition: all var(--transition);
  cursor: default;
}
@media (hover: hover) {
  .skill-tag:hover {
    border-color: var(--clr-primary);
    background: rgba(124,92,252,.1);
    color: var(--clr-primary-hover);
  }
}

/* ================================================
   Timeline (Experience)
   ================================================ */
.timeline {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding-left: 40px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 15px; top: 0; bottom: 0;
  width: 2px;
  background: var(--clr-border);
}
.timeline-item {
  position: relative;
  margin-bottom: clamp(28px, 5vw, 48px);
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
  position: absolute;
  left: -40px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--clr-primary);
  border: 3px solid var(--clr-bg);
  box-shadow: 0 0 0 3px var(--clr-primary);
}
.section-alt .timeline-marker { border-color: var(--clr-bg-alt); }

.timeline-content {
  min-width: 0;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: clamp(18px, 3.5vw, 28px) var(--card-pad);
  transition: transform .35s ease, box-shadow .35s ease;
}
@media (hover: hover) {
  .timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
  }
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.timeline-header > div { min-width: 0; }
.timeline-role {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 700;
}
.timeline-company {
  color: var(--clr-primary);
  font-weight: 500;
  font-size: .95rem;
  margin-top: 2px;
}
.timeline-date {
  font-size: .8rem;
  color: var(--clr-text-muted);
  background: var(--clr-surface);
  padding: 4px 14px;
  border-radius: 50px;
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
  align-self: flex-start;
}
.timeline-details {
  padding-left: 18px;
  list-style: disc;
  color: var(--clr-text-muted);
  font-size: .93rem;
}
.timeline-details li { margin-bottom: 6px; }
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.timeline-tags span {
  font-size: .78rem;
  background: rgba(124,92,252,.12);
  color: var(--clr-primary-hover);
  padding: 4px 12px;
  border-radius: 50px;
  font-weight: 500;
}

/* ================================================
   Education
   ================================================ */
.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(20px, 3vw, 28px);
}
.edu-card {
  min-width: 0;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  display: flex;
  gap: clamp(14px, 2.5vw, 20px);
  align-items: flex-start;
  transition: transform .35s ease, box-shadow .35s ease;
}
@media (hover: hover) {
  .edu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}
.edu-info { min-width: 0; }
.edu-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface);
  border-radius: var(--radius-sm);
}
.edu-degree {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.edu-school {
  color: var(--clr-primary);
  font-weight: 500;
  font-size: .93rem;
  margin-bottom: 4px;
}
.edu-year {
  font-size: .8rem;
  color: var(--clr-text-muted);
  background: var(--clr-surface);
  padding: 2px 12px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 12px;
}
.edu-description {
  color: var(--clr-text-muted);
  font-size: .9rem;
  line-height: 1.6;
}

/* ================================================
   Contact
   ================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 48px);
  align-items: start;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  color: var(--clr-text);
  font-family: var(--font-sans);
  font-size: 16px;             /* 16px keeps iOS Safari from zooming on focus */
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(124,92,252,.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* Inline validation + status messaging */
.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"] { border-color: #ff6b6b; }
.form-error {
  display: block;
  color: var(--clr-danger);
  font-size: .8rem;
  margin-top: 6px;
}
.form-status {
  font-size: .9rem;
  min-height: 1.4em;
}
.form-status.success { color: var(--clr-accent); }
.form-status.error   { color: var(--clr-danger); }

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 12px;
}
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.contact-item > div { min-width: 0; }
.contact-icon {
  font-size: 1.5rem;
  width: 52px; height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.contact-item h4 {
  font-weight: 600;
  margin-bottom: 2px;
}
.contact-item p,
.contact-item a {
  color: var(--clr-text-muted);
  font-size: .93rem;
  overflow-wrap: anywhere;     /* long emails wrap instead of overflowing */
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.social-links a {
  color: var(--clr-text-muted);
  font-weight: 500;
  font-size: .9rem;
  padding: 4px 0;
}
.social-links a:hover { color: var(--clr-primary); }

/* ================================================
   Footer
   ================================================ */
.footer {
  background: var(--clr-bg);
  overflow: hidden;
}

/* -- CTA Banner -- */
.footer-cta {
  position: relative;
  padding: clamp(40px, 7vw, 64px) 0;
  background:
    linear-gradient(135deg, rgba(124,92,252,.18) 0%, rgba(0,212,170,.12) 100%),
    var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  border-bottom: 1px solid var(--clr-border);
}
.footer-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 400px at 20% 50%, rgba(124,92,252,.2), transparent),
    radial-gradient(circle 300px at 80% 50%, rgba(0,212,170,.15), transparent);
  pointer-events: none;
}
.footer-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.footer-cta-text h3 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.footer-cta-text p {
  color: var(--clr-text-muted);
  font-size: 1rem;
}
.btn-glow {
  box-shadow:
    0 0 20px rgba(124,92,252,.4),
    0 0 60px rgba(124,92,252,.15);
  animation: glow-pulse 2.5s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%,100% { box-shadow: 0 0 20px rgba(124,92,252,.4), 0 0 60px rgba(124,92,252,.15); }
  50%     { box-shadow: 0 0 28px rgba(124,92,252,.55), 0 0 80px rgba(124,92,252,.25); }
}

/* -- Main Grid -- */
.footer-main {
  padding: clamp(40px, 7vw, 64px) 0 clamp(32px, 5vw, 48px);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(32px, 4vw, 48px);
}
.footer-col { min-width: 0; }
.footer-logo {
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  display: inline-block;
  margin-bottom: 12px;
}
.footer-tagline {
  color: var(--clr-text-muted);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 24px;
  max-width: 320px;
}

/* Social circles */
.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.social-circle {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  transition: all var(--transition);
}
.social-circle svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .social-circle:hover {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(124,92,252,.35);
  }
}

/* Quick Links */
.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 12px;
}
.footer-heading::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 32px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
}
.footer-links li { margin-bottom: 4px; }
.footer-links a {
  display: inline-block;
  color: var(--clr-text-muted);
  font-size: .93rem;
  position: relative;
  padding: 6px 0;              /* taller tap target */
  transition: all var(--transition);
}
.footer-links a::before {
  content: "→";
  position: absolute;
  left: -18px;
  opacity: 0;
  transition: all var(--transition);
  color: var(--clr-accent);
}
@media (hover: hover) {
  .footer-links a:hover {
    color: var(--clr-text);
    padding-left: 20px;
  }
  .footer-links a:hover::before {
    opacity: 1;
    left: 0;
  }
}

/* Newsletter */
.footer-newsletter-text {
  color: var(--clr-text-muted);
  font-size: .9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}
.footer-newsletter {
  display: flex;
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  transition: border-color var(--transition);
}
.footer-newsletter:focus-within { border-color: var(--clr-primary); }
.footer-newsletter input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 12px 20px;
  color: var(--clr-text);
  font-family: var(--font-sans);
  font-size: 16px;             /* prevents iOS focus zoom */
  outline: none;
}
.footer-newsletter input::placeholder { color: var(--clr-text-muted); }
.footer-newsletter button {
  background: var(--clr-primary);
  border: none;
  padding: 12px 18px;
  min-width: 56px;
  flex-shrink: 0;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.footer-newsletter button svg { width: 20px; height: 20px; }
.footer-newsletter button:hover { background: var(--clr-primary-hover); }

/* -- Bottom Bar -- */
.footer-bottom {
  border-top: 1px solid var(--clr-border);
  padding: 24px 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--clr-text-muted);
}
.footer-bottom-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 20px;
}
.footer-credit {
  color: var(--clr-text);
  border-bottom: 1px solid transparent;
}
.back-to-top { text-decoration: none; }
.btt-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  transition: all var(--transition);
}
.btt-arrow svg { width: 18px; height: 18px; }
@media (hover: hover) {
  .footer-credit:hover { color: var(--clr-accent); border-bottom-color: currentColor; }
  .back-to-top:hover .btt-arrow {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(124,92,252,.35);
  }
}

/* ================================================
   Animations
   ================================================ */

/* -- Hero entrance sequence -- */
.hero-greeting,
.hero-name,
.hero-title,
.hero-description,
.hero-actions {
  opacity: 0;
  transform: translateY(28px);
  animation: hero-fade-in .7s ease forwards;
}
.hero-greeting   { animation-delay: .2s; }
.hero-name       { animation-delay: .4s; }
.hero-title      { animation-delay: .6s; }
.hero-description{ animation-delay: .8s; }
.hero-actions    { animation-delay: 1s; }

@keyframes hero-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

/* -- Typing cursor on hero title -- */
.hero-title::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  background: transparent;
  margin-left: 2px;
  vertical-align: text-bottom;
}
.hero-title.typing::after {
  background: var(--clr-accent);
  animation: cursor-blink .7s step-end infinite;
}
@keyframes cursor-blink {
  0%,100% { background: var(--clr-accent); }
  50%     { background: transparent; }
}

/* -- Floating particles in hero -- */
.hero-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  0%   { opacity: 0; transform: translateY(0) scale(.5); }
  10%  { opacity: .6; }
  90%  { opacity: .6; }
  100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

/* -- Scroll reveal variants -- */
.reveal {
  opacity: 0;
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none !important;
}
.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.reveal-scale { transform: scale(.85); }
.reveal-flip  { transform: perspective(600px) rotateX(15deg) translateY(30px); }

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: .05s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: .1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: .15s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: .2s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: .25s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: .3s; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: .35s; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: .4s; }

/* -- Section title animated underline -- */
.section-title {
  position: relative;
  display: block;
}
.section-title::after {
  content: "";
  display: block;
  width: 0;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  transition: width .6s ease;
}
.section-title.line-visible::after { width: 60px; }

/* -- Skill tags pop-in -- */
.skill-tag {
  opacity: 0;
  transform: scale(.7) translateY(10px);
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.skill-tag.pop-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* -- Timeline slide-in -- */
.timeline-item .timeline-content {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity .55s ease, transform .55s ease;
}
.timeline-item.slide-in .timeline-content {
  opacity: 1;
  transform: translateX(0);
}
.timeline-item .timeline-marker {
  transform: scale(0);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.timeline-item.slide-in .timeline-marker { transform: scale(1); }

/* -- Education cards zoom in -- */
.edu-card {
  opacity: 0;
  transform: scale(.88) translateY(20px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .3s ease;
}
.edu-card.zoom-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* -- Footer social icon stagger -- */
.footer-socials .social-circle {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease, color .3s ease;
}
.footer-socials.animate .social-circle {
  opacity: 1;
  transform: translateY(0);
}
.footer-socials.animate .social-circle:nth-child(1) { transition-delay: .05s; }
.footer-socials.animate .social-circle:nth-child(2) { transition-delay: .12s; }
.footer-socials.animate .social-circle:nth-child(3) { transition-delay: .19s; }
.footer-socials.animate .social-circle:nth-child(4) { transition-delay: .26s; }

/* -- Button press effect -- */
.btn:active { transform: scale(.96); }

/* ================================================
   Light Motion Animations (ambient)
   ================================================ */

/* -- Hero background gradient drift -- */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 500px at 30% 20%, rgba(124,92,252,.10), transparent),
    radial-gradient(circle 400px at 70% 80%, rgba(0,212,170,.08), transparent);
  animation: gradient-drift 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes gradient-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.08); }
}

/* -- Hero name shimmer -- */
.hero-name {
  background-size: 200% 100%;
  animation: hero-fade-in .7s ease .4s forwards, name-shimmer 6s ease-in-out infinite;
}
@keyframes name-shimmer {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}

/* -- About photo gentle float -- */
.about-image-placeholder { animation: gentle-float 5s ease-in-out infinite; }
@keyframes gentle-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

/* -- Stat numbers soft color pulse -- */
.stat-number { animation: stat-glow 3s ease-in-out infinite; }
@keyframes stat-glow {
  0%,100% { text-shadow: 0 0 0 transparent; }
  50%     { text-shadow: 0 0 18px rgba(124,92,252,.3); }
}

/* -- Skill cards border shimmer -- */
.skill-category::before {
  content: "";
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(124,92,252,.08), transparent, rgba(0,212,170,.06), transparent);
  animation: border-spin 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.skill-category > * { position: relative; z-index: 1; }
@keyframes border-spin {
  to { transform: rotate(360deg); }
}

/* -- Timeline marker soft pulse -- */
.timeline-item.slide-in .timeline-marker {
  animation: marker-pulse 2.5s ease-in-out infinite;
}
@keyframes marker-pulse {
  0%,100% { box-shadow: 0 0 0 3px var(--clr-primary); }
  50%     { box-shadow: 0 0 0 6px rgba(124,92,252,.25), 0 0 16px rgba(124,92,252,.15); }
}

/* -- Education icon gentle bob -- */
.edu-card.zoom-in .edu-icon { animation: icon-bob 3.5s ease-in-out infinite; }
@keyframes icon-bob {
  0%,100% { transform: translateY(0) rotate(0); }
  25%     { transform: translateY(-3px) rotate(-2deg); }
  75%     { transform: translateY(2px) rotate(1deg); }
}

/* -- Section title underline gradient slide -- */
.section-title.line-visible::after {
  background-size: 200% 100%;
  animation: underline-slide 3s linear infinite;
}
@keyframes underline-slide {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* -- Footer CTA aurora -- */
.footer-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 350px 200px at 25% 50%, rgba(124,92,252,.12), transparent),
    radial-gradient(ellipse 300px 180px at 75% 50%, rgba(0,212,170,.10), transparent);
  animation: aurora-shift 8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora-shift {
  0%   { transform: translateX(-20px); opacity: .6; }
  100% { transform: translateX(20px); opacity: 1; }
}

/* -- Scroll-arrow soft glow -- */
.scroll-arrow { animation: arrow-glow 2s ease-in-out infinite; }
@keyframes arrow-glow {
  0%,100% { border-color: var(--clr-text-muted); filter: drop-shadow(0 0 0 transparent); }
  50%     { border-color: var(--clr-accent); filter: drop-shadow(0 0 6px rgba(0,212,170,.4)); }
}

/* -- Social circle idle breathe -- */
.footer-socials.animate .social-circle {
  animation: social-breathe 4s ease-in-out infinite;
}
.footer-socials.animate .social-circle:nth-child(2) { animation-delay: .5s; }
.footer-socials.animate .social-circle:nth-child(3) { animation-delay: 1s; }
.footer-socials.animate .social-circle:nth-child(4) { animation-delay: 1.5s; }
@keyframes social-breathe {
  0%,100% { box-shadow: 0 0 0 0 transparent; }
  50%     { box-shadow: 0 0 12px rgba(124,92,252,.15); }
}

/* -- Newsletter button arrow bounce -- */
.footer-newsletter button svg { animation: arrow-nudge 2s ease-in-out infinite; }
@keyframes arrow-nudge {
  0%,100% { transform: translateX(0); }
  50%     { transform: translateX(3px); }
}

/* -- Back-to-top idle float -- */
.btt-arrow { animation: btt-float 3s ease-in-out infinite; }
@keyframes btt-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-3px); }
}

/* ================================================
   RESPONSIVE — Large desktop (≥ 1400px)
   ================================================ */
@media (min-width: 1400px) {
  :root { --max-width: 1240px; }
}

/* ================================================
   RESPONSIVE — Small laptop / tablet landscape (≤ 1024px)
   ================================================ */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  }
  .footer-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.4fr);
  }
}

/* ================================================
   RESPONSIVE — Tablet (≤ 900px)
   ================================================ */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-image-placeholder {
    max-width: 260px;
    margin: 0 auto;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-info { padding-top: 0; }
  .skills-categories {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

/* ================================================
   RESPONSIVE — Mobile (≤ 768px)
   ================================================ */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  /* Off-canvas drawer */
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    width: min(78%, 320px);
    height: 100vh;             /* fallback */
    height: 100dvh;            /* tracks the dynamic viewport on mobile */
    background: var(--clr-surface);
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--nav-h) + 32px) 28px 32px;
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: -8px 0 30px rgba(0,0,0,.4);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 1200;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a {
    font-size: 1.05rem;
    padding: 12px 0;           /* full-width, finger-friendly rows */
  }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links .btn { margin-top: 12px; }

  .section-subtitle { margin-bottom: 36px; }

  .about-stats {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

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

  .timeline { padding-left: 32px; }
  .timeline::before { left: 11px; }
  .timeline-marker { left: -32px; }

  .footer-cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .footer-brand-col { grid-column: auto; text-align: center; }
  .footer-tagline { margin: 0 auto 24px; }
  .footer-socials { justify-content: center; }
  .footer-heading::after { left: 50%; transform: translateX(-50%); }
  .footer-bottom-inner { flex-direction: column; gap: 16px; text-align: center; }
  .footer-bottom-text { justify-content: center; gap: 2px 12px; }
}

/* ================================================
   RESPONSIVE — Large phone (≤ 600px)
   ================================================ */
@media (max-width: 600px) {
  .edu-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .contact-item {
    gap: 12px;
  }
  .hero-actions .btn { width: 100%; max-width: 280px; }
}

/* ================================================
   RESPONSIVE — Small phone (≤ 480px)
   ================================================ */
@media (max-width: 480px) {
  html { font-size: 15px; }

  .hero-scroll-hint { display: none; }   /* no room below the fold */

  .btn { padding: 12px 24px; font-size: .9rem; }

  .skill-tags { gap: 8px; }
  .skill-tag  { padding: 6px 12px; font-size: .8rem; }

  .timeline-role { font-size: 1rem; }
  .timeline-details { padding-left: 16px; font-size: .88rem; }

  .edu-icon { width: 48px; height: 48px; font-size: 1.6rem; }

  .contact-icon { width: 44px; height: 44px; font-size: 1.25rem; }
}

/* ================================================
   RESPONSIVE — Very small phone (≤ 360px)
   ================================================ */
@media (max-width: 360px) {
  :root { --nav-h: 64px; }

  .logo { font-size: 1.05rem; }
  .nav-links { width: 86%; }

  .timeline { padding-left: 24px; }
  .timeline::before { left: 7px; }
  .timeline-marker { left: -24px; }

  .timeline-tags span,
  .edu-year { font-size: .72rem; }

  .footer-newsletter input { padding: 12px 14px; }
}

/* ================================================
   RESPONSIVE — Phone in landscape (short viewports)
   ================================================ */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .hero-content {
    padding: calc(var(--nav-h) + 32px) var(--gutter) 48px;
  }
  .hero-scroll-hint { display: none; }
  .nav-links { padding-top: 80px; }
}

/* ================================================
   Touch devices — trim expensive ambient motion
   ================================================ */
@media (hover: none) {
  .hero::after,
  .footer-cta::after,
  .skill-category::before { animation: none; }
  .about-image-placeholder,
  .btt-arrow,
  .footer-newsletter button svg { animation: none; }
}

/* ================================================
   Reduced motion
   ================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Make sure nothing stays stuck invisible when animations are off */
  .hero-greeting, .hero-name, .hero-title, .hero-description, .hero-actions,
  .reveal, .skill-tag, .edu-card, .timeline-item .timeline-content,
  .footer-socials .social-circle {
    opacity: 1;
    transform: none;
  }
  .timeline-item .timeline-marker { transform: scale(1); }
}

/* ================================================
   Print
   ================================================ */
@media print {
  .navbar, .nav-backdrop, .hero-scroll-hint, .footer-cta,
  .footer-newsletter, .back-to-top, .contact-form, .skip-link { display: none !important; }
  body { background: #fff; color: #000; overflow: visible; }
  .section, .section-alt { background: #fff; padding: 16px 0; }
  .skill-category, .edu-card, .timeline-content {
    border: 1px solid #ccc;
    background: #fff;
    opacity: 1 !important;
    transform: none !important;
    break-inside: avoid;
  }
  .hero { min-height: auto; }
  a { color: #000; text-decoration: underline; }
}
