@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@600;700;800&family=Space+Grotesk:wght@500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Colors - AI Modern / OLED Dark Focus */
  --bg-black: #000000;
  --bg-dark: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);

  --primary: #6366f1;
  /* AI Purple */
  --primary-glow: rgba(99, 102, 241, 0.5);
  --secondary: #0080ff;
  /* Electric Blue */
  --accent: #3ddc84;
  /* Android Green */

  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Gradents */
  --gradient-ai: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  --gradient-aurora: linear-gradient(120deg, #6366f1, #0080ff, #3ddc84, #6366f1);

  /* Spacing & Borders */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --container-max: 1200px;

  /* Transitions */
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Optimization for Animations */
.reveal,
.aurora-bg,
.bento-card,
.float-slow,
.float-medium {
  will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .aurora-bg {
    display: none;
  }
}

[data-theme="light"] {
  --bg-black: #f8fafc;
  --bg-dark: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.02);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.05);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-black);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Selection */
::selection {
  background: var(--primary);
  color: white;
}

/* Hide scrollbar but keep functionality */
body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: var(--bg-black);
}

body::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Containers */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.accent-text {
  background: var(--gradient-ai);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Aurora Background Effect */
.aurora-bg {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1), transparent 40%),
    radial-gradient(circle at 20% 30%, rgba(0, 128, 255, 0.1), transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(61, 220, 132, 0.05), transparent 30%);
  filter: blur(80px);
  animation: aurora-float 20s infinite alternate-reverse;
}

@keyframes aurora-float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(5%, 5%) rotate(5deg);
  }

  100% {
    transform: translate(-5%, 2%) rotate(-5deg);
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle-wrapper {
  display: none;
  align-items: center;
  gap: 1rem;
}

.mobile-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-black);
  padding: 2rem;
  border-bottom: 1px solid var(--glass-border);
  display: none;
  z-index: 1000;
  backdrop-filter: blur(20px);
}

.mobile-dropdown.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 600;
}

/* Header & Nav */
.site-header {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 4rem);
  max-width: var(--container-max);
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 0.75rem 2rem;
  transition: var(--transition-smooth);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.site-nav a:hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-bounce);
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
}

.btn.primary {
  background: var(--gradient-ai);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
}

.btn.ghost:hover {
  background: var(--glass-bg);
  transform: translateY(-2px);
}

/* CTA Row */
.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 4rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-text .subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-text .subtitle span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-text .subtitle span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.hero-text .lead {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 3rem;
  max-width: 600px;
}

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-wrapper {
  width: 100%;
  max-width: 380px;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.hero-art::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: var(--gradient-ai);
  filter: blur(40px);
  opacity: 0.5;
  z-index: -1;
}

/* Bento Grid System */
.section {
  padding: 8rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 4rem;
}

.section-head h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  grid-auto-rows: minmax(160px, auto);
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-auto-flow: dense;
}

/* Reordering for Bento Logic (Soft Skills above Languages) */
.bento-grid>.bento-card:nth-last-child(1) {
  order: 1;
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.tech-icons {
  display: flex;
  gap: 1.5rem;
  font-size: 2rem;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
}

.tech-icons.big i {
  font-size: 2.25rem;
}

/* Brand Colors */
.java-color {
  color: #f8981d;
}

.python-color {
  color: #3776ab;
}

.sql-color {
  color: #336791;
}

.code-color {
  color: #6366f1;
}

.tech-icons i,
.tech-icon-img {
  transition: var(--transition-smooth);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.05));
  animation: logo-bob 4s ease-in-out infinite both;
}

/* Staggered delay logic */
.tech-icons i:nth-child(1),
.tech-icon-img:nth-child(1) {
  animation-delay: 0.1s;
}

.tech-icons i:nth-child(2),
.tech-icon-img:nth-child(2) {
  animation-delay: 0.3s;
}

.tech-icons i:nth-child(3),
.tech-icon-img:nth-child(3) {
  animation-delay: 0.5s;
}

