/* === Root Variables === */
:root {
  --primary: #e9692c;
  --primary-dark: #cc5117;
  --dark-bg: #1a1a1a;
  --dark-card: #242424;
  --light-bg: #f8f9fc;
  --white: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #666666;
  --text-light: #ffffff;
  --border-radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-hover: 0 12px 28px rgba(0,0,0,0.18);
  --transition: all 0.3s ease;
}

/* === Dark Mode === */
body.dark-mode {
  --light-bg: #121212;
  --white: #1e1e1e;
  --text-dark: #e0e0e0;
  --text-muted: #aaaaaa;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-hover: 0 12px 28px rgba(0,0,0,0.5);
}

body.dark-mode #about        { background: #121212; }
body.dark-mode #internships  { background: #121212; }
body.dark-mode #achievements { background: #121212; }
body.dark-mode #contact      { background: #121212; }
body.dark-mode .internship   { background: #1e1e1e; }
body.dark-mode .contact-box  { background: #1e1e1e; border-color: #444; }
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea { background: #1e1e1e; border-color: #444; color: #e0e0e0; }
body.dark-mode .contact-form input::placeholder,
body.dark-mode .contact-form textarea::placeholder { color: #888; }
body.dark-mode .bio h1       { color: #e0e0e0; }
body.dark-mode .bio p        { color: #c0c0c0; }
body.dark-mode .skill-tag    { background: #2a2a2a; color: #ccc; border-color: #444; }
body.dark-mode .filter-btn   { background: #2a2a2a; color: #ccc; border-color: #444; }
body.dark-mode .filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
body.dark-mode footer        { background: #0a0a0a; }

/* === Base Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
html { scroll-behavior: smooth; }
body { line-height: 1.6; color: var(--text-dark); background: var(--light-bg); transition: background 0.3s, color 0.3s; }

/* === Page Loader === */
#page-loader {
  position: fixed; inset: 0;
  background: var(--dark-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-ring {
  width: 52px; height: 52px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Scroll Progress Bar === */
#scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--primary);
  z-index: 10001;
  transition: width 0.1s linear;
}

/* === Header === */
header {
  background: var(--dark-bg);
  color: var(--text-light);
  padding: 1rem 0;
  position: fixed;
  width: 100%; top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s;
}
header.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.35); }

nav {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 2rem;
}
.nav-brand { font-size: 1.4rem; font-weight: 700; color: var(--text-light); letter-spacing: 0.5px; }

.nav-links { display: flex; gap: 1.6rem; align-items: center; }
.nav-links a {
  color: var(--text-light); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Theme toggle button */
#theme-toggle {
  background: none; border: 1.5px solid rgba(255,255,255,0.3);
  color: var(--text-light); border-radius: 20px;
  padding: 0.3rem 0.75rem; font-size: 0.85rem;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 0.4rem;
}
#theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* Mobile nav toggle */
.mobile-nav-toggle {
  display: none; background: none; border: none;
  color: var(--text-light); font-size: 1.5rem; cursor: pointer;
}

/* === Sections === */
section { padding: 5rem 2rem; min-height: 100vh; display: flex; align-items: center; }
.container { max-width: 1200px; margin: 0 auto; width: 100%; }

/* === CV Modal === */
.cv-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
  padding: 0.75rem;
}
.cv-modal-box {
  background: #1a1a1a;
  border-radius: 14px;
  width: 100%; max-width: 1100px;
  height: 95vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  animation: cvModalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cvModalIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* Header bar */
.cv-modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.cv-modal-title {
  font-size: 0.9rem; font-weight: 600;
  color: rgba(255,255,255,0.85);
  display: flex; align-items: center; gap: 0.5rem;
}
.cv-modal-title i { color: var(--primary); }

.cv-modal-actions {
  display: flex; align-items: center; gap: 0.6rem;
}
.cv-action-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.38rem 0.9rem;
  font-size: 0.8rem; font-weight: 600;
  color: var(--primary);
  border: 1.5px solid rgba(233,105,44,0.4);
  border-radius: 6px; text-decoration: none;
  background: rgba(233,105,44,0.08);
  transition: var(--transition);
}
.cv-action-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cv-close-btn {
  width: 32px; height: 32px;
  border-radius: 7px; border: none;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.cv-close-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* iframe body */
.cv-modal-body {
  flex: 1;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.cv-modal-body iframe {
  position: absolute;
  top: 0;
  left: -1%;
  width: 102%;
  height: 110%;
  border: none;
  display: block;
}

@media (max-width: 600px) {
  .cv-modal-overlay { padding: 0; }
  .cv-modal-box { border-radius: 0; height: 100vh; max-width: 100%; }
}

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.modal-box {
  background: var(--white); padding: 2rem;
  border: 2px solid var(--primary); border-radius: 14px;
  width: 90%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25); text-align: center;
}
.modal-box h2 { color: var(--primary); margin-bottom: 0.8rem; }
.username-display { margin-bottom: 1rem; font-weight: 500; }
.password-wrapper { position: relative; margin-bottom: 1rem; }
.password-wrapper input {
  width: 100%; padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; outline: none;
}
.toggle-password { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #888; cursor: pointer; }
.modal-box button {
  padding: 0.6rem 1.5rem; border: 2px solid var(--primary);
  background: transparent; color: var(--primary);
  font-weight: 600; border-radius: 6px; cursor: pointer; transition: var(--transition);
}
.modal-box button:hover { background: var(--primary); color: white; }
.error-msg { margin-top: 0.5rem; color: #e53935; font-size: 0.9rem; }

/* === About / Hero === */
#about {
  background: linear-gradient(135deg, #fdf6f0 0%, #fff8f4 50%, #f0f4ff 100%);
  margin-top: 4rem; padding: 5rem 2rem;
  position: relative; overflow: hidden;
}
body.dark-mode #about {
  background: linear-gradient(135deg, #1a1a1a 0%, #1e1a18 50%, #181a1e 100%);
}

/* Subtle animated mesh background */
#about::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(233,105,44,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(100,120,255,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.profile-container { display: flex; gap: 5rem; align-items: center; position: relative; z-index: 1; }

.profile-image {
  position: relative; width: 340px; height: 340px;
  border-radius: 50%; overflow: hidden;
  border: 5px solid var(--primary);
  flex-shrink: 0;
  transition: box-shadow 0.4s ease, transform 0.3s ease;
}
.profile-image:hover {
  box-shadow: 0 0 60px rgba(233,105,44,0.5);
  transform: scale(1.04);
}
.profile-image img { width: 100%; height: 100%; object-fit: cover; }

.bio { flex: 1; }
.bio h1 { font-size: 2.2rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; }

/* Open to work badge */
.open-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(16,185,129,0.10); color: #059669;
  border: 1px solid rgba(16,185,129,0.30);
  border-radius: 20px; padding: 0.25rem 0.8rem;
  font-size: 0.8rem; font-weight: 600; margin-bottom: 0.8rem;
  letter-spacing: 0.3px;
}
.open-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10b981;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* Typewriter role */
.bio-role {
  font-size: 1.4rem; font-weight: 500; color: var(--primary);
  margin-bottom: 1.2rem; min-height: 2rem;
}
#typewriter-text::after {
  content: '|'; animation: blink 0.7s step-end infinite;
  color: var(--primary); margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.bio p { font-size: 1rem; line-height: 1.8; color: var(--text-muted); margin-bottom: 1.2rem; }

.social-links { display: flex; gap: 1rem; margin-top: 1.2rem; margin-bottom: 1.2rem; }
.social-links a {
  color: var(--primary); font-size: 1.5rem;
  transition: var(--transition);
  position: relative;
}
.social-links a:hover { color: var(--primary-dark); transform: translateY(-3px); }

/* Tooltips on social icons */
.social-links a::after,
.social-links-contact a::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: #1a1a1a; color: #fff;
  font-size: 0.68rem; font-weight: 500;
  padding: 0.22rem 0.55rem; border-radius: 5px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
  letter-spacing: 0.3px; z-index: 10;
}
.social-links a:hover::after,
.social-links-contact a:hover::after {
  opacity: 1; transform: translateX(-50%) scale(1);
}

.cv-download-button {
  display: inline-block; padding: 0.6rem 1.6rem;
  font-size: 0.95rem; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 6px;
  background: transparent; text-decoration: none; font-weight: 600;
  transition: var(--transition);
}
.cv-download-button:hover { background: var(--primary); color: #fff; }

/* === Projects === */
#projects { background: var(--dark-bg); color: var(--text-light); }
#projects h2 { text-align: center; font-size: 1.8rem; margin-bottom: 1.5rem; }
#projects h2 i { color: var(--primary); margin-right: 0.5rem; }

/* Filter bar */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  justify-content: center; margin-bottom: 2rem;
}
.filter-btn {
  padding: 0.4rem 1.1rem; border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.75);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.8rem;
}
.project-card {
  background: var(--dark-card);
  padding: 1.5rem; border-radius: var(--border-radius);
  border: 1px solid rgba(255,255,255,0.07);
  transition: var(--transition);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(233,105,44,0.15);
}
.project-card.hidden { display: none; }

/* Featured badge */
.featured-badge {
  position: absolute; top: 0; right: 0;
  background: var(--primary); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-bottom-left-radius: 8px;
  letter-spacing: 0.5px;
}

.project-card h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; }
.project-card p { font-size: 0.9rem; color: rgba(255,255,255,0.75); margin-bottom: 0.4rem; line-height: 1.6; }

/* Tech tag chips */
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0.8rem; }
.tech-tag {
  background: rgba(233,105,44,0.12); color: var(--primary);
  border: 1px solid rgba(233,105,44,0.3);
  border-radius: 12px; padding: 0.2rem 0.65rem;
  font-size: 0.75rem; font-weight: 500;
}

/* GitHub / paper links */
.github-link { margin-top: auto; padding-top: 0.8rem; }
.github-link a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: rgba(255,255,255,0.8); text-decoration: none;
  padding: 0.4rem 0.9rem; border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem; transition: var(--transition);
}
.github-link a:hover { border-color: var(--primary); color: var(--primary); background: rgba(233,105,44,0.08); }
.github-link i { font-size: 1rem; color: var(--primary); }

/* Publications reuse project-card styles */
#publications { background: var(--dark-bg); color: var(--text-light); padding: 4rem 2rem; }
#publications h2 { text-align: center; font-size: 1.8rem; color: var(--primary); margin-bottom: 2rem; }
#publications h2 i { margin-right: 0.5rem; }
.head { color: var(--primary); text-align: center; }

/* === Internships — Timeline === */
#internships { background: var(--light-bg); padding: 5rem 2rem; }
#internships h2 {
  font-size: 1.8rem; font-weight: 700; color: var(--text-dark);
  margin-bottom: 3rem; display: flex; align-items: center; gap: 0.6rem;
}
#internships h2 i { color: var(--primary); }

.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: '';
  position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: rgba(233,105,44,0.25);
  border-radius: 2px;
}

.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-item:last-child { margin-bottom: 0; }

/* Dot on the line */
.timeline-dot {
  position: absolute; left: -2.1rem; top: 1.2rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--light-bg);
  box-shadow: 0 0 0 2px var(--primary);
  transition: transform 0.3s;
}
.timeline-item:hover .timeline-dot { transform: scale(1.3); }

.timeline-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
  border: 1.5px solid transparent;
  transition: var(--transition);
  text-decoration: none; color: inherit;
  display: block;
}
.timeline-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateX(4px);
}

