@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0f1d32;
  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --accent-cyan: #00f2fe;
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --accent-glow: rgba(168, 85, 247, 0.12);
  --glass-bg: rgba(10, 22, 40, 0.5);
  --glass-border: rgba(255, 255, 255, 0.06);
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family-body: 'Noto Sans Lao', 'Times New Roman', serif;
  --font-family-heading: 'Noto Sans Lao', 'Times New Roman', serif;
}

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

button, input, textarea, select {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family-body);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Gradients & Canvas */
.background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background: url('./assets/bg-navy.jpg') no-repeat center center;
  background-size: cover;
}

.background-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(10, 22, 40, 0.3) 0%, 
    rgba(10, 22, 40, 0.6) 40%, 
    rgba(10, 22, 40, 0.85) 100%);
  z-index: 0;
  pointer-events: none;
}

/* Luxurious Dotted Matrix Grid */
.background-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
}

#bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Typography & Neon Gradients */
h1, h2, h3, h4, .logo, .stat-num, .timeline-date {
  font-family: var(--font-family-heading);
}

.gradient-text-neon {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 45%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 35px rgba(168, 85, 247, 0.15);
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2.section-title {
  font-size: 2.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: -0.8px;
}

/* Glassmorphism Common */
.glass-card {
  background: rgba(10, 22, 40, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 2.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  font-family: var(--font-family-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #030307;
  border: none;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.25);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px rgba(0, 242, 254, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.1);
}

/* Floating Navigation Header */
header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1100px;
  z-index: 100;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: var(--transition-smooth);
}

header.scrolled {
  top: 10px;
  width: 95%;
  border-color: rgba(168, 85, 247, 0.2);
  background: rgba(10, 22, 40, 0.85);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 2.5rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  letter-spacing: -1px;
}

.logo-dot {
  color: var(--accent-cyan);
  display: inline-block;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent-cyan)); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 10px var(--accent-cyan)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent-cyan)); }
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

nav ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  position: relative;
  padding: 0.5rem 0;
}

nav ul li a:hover, nav ul li a.active {
  color: var(--text-primary);
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-purple));
  transition: var(--transition-smooth);
}

nav ul li a:hover::after, nav ul li a.active::after {
  width: 80%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Language Toggle */
.lang-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.lang-toggle:hover {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}

.lang-toggle svg {
  stroke: var(--accent-cyan);
}

/* Hamburger Menu Button */
.hamburger {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  z-index: 110;
}

.hamburger svg {
  stroke: var(--text-primary);
  transition: all 0.3s ease;
  position: absolute;
}

.hamburger .icon-menu { opacity: 1; transform: rotate(0deg) scale(1); }
.hamburger .icon-close { opacity: 0; transform: rotate(-90deg) scale(0.7); }

.hamburger.active .icon-menu { opacity: 0; transform: rotate(90deg) scale(0.7); }
.hamburger.active .icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

/* Mobile Nav Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 104;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
}

/* About Subtitle base */
.about-subtitle {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 100px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: 4rem;
  width: 100%;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1rem;
}

.hero-name {
  font-size: 4.8rem;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
}

.hero-typed-wrapper {
  font-size: 2rem;
  font-weight: 600;
  height: 45px;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-typed {
  color: var(--accent-purple);
  border-right: 2px solid var(--accent-cyan);
  animation: blink 0.75s step-end infinite;
  padding-right: 4px;
}

@keyframes blink {
  from, to { border-color: transparent }
  50% { border-color: var(--accent-cyan); }
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
}

.hero-ctas {
  display: flex;
  gap: 1.5rem;
}

.hero-graphics {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-glow-ring {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, rgba(168, 85, 247, 0.08) 40%, transparent 70%);
  position: absolute;
  animation: pulseGlow 5s infinite alternate;
}

/* Infinity Symbol Container */
.infinity-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px;
  height: 280px;
  animation: floatInfinity 6s ease-in-out infinite;
}

.infinity-svg {
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(0, 242, 254, 0.3));
}

.infinity-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawInfinity 3s ease forwards, glowPulse 3s ease-in-out infinite 3s;
}

/* Orbiting Rings */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.orbit-ring-1 {
  width: 300px;
  height: 300px;
  border-color: rgba(0, 242, 254, 0.12);
  animation: orbitSpin 12s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-ring-2 {
  width: 240px;
  height: 240px;
  border-color: rgba(168, 85, 247, 0.1);
  border-style: dashed;
  animation: orbitSpin 18s linear infinite reverse;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-ring-3 {
  width: 180px;
  height: 180px;
  border-color: rgba(236, 72, 153, 0.08);
  animation: orbitSpin 8s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

@keyframes floatInfinity {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes drawInfinity {
  to { stroke-dashoffset: 0; }
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.5)); stroke-width: 3; }
  50% { filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6)); stroke-width: 4; }
}

