/* ================= RESET & BASE STYLES ================= */
/* Apply box-sizing and remove default margin/padding from all elements */
*,
*::before,
*::after {
  box-sizing: border-box; /* Makes width/height calculations easier */
  margin: 0;              /* Removes default browser margin */
  padding: 0;             /* Removes default browser padding */
}

/* ================= CSS VARIABLES ================= */
/* Define reusable colors, sizes, shadows, and transitions */
:root {
  --bg: #050816;                 /* Main background color */
  --bg-alt: #080b20;             /* Alternate background */
  --text: #f9fafb;               /* Main text color */
  --muted: #e5e7eb;              /* Muted/secondary text */
  --accent: #6366f1;             /* Primary accent color */
  --accent-soft: rgba(99, 102, 241, 0.2);
  --accent-strong: rgba(129, 140, 248, 0.55);
  --danger: #fb7185;             /* Error / danger color */
  --card: rgba(15, 23, 42, 0.85);/* Card background */
  --border-subtle: rgba(148, 163, 184, 0.3); /* Soft borders */
  --radius-lg: 24px;             /* Large border radius */
  --radius-md: 16px;             /* Medium border radius */
  --radius-full: 999px;          /* Fully rounded */
  --shadow-soft: 0 22px 55px rgba(15, 23, 42, 0.8); /* Soft shadow */
  --transition-fast: 180ms ease-out; /* Fast transition */
  --transition-med: 280ms ease-out;  /* Medium transition */
}

:root.light,
body.light {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --accent: #6d28d9;
  --accent-soft: rgba(109, 40, 217, 0.1);
  --accent-strong: rgba(109, 40, 217, 0.18);
  --card: rgba(255, 255, 255, 0.94);
  --border-subtle: rgba(148, 163, 184, 0.22);
  --shadow-soft: 0 20px 44px rgba(15, 23, 42, 0.07);

  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.2);
  --emerald-light: rgba(5, 150, 105, 0.05);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.2);
  --purple-light: rgba(124, 58, 237, 0.04);
  --terracotta: #c1694f;
  --terracotta-soft: rgba(193, 105, 79, 0.2);
  --terracotta-light: rgba(193, 105, 79, 0.05);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.2);
  --amber-light: rgba(217, 119, 6, 0.05);
  --sage: #84a98c;
  --sage-soft: rgba(132, 169, 140, 0.2);
  --burgundy: #722f37;
  --burgundy-soft: rgba(114, 47, 55, 0.2);
  --gold: #b8860b;
  --gold-soft: rgba(184, 134, 11, 0.2);
}

/* ================= BODY ================= */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; /* Modern font stack */
  background: var(--bg);          /* Apply background color */
  color: var(--text);             /* Default text color */
  min-height: 100vh;              /* Full viewport height */
  overflow-x: hidden;             /* Prevent horizontal scroll */
  position: relative;             /* Base for positioned elements */
  transition: background 0.3s ease, color 0.3s ease;
}

body.light {
  background: #ffffff;
}

body.light .bg-gradient,
body.light .bg-glow {
  display: none;
}

