/* ========== BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #020617;
  --bg-soft: #020617;
  --card-bg: rgba(15, 23, 42, 0.96);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #22c55e;
  --accent2: #38bdf8;
  --border-soft: rgba(148, 163, 184, 0.4);
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-soft: 0 22px 60px rgba(15, 23, 42, 0.9);
  --transition-fast: 0.18s ease;
  --transition-med: 0.32s ease;
}

/* Light theme main variables */
body[data-theme="light"] {
  --bg: #f3f4f6;
  --bg-soft: #ffffff;
  --card-bg: #ffffff;
  --text: #020617;
  --text-muted: #6b7280;
  --border-soft: rgba(148, 163, 184, 0.5);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background canvas + glow */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: radial-gradient(circle at top, #020617 0, #000 55%, #020617 100%);
}

/* Light theme background for canvas */
body[data-theme="light"] #bg-canvas {
  background: radial-gradient(circle at top, #e5e7eb 0, #c7d2fe 45%, #e5e7eb 100%);
}

.background-glow {
  position: fixed;
  inset: -40%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(34, 197, 94, 0.22), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.23), transparent 55%);
  mix-blend-mode: screen;
  filter: blur(8px);
  animation: glowMove 45s linear infinite alternate;
}

@keyframes glowMove {
  0%   { transform: scale(1) rotate(0deg) translate3d(0,0,0); }
  50%  { transform: scale(1.08) rotate(10deg) translate3d(15px,-20px,0); }
  100% { transform: scale(1.04) rotate(-12deg) translate3d(-15px,15px,0); }
}

/* ========== PRELOADER (LOGIN ANIMATION) ========== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Particles canvas over preloader */
#loadingParticles {
  position: absolute;
  inset: 0;
}

/* UJJWAL text animation */
.loadingText {
  position: relative;
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #22c55e;
  text-transform: uppercase;
  text-shadow: 0 0 25px rgba(34, 197, 94, 0.9);
  display: flex;
}

.loadingText span {
  display: inline-block;
  transform-origin: center;
  animation: floatLetter 1.2s ease-in-out infinite;
}

.loadingText span:nth-child(2){ animation-delay: .07s; }
.loadingText span:nth-child(3){ animation-delay: .14s; }
.loadingText span:nth-child(4){ animation-delay: .21s; }
.loadingText span:nth-child(5){ animation-delay: .28s; }
.loadingText span:nth-child(6){ animation-delay: .35s; }

@keyframes floatLetter {
  0%   { transform: translateY(0) rotate(0deg); opacity: .6; }
  30%  { transform: translateY(-12px) rotate(-4deg); opacity: 1; }
  60%  { transform: translateY(0) rotate(0deg); opacity: .9; }
  100% { transform: translateY(8px) rotate(3deg); opacity: .6; }
}

/* ========== LAYOUT HELPERS ========== */
.container {
  width: min(1120px, 90%);
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  position: relative;
}

.section-alt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.07), transparent 60%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.07), transparent 60%);
}

/* Scroll reveal (direction aware) */
.reveal {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  /* faster animation */
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.reveal.from-bottom { transform: translateY(22px) scale(.985); }
.reveal.from-top    { transform: translateY(-22px) scale(.985); }
.reveal.visible     { opacity: 1; transform: translateY(0) scale(1); }

/* ========== HEADER / NAVBAR ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(2,6,23,.98), rgba(2,6,23,.9), transparent);
  border-bottom: 1px solid rgba(15,23,42,.9);
}

/* Light header */
body[data-theme="light"] .header {
  background: linear-gradient(to bottom, rgba(248,250,252,.98), rgba(248,250,252,.96), transparent);
  border-bottom-color: rgba(148,163,184,.5);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.logo span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: .95rem;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  transition: width var(--transition-fast);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-contact-btn {
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(15,23,42,.95);
}

/* Light nav + contact button */
body[data-theme="light"] .nav {
  background: rgba(248,250,252,.97);
  border-bottom-color: rgba(148,163,184,.5);
}
body[data-theme="light"] .nav-contact-btn {
  background: #ffffff;
}

.theme-toggle {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(15,23,42,.95);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--accent2);
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
}

/* ========== HERO ========== */
.hero {
  padding: 5.5rem 0 4rem;
}

.hero-container {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  gap: 3rem;
  align-items: center;
}

.hero-greet {
  text-transform: uppercase;
  letter-spacing: .25em;
  font-size: .85rem;
  color: var(--accent2);
  margin-bottom: .4rem;
}

.hero-name {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 700;
  margin-bottom: .4rem;
}

.hero-role {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero-role span {
  color: var(--accent);
  font-weight: 600;
}

.cursor {
  display: inline-block;
  width: 1px;
  background: var(--text);
  margin-left: 2px;
  animation: blink 1s infinite;
}
@keyframes blink {
  0%,49% { opacity:1; }
  50%,100% { opacity:0; }
}

.hero-description {
  font-size: .95rem;
  color: var(--text-muted);
  max-width: 30rem;
  margin-bottom: 1.7rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .92rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast);
}

.primary-btn {
  background: linear-gradient(120deg, var(--accent2), var(--accent));
  color: #020617;
  box-shadow: 0 14px 40px rgba(34,197,94,.5);
}
.primary-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 50px rgba(34,197,94,.7);
}