@keyframes orbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Bento Grid Layout (About Section) */
.about {
  padding: 4rem 0;
  position: relative;
}

.about-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(160px, auto);
  gap: 1.5rem;
  margin-top: 2rem;
}

.bento-card {
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 15px 40px rgba(168, 85, 247, 0.08);
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: flex-start;
  gap: 1.5rem;
}

.bento-large .about-subtitle {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.bento-large h2 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
}

.bento-large .about-bio {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.bento-avatar {
  grid-column: span 1;
  grid-row: span 4;
  padding: 8px;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 10%, rgba(168, 85, 247, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.bento-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.bento-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-avatar:hover img {
  transform: scale(1.06);
}

.bento-stat {
  grid-column: span 1;
  grid-row: span 1;
  align-items: center;
  text-align: center;
}

.bento-stat .stat-num {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.bento-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.bento-ai {
  grid-column: span 2;
  grid-row: span 1;
  justify-content: flex-start;
  gap: 1.25rem;
}

.bento-ai .ai-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.bento-ai .ai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bento-ai .ai-tag {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-smooth);
}

.bento-ai .ai-tag:hover {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.08);
  transform: translateY(-2px);
}

.bento-ai .ai-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

/* Projects Section */
.projects {
  padding: 4rem 0;
  position: relative;
}

.project-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 0.6rem 1.6rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.1);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.project-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 20px 45px rgba(0, 242, 254, 0.08);
}

.project-img-container {
  position: relative;
  height: 220px;
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

.project-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-img-container > img {
  transform: scale(1.05);
}

.project-logo-mini {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 22, 40, 0.7);
  backdrop-filter: blur(10px);
  z-index: 10;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.project-logo-mini img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}


.project-card-content {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

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

.project-tag {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-blue);
  padding: 0.3rem 0.85rem;
  border-radius: 30px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-btn {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0;
  transition: var(--transition-smooth);
}

.project-btn:hover {
  gap: 0.75rem;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.custom-arrow-btn {
  color: #a45ee5;
}

.custom-arrow-btn:hover {
  text-shadow: 0 0 10px rgba(164, 94, 229, 0.4);
}

/* Skills Section Redesigned (Progress Bars) */
.skills {
  padding: 4rem 0;
  position: relative;
}

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

.skill-category {
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
}

.skill-category:hover {
  border-color: rgba(0, 242, 254, 0.2);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3),
              inset 0 0 15px rgba(255, 255, 255, 0.02);
  transform: translateY(-4px);
}

.skill-category-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.4px;
}

.skill-category-title svg {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.3));
}

.skill-items {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: var(--transition-smooth);
}

.skill-item:hover {
  transform: translateX(4px);
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.skill-name {
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.skill-item:hover .skill-name {
  color: var(--accent-cyan);
}

.skill-percentage {
  color: var(--text-secondary);
  font-weight: 600;
  font-family: var(--font-family-heading);
  font-size: 0.9rem;
}

.skill-item:hover .skill-percentage {
  color: var(--text-primary);
}

.skill-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.skill-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Multi-colored glowing progress bars */
.skill-category:nth-child(2) .skill-bar-fill {
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.skill-category:nth-child(3) .skill-bar-fill {
  background: linear-gradient(90deg, #06b6d4, #00f2fe);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.skill-category:nth-child(4) .skill-bar-fill {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

/* Tech Stack Section (Pill Badges) */
.tech-stack {
  padding: 4rem 0;
  position: relative;
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.tech-tag {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.6rem;
  border-radius: 50px;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: default;
}

.tech-tag i, .tech-tag svg {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.1));
  transition: transform 0.3s ease;
}

.tech-tag:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 10px 25px rgba(0, 242, 254, 0.1);
}

.tech-tag:hover i, .tech-tag:hover svg {
  transform: scale(1.1);
}

/* Experience Section (Illuminated Alternating Path) */
.experience {
  padding: 4rem 0;
  position: relative;
}

.timeline {
  max-width: 950px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-cyan) 0%, var(--accent-purple) 50%, #ec4899 100%);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.timeline-item {
  position: relative;
  width: 100%;
  margin-bottom: 4rem;
  display: flex;
  justify-content: flex-start; /* Odd items: card on the left */
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Even items: card on the right */
.timeline-item:nth-child(even) {
  justify-content: flex-end;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 35px;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 4px solid var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  z-index: 2;
  transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-dot {
  transform: translate(-50%, -50%) scale(1.3);
}

.timeline-card {
  width: 45%;
  position: relative;
  padding: 2.2rem;
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
}

.timeline-card:hover {
  transform: translateY(-5px);
}

/* Specific colored accents for each timeline card */
/* 1. Freelancer: Cyan / Blue */
.timeline-item:nth-child(1) .timeline-dot {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}
.timeline-item:nth-child(1) .timeline-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 15px 40px rgba(0, 242, 254, 0.08),
              inset 0 0 15px rgba(0, 242, 254, 0.02);
}
.timeline-item:nth-child(1) .timeline-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 20px 20px 0 0;
}

/* 2. Lead Developer: Purple / Violet */
.timeline-item:nth-child(2) .timeline-dot {
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple);
}
.timeline-item:nth-child(2) .timeline-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 15px 40px rgba(168, 85, 247, 0.08),
              inset 0 0 15px rgba(168, 85, 247, 0.02);
}
.timeline-item:nth-child(2) .timeline-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-purple), #8b5cf6);
  border-radius: 20px 20px 0 0;
}