/* ================= BACKGROUND EFFECTS ================= */
/* Gradient background overlay */
.bg-gradient {
  position: fixed;                /* Fixed so it stays on scroll */
  inset: 0;                       /* Covers full screen */
  background: radial-gradient(circle at top left, #1d4ed8 0, transparent 55%),
    radial-gradient(circle at bottom right, #7c3aed 0, transparent 55%),
    radial-gradient(circle at top right, #0ea5e9 0, transparent 45%);
  opacity: 0.16;                  /* Soft visibility */
  pointer-events: none;           /* Not clickable */
  z-index: -3;                    /* Behind everything */
}

body.light .bg-gradient {
  opacity: 0.05;
  filter: saturate(1);
}

body.light .bg-glow {
  opacity: 0.08;
}

/* Glowing blurred circles */
.bg-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;             /* Circle shape */
  filter: blur(90px);             /* Blur effect */
  mix-blend-mode: screen;         /* Light blending */
  opacity: 0.4;
  pointer-events: none;
  z-index: -2;
  animation: floatGlow 22s ease-in-out infinite alternate; /* Floating animation */
}

/* First glow position and color */
.bg-glow-1 {
  top: -100px;
  left: -80px;
  background: rgba(96, 165, 250, 0.8);
}

/* Second glow position and color */
.bg-glow-2 {
  bottom: -120px;
  right: -90px;
  background: rgba(244, 114, 182, 0.7);
  animation-delay: -6s;           /* Delay animation */
}

/* ================= CUSTOM CURSOR ================= */
.cursor-dot,
.cursor-outline {
  position: fixed;                /* Follows mouse */
  border-radius: 50%;             /* Circle */
  pointer-events: none;           /* Does not block clicks */
  z-index: 50;
  transform: translate(-50%, -50%); /* Center on cursor */
  transition: transform 0.08s ease-out, opacity 0.2s ease-out;
}

/* Small cursor dot */
.cursor-dot {
  width: 6px;
  height: 6px;
  background: #e5e7eb;
}

/* Cursor outline */
.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(209, 213, 219, 0.6);
  backdrop-filter: blur(8px);
  opacity: 0.35;
}

/* Touch devices have no mouse to track, so the dot/ring never move off
   their default position. Hide them rather than leave a stray artifact. */
@media (hover: none) and (pointer: coarse) {
  .cursor-dot,
  .cursor-outline {
    display: none;
  }
}

/* ================= HEADER ================= */
.header {
  max-width: 1120px;              /* Content width */
  margin: 0 auto;                 /* Center horizontally */
  padding: 20px 20px 0;
  display: flex;                  /* Horizontal layout */
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

body.light .logo,
body.light .nav-toggle,
body.light #theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

/* Logo styling */
.logo {
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.4));
  box-shadow: 0 12px 25px rgba(42, 42, 15, 0.8);
}

/* Highlight part of logo */
.logo span {
  color: var(--accent);
}

.logo img {
  height: 30px;
  width: 30px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Right-side actions (theme toggle + hamburger) stay grouped together */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Center the nav links as a group inside the header container so they
   align with the centered hero content below it. */
.nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* ================= NAVIGATION ================= */
.nav ul {
  display: flex;                  /* Horizontal menu */
  gap: 18px;
  list-style: none;               /* Remove bullets */
}

/* Navigation links */
.nav-link {
  position: relative;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;          /* Remove underline */
  padding: 6px 0;
  transition: color var(--transition-fast);
}

/* Animated underline */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #6366f1, #f97316);
  transition: width 200ms ease-out;
}

/* Hover effect */
.nav-link:hover {
  color: var(--text);
}

/* Active and hover underline */
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--text);
}

/* ================= MOBILE NAV BUTTON ================= */
.nav-toggle {
  display: none;                  /* Hidden on desktop */
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 60;
}

/* Hamburger lines */
.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #e5e7eb;
}

body.light .nav-toggle span {
  background: #475569;
}

/* Open mobile nav */
.nav.open {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

/* ================= THEME TOGGLE ================= */
#theme-toggle {
  width: 52px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.5));
  margin-left: 20px;
  display: flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.9);
}

/* Toggle circle */
.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #f9fafb, #e5e7eb);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.3),
    0 10px 25px rgba(15, 23, 42, 0.8);
  transform: translateX(0);
  transition: transform 0.25s ease-out;
}

/* Light mode background */
body.light #theme-toggle {
  background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
}

/* Move toggle in light mode */
body.light .toggle-thumb {
  transform: translateX(24px);
}

body.light .cursor-dot {
  background: #0f172a;
}

body.light .cursor-outline {
  border-color: rgba(15, 23, 42, 0.2);
}

/* ================= MAIN LAYOUT ================= */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

/* Content section card */
.section {
  margin-top: 40px;
  padding: 26px 26px 32px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.86));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(26px);
  position: relative;
  overflow: hidden;
  color: var(--muted);
}

body.light .section {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--text);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

/* Alternate section style */
.section-alt {
  margin-top: 26px;
  background: radial-gradient(circle at bottom, rgba(24, 35, 75, 0.94), rgba(15, 23, 42, 0.9));
}

body.light .section-alt {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(148, 163, 184, 0.18);
}

/* ================= LIGHT MODE SECTION ACCENTS ================= */
body.light .section::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  opacity: 0.85;
}