.tech-icons i:nth-child(4),
.tech-icon-img:nth-child(4) {
  animation-delay: 0.7s;
}

.tech-icons i:nth-child(5),
.tech-icon-img:nth-child(5) {
  animation-delay: 0.9s;
}

@keyframes logo-bob {

  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

.tech-icon-img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

.tech-icons i:hover,
.tech-icon-img:hover {
  color: var(--text-main);
  transform: scale(1.3) rotate(0) translateY(-10px) !important;
  filter: drop-shadow(0 0 20px var(--primary-glow));
  animation-play-state: paused;
}

.tech-label {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-family: var(--font-mono);
}

.bento-card:hover {
  background: var(--glass-bg);
  border-color: var(--primary);
  transform: translateY(-5px);
}

.bento-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Variants for bento spans */
.span-2 {
  grid-column: span 2;
}

.row-2 {
  grid-row: span 2;
}

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: span 4;
}

/* About Bento */
/* About Bento Grid Specifics */
@media (min-width: 1024px) {
  .about-bento {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .about-bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .about-bento {
    grid-template-columns: 1fr;
  }
}

.about-bento .bio {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-bento .image-card {
  grid-column: span 2;
  padding: 0;
  overflow: hidden;
}

.about-bento .image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-bento .stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stat-card .number {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--primary);
}

/* Skills Bento */
.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  font-size: 0.9rem;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-ai);
  border-radius: 10px;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== */
/* Projects Grid         */
/* ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
}

/* Project Cards */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-bounce);
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.project-card:hover .project-img img {
  transform: scale(1.05);
}

.project-info {
  padding: 2rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  color: var(--text-muted);
}

.project-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-fast);
  word-break: break-word;
  overflow-wrap: break-word;
}

.contact-link:hover {
  background: var(--glass-bg);
  border-color: var(--primary);
  transform: translateX(10px);
}

.contact-link .icon {
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  outline: none;
  transition: var(--transition-fast);
  font-family: inherit;
  font-size: 1rem;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ===================== */
/* Footer                */
/* ===================== */
.site-footer {
  padding: 4rem 0;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

/* AI Chatbot Refined */
#chatbot-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
}

#chatbot-toggle {
  background: var(--gradient-ai);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 20px var(--primary-glow);
  cursor: pointer;
  transition: var(--transition-bounce);
  font-size: 0.95rem;
  white-space: nowrap;
}

#chatbot-toggle:hover {
  transform: scale(1.05) translateY(-5px);
}

#chatbot-box {
  position: absolute;
  bottom: calc(100% + 1rem);
  right: 0;
  width: 720px;
  max-height: 500px;
  background: var(--bg-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

#chatbot-box.open {
  display: flex;
  animation: slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-header {
  padding: 1.5rem;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  flex-shrink: 0;
}

.chat-header .title {
  font-weight: 700;
  font-size: 1rem;
}

#chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.message.bot {
  align-self: flex-start;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 0;
}

.message.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 0;
}

.chat-input-row {
  padding: 1.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 0.75rem;
}

.chat-input-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--text-main);
  outline: none;
  font-size: 0.9rem;
  min-width: 0;
}

#chat-send {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* Animations for reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Cursor */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transition: transform 0.1s ease;
  transform: translate(-50%, -50%);
  display: none;
}

@media (hover: hover) {
  .custom-cursor {
    display: block;
  }

  body {
    cursor: none;
  }

  a,
  button,
  .bento-card,
  .project-card {
    cursor: none;
  }
}

/* ======================================================= */
/*   RESPONSIVE BREAKPOINTS                                */
/*   320 | 375 | 425 | 620 | 768 | 1024 | 1440 | 2560    */
/* ======================================================= */