/* 3. Senior Developer: Blue / Sky */
.timeline-item:nth-child(3) .timeline-dot {
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
}
.timeline-item:nth-child(3) .timeline-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.08),
              inset 0 0 15px rgba(59, 130, 246, 0.02);
}
.timeline-item:nth-child(3) .timeline-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), #06b6d4);
  border-radius: 20px 20px 0 0;
}

/* 4. Junior Developer: Pink / Rose */
.timeline-item:nth-child(4) .timeline-dot {
  border-color: #ec4899;
  box-shadow: 0 0 10px #ec4899;
}
.timeline-item:nth-child(4) .timeline-card:hover {
  border-color: rgba(236, 72, 153, 0.3);
  box-shadow: 0 15px 40px rgba(236, 72, 153, 0.08),
              inset 0 0 15px rgba(236, 72, 153, 0.02);
}
.timeline-item:nth-child(4) .timeline-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ec4899, #f43f5e);
  border-radius: 20px 20px 0 0;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.timeline-company {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 0.25rem;
  display: block;
}

.timeline-item:nth-child(1) .timeline-company { color: var(--accent-cyan); }
.timeline-item:nth-child(2) .timeline-company { color: var(--accent-purple); }
.timeline-item:nth-child(3) .timeline-company { color: var(--accent-blue); }
.timeline-item:nth-child(4) .timeline-company { color: #ec4899; }

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-family-heading);
  padding: 0.35rem 1rem;
  border-radius: 30px;
}

.timeline-item:nth-child(1) .timeline-date {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid rgba(0, 242, 254, 0.15);
}

.timeline-item:nth-child(2) .timeline-date {
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.timeline-item:nth-child(3) .timeline-date {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.timeline-item:nth-child(4) .timeline-date {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.05);
  border: 1px solid rgba(236, 72, 153, 0.15);
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Certificates Section */
.certificates {
  padding: 4rem 0;
  position: relative;
}

.cert-grid {
  display: flex;
  justify-content: center;
}

.cert-card {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 0;
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
}

.cert-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 65%; /* aspect ratio roughly matched to a certificate */
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cert-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cert-card:hover .cert-image {
  transform: scale(1.05);
}

.cert-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-overlay svg {
  color: #fff;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.8));
}

.cert-card:hover .cert-overlay {
  opacity: 1;
}

.cert-content {
  padding: 2rem;
}

.cert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cert-date {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  font-family: var(--font-family-heading);
}

.cert-badge {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.cert-title-text {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cert-issuer {
  display: block;
  font-size: 0.95rem;
  color: var(--accent-purple);
  margin-bottom: 1.2rem;
}

.cert-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Contact Section */
.contact {
  padding: 4rem 0;
  position: relative;
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 5rem;
  align-items: start;
}

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

.contact-info-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-top: 0.5rem;
}

.contact-info-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0.5rem auto 0 auto;
}

.contact-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  margin-top: 1rem;
}

.contact-grid-card {
  background: rgba(10, 22, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.contact-grid-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  border-radius: 10px 10px 0 0;
  transition: var(--transition-smooth);
}

.contact-grid-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.04);
}

/* Individual card accents and glows */
/* Email Card */
.contact-grid-card:nth-child(1)::after {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}
.contact-grid-card:nth-child(1):hover {
  border-color: rgba(0, 242, 254, 0.2);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.06);
}
.contact-grid-card:nth-child(1) .contact-card-icon {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
  border-color: rgba(0, 242, 254, 0.15);
}

/* Phone Card */
.contact-grid-card:nth-child(2)::after {
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}
.contact-grid-card:nth-child(2):hover {
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.06);
}
.contact-grid-card:nth-child(2) .contact-card-icon {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.15);
}