.timeline-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.timeline-company { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.timeline-period {
  font-size: 0.8rem; color: var(--text-muted);
  background: rgba(233,105,44,0.08);
  border: 1px solid rgba(233,105,44,0.2);
  border-radius: 12px; padding: 0.15rem 0.6rem;
  white-space: nowrap;
}
.timeline-role { font-size: 0.95rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.3rem; }
.timeline-desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* === Skills & Certifications === */
#skills-certifications { background: var(--dark-bg); color: var(--text-light); padding: 5rem 2rem; }
#skills-certifications h2 { text-align: center; font-size: 1.8rem; margin-bottom: 0.5rem; }
#skills-certifications h2 i { color: var(--primary); margin-right: 0.5rem; }

.split-container { display: flex; gap: 4rem; margin-top: 3rem; }
.skills-container, .certifications-container { flex: 1; }

/* Skills icon grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.skill-chip {
  background: var(--dark-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 1rem 0.8rem;
  text-align: center; transition: var(--transition);
  cursor: default;
}
.skill-chip:hover {
  border-color: var(--primary);
  background: rgba(233,105,44,0.08);
  transform: translateY(-3px);
}
.skill-chip i { font-size: 1.6rem; color: var(--primary); display: block; margin-bottom: 0.5rem; }
.skill-chip .skill-name { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.skill-chip .skill-sub { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 0.2rem; }

/* Certifications */
.certifications-container h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1.2rem; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; }
.cert-card {
  background: var(--dark-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 1rem 1.2rem;
  margin-bottom: 1rem; transition: var(--transition);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.cert-card:hover { border-color: var(--primary); transform: translateX(4px); }
.cert-info { flex: 1; }
.cert-info h4 { font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 0.2rem; }
.cert-info .cert-issuer { font-size: 0.78rem; color: rgba(255,255,255,0.45); }
.cert-view-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem; border-radius: 6px;
  border: 1px solid rgba(233,105,44,0.4); color: var(--primary);
  font-size: 0.75rem; font-weight: 600; text-decoration: none;
  white-space: nowrap; transition: var(--transition);
  background: rgba(233,105,44,0.06);
}
.cert-view-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Platforms */
.platforms-container { margin-top: 3rem; text-align: center; }
.platforms-label { font-size: 0.8rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.platform-logos { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
.platform-logo {
  width: 48px; height: 48px; object-fit: contain;
  background: rgba(255,255,255,0.08); padding: 8px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}
.platform-logo:hover { transform: scale(1.12); box-shadow: 0 4px 14px rgba(233,105,44,0.35); border-color: var(--primary); }

/* === Achievements === */
#achievements {
  background: #ffffff;
  color: var(--text-dark);
  padding: 5rem 2rem;
}

.achievements-heading {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.achievements-heading i {
  animation: trophy-shine 2.5s ease-in-out infinite;
}
@keyframes trophy-shine {
  0%, 100% { transform: rotate(-8deg); }
  50%       { transform: rotate(8deg); }
}

.achievements-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Card — title top-left, icon bottom-left, matching reference */
.achievement-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem 1.4rem 1.2rem 1.4rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  min-height: 160px;
}
.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Title + description block */
.achievement-body h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.45rem;
  line-height: 1.4;
}
.achievement-body p {
  font-size: 0.85rem;
  color: #666666;
  line-height: 1.55;
  margin: 0;
}

/* Icon bubble — bottom-left, orange tinted square */
.achievement-icon {
  width: 40px;
  height: 40px;
  background: rgba(233, 105, 44, 0.10);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-start;
}
.achievement-icon i {
  font-size: 1.15rem;
  color: var(--primary);
}

/* Dark mode */
body.dark-mode #achievements        { background: #121212; }
body.dark-mode .achievement-card    { background: #1e1e1e; border-color: #2a2a2a; }
body.dark-mode .achievement-body h3 { color: #e0e0e0; }
body.dark-mode .achievement-body p  { color: #aaaaaa; }
body.dark-mode .achievement-icon    { background: rgba(233, 105, 44, 0.15); }

/* Responsive */
@media (max-width: 900px) {
  .achievements-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .achievements-grid-3 { grid-template-columns: 1fr; }
}

/* === Contact === */
#contact {
  background: var(--white);
  background-image: url('contact background.png');
  background-size: cover; background-position: center;
  background-blend-mode: overlay;
  color: var(--text-dark); padding: 5rem 2rem;
  position: relative;
}
#contact::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.82);
  pointer-events: none;
}
body.dark-mode #contact::before { background: rgba(18,18,18,0.88); }
#contact .container { position: relative; z-index: 1; }

#contact h2 {
  text-align: center; font-size: 2.2rem; font-weight: 700;
  color: var(--primary); margin-bottom: 0.5rem;
  position: relative; display: inline-block;
  left: 50%; transform: translateX(-50%);
  padding-bottom: 0.5rem;
}
#contact h2::after {
  content: ''; position: absolute; bottom: 0; left: 25%; width: 50%;
  height: 3px; background: var(--primary); border-radius: 2px;
}
.contact-intro { text-align: center; font-size: 1rem; color: var(--text-muted); margin-bottom: 2rem; }