/* ------- 4K / ULTRA-WIDE (≥2560px) ------- */
@media (min-width: 2560px) {
  :root {
    --container-max: 1800px;
  }

  .hero-text h1 {
    font-size: 6.5rem;
  }

  .hero-text .lead {
    font-size: 1.6rem;
    max-width: 800px;
  }

  .hero-text .subtitle {
    font-size: 1.4rem;
    gap: 2.5rem;
  }

  .hero-inner {
    gap: 6rem;
  }

  .avatar-wrapper {
    max-width: 500px;
  }

  .section {
    padding: 12rem 0;
  }

  .section-head h2 {
    font-size: 4.5rem;
  }

  .section-head .text-muted {
    font-size: 1.3rem;
  }

  .bento-grid {
    gap: 2rem;
  }

  .bento-card {
    padding: 3rem;
    border-radius: var(--radius-xl);
  }

  .bento-card h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .bento-card .lead,
  .bento-card .text-muted {
    font-size: 1.15rem;
  }

  .stat-card .number {
    font-size: 3.5rem;
  }

  .tech-icon-img {
    width: 3rem;
    height: 3rem;
  }

  .tech-icons {
    gap: 2rem;
  }

  .skill-info {
    font-size: 1.1rem;
  }

  .progress-track {
    height: 8px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }

  .project-info {
    padding: 3rem;
  }

  .project-info h3 {
    font-size: 1.6rem;
  }

  .project-info .text-muted {
    font-size: 1.05rem;
  }

  .tag {
    font-size: 0.9rem;
    padding: 0.35rem 1rem;
  }

  .contact-grid {
    gap: 5rem;
  }

  .contact-link {
    padding: 2rem;
    gap: 2rem;
  }

  .contact-link .icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .contact-form {
    padding: 4rem;
    gap: 2rem;
  }

  .form-group label {
    font-size: 1.1rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 1.25rem;
    font-size: 1.1rem;
  }

  .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }

  .site-footer {
    padding: 5rem 0;
  }

  #chatbot-toggle {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }

  #chatbot-box {
    width: 440px;
    max-height: 600px;
  }
}

