@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ===========================
   CSS Variables
   =========================== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --accent: #ffffff;
  --accent-dim: #c0c0c0;
  --text-primary: #ffffff;
  --text-secondary: #9a9a9a;
  --text-muted: #505050;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.4);
  --shadow-glow: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --t: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-w: 1100px;
  --font: 'Inter', sans-serif;
  --font-d: 'Space Grotesk', sans-serif;
}

/* ===========================
   Reset
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

/* ===========================
   Ambient Background
   =========================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 85% 15%, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   Utilities
   =========================== */
.highlight {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04rem;
  cursor: pointer;
  transition: var(--t);
  border: 1.5px solid transparent;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
  text-align: center;
}

.btn-primary {
  color-scheme: only light;
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ===========================
   Keyframes
   =========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}


@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.15); }
  50%       { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

/* Scroll-triggered reveal */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid children */
.skills-grid .fade-in:nth-child(1)  { transition-delay: 0.05s; }
.skills-grid .fade-in:nth-child(2)  { transition-delay: 0.10s; }
.skills-grid .fade-in:nth-child(3)  { transition-delay: 0.15s; }
.skills-grid .fade-in:nth-child(4)  { transition-delay: 0.20s; }
.skills-grid .fade-in:nth-child(5)  { transition-delay: 0.25s; }
.skills-grid .fade-in:nth-child(6)  { transition-delay: 0.30s; }
.skills-grid .fade-in:nth-child(7)  { transition-delay: 0.35s; }
.skills-grid .fade-in:nth-child(8)  { transition-delay: 0.40s; }
.skills-grid .fade-in:nth-child(9)  { transition-delay: 0.45s; }
.skills-grid .fade-in:nth-child(10) { transition-delay: 0.50s; }

/* ===========================
   Navbar
   =========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.4rem 2rem;
  transition: background 0.4s ease, padding 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
  padding: 0.9rem 2rem;
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02rem;
  transition: color var(--t);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  transition: color var(--t);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   Section Layout
   =========================== */
section {
  position: relative;
  z-index: 1;
  padding: 7rem 2rem;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.section-container {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.section-header {
  margin-bottom: 3.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-num {
  font-family: var(--font-d);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04rem;
}

.section-header h2 {
  font-family: var(--font-d);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 700;
  color: var(--text-primary);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 280px;
}

/* ===========================
   Home Section
   =========================== */
section.home {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0.92) 100%),
    url('../images/body.jpg') center / cover no-repeat;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 5rem 0 4rem;
}

.home-content {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem;
  z-index: 1;
}

.home-greeting {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.home-name {
  font-family: var(--font-d);
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0.4rem 0;
  color: #ffffff;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.home-subtitle {
  font-family: var(--font-d);
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0.4rem 0 1.4rem;
  animation: fadeInUp 0.7s ease 0.3s both;
  min-height: 2.2rem;
}

.cursor {
  color: var(--accent);
  animation: blink 0.9s step-end infinite;
}

.home-desc {
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.85;
  margin-bottom: 2.2rem;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.home-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.8rem;
  animation: fadeInUp 0.7s ease 0.5s both;
}

.social-links {
  display: flex;
  gap: 1rem;
  animation: fadeInUp 0.7s ease 0.6s both;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: var(--t);
}

.social-links a:hover {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
  animation: fadeInUp 1s ease 1.2s both;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

/* ===========================
   About Section
   =========================== */
section.about {
  background: var(--bg-primary);
  overflow: hidden;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.9;
}

.about-card {
  display: flex;
  justify-content: center;
}

.about-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 320px;
  transition: var(--t);
}

.about-card-inner:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 16px 48px rgba(255, 255, 255, 0.06);
  transform: translateY(-4px);
}

.about-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 2rem;
  animation: pulseRing 3.5s ease-in-out infinite;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  word-break: break-word;
}

.info-item i {
  color: var(--accent);
  width: 16px;
  flex-shrink: 0;
}

/* ===========================
   Skills Section
   =========================== */
section.skills {
  background: var(--bg-secondary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.2rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  cursor: default;
  transition: var(--t);
}

.skill-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.06);
}

.skill-card img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  transition: transform var(--t), filter var(--t);
  animation: float 4s ease-in-out infinite;
}

/* Stagger float animations */
.skill-card:nth-child(2) img { animation-delay: 0.3s; }
.skill-card:nth-child(3) img { animation-delay: 0.6s; }
.skill-card:nth-child(4) img { animation-delay: 0.9s; }
.skill-card:nth-child(5) img { animation-delay: 1.2s; }
.skill-card:nth-child(6) img { animation-delay: 1.5s; }
.skill-card:nth-child(7) img { animation-delay: 1.8s; }
.skill-card:nth-child(8) img { animation-delay: 2.1s; }
.skill-card:nth-child(9) img { animation-delay: 2.4s; }
.skill-card:nth-child(10) img { animation-delay: 2.7s; }

.skill-card:hover img {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
  animation-play-state: paused;
}

.skill-card span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  transition: color var(--t);
}

.skill-card:hover span {
  color: var(--text-primary);
}

/* ===========================
   Projects Section
   =========================== */
section.projects {
  background: var(--bg-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--t);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(255, 255, 255, 0.06);
}

.project-img {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.06);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 18, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.overlay-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #020a12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--t);
  transform: translateY(12px);
}

.project-card:hover .overlay-btn {
  transform: translateY(0);
}

.overlay-btn:hover {
  background: var(--text-primary);
  transform: scale(1.1) !important;
}