.contact-boxes { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.contact-box {
  background: var(--white); border-radius: var(--border-radius);
  box-shadow: var(--shadow); padding: 1.2rem 2rem;
  display: flex; align-items: center; gap: 0.8rem;
  border: 1.5px solid rgba(0,0,0,0.1);
  transition: var(--transition); min-width: 260px;
}
.contact-box:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); }
.contact-box i { font-size: 1.6rem; color: var(--primary); }
.contact-box a { text-decoration: none; color: var(--text-dark); font-size: 0.95rem; font-weight: 500; transition: color 0.3s; }
.contact-box:hover a { color: var(--primary); }

.social-links-contact { display: flex; justify-content: center; gap: 1.8rem; margin: 1.5rem 0; }
.social-links-contact a { font-size: 2rem; color: var(--primary); transition: var(--transition); position: relative; }
.social-links-contact a:hover { color: var(--primary-dark); transform: translateY(-3px); }

.contact-form { max-width: 680px; margin: 1.5rem auto 0; display: flex; flex-direction: column; gap: 1rem; }
.contact-form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-form input, .contact-form textarea {
  flex: 1; padding: 0.75rem 1rem; border-radius: 8px;
  border: 1.5px solid #ddd; font-size: 0.95rem; outline: none;
  font-family: inherit; background: var(--white); color: var(--text-dark);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(233,105,44,0.12);
}
.contact-form textarea { width: 100%; resize: vertical; min-height: 140px; }
#form-fields { display: flex; flex-direction: column; gap: 1rem; }
.contact-form button {
  align-self: center; padding: 0.7rem 2.2rem;
  font-size: 0.95rem; font-weight: 600; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 6px;
  background: transparent; cursor: pointer; transition: var(--transition);
}
.contact-form button:hover { background: var(--primary); color: #fff; }
.contact-location { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* === Toast Notification (top-right) === */
#site-toast {
  position: fixed;
  top: -80px;               /* starts off-screen */
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  border-radius: 50px;
  background: #1a1a1a;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  pointer-events: none;
  opacity: 0;
  transition: top 0.38s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  white-space: nowrap;
}
#site-toast.toast-show {
  top: 1.4rem;
  opacity: 1;
  pointer-events: auto;
}
#site-toast #toast-icon-wrap i { font-size: 1rem; }
#site-toast.toast-success #toast-icon-wrap i { color: #22c55e; }
#site-toast.toast-error   #toast-icon-wrap i { color: #ef4444; }
#site-toast.toast-info    #toast-icon-wrap i { color: var(--primary); }