body.light .section:has(.hero-content) {
  --section-accent: var(--emerald);
}
body.light .section:has(.hero-content)::before {
  background: var(--section-accent);
}
body.light .section:has(.hero-content) {
  background: linear-gradient(135deg, var(--emerald-light), rgba(255,255,255,0.92) 60%);
}

body.light .section-alt:has(.projects-grid) {
  --section-accent: var(--amber);
}
body.light .section-alt:has(.projects-grid)::before {
  background: var(--section-accent);
}
body.light .section-alt:has(.projects-grid) {
  background: linear-gradient(135deg, var(--amber-light), rgba(255,255,255,0.92) 60%);
}

body.light .skills-section {
  --section-accent: var(--sage);
}
body.light .skills-section::before {
  background: var(--section-accent);
}
body.light .skills-section {
  background: linear-gradient(135deg, var(--sage-soft), rgba(255,255,255,0.92) 60%);
}

body.light .section:has(.about-layout) {
  --section-accent: var(--purple);
}
body.light .section:has(.about-layout)::before {
  background: var(--section-accent);
}
body.light .section:has(.about-layout) {
  background: linear-gradient(135deg, var(--purple-light), rgba(255,255,255,0.92) 60%);
}

body.light .section:has(.contact-layout) {
  --section-accent: var(--burgundy);
}
body.light .section:has(.contact-layout)::before {
  background: var(--section-accent);
}
body.light .section:has(.contact-layout) {
  background: linear-gradient(135deg, var(--burgundy-soft), rgba(255,255,255,0.92) 60%);
}

body.light .section:has(.projects-gallery) {
  --section-accent: var(--terracotta);
}
body.light .section:has(.projects-gallery)::before {
  background: var(--section-accent);
}
body.light .section:has(.projects-gallery) {
  background: linear-gradient(135deg, var(--terracotta-light), rgba(255,255,255,0.92) 60%);
}

/* Section heading wrapper */
.section-header {
  max-width: 680px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 30px;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  line-height: 1.2;
  text-wrap: balance;
}

.section-subtitle {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 660px;
}

/* Error pages (404 / 500) */
.error-layout {
  text-align: center;
  padding: 48px 16px;
}
.error-layout .section-title {
  font-size: clamp(3rem, 8vw, 5rem);
  margin-bottom: 12px;
}
.error-layout .section-subtitle {
  margin: 0 auto 28px;
}
.error-layout .btn {
  display: inline-flex;
}

/* ================= TYPOGRAPHY & CONTENT FLOW ================= */
body {
  line-height: 1.6;
}

.hero-content {
  max-width: 680px;
}

.hero-photo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid rgba(129, 140, 248, 0.35);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.55), 0 0 40px rgba(99, 102, 241, 0.18);
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #e5e7eb;
}

body.light .hero-kicker {
  color: #6d28d9;
  font-weight: 600;
}

/* Fluid sizing: scales smoothly with viewport instead of stepping
   through several fixed-pixel breakpoint overrides. Maxes out at
   36px to match the site's existing desktop appearance. */
.hero-title {
  font-size: clamp(1.7rem, 0.9rem + 4vw, 2.25rem);
  line-height: 1.15;
  margin: 10px 0 8px;
  color: #f9fafb;
}

body.light .hero-title,
body.light .section-title,
body.light .stat-number,
body.light .project-card h3,
body.light .project-card h2,
body.light .timeline h3,
body.light .contact-details h2,
body.light .contact-details h3,
body.light .field label {
  color: #0f172a;
}

.hero-title span {
  background: linear-gradient(120deg, #22d3ee, #6366f1, #f97316);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 14px;
  line-height: 1.8;
  max-width: 420px;
  margin-bottom: 24px;
  color: #e5e7eb;
}

body.light .hero-subtitle,
body.light .section-subtitle,
body.light .stat-label,
body.light .project-card p,
body.light .about-text p,
body.light .contact-details ul,
body.light .form-note,
body.light .timeline p,
body.light .timeline-tag {
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.22);
}

.stat-number {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #f9fafb;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.about-text p,
.contact-details ul,
.form-note,
.project-card p,
.timeline p {
  color: var(--muted);
  line-height: 1.75;
}

.about-text p {
  margin-bottom: 14px;
}

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: #f8fafc;
  font-size: 0.92rem;
  text-decoration: none;
}