.ghost-btn {
  background: rgba(15,23,42,.95);
  border-color: var(--border-soft);
  color: var(--text-muted);
}
.ghost-btn:hover {
  border-color: var(--accent2);
  color: var(--text);
}

/* Hero image */
.hero-photo-card {
  background: radial-gradient(circle at 0 0, rgba(34,197,94,.4), transparent 55%),
              radial-gradient(circle at 100% 100%, rgba(56,189,248,.35), transparent 55%),
              var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 1.6rem 1.6rem 2.1rem;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo {
  width: 230px;
  height: 230px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(248,250,252,.18);
}

/* ========== SECTION HEADERS ========== */
.section-header {
  text-align: center;
  margin-bottom: 2.3rem;
}
.section-header h2 {
  font-size: 1.8rem;
  margin-bottom: .4rem;
}
.section-header p {
  color: var(--text-muted);
  font-size: .95rem;
}

/* ========== ABOUT ========== */
.about-section {
  padding-top: 1.5rem;
}

.about-container {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(0,1.4fr);
  gap: 2.5rem;
  align-items: center;
}

.about-photo img {
  width: 100%;
  border-radius: 26px;
  border: 2px solid rgba(148,163,184,.7);
  box-shadow: 0 25px 80px rgba(15,23,42,.95);
  object-fit: cover;
}

.about-content {
  padding: 1rem 0;
}

.about-title {
  font-size: 1.6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.about-title span {
  color: var(--accent);
}

.about-name {
  margin-top: .9rem;
  font-size: 1.3rem;
}
.about-name span {
  color: var(--accent2);
  text-shadow: 0 0 12px rgba(56,189,248,.7);
}

.about-text {
  margin-top: .7rem;
  font-size: .93rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.about-details {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .4rem 1.8rem;
  font-size: .9rem;
}

.about-details p strong {
  color: var(--accent);
  font-weight: 600;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 1.4rem 1.3rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med), background var(--transition-med);
}

.skill-card i {
  font-size: 1.6rem;
  color: var(--accent);
}

.skill-card h3 {
  font-size: 1.05rem;
}

.skill-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.skill-card .tag {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.9);
}

body[data-theme="light"] .skill-card .tag {
  background: #f9fafb;
}

.skill-card:hover {
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.7);
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.14), transparent 55%), var(--card-bg);
}


/* ========== PROJECTS ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15,23,42,.9);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
}

.project-image {
  height: 160px;
  background-position: center;
  background-size: cover;
  transition: transform 0.6s ease;
}

.project-content {
  padding: 1.1rem 1.2rem 1.3rem;
}

.project-content h3 {
  font-size: 1.02rem;
  margin-bottom: .3rem;
}

.project-content p {
  font-size: .9rem;
  color: var(--text-muted);
}

.project-tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .4rem;
}

.project-tags span {
  font-size: .75rem;
  padding: .18rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.7);
  /* uses theme variable now: dark in dark mode, white in light mode */
  background: var(--bg-soft);
}


.project-links {
  display: flex;
  gap: .8rem;
  margin-top: .6rem;
}

.project-links a {
  font-size: .84rem;
  color: var(--accent2);
  text-decoration: none;
  position: relative;
}

.project-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 1px;
  background: var(--accent2);
  transition: width .2s;
}
.project-links a:hover::after { width: 100%; }

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 80px rgba(15,23,42,1);
  border-color: rgba(56,189,248,.8);
}
.project-card:hover .project-image {
  transform: scale(1.05);
}

/* ========== YOUTUBE ========== */
.yt-channel-card {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  padding: 1.7rem 1.4rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(15,23,42,.9);
  margin-bottom: 2rem;
}

.yt-logo {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid rgba(248,250,252,.22);
  margin-bottom: .6rem;
}

.yt-channel-name {
  font-size: 1.3rem;
  margin-bottom: .4rem;
}

.yt-channel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .7rem;
  margin-bottom: .3rem;
}

.yt-sub-btn {
  background: #ff0000;
  color: #f9fafb;
  border: none;
  box-shadow: 0 12px 30px rgba(239,68,68,.55);
}
.yt-sub-btn i { margin-right: .3rem; }

.yt-channel-meta {
  font-size: .85rem;
  color: var(--text-muted);
}

.yt-videos-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1.4rem;
}

.yt-video-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(15,23,42,.9);
  transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
}

.yt-thumb-wrapper {
  position: relative;
  display: block;
}