/* ------- WIDESCREEN / LARGE DESKTOP (1441px – 2559px) ------- */
@media (min-width: 1441px) and (max-width: 2559px) {
  :root {
    --container-max: 1400px;
  }

  .hero-text h1 {
    font-size: 5.5rem;
  }

  .hero-text .lead {
    font-size: 1.35rem;
  }

  .hero-text .subtitle {
    font-size: 1.2rem;
    gap: 2rem;
  }

  .avatar-wrapper {
    max-width: 420px;
  }

  .section {
    padding: 10rem 0;
  }

  .section-head h2 {
    font-size: 3.75rem;
  }

  .bento-card h3 {
    font-size: 1.75rem;
  }

  .bento-card {
    padding: 2.5rem;
  }

  .stat-card .number {
    font-size: 3rem;
  }

  .tech-icon-img {
    width: 2.5rem;
    height: 2.5rem;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .project-info {
    padding: 2.5rem;
  }

  .contact-form {
    padding: 3.5rem;
  }

  .site-footer {
    padding: 4.5rem 0;
  }
}

/* ------- STANDARD DESKTOP (1025px – 1440px) ------- */
/* Base styles already handle this. Only fine-tuning. */
@media (min-width: 1025px) and (max-width: 1440px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .about-bento {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ------- TABLET / iPad (769px – 1024px) ------- */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  .hero-text .subtitle {
    justify-content: center;
  }

  .hero-text .lead {
    margin-left: auto;
    margin-right: auto;
  }

  .cta-row {
    justify-content: center;
  }

  .avatar-wrapper {
    max-width: 280px;
    margin: 0 auto;
  }

  .bento-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .about-bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Nav switch to mobile */
  .desktop-nav {
    display: none !important;
  }

  .nav-toggle,
  .mobile-toggle-wrapper {
    display: flex !important;
  }

  .site-header {
    top: 0;
    width: 100%;
    border-radius: 0;
    left: 0;
    transform: none;
    padding: 0.75rem 2rem;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 6rem 0;
  }
}

/* ------- TABLET PORTRAIT / SMALL TABLET (621px – 768px) ------- */
@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .hero-inner {
    gap: 2rem;
  }

  .hero-text h1 {
    font-size: clamp(2.2rem, 7vw, 3.5rem);
  }

  .avatar-wrapper {
    max-width: 250px;
  }

  .section {
    padding: 5rem 0;
  }

  .section-head {
    margin-bottom: 3rem;
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .bento-card {
    padding: 1.75rem;
  }

  .bento-card h3 {
    font-size: 1.25rem;
  }

  .about-bento .bio {
    grid-column: span 2;
    grid-row: span 1;
  }

  .about-bento .image-card {
    grid-column: span 2;
    max-height: 280px;
  }

  .span-2 {
    grid-column: span 2;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-form {
    padding: 2rem;
  }

  .contact-link {
    padding: 1.25rem;
    gap: 1rem;
  }

  .contact-link .icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }

  /* Chatbot */
  #chatbot-box {
    width: calc(100vw - 3rem);
    right: -0.5rem;
    max-height: 55vh;
  }

  .site-footer {
    padding: 3rem 0;
  }
}

/* ------- PHABLET / WIDE MOBILE (426px – 620px) ------- */
@media (max-width: 620px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero {
    padding-top: 5.5rem;
    padding-bottom: 2.5rem;
  }

  .hero-text h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
  }

  .hero-text .subtitle {
    font-size: 0.95rem;
    gap: 0.75rem;
  }

  .hero-text .lead {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .avatar-wrapper {
    max-width: 230px;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section-head {
    margin-bottom: 2.5rem;
  }

  .section-head h2 {
    font-size: 2rem;
  }

  .bento-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .bento-card {
    padding: 1.5rem;
  }

  .bento-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
  }

  .span-2 {
    grid-column: span 2;
  }

  .about-bento .stat-card {
    grid-column: span 1;
  }

  .stat-card .number {
    font-size: 2rem;
  }

  .tech-icons {
    gap: 1rem;
  }

  .tech-icon-img {
    width: 2rem;
    height: 2rem;
  }

  .project-info {
    padding: 1.5rem;
  }

  .project-info h3 {
    font-size: 1.15rem;
  }

  .contact-grid {
    gap: 2rem;
  }

  .contact-form {
    padding: 1.75rem;
    gap: 1.25rem;
  }

  .contact-link {
    padding: 1rem;
    gap: 1rem;
  }

  .contact-link .icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.85rem;
    font-size: 0.95rem;
  }

  /* Chatbot goes fullwidth bottom sheet */
  #chatbot-widget {
    bottom: 1.25rem;
    right: 1.25rem;
  }

  #chatbot-toggle {
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem;
  }

  #chatbot-box {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .chat-header {
    padding: 1rem 1.25rem;
  }

  #chat-messages {
    padding: 1rem;
  }

  .chat-input-row {
    padding: 1rem 1.25rem;
  }

  .site-footer {
    padding: 2.5rem 0;
  }
}