/* Location Card */
.contact-grid-card:nth-child(3)::after {
  background: linear-gradient(90deg, var(--accent-purple), #ec4899);
}
.contact-grid-card:nth-child(3):hover {
  border-color: rgba(168, 85, 247, 0.2);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.06);
}
.contact-grid-card:nth-child(3) .contact-card-icon {
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.05);
  border-color: rgba(168, 85, 247, 0.15);
}

.contact-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.2rem;
  transition: var(--transition-smooth);
}

.contact-card-icon svg {
  stroke: currentColor;
}

.contact-card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.contact-card-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-smooth);
  word-break: break-word;
  overflow-wrap: anywhere;
}

a.contact-card-value:hover {
  color: var(--accent-cyan);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  text-decoration: none;
}

.social-btn svg {
  fill: none;
  stroke: currentColor;
}

.social-links-wrapper {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.social-btn[aria-label="GitHub"]:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.12);
}

.social-btn[aria-label="Facebook"]:hover {
  color: #1877f2;
  border-color: rgba(24, 119, 242, 0.4);
  background: rgba(24, 119, 242, 0.06);
  box-shadow: 0 0 20px rgba(24, 119, 242, 0.22);
}

.social-btn[aria-label="TikTok"]:hover {
  color: #fe2c55;
  border-color: rgba(254, 44, 85, 0.4);
  background: rgba(254, 44, 85, 0.06);
  box-shadow: 0 0 20px rgba(254, 44, 85, 0.22);
}

.contact-card {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
  padding: 4rem 3rem;
  border-radius: 24px;
  background: rgba(10, 22, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition-smooth);
}

.contact-card:hover {
  border-color: rgba(168, 85, 247, 0.15);
}

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

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.form-group input, .form-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  padding: 0.95rem 1.25rem;
  border-radius: 12px;
  font-family: var(--font-family-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.02);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.form-status {
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Footer */
footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 22, 40, 0.7);
  position: relative;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.scroll-top-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.scroll-top-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

/* ===== MODAL DIALOG — Redesigned ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 8, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Scrollable sheet */
.modal-content {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 2;
  border-radius: 24px;
  background: rgba(8, 16, 32, 0.92);
  border: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.3) transparent;
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.35); border-radius: 4px; }

/* Close button */
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: 1rem 1rem 0 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.12);
  border-color: rgba(168,85,247,0.4);
  transform: rotate(90deg);
}

/* Gallery */
.modal-gallery-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  margin: 0 1rem 0 1rem;
  border-radius: 16px;
  overflow: hidden;
  height: 38vh;
  min-height: 200px;
  max-height: 340px;
  clear: both;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
  font-size: 0.9rem;
}

.gallery-btn:hover {
  background: rgba(168,85,247,0.55);
  border-color: rgba(168,85,247,0.6);
  box-shadow: 0 0 16px rgba(168,85,247,0.35);
}

.prev-btn { left: 0.75rem; }
.next-btn { right: 0.75rem; }

.modal-main-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

/* Dots */
.gallery-indicators {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.3s;
}

.indicator-dot.active {
  background: var(--accent-purple);
  width: 22px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(168,85,247,0.5);
}