.pill:hover {
  border-color: rgba(129, 140, 248, 0.55);
}

/* In-content links (match surrounding text color) */
.text-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(148, 163, 184, 0.35);
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.text-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.project-tags li a {
  color: inherit;
  text-decoration: none;
}

.project-tags li a:hover {
  text-decoration: underline;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.projects-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body.light .project-card,
body.light .stat-card,
body.light .contact-form,
body.light .contact-details,
body.light .timeline li,
body.light .pill,
body.light .social-list a,
body.light .field input,
body.light .field textarea {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.22);
}

/* ================= LIGHT MODE CARD ACCENTS ================= */
body.light .project-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
}

body.light .project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

body.light .project-card:hover::before {
  opacity: 1;
}

body.light .project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px var(--card-accent-shadow, rgba(124, 58, 237, 0.2));
  border-color: var(--card-accent, rgba(139, 92, 246, 0.5));
}

body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+1) {
  --card-accent: var(--emerald);
  --card-accent-shadow: rgba(5, 150, 105, 0.2);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+1)::before {
  background: var(--card-accent);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+2) {
  --card-accent: var(--purple);
  --card-accent-shadow: rgba(124, 58, 237, 0.2);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+2)::before {
  background: var(--card-accent);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+3) {
  --card-accent: var(--amber);
  --card-accent-shadow: rgba(217, 119, 6, 0.2);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+3)::before {
  background: var(--card-accent);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+4) {
  --card-accent: var(--terracotta);
  --card-accent-shadow: rgba(193, 105, 79, 0.2);
}
body.light .section-alt:has(.projects-grid) .project-card:nth-child(4n+4)::before {
  background: var(--card-accent);
}

body.light .projects-gallery .project-card:nth-child(4n+1) {
  --card-accent: var(--emerald);
  --card-accent-shadow: rgba(5, 150, 105, 0.2);
}
body.light .projects-gallery .project-card:nth-child(4n+1)::before {
  background: var(--card-accent);
}
body.light .projects-gallery .project-card:nth-child(4n+2) {
  --card-accent: var(--purple);
  --card-accent-shadow: rgba(124, 58, 237, 0.2);
}
body.light .projects-gallery .project-card:nth-child(4n+2)::before {
  background: var(--card-accent);
}
body.light .projects-gallery .project-card:nth-child(4n+3) {
  --card-accent: var(--terracotta);
  --card-accent-shadow: rgba(193, 105, 79, 0.2);
}
body.light .projects-gallery .project-card:nth-child(4n+3)::before {
  background: var(--card-accent);
}
body.light .projects-gallery .project-card:nth-child(4n+4) {
  --card-accent: var(--amber);
  --card-accent-shadow: rgba(217, 119, 6, 0.2);
}
body.light .projects-gallery .project-card:nth-child(4n+4)::before {
  background: var(--card-accent);
}

body.light .skills-section .project-card {
  --card-accent: var(--sage);
  --card-accent-shadow: rgba(132, 169, 140, 0.2);
}
body.light .skills-section .project-card::before {
  background: var(--card-accent);
}
body.light .skills-section .project-card {
  background: linear-gradient(135deg, var(--sage-soft), rgba(255,255,255,0.92) 70%);
}

body.light .project-card:nth-child(4n+1) {
  background: linear-gradient(135deg, var(--emerald-light), rgba(255,255,255,0.92) 70%);
}
body.light .project-card:nth-child(4n+2) {
  background: linear-gradient(135deg, var(--purple-light), rgba(255,255,255,0.92) 70%);
}
body.light .project-card:nth-child(4n+3) {
  background: linear-gradient(135deg, var(--terracotta-light), rgba(255,255,255,0.92) 70%);
}
body.light .project-card:nth-child(4n+4) {
  background: linear-gradient(135deg, var(--amber-light), rgba(255,255,255,0.92) 70%);
}

.project-card h3,
.project-card h2 {
  font-size: 1.08rem;
  margin-bottom: 2px;
}

.project-card p {
  margin: 0;
}

/* Keep every card the same compact height by clamping long descriptions.
   If the text actually overflows, script.js adds a "Read more..." toggle. */
