/* =========================
   Modern Personal / Portfolio Styles – 2025/2026 vibe with Dark Mode Toggle
   ========================= */

:root {
  --primary:      #0066ff;
  --primary-dark: #004dcc;
  --text:         #0f172a;
  --text-light:   #475569;
  --bg:           #ffffff;
  --bg-soft:      #f8fafc;
  --gray-200:     #e2e8f0;
  --gray-300:     #cbd5e1;
  --shadow-sm:    0 4px 12px rgba(0,0,0,0.06);
  --shadow-md:    0 10px 38px rgba(0,0,0,0.10);
  --radius:       16px;
  --transition:   all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dark {
  --primary:      #60a5fa;
  --primary-dark: #3b82f6;
  --text:         #e2e8f0;
  --text-light:   #94a3b8;
  --bg:           #0f172a;
  --bg-soft:      #1e293b;
  --gray-200:     #334155;
  --gray-300:     #475569;
  --shadow-sm:    0 4px 12px rgba(0,0,0,0.45);
  --shadow-md:    0 10px 38px rgba(0,0,0,0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Dark mode specific overrides */
.dark header {
  background: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid #334155;
}

.dark nav a {
  color: #e2e8f0;
}

.dark .project-card,
.dark .card {
  background: #1e293b;
  border-color: #334155;
}

.dark .project-img {
  border-color: #334155;
  box-shadow: 0 20px 50px rgba(0,0,0,0.42);
}

.dark footer {
  background: #1e293b;
  border-top: 1px solid #334155;
}

.dark h1 {
  background: linear-gradient(90deg, #e2e8f0, #cbd5e1, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dark h2::after {
  background: linear-gradient(90deg, var(--primary), #93c5fd);
}

/* ───────────────────────────────────────
   Header + Navigation + Theme Toggle
   ─────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  transition: var(--transition);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.4rem;
  list-style: none;
  margin: 0;
  padding: 1.1rem 0;
  flex: 1;
}

nav a {
  position: relative;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
  padding: 0.4rem 0.2rem;
  transition: var(--transition);
}

nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2.5px;
  bottom: -2px;
  left: 50%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.32s ease, left 0.32s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--primary);
  transform: translateY(-1px);
}

nav a:hover::after,
nav a:focus-visible::after {
  width: 100%;
  left: 0;
}

#theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  transition: var(--transition);
}

#theme-toggle:hover {
  color: var(--primary);
  transform: scale(1.15);
}

/* ───────────────────────────────────────
   Hero / Profile section
   ─────────────────────────────────────── */
.profile-img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 3.5rem auto 1.8rem;
  border: 8px solid var(--bg);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(0,102,255,0.12);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s;
  animation: gentle-float 8s ease-in-out infinite;
  will-change: transform;
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.profile-img:hover {
  animation-play-state: paused;
  transform: scale(1.12) translateY(-12px);
  box-shadow: 0 32px 70px rgba(0,0,0,0.22), 0 0 0 3px rgba(0,102,255,0.18);
}

/* ───────────────────────────────────────
   Main, Headings, Projects
   ─────────────────────────────────────── */
main {
  max-width: 980px;
  margin: 5vh auto 10vh;
  padding: 0 24px;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
  margin: 0.4rem 0 1rem;
  background: linear-gradient(90deg, #1e293b, #334155, #64748b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile-subtitle {
  text-align: center;
  font-size: 1.38rem;
  color: var(--text-light);
  margin: 0 0 2.2rem;
  font-weight: 400;
}

h2 {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 5rem 0 1.6rem;
  position: relative;
  padding-bottom: 0.9rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 4px;
}

.project-img {
  width: 80%;
  max-width: 1100px;
  margin: 4.5rem auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  border: 1px solid var(--gray-200);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, box-shadow, border-color;
}

.project-img:hover {
  transform: translateY(-24px) scale(1.05);
  box-shadow: 0 50px 130px rgba(0,0,0,0.24);
  border-color: var(--primary);
}

.project-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.42s, border-color 0.3s;
}

.project-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.project-card h2 {
  margin-top: 0;
  font-size: 1.8rem;
}

/* ───────────────────────────────────────
   Footer
   ─────────────────────────────────────── */
/* ───────────────────────────────────────
   Footer – Professional & Modern
   ─────────────────────────────────────── */
footer {
  margin-top: 8rem;
  padding: 4rem 2rem 2.5rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--gray-200);
  color: var(--text-light);
  font-size: 0.95rem;
  text-align: center;
}

.footer-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem 2.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--link-color, var(--primary));
  text-decoration: none;
  font-weight: 500;
  transition: color 0.25s, transform 0.25s;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--link-hover, var(--primary-dark));
  transform: translateY(-1px);
}

.footer-links .icon {
  font-size: 1.3rem;
  opacity: 0.8;
  transition: opacity 0.25s, color 0.25s;
}

.footer-links a:hover .icon {
  opacity: 1;
  color: var(--link-hover, var(--primary-dark));
}

.footer-copyright {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ───────────────────────────────────────
   Link colors – different in light & dark mode
   ─────────────────────────────────────── */

:root {
  --link-color:       #0066ff;        /* light mode – your brand blue */
  --link-hover:       #004dcc;
}

.dark {
  --link-color:       #93c5fd;        /* dark mode – much lighter & softer blue */
  --link-hover:       #60a5fa;        /* hover – original primary for familiarity */
}

/* Optional: even softer / more muted variant if #93c5fd feels still too bright */
.dark {
  --link-color:       #a5d6ff;        /* alternative – very soft blue */
  --link-hover:       #7ab8ff;
}

/* Dark mode footer adjustments (already good, just making sure links are visible) */
.dark footer a {
  color: var(--link-color);
}

.dark .footer-links a:hover,
.dark .footer-links a:focus {
  color: var(--link-hover);
}

/* ───────────────────────────────────────
   Responsive
   ─────────────────────────────────────── */
@media (max-width: 768px) {
  nav ul {
    gap: 1.4rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .profile-img {
    width: 180px;
    height: 180px;
    margin: 2.8rem auto 1.6rem;
  }
  
  h1 {
    font-size: 3.2rem;
  }
  
  h2 {
    font-size: 1.9rem;
  }
  
  main {
    padding: 0 16px;
  }

  .project-img {
    width: 95%;
  }
}