/* === Contact Form — Success State === */
.form-success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  gap: 0.6rem;
  animation: fadeInUp 0.45s ease forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.success-icon i {
  font-size: 2.8rem;
  color: #22c55e;
  margin-bottom: 0.4rem;
  display: block;
}
.form-success-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}
.form-success-state p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 340px;
  line-height: 1.6;
}
body.dark-mode .form-success-state h4 { color: #e0e0e0; }

/* === Footer === */
footer { background: #111; padding: 1.5rem 0; text-align: center; color: var(--text-light); }
footer p { font-size: 0.85rem; letter-spacing: 0.5px; position: relative; display: inline-block; padding: 0 1.5rem; }
footer p::before, footer p::after {
  content: ''; position: absolute; top: 50%;
  width: 28px; height: 1px; background: var(--primary);
}
footer p::before { left: -28px; }
footer p::after { right: -28px; }

/* === Animations === */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* === Responsive === */
@media (max-width: 900px) {
  .split-container { flex-direction: column; gap: 2.5rem; }
  .profile-container { gap: 3rem; }
}

@media (max-width: 768px) {
  .profile-container { flex-direction: column; text-align: center; }
  .edu-strip { max-width: 100%; margin-left: auto; margin-right: auto; text-align: left; }
  .profile-image { width: 240px; height: 240px; }
  .social-links { justify-content: center; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background: var(--dark-bg); padding: 1rem 2rem; gap: 1rem; box-shadow: 0 10px 20px rgba(0,0,0,0.3); z-index: 999; }
  .nav-links.open { display: flex; }
  .mobile-nav-toggle { display: block; }
  .timeline { padding-left: 2rem; }
  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .achievements-grid-3 { grid-template-columns: 1fr; }
  .contact-boxes { flex-direction: column; align-items: center; }
  .contact-box { width: 100%; max-width: 360px; }
  #theme-toggle span { display: none; }
}

@media (max-width: 480px) {
  .bio h1 { font-size: 1.6rem; }
  .bio-role { font-size: 1.1rem; }
  .filter-bar { gap: 0.4rem; }
  .filter-btn { font-size: 0.78rem; padding: 0.3rem 0.8rem; }
}