/* ------- STANDARD MOBILE (376px – 425px) ------- */
@media (max-width: 425px) {
  .brand span {
    font-size: 1rem;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .site-header {
    padding: 0.6rem 1rem;
  }

  .hero-text h1 {
    font-size: 2.1rem;
  }

  .hero-text .subtitle {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .cta-row .btn {
    justify-content: center;
  }

  .avatar-wrapper {
    max-width: 210px;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-head h2 {
    font-size: 1.75rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .span-2,
  .span-3,
  .span-4 {
    grid-column: span 1;
  }

  .about-bento .bio {
    grid-column: span 1;
    grid-row: span 1;
  }

  .about-bento .image-card {
    grid-column: span 1;
    min-height: 200px;
    max-height: 260px;
  }

  .bento-card {
    padding: 1.25rem;
  }

  .bento-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
  }

  .stat-card .number {
    font-size: 1.85rem;
  }

  .tech-icon-img {
    width: 1.85rem;
    height: 1.85rem;
  }

  .tech-icons {
    gap: 0.85rem;
  }

  .project-info {
    padding: 1.25rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.65rem;
  }

  .contact-link {
    padding: 0.9rem;
    gap: 0.85rem;
  }

  .contact-link .icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .contact-form {
    padding: 1.5rem;
    gap: 1.15rem;
  }

  .mobile-dropdown {
    padding: 1.5rem 1.25rem;
  }

  .mobile-nav-links {
    gap: 1.25rem;
  }

  .mobile-nav-links a {
    font-size: 1.1rem;
  }

  /* Disable hover transforms on mobile */
  .project-card:hover {
    transform: none;
    box-shadow: none;
  }

  .bento-card:hover {
    transform: none;
  }

  .contact-link:hover {
    transform: none;
  }
}

/* ------- COMPACT MOBILE (321px – 375px) ------- */
@media (max-width: 375px) {
  .container {
    padding: 0 0.9rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand span {
    font-size: 0.92rem;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .site-header {
    padding: 0.5rem 0.9rem;
  }

  .mobile-toggle-wrapper {
    gap: 0.6rem;
  }

  .hero {
    padding-top: 5rem;
    padding-bottom: 2rem;
  }

  .hero-text h1 {
    font-size: 1.9rem;
    margin-bottom: 0.85rem;
  }

  .hero-text .subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .hero-text .lead {
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
    line-height: 1.55;
  }

  .btn {
    padding: 0.6rem 1.15rem;
    font-size: 0.85rem;
  }

  .avatar-wrapper {
    max-width: 190px;
  }

  .section-head h2 {
    font-size: 1.6rem;
  }

  .section-head .text-muted {
    font-size: 0.85rem;
  }

  .bento-card {
    padding: 1.15rem;
  }

  .bento-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .bento-card .lead {
    font-size: 0.88rem;
  }

  .bento-card .text-muted {
    font-size: 0.82rem;
  }

  .stat-card .number {
    font-size: 1.7rem;
  }

  .skill-info {
    font-size: 0.8rem;
  }

  .tech-icons {
    gap: 0.7rem;
  }

  .tech-icon-img {
    width: 1.7rem;
    height: 1.7rem;
  }

  .project-info h3 {
    font-size: 1.05rem;
  }

  .project-info .text-muted {
    font-size: 0.82rem;
  }

  .tag {
    font-size: 0.65rem;
    padding: 0.18rem 0.55rem;
  }

  .contact-form {
    padding: 1.25rem;
    gap: 1rem;
  }

  .contact-link {
    padding: 0.8rem;
    gap: 0.7rem;
  }

  .contact-link .icon {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .form-group label {
    font-size: 0.8rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.75rem;
    font-size: 0.88rem;
  }

  #chatbot-widget {
    bottom: 1rem;
    right: 1rem;
  }

  #chatbot-toggle {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    gap: 0.5rem;
  }

  #chatbot-box {
    max-height: 70vh;
  }

  .site-footer {
    padding: 2rem 0;
  }

  .site-footer .text-dim {
    font-size: 0.8rem;
  }
}

/* ------- ULTRA-SMALL MOBILE (≤320px) ------- */
@media (max-width: 320px) {
  .container {
    padding: 0 0.75rem;
  }

  .brand {
    gap: 0.4rem;
  }

  .brand span {
    font-size: 0.82rem;
  }

  .brand-mark {
    width: 22px;
    height: 22px;
  }

  .site-header {
    padding: 0.4rem 0.75rem;
  }

  .mobile-toggle-wrapper {
    gap: 0.4rem;
  }

  .nav-toggle {
    font-size: 1.25rem;
    padding: 0.35rem;
  }

  .hero {
    padding-top: 4rem;
    padding-bottom: 1.5rem;
  }

  .hero-text h1 {
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
    line-height: 1.15;
  }

  .hero-text .subtitle {
    font-size: 0.78rem;
    gap: 0.35rem;
    margin-bottom: 1rem;
  }

  .hero-text .subtitle span::before {
    width: 5px;
    height: 5px;
  }

  .hero-text .lead {
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
  }

  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .avatar-wrapper {
    max-width: 160px;
  }

  .section {
    padding: 2.5rem 0;
  }

  .section-head {
    margin-bottom: 1.5rem;
  }

  .section-head h2 {
    font-size: 1.4rem;
  }

  .section-head .text-muted {
    font-size: 0.78rem;
  }

  .bento-card {
    padding: 1rem;
  }

  .bento-card h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }

  .bento-card .lead {
    font-size: 0.82rem;
  }

  .bento-card .text-muted {
    font-size: 0.78rem;
  }

  .stat-card .number {
    font-size: 1.5rem;
  }

  .stat-card .text-dim {
    font-size: 0.72rem;
  }

  .skill-info {
    font-size: 0.75rem;
  }

  .progress-track {
    height: 5px;
  }

  .tech-icons {
    gap: 0.6rem;
  }

  .tech-icon-img {
    width: 1.5rem;
    height: 1.5rem;
  }

  .project-img {
    aspect-ratio: 16/10;
  }

  .project-info {
    padding: 1rem;
  }

  .project-info h3 {
    font-size: 1rem;
  }

  .project-info .text-muted {
    font-size: 0.78rem;
  }

  .tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
  }

  .project-links .btn {
    font-size: 0.72rem;
    padding: 0.45rem 0.85rem;
  }

  .contact-link {
    padding: 0.7rem;
    gap: 0.6rem;
  }

  .contact-link .icon {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .contact-link p {
    font-size: 0.78rem;
  }

  .contact-link .text-dim {
    font-size: 0.7rem;
  }

  .contact-form {
    padding: 1rem;
    gap: 0.85rem;
  }

  .form-group label {
    font-size: 0.75rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.65rem;
    font-size: 0.82rem;
  }

  .contact-form .btn {
    font-size: 0.78rem;
    padding: 0.55rem 1rem;
  }

  #chatbot-widget {
    bottom: 0.75rem;
    right: 0.75rem;
  }

  #chatbot-toggle {
    padding: 0.45rem 0.85rem;
    font-size: 0.72rem;
    gap: 0.4rem;
  }

  #chatbot-box {
    max-height: 65vh;
  }

  .chat-header {
    padding: 0.85rem 1rem;
  }

  .chat-header img {
    width: 32px;
    height: 32px;
  }

  .chat-header .title {
    font-size: 0.85rem;
  }

  #chat-messages {
    padding: 0.85rem;
  }

  .message {
    font-size: 0.82rem;
    padding: 0.6rem 0.85rem;
  }

  .chat-input-row {
    padding: 0.85rem 1rem;
    gap: 0.5rem;
  }

  .chat-input-row input {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
  }

  #chat-send {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }

  .mobile-dropdown {
    padding: 1.25rem 1rem;
  }

  .mobile-nav-links {
    gap: 1rem;
  }

  .mobile-nav-links a {
    font-size: 1rem;
  }

  .site-footer {
    padding: 1.5rem 0;
  }

  .site-footer .text-dim {
    font-size: 0.72rem;
  }
}