/* Thumbnails */
.modal-thumbnails {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.modal-thumbnails::-webkit-scrollbar { display: none; }

.thumb-img {
  width: 42px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s;
  opacity: 0.5;
  flex-shrink: 0;
}

.thumb-img.active {
  opacity: 1;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(164,94,229,0.55);
}

.thumb-img:hover { opacity: 0.85; }

/* Info section */
.modal-info-container {
  padding: 1.25rem 1.25rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-top-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.modal-logo-box {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.modal-title-box { min-width: 0; }

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modal-action-box {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-app-store {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #605ee5, #a45ee5);
  color: white;
  padding: 0.6rem 1.1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(96,94,229,0.3);
}

.btn-app-store:hover {
  background: linear-gradient(135deg, #7a78ff, #c47aff);
  box-shadow: 0 6px 20px rgba(164,94,229,0.5);
  transform: translateY(-2px);
}

/* Divider line */
.modal-divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 0;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  padding-top: 0.25rem;
}

/* ===================================================================
   RESPONSIVE DESIGN - All Devices
   Breakpoints:
   - 1024px : Tablets (iPad landscape, Android tablets)
   - 768px  : Tablets portrait (iPad portrait)
   - 480px  : Mobile phones (iPhone, Android)
   - 360px  : Small phones (iPhone SE, older Android)
   =================================================================== */

/* ---------- Tablet & iPad Landscape (max-width: 1024px) ---------- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    align-items: center;
  }

  .hero-name {
    font-size: 3.8rem;
  }

  .hero-description {
    margin: 0 auto 2.5rem auto;
    max-width: 90%;
  }

  .hero-graphics {
    display: flex;
    justify-content: center;
  }

  .infinity-container {
    width: 280px;
    height: 240px;
  }

  .infinity-svg {
    width: 280px;
    height: 170px;
  }

  .hero-glow-ring {
    width: 300px;
    height: 300px;
  }

  .orbit-ring-1 { width: 260px; height: 260px; }
  .orbit-ring-2 { width: 210px; height: 210px; }
  .orbit-ring-3 { width: 160px; height: 160px; }

  /* About Bento Grid - 2 columns for tablets */
  .about-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }

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

  .bento-avatar {
    grid-column: span 2;
    grid-row: span 1;
    height: 400px;
  }

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

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

  .bento-large h2 {
    font-size: 2rem;
  }

  /* Projects Grid */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }

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

  .contact-info {
    text-align: center;
    align-items: center;
  }

  .contact-items-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Timeline stays alternating on tablets */
  .timeline-card {
    width: 45%;
  }

  /* Section padding */
  .about, .projects, .skills, .tech-stack, .experience, .certificates, .contact {
    padding: 3rem 0;
  }
}

/* ---------- Tablet Portrait & iPad (max-width: 768px) ---------- */
@media (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }

  /* Header */
  header {
    width: 94%;
    top: 12px;
    border-radius: 60px;
  }

  header.scrolled {
    top: 8px;
    width: 96%;
  }

  .nav-container {
    padding: 0 1.25rem;
    height: 60px;
  }

  .logo {
    font-size: 1.4rem;
  }

  /* Hamburger Menu */
  .hamburger {
    display: flex;
    z-index: 110;
  }

  .nav-overlay {
    display: block;
    pointer-events: none;
  }

  .nav-overlay.active {
    pointer-events: auto;
  }

  /* Mobile Navigation Drawer */
  nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: rgba(3, 3, 7, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    padding: 100px 2.5rem 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    z-index: 105;
    transition: var(--transition-smooth);
    border-radius: 0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  }

  nav.active {
    right: 0;
  }

  nav ul {
    flex-direction: column;
    gap: 1.8rem;
  }

  nav ul li a {
    font-size: 1.15rem;
    display: block;
    padding: 0.6rem 0;
  }

  nav ul li a::after {
    bottom: 0;
    left: 0;
    transform: none;
  }

  nav ul li a:hover::after, nav ul li a.active::after {
    width: 40px;
  }

  /* Language Toggle */
  .lang-toggle {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
  }

  /* Hero Section */
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 90px;
  }

  .hero-name {
    font-size: 3rem;
  }

  .hero-typed-wrapper {
    font-size: 1.4rem;
    height: 38px;
  }

  .hero-description {
    font-size: 1rem;
    max-width: 100%;
    margin-bottom: 2rem;
  }

  .hero-greeting {
    font-size: 0.95rem;
    letter-spacing: 2px;
  }

  .hero-ctas {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .btn-primary, .btn-secondary {
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
  }

  .hero-graphics {
    margin-top: 1rem;
  }

  .infinity-container {
    width: 240px;
    height: 200px;
  }

  .infinity-svg {
    width: 240px;
    height: 150px;
  }

  .hero-glow-ring {
    width: 250px;
    height: 250px;
  }

  .orbit-ring-1 { width: 220px; height: 220px; }
  .orbit-ring-2 { width: 180px; height: 180px; }
  .orbit-ring-3 { width: 140px; height: 140px; }

  /* About Bento Grid - 2 columns on mobile tablets (stat cards side by side) */
  .about-bento {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 1.25rem;
  }

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

  .bento-large h2 {
    font-size: 1.8rem;
  }

  .bento-large .about-bio {
    font-size: 0.95rem;
  }

  .bento-avatar {
    grid-column: span 2;
    grid-row: span 1;
    height: auto;
    min-height: 320px;
    order: -1; /* Show avatar first on mobile */
  }

  .bento-avatar .bento-avatar-inner img {
    object-fit: contain;
    object-position: center top;
  }

  .bento-stat {
    grid-column: span 1;
    grid-row: span 1;
    padding: 1.8rem;
  }

  .bento-stat .stat-num {
    font-size: 2.5rem;
  }

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

  .bento-ai .ai-tags {
    gap: 0.6rem;
  }

  .bento-ai .ai-tag {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
  }

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

  .project-img-container {
    height: 200px;
  }

  .project-card-content {
    padding: 1.5rem;
  }

  .project-title {
    font-size: 1.2rem;
  }

  .project-desc {
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
  }

  .project-filters {
    gap: 0.5rem;
    margin-bottom: 2.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
  }

  /* Section titles */
  h2.section-title {
    font-size: 2rem;
  }

  .gradient-text[style*="font-size: 2.2rem"] {
    font-size: 1.6rem !important;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .skill-category {
    padding: 1.8rem;
  }

  .skill-category-title {
    font-size: 1.15rem;
    padding-bottom: 1rem;
  }

  /* Tech Stack */
  .tech-grid {
    gap: 0.8rem;
  }

  .tech-tag {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .tech-tag i, .tech-tag svg {
    font-size: 1.25rem;
  }

  /* Timeline - Single column on mobile */
  .timeline::before {
    left: 15px;
    transform: none;
  }

  .timeline-item {
    padding-left: 45px;
    justify-content: flex-start !important;
    margin-bottom: 2.5rem;
  }

  .timeline-dot {
    left: 15px;
    top: 35px;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
  }

  .timeline-item:hover .timeline-dot {
    transform: translate(-50%, -50%) scale(1.2);
  }

  .timeline-card {
    width: 100% !important;
    padding: 1.8rem;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .timeline-title {
    font-size: 1.15rem;
  }

  .timeline-desc {
    font-size: 0.9rem;
  }

  /* Certificates */
  .cert-card {
    max-width: 100%;
  }

  .cert-content {
    padding: 1.5rem;
  }

  .cert-title-text {
    font-size: 1.2rem;
  }

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

  .contact-info {
    text-align: center;
    align-items: center;
  }

  .contact-info-title {
    font-size: 2rem;
  }

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

  .contact-grid-card {
    flex-direction: row;
    align-items: center;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    text-align: left;
  }

  .contact-grid-card .contact-card-label,
  .contact-grid-card .contact-card-value {
    display: block;
  }

  .contact-card-icon {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .contact-card {
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }

  .contact-info-title {
    font-size: 1.6rem !important;
  }

  .social-links-wrapper {
    justify-content: center;
  }

  /* Footer */
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-text {
    font-size: 0.85rem;
  }

  /* Modal */
  .modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 16px 16px;
  }

  .modal-gallery-wrapper {
    height: 26vh;
    min-height: 170px;
    margin: 0 0.75rem;
  }

  .modal-gallery-wrapper .gallery-btn {
    width: 34px;
    height: 34px;
  }

  .prev-btn { left: 0.5rem; }
  .next-btn { right: 0.5rem; }

  .modal-top-row {
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
  }

  .modal-logo-box {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .modal-info-container {
    padding: 1rem 1rem 1.25rem 1rem;
  }

  .modal-thumbnails {
    padding: 0.6rem 0.75rem 0 0.75rem;
    gap: 0.5rem;
  }

  .thumb-img {
    width: 38px;
    height: 56px;
  }

  .thumb-img {
    width: 38px;
    height: 58px;
  }

  /* Aurora effects - reduce for performance */
  .aurora {
    opacity: 0.4;
  }
}

/* ---------- Mobile Phones (max-width: 480px) ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  /* Header */
  header {
    width: 96%;
    top: 8px;
    border-radius: 50px;
  }

  header.scrolled {
    top: 6px;
    width: 98%;
  }

  .nav-container {
    padding: 0 1rem;
    height: 56px;
  }

  .logo {
    font-size: 1.3rem;
  }

  .lang-toggle {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }

  .lang-toggle svg {
    width: 14px;
    height: 14px;
  }

  .nav-actions {
    gap: 0.8rem;
  }

  /* Mobile Nav Drawer */
  nav {
    width: 100%;
    padding: 90px 2rem 2rem 2rem;
  }

  nav ul {
    gap: 1.5rem;
  }

  nav ul li a {
    font-size: 1.2rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  /* Hero */
  .hero {
    padding-top: 80px;
    padding-bottom: 2rem;
  }

  .hero-greeting {
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
  }

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

  .hero-typed-wrapper {
    font-size: 1.15rem;
    height: 32px;
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.75rem;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
  }

  .hero-graphics {
    margin-top: 0.5rem;
  }

  .infinity-container {
    width: 200px;
    height: 170px;
  }

  .infinity-svg {
    width: 200px;
    height: 130px;
  }

  .hero-glow-ring {
    width: 200px;
    height: 200px;
  }

  .orbit-ring-1 { width: 190px; height: 190px; }
  .orbit-ring-2 { width: 150px; height: 150px; }
  .orbit-ring-3 { width: 110px; height: 110px; }

  /* About Section */
  .about {
    padding: 2.5rem 0;
  }

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

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

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

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

  .bento-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .bento-large .about-subtitle {
    font-size: 0.85rem;
  }

  .bento-large h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .bento-large .about-bio {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .bento-avatar {
    height: auto;
    min-height: 280px;
    border-radius: 16px;
  }

  .bento-avatar-inner {
    border-radius: 12px;
  }

  .bento-stat {
    padding: 1.5rem;
  }

  .bento-stat .stat-num {
    font-size: 2.2rem;
  }

  .bento-stat .stat-label {
    font-size: 0.75rem;
  }

  .bento-ai .ai-title {
    font-size: 0.85rem;
  }

  .bento-ai .ai-tags {
    gap: 0.5rem;
  }

  .bento-ai .ai-tag {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.4rem;
  }

  .bento-ai .ai-icon {
    width: 14px;
    height: 14px;
  }

  /* Section titles for mobile */
  .about-subtitle {
    font-size: 0.85rem !important;
  }

  .gradient-text[style*="font-size: 2.2rem"] {
    font-size: 1.35rem !important;
  }

  /* Projects */
  .projects {
    padding: 2.5rem 0;
  }

  .project-filters {
    gap: 0.4rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
  }

  .filter-btn {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
  }

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

  .project-card {
    border-radius: 16px;
  }

  .project-img-container {
    height: 180px;
  }

  .project-card-content {
    padding: 1.25rem;
  }

  .project-tags {
    margin-bottom: 1rem;
    gap: 0.4rem;
  }

  .project-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.7rem;
  }

  .project-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .project-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    -webkit-line-clamp: 2;
  }

  .project-btn {
    font-size: 0.85rem;
  }

  /* Skills */
  .skills {
    padding: 2.5rem 0;
  }

  .skills-grid {
    gap: 1.25rem;
  }

  .skill-category {
    padding: 1.5rem;
    gap: 1.4rem;
    border-radius: 16px;
  }

  .skill-category-title {
    font-size: 1.05rem;
    gap: 0.6rem;
    padding-bottom: 0.9rem;
  }

  .skill-category-title svg {
    width: 18px;
    height: 18px;
  }

  .skill-items {
    gap: 1.2rem;
  }

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

  .skill-percentage {
    font-size: 0.82rem;
  }

  .skill-progress-bar {
    height: 5px;
  }

  /* Tech Stack */
  .tech-stack {
    padding: 2.5rem 0;
  }

  .tech-grid {
    gap: 0.6rem;
  }

  .tech-tag {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    gap: 0.5rem;
    border-radius: 40px;
  }

  .tech-tag i, .tech-tag svg {
    font-size: 1.1rem;
  }

  /* Experience */
  .experience {
    padding: 2.5rem 0;
  }

  .timeline-item {
    margin-bottom: 2rem;
    padding-left: 38px;
  }

  .timeline-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .timeline-title {
    font-size: 1.05rem;
  }

  .timeline-company {
    font-size: 0.85rem;
  }

  .timeline-date {
    font-size: 0.78rem;
    padding: 0.3rem 0.8rem;
  }

  .timeline-desc {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  /* Certificates */
  .certificates {
    padding: 2.5rem 0;
  }

  .cert-content {
    padding: 1.25rem;
  }

  .cert-title-text {
    font-size: 1.1rem;
  }

  .cert-desc {
    font-size: 0.85rem;
  }

  .cert-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Contact */
  .contact {
    padding: 2.5rem 0;
  }

  .contact-info-title {
    font-size: 1.35rem !important;
  }

  .contact-info-desc {
    font-size: 0.85rem;
    max-width: 100% !important;
  }

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

  .contact-grid-card {
    flex-direction: row;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    border-radius: 12px;
    text-align: left;
  }

  .contact-card-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .contact-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .contact-grid-card > .contact-card-label {
    font-size: 0.7rem;
    display: block;
  }

  .contact-grid-card > .contact-card-value,
  .contact-grid-card > a.contact-card-value {
    font-size: 0.88rem;
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .social-links-wrapper {
    gap: 0.8rem;
  }

  .social-btn {
    width: 42px;
    height: 42px;
  }

  .contact-card {
    padding: 1.5rem 1rem;
    border-radius: 16px;
    gap: 1.25rem;
  }

  .contact-form {
    gap: 1.25rem;
  }

  .form-group input, .form-group textarea {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  /* Footer */
  footer {
    padding: 2rem 0;
  }

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

  .scroll-top-btn {
    width: 38px;
    height: 38px;
  }

  /* Modal */
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    max-height: 94vh;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    /* slide up from bottom */
    transform: translateY(40px) scale(1);
  }

  .modal.active .modal-content {
    transform: translateY(0) scale(1);
  }

  /* Pull handle indicator */
  .modal-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: 0.9rem auto 0 auto;
  }

  .modal-close {
    margin: 0.6rem 0.75rem 0 0;
  }

  .modal-gallery-wrapper {
    height: 30vw;
    min-height: 180px;
    max-height: 260px;
    margin: 0 0.75rem;
    border-radius: 12px;
  }

  .gallery-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .prev-btn { left: 0.4rem; }
  .next-btn { right: 0.4rem; }

  .modal-thumbnails {
    padding: 0.5rem 0.75rem 0 0.75rem;
    gap: 0.4rem;
  }

  .thumb-img {
    width: 34px;
    height: 50px;
    border-radius: 6px;
  }

  .modal-info-container {
    gap: 0.7rem;
    padding: 0.9rem 0.9rem 1.25rem 0.9rem;
  }

  .modal-top-row {
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem;
    align-items: center;
  }

  .modal-logo-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    padding: 6px;
  }

  .modal-title {
    font-size: 1rem;
  }

  .modal-desc {
    font-size: 0.88rem;
  }

  .btn-app-store {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
  }

  .btn-app-store svg {
    width: 14px;
    height: 14px;
  }

  .modal-tags {
    gap: 0.35rem;
  }

  .modal-desc {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .btn-app-store {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 25px;
  }

  .btn-app-store svg {
    width: 14px;
    height: 14px;
  }

  /* Glass card adjustments for mobile */
  .glass-card {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }

  /* Disable hover transforms on touch devices for better UX */
  .project-card:hover,
  .bento-card:hover,
  .tech-tag:hover,
  .skill-category:hover {
    transform: none;
  }

  /* Aurora - reduce for mobile performance */
  .aurora {
    opacity: 0.3;
  }

  /* Background dots - subtle on mobile */
  .background-wrapper::after {
    background-size: 24px 24px;
    opacity: 0.5;
  }
}

/* ---------- Small Phones (max-width: 360px) ---------- */
@media (max-width: 360px) {
  .container {
    padding: 0 0.75rem;
  }

  .nav-container {
    padding: 0 0.75rem;
    height: 52px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-typed-wrapper {
    font-size: 1rem;
    height: 28px;
  }

  .hero-description {
    font-size: 0.85rem;
  }

  .hero-greeting {
    font-size: 0.8rem;
  }

  .bento-large h2 {
    font-size: 1.3rem;
  }

  .bento-large .about-bio {
    font-size: 0.85rem;
  }

  .bento-avatar {
    height: 240px;
  }

  .bento-stat .stat-num {
    font-size: 2rem;
  }

  .infinity-container {
    width: 170px;
    height: 150px;
  }

  .infinity-svg {
    width: 170px;
    height: 110px;
  }

  .hero-glow-ring {
    width: 170px;
    height: 170px;
  }

  .orbit-ring-1 { width: 160px; height: 160px; }
  .orbit-ring-2 { width: 130px; height: 130px; }
  .orbit-ring-3 { width: 100px; height: 100px; }

  .project-img-container {
    height: 160px;
  }

  .contact-info-title {
    font-size: 1.4rem;
  }

  .timeline-card {
    padding: 1.25rem;
  }

  .skill-category {
    padding: 1.25rem;
  }

  .tech-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .modal-gallery-wrapper {
    height: 22vh;
    min-height: 130px;
  }

  .modal-title {
    font-size: 0.95rem;
  }
}

/* ---------- Landscape mode for phones ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: 80px;
    padding-bottom: 2rem;
  }

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

  .hero-content {
    align-items: flex-start;
  }

  .hero-name {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
  }

  .hero-typed-wrapper {
    font-size: 1.1rem;
    height: 28px;
    margin-bottom: 0.75rem;
  }

  .hero-description {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-ctas {
    flex-direction: row;
  }

  .btn-primary, .btn-secondary {
    width: auto;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
  }

  .infinity-container {
    width: 180px;
    height: 150px;
  }

  .modal {
    padding: 0.5rem;
    align-items: center;
  }

  .modal-content {
    border-radius: 16px;
    max-height: 95vh;
  }

  .modal-content::before {
    display: none;
  }

  .modal-gallery-wrapper {
    height: 45vh;
    max-height: none;
  }
}

/* ---------- Touch Device Optimizations ---------- */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices for better experience */
  .project-card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  }

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

  .tech-tag:hover {
    transform: none;
  }

  .skill-category:hover {
    transform: none;
  }

  .skill-item:hover {
    transform: none;
  }

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

  .contact-grid-card:hover {
    transform: none;
  }

  /* Make touch targets bigger */
  nav ul li a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .filter-btn {
    min-height: 44px;
  }

  .social-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .project-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Prevent text selection on interactive elements */
  .btn-primary,
  .btn-secondary,
  .filter-btn,
  .social-btn,
  .project-btn,
  .hamburger,
  .lang-toggle {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
  }
}

/* ---------- Safe area insets for notched phones (iPhone X+) ---------- */
@supports (padding: max(0px)) {
  .hero {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  .modal-content {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  nav {
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }
}

/* ---------- Reduced motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .infinity-path {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  .aurora {
    display: none;
  }
}