.project-card > p {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card > p.is-expanded,
.featured-projects-grid .project-card p.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.card-more {
  background: none;
  border: none;
  padding: 0;
  margin-top: 2px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}

.card-more:hover {
  text-decoration: underline;
}

/* Featured Projects on the home page are meant to be a short teaser
   (the full description is one click away on the Projects page), so
   clamp the blurb to 3 lines. Without this, a card with a longer blurb
   (e.g. Tixora) grows much taller than its row-mate and drags the
   whole row down with it, especially in the 2-column mobile layout. */
.featured-projects-grid .project-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-top: 2px;
}

.project-tags li {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  font-size: 0.82rem;
  color: #e0e7ff;
}

body.light .project-tags li,
body.light .pill,
body.light .social-list a {
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.15);
  font-weight: 600;
}

.project-link {
  margin-top: auto;
  color: #8ddcff;
  font-weight: 600;
  text-decoration: none;
}

body.light .project-link {
  color: #6d28d9;
}

.project-link:hover {
  text-decoration: underline;
}

.skills-section {
  margin-top: 24px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.contact-form,
.contact-details {
  padding: 20px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.2);
 
}

body.light .contact-form,
body.light .contact-details {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.16);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.95rem;
  color: #f9fafb;
}

.field input,
.field textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.4);
  color: #f9fafb;
  resize: vertical;
}

body.light .field input,
body.light .field textarea {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.3);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.contact-details h2,
.contact-details h3 {
  margin-bottom: 10px;
}

.contact-details ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.contact-details li {
  line-height: 1.7;
}

.form-note {
  margin-top: 14px;
  font-size: 0.96rem;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.timeline li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.timeline-tag {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7d2fe;
}

.timeline h3 {
  margin-bottom: 4px;
}

/* ================= ABOUT SECTION ================= */
.about-layout {
  display: grid;                  /* Two-column layout */
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Photo container */
.about-photo {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Profile image */
.about-photo img {
  width: 280px;
  max-width: 100%;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover zoom effect */
.about-photo img:hover {
  transform: scale(1.75);
  box-shadow: 0 32px 55px rgba(122, 92, 233, 0.9);
}

/* About text color */
.about-text {
  color: var(--muted);
}

/* ================= HERO SECTION ================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  min-height: 360px;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  position: relative;
  overflow: visible;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #22d3ee 100%);
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.28);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.24), transparent 48%, rgba(255, 255, 255, 0.12));
  pointer-events: none;
  opacity: 0.95;
}

.btn-primary:hover {
  box-shadow: 0 18px 34px rgba(99, 102, 241, 0.36);
}

body.light .btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 50%, #059669 100%);
  box-shadow: 0 14px 30px rgba(124, 58, 237, 0.28);
}

body.light .btn-primary:hover {
  box-shadow: 0 18px 34px rgba(124, 58, 237, 0.36);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.light .btn-ghost {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(148, 163, 184, 0.22);
}

.contact-form .btn {
  margin-top: 8px;
  min-width: 176px;
}

/* ================= TEXT COLORS ================= */
.about-text p,
.contact-details ul,
.form-note {
  color: #e5e7eb;
}

/* ================= SOCIAL LINKS ================= */
.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin-top: 8px;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: #f9fafb;
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.social-list a:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

/* ================= FOOTER ================= */
.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 26px;
  font-size: 12px;
  color: #e5e7eb;
}

body.light .footer {
  color: #64748b;
}

/* ================= RESPONSIVE (<=900px): layout stacking + mobile nav ================= */
@media (max-width: 900px) {
  /* --- Layout stacking --- */
  .hero,
  .about-layout,
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .about-layout {
    gap: 20px;
  }
  .about-photo {
    margin: 0 auto;
  }
  .about-photo img {
    width: 200px;
  }
  .hero-photo {
    order: -1;
  }
  .hero-photo img {
    width: 200px;
    height: 200px;
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* --- Mobile navigation --- */
  .nav-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    left: auto;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(5, 8, 22, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-subtle);
    padding: 88px 28px 28px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 280ms ease, opacity 280ms ease;
    z-index: 55;
  }

  body.light .nav {
    background: rgba(248, 250, 252, 0.97);
  }

  .nav.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav ul {
    flex-direction: column;
    gap: 20px;
  }

  .nav-link {
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  .header,
  main {
    padding-inline: 16px;
  }

  /* Keep Featured Projects in the desktop-style 2-column layout */
  .projects-grid {
    gap: 12px;
  }
}
.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.field-error {
    display: block;
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 0.9rem;
}
.cursor{
    animation:blink .8s infinite;
}

@keyframes blink{

50%{

opacity:0;

}

}
a[href^="mailto:"],
a[href^="tel:"] {
    color: white;
    text-decoration: none;
}

a[href^="mailto:"]:hover,
a[href^="tel:"]:hover {
    color: white;
    text-decoration: underline;
}

body.light a[href^="mailto:"],
body.light a[href^="tel:"] {
    color: #6d28d9;
}

body.light a[href^="mailto:"]:hover,
body.light a[href^="tel:"]:hover {
    color: #5b21b6;
}

/* ================= ADMIN LOGIN ================= */
.admin-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}

.admin-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(26px);
}

.admin-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.admin-card .section-subtitle {
  margin-bottom: 20px;
}

.admin-error {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.25);
  color: #fb7185;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ================= ADMIN DASHBOARD ================= */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table th {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.admin-table td {
  color: var(--muted);
  vertical-align: top;
}

.admin-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

.admin-table .message-text {
  max-width: 300px;
  word-break: break-word;
}

.admin-table .nowrap {
  white-space: nowrap;
}

.admin-table a[href^="mailto:"] {
  color: var(--accent);
  text-decoration: none;
}

.admin-table a[href^="mailto:"]:hover {
  text-decoration: underline;
}

body.light .admin-table a[href^="mailto:"] {
  color: #6d28d9;
}

.admin-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.btn-logout {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.08);
}