/* ======================================================= */
/*   HEIGHT-AWARE QUERIES — Smart viewport height handling */
/* ======================================================= */

/* Short screens (landscape phones, small laptops) */
@media (max-height: 600px) {
  .hero {
    height: auto;
    min-height: auto;
    padding-top: 5rem;
    padding-bottom: 2rem;
  }

  .hero-inner {
    gap: 1.5rem;
  }

  .hero-text h1 {
    margin-bottom: 0.75rem;
  }

  .hero-text .lead {
    margin-bottom: 1.5rem;
  }

  .avatar-wrapper {
    max-width: 180px;
  }

  .section {
    padding: 3rem 0;
  }

  .section-head {
    margin-bottom: 2rem;
  }
}

/* Landscape mobile — side-by-side hero */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding-top: 4.5rem;
    padding-bottom: 1.5rem;
  }

  .hero-inner {
    grid-template-columns: 1.2fr 0.8fr;
    text-align: left;
    gap: 2rem;
  }

  .hero-text .subtitle {
    justify-content: flex-start;
  }

  .cta-row {
    justify-content: flex-start;
  }

  .hero-text .lead {
    margin-left: 0;
    margin-right: 0;
  }

  .avatar-wrapper {
    max-width: 200px;
    margin: 0 auto;
  }

  .hero-text h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }

  .hero-text .lead {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}