.yt-thumb-wrapper img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform .45s ease, filter .45s ease;
}

.yt-badge {
  position: absolute;
  left: .75rem;
  bottom: .7rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: rgba(15,23,42,.92);
  color: #f9fafb;
  font-size: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.yt-badge i { color: #ff0000; }

.yt-video-info {
  padding: .8rem .9rem .9rem;
}
.yt-video-info h3 {
  font-size: .96rem;
  margin-bottom: .1rem;
}
.yt-video-info p {
  font-size: .8rem;
  color: var(--text-muted);
}

.yt-video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px rgba(15,23,42,1);
  border-color: rgba(56,189,248,.8);
}
.yt-video-card:hover img {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* ========== GALLERY + LIGHTBOX ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1rem;
}

.gallery-item {
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  cursor: pointer;
  /* card background now follows theme */
  background: var(--card-bg);
  box-shadow: 0 18px 55px rgba(15,23,42,.9);
  transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .4s ease, opacity .4s ease;
}
.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,.8);
  box-shadow: 0 24px 75px rgba(15,23,42,1);
}
.gallery-item:hover img {
  transform: scale(1.06);
  opacity: .9;
}

/* Light gallery background */
body[data-theme="light"] .gallery-item {
  background: #ffffff;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.87);
  backdrop-filter: blur(6px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.7);
  box-shadow: 0 24px 80px rgba(0,0,0,.9);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  object-fit: contain;
  background: #020617;
}

.lightbox-close {
  position: absolute;
  right: .55rem;
  top: .55rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: none;
  background: rgba(15,23,42,.94);
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ========== CONTACT ========== */
.contact-container {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  gap: 2.4rem;
  align-items: flex-start;
}

.contact-text h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.contact-info {
  list-style: none;
  display: grid;
  gap: .7rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.contact-info li {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.contact-info i {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: rgba(15,23,42,.95);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent2);
}

/* Light contact info icon */
body[data-theme="light"] .contact-info i {
  background: #ffffff;
}

.contact-form {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  padding: 1.5rem 1.3rem;
  box-shadow: 0 18px 60px rgba(15,23,42,.9);
  display: grid;
  gap: .9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: .6rem .8rem;
  border-radius: .8rem;
  border: 1px solid rgba(148,163,184,.7);
  /* follows theme now */
  background: var(--bg-soft);
  color: var(--text);
  font-size: .9rem;
  outline: none;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* contact social buttons */
.contact-socials {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.contact-social {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-muted);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.contact-social i {
  font-size: 0.95rem;
}

/* hover effect */
.contact-social:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.8);
  border-color: var(--accent2);
  color: var(--text);
}

/* tiny brand colours */
.contact-social.youtube i { color: #ff0000; }
.contact-social.insta i   { color: #e11d48; }
.contact-social.telegram i{ color: #0ea5e9; }
.contact-social.web i     { color: var(--accent); }


/* ========== FOOTER ========== */
.footer {
  padding: 1.4rem 0 1.6rem;
  text-align: center;
  font-size: .85rem;
  border-top: 1px solid rgba(15,23,42,.9);
  background: #020617;
}

/* Light footer */
body[data-theme="light"] .footer {
  background: #f3f4f6;
  border-top-color: rgba(148,163,184,.5);
  color: #020617;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.7);
  background: rgba(15,23,42,.96);
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 45px rgba(15,23,42,1);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s, background .2s, border-color .2s;
  z-index: 100;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Light back-to-top */
body[data-theme="light"] .back-to-top {
  background: #ffffff;
  color: #020617;
  border-color: rgba(148,163,184,.6);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 920px) {
  .hero-container {
    grid-template-columns: 1fr;
  }
  .hero-photo-card {
    max-width: 320px;
    margin-inline: auto;
  }
  .about-container {
    grid-template-columns: 1fr;
  }
  .skills-grid,
  .projects-grid,
  .gallery-grid,
  .yt-videos-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .contact-container {
    grid-template-columns: 1fr;
  }

  .nav {
    position: absolute;
    inset: 100% 0 auto 0;
    background: rgba(2,6,23,.98);
    border-bottom: 1px solid rgba(15,23,42,.9);
    flex-direction: column;
    align-items: flex-start;
    padding: .6rem 0;
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }

  body[data-theme="light"] .nav {
    background: rgba(248,250,252,.97);
    border-bottom-color: rgba(148,163,184,.5);
  }

  .nav.show {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-link {
    width: 100%;
    padding: .45rem 6%;
  }
  .nav-link::after { display: none; }
  .nav-toggle { display: block; }
}

@media (max-width: 640px) {
  .section { padding: 3.5rem 0; }
  .skills-grid,
  .projects-grid,
  .gallery-grid,
  .yt-videos-grid {
    grid-template-columns: 1fr;
  }
  .back-to-top {
    right: 1rem;
    bottom: 1rem;
  }
}