body.light .btn-logout {
  background: rgba(251, 113, 133, 0.08);
}

.btn-logout:hover {
  border-color: rgba(251, 113, 133, 0.6);
  box-shadow: 0 4px 16px rgba(251, 113, 133, 0.2);
}

/* ================= SMALL SCREEN RESPONSIVE ================= */
@media (max-width: 640px) {
  /* Keep the desktop-style two-column stats layout on phones */
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .section-title {
    font-size: 24px;
  }

  .section {
    padding: 20px 18px 24px;
    margin-top: 24px;
  }

  main {
    padding: 16px 14px 40px;
  }

  .header {
    padding: 14px 14px 0;
  }

  .projects-gallery {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .projects-gallery .project-card > p {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .project-card {
    padding: 14px;
    gap: 8px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .contact-form .btn {
    min-width: 100%;
    width: 100%;
  }

  .admin-card {
    padding: 24px 20px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .footer {
    padding: 14px 14px 20px;
  }
}

@media (max-width: 480px) {
  .hero-kicker {
    font-size: 11px;
  }

  .section-title {
    font-size: 20px;
  }

  .section-subtitle {
    font-size: 0.88rem;
  }

  .logo {
    font-size: 15px;
    padding: 6px 14px;
  }

  #theme-toggle {
    width: 44px;
    height: 22px;
  }

  body.light .toggle-thumb {
    transform: translateX(20px);
  }

  .toggle-thumb {
    width: 16px;
    height: 16px;
  }

  .about-photo img {
    width: 160px;
  }

  .about-photo img:hover {
    transform: none;
  }

  .nav {
    width: 220px;
    padding: 80px 20px 20px;
  }

  .pill {
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  .project-tags li {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .contact-form {
    padding: 16px;
  }

  .contact-details {
    padding: 16px;
  }

  .field input,
  .field textarea {
    padding: 10px 12px;
    font-size: 16px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}

@media (max-width: 360px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-card {
    padding: 10px;
    gap: 6px;
  }

  .header {
    padding: 10px 10px 0;
  }

  main {
    padding: 12px 10px 32px;
  }

  .section {
    padding: 16px 14px 20px;
  }

  .hero-kicker {
    font-size: 10px;
  }

  .hero-stats {
    gap: 8px;
  }

  .admin-card {
    padding: 18px 16px;
  }
}
.chatbot-logo {
    border-radius: 50%;
}