/* Medium height screens (tablets portrait, short laptops) */
@media (min-height: 601px) and (max-height: 800px) and (max-width: 1024px) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .avatar-wrapper {
    max-width: 220px;
  }

  .section {
    padding: 4rem 0;
  }
}

/* Tall phones — use the space well */
@media (min-height: 800px) and (max-width: 480px) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
  }

  .hero-inner {
    gap: 3rem;
  }

  .avatar-wrapper {
    max-width: 240px;
  }

  .hero-text .lead {
    margin-bottom: 2.5rem;
  }
}

/* Very tall phones (iPhone 14 Pro Max etc) */
@media (min-height: 900px) and (max-width: 430px) {
  .hero-inner {
    gap: 3.5rem;
  }

  .avatar-wrapper {
    max-width: 260px;
  }

  .section {
    padding: 5rem 0;
  }
}

/* Mobile bottom nav - hidden by default */
.mobile-bottom-nav {
  display: none;
}

/* ======================================================= */
/*   ADVANCED MICRO-ANIMATIONS                             */
/* ======================================================= */

/* Floating Motion */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(1deg);
  }

  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.float-slow {
  animation: float 6s ease-in-out infinite;
}

.float-medium {
  animation: float 4s ease-in-out infinite;
}

/* Shine Sweep Effect */
.bento-card,
.project-card {
  position: relative;
  overflow: hidden;
}

.bento-card::after,
.project-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -150%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg,
      transparent,
      rgba(255, 255, 255, 0.05),
      transparent);
  transform: rotate(45deg);
  transition: none;
  pointer-events: none;
}

.bento-card:hover::after,
.project-card:hover::after {
  left: 150%;
  transition: 0.8s ease-in-out;
}

/* Neon Pulse */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 5px var(--primary-glow);
  }

  50% {
    box-shadow: 0 0 20px var(--primary-glow);
  }

  100% {
    box-shadow: 0 0 5px var(--primary-glow);
  }
}

.glow-active {
  animation: pulse-glow 3s infinite;
}

/* Magnetic Button Hover logic handled in JS */
.btn-magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Spotlight Effect logic handled in JS */
.spotlight {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bento-card:hover .spotlight {
  opacity: 1;
}

/* ======================================================= */
/*   TOUCH DEVICE TWEAKS                                   */
/* ======================================================= */
@media (hover: none) {
  .bento-card:hover {
    transform: none;
    background: var(--bg-card);
    border-color: var(--glass-border);
  }

  .project-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--glass-border);
  }

  .contact-link:hover {
    transform: none;
  }

  .btn.primary:hover {
    transform: none;
  }

  .btn.ghost:hover {
    transform: none;
  }

  .bento-card::after,
  .project-card::after {
    display: none;
  }

  .spotlight {
    display: none;
  }

  .tech-icons i:hover,
  .tech-icon-img:hover {
    transform: none !important;
  }

  /* Active states for touch feedback */
  .bento-card:active {
    transform: scale(0.98);
    border-color: var(--primary);
    transition: transform 0.15s ease;
  }

  .project-card:active {
    transform: scale(0.98);
    border-color: var(--primary);
    transition: transform 0.15s ease;
  }

  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }

  .contact-link:active {
    background: var(--glass-bg);
    border-color: var(--primary);
  }
}

/* Disable floating animation on mobile for performance */
@media (max-width: 768px) {

  .float-slow,
  .float-medium {
    animation: none;
  }

  .aurora-bg {
    animation-duration: 40s;
    filter: blur(100px);
  }

  .glow-active {
    animation: none;
  }
}

/* ======================================================= */
/*   IMAGE PERFORMANCE                                     */
/* ======================================================= */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.project-img img,
.about-bento .image-card img,
.avatar-wrapper img {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Use dynamic viewport height where supported */
@supports (min-height: 100dvh) {
  .hero {
    min-height: 100dvh;
  }
}