.overlay-btn:nth-child(2) { transition-delay: 0.06s; }

.project-info {
  padding: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.project-tags span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  letter-spacing: 0.03rem;
}

.project-info h3 {
  font-family: var(--font-d);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.project-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 1.2rem;
}

.project-links {
  display: flex;
  gap: 1.2rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  transition: color var(--t);
}

.project-links a:hover {
  color: var(--accent);
}

/* ===========================
   Contact Section
   =========================== */
section.contact {
  background: var(--bg-secondary);
  overflow: hidden;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 5rem;
  align-items: start;
}

.contact-text h3 {
  font-family: var(--font-d);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.contact-text > p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 2rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color var(--t), transform var(--t);
  padding: 0.3rem 0;
  word-break: break-word;
}

.contact-item i {
  color: var(--accent);
  width: 18px;
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-item:hover {
  color: var(--accent);
  transform: translateX(6px);
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.92rem;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* ===========================
   Footer
   =========================== */
footer {
  position: relative;
  z-index: 1;
  padding: 1.8rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color var(--t);
}

.footer-socials a:hover {
  color: var(--accent);
}

/* ===========================
   About + Contact — Enhanced Animations
   =========================== */

/* Directional slide variants (work alongside existing .fade-in) */
.fade-in.from-left  { transform: translateX(-50px); }
.fade-in.from-right { transform: translateX(50px); }
.fade-in.from-left.visible,
.fade-in.from-right.visible { transform: translateX(0); }

/* --- About: stagger paragraphs and resume button --- */
.about-text p,
.about-text .btn-outline {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.about-text.visible p:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.25s; }
.about-text.visible p:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.42s; }
.about-text.visible p:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.59s; }
.about-text.visible .btn-outline   { opacity: 1; transform: none; transition-delay: 0.76s; }

/* --- About: avatar spring pop --- */
.about-avatar {
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.about-card.visible .about-avatar {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.3s;
}

/* --- About: info items slide in from right --- */
.info-item {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.about-card.visible .info-item:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.48s; }
.about-card.visible .info-item:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.62s; }
.about-card.visible .info-item:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.76s; }

/* --- Contact: heading underline grow --- */
.contact-text h3 { position: relative; }
.contact-text h3::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}
.contact-text.visible h3::after { width: 65%; }

/* --- Contact: intro paragraph stagger --- */
.contact-text > p {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.contact-text.visible > p { opacity: 1; transform: none; transition-delay: 0.45s; }

/* --- Contact: items fade in stagger (opacity-only to preserve hover transform) --- */
@keyframes fadeInItem {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.contact-info .contact-item { opacity: 0; }
.contact-text.visible .contact-info .contact-item:nth-child(1) { animation: fadeInItem 0.45s ease 0.55s forwards; }
.contact-text.visible .contact-info .contact-item:nth-child(2) { animation: fadeInItem 0.45s ease 0.70s forwards; }
.contact-text.visible .contact-info .contact-item:nth-child(3) { animation: fadeInItem 0.45s ease 0.85s forwards; }

/* ===========================
   Responsive
   =========================== */

/* Tablet / iPad */
@media (max-width: 900px) {
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-card {
    order: -1;
  }

  .about-card-inner {
    max-width: 100%;
  }

  .contact-content {
    gap: 2.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  section {
    padding: 5rem 1.5rem;
    min-height: auto;
  }

  section.home {
    min-height: 100vh;
    min-height: 100svh;
    padding: 4.5rem 0 3rem;
  }

  .home-content {
    padding: 0 1.5rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: 2rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border);
    z-index: 99;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    font-size: 1.05rem;
  }

  .hamburger {
    display: flex;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .section-line {
    display: none;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Reduce slide distance so translateX stays well within viewport */
  .fade-in.from-left  { transform: translateX(-28px); }
  .fade-in.from-right { transform: translateX(28px); }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-content {
    gap: 2rem;
  }
}

/* Small mobile (iPhone SE, Galaxy A series) */
@media (max-width: 480px) {
  section {
    padding: 4.5rem 1.2rem;
  }

  section.home {
    padding: 4rem 0 3rem;
  }

  .home-content {
    padding: 0 1.2rem;
  }

  .home-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .home-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .skill-card {
    padding: 1.5rem 0.8rem;
  }

  .about-card-inner {
    padding: 1.8rem 1.2rem;
  }

  .project-info {
    padding: 1.2rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }
}

/* Very small (320px – older iPhones, small Androids) */
@media (max-width: 360px) {
  section {
    padding: 4rem 1rem;
  }

  section.home {
    padding: 4rem 0 2.5rem;
  }

  .home-content {
    padding: 0 1rem;
  }

  .skills-grid {
    gap: 0.6rem;
  }

  .skill-card {
    padding: 1.2rem 0.6rem;
  }

  .skill-card img {
    width: 36px;
    height: 36px;
  }

  .navbar {
    padding: 1rem 1rem;
  }

  .navbar.scrolled {
    padding: 0.7rem 1rem;
  }
}

/* Landscape mobile (short viewport) */
@media (max-height: 550px) and (orientation: landscape) {
  section.home {
    min-height: auto;
    padding: 4rem 0 2rem;
    align-items: flex-start;
  }

  .scroll-indicator {
    display: none;
  }

  .home-name {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }

  .home-desc {
    display: none;
  }

  section {
    min-height: auto;
    padding: 4rem 1.5rem;
  }
}

/* High-DPI / Retina — crisp borders */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .skill-card,
  .project-card,
  .about-card-inner {
    border-width: 0.5px;
  }
}
