/* ============================================
   Santhosh Panneer Selvam - Portfolio
   Theme: Robotics & Automation
   ============================================ */

:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --accent: #00d4aa;
  --accent-dim: #00a884;
  --accent-glow: rgba(0, 212, 170, 0.3);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  /* Let clicks pass through */
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}

a:hover {
  color: var(--accent-dim);
  opacity: 0.9;
}

.accent {
  color: var(--accent);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 14, 23, 0.95);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1.05rem;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6rem 2rem 4rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.circuit-line {
  position: absolute;
  bottom: 20%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
}

.hero-tag {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-sub {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.25s;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.8);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ========== Sections common ========== */
.section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.section-num {
  color: var(--accent);
  font-size: 0.9em;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ========== About ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.about-lead {
  color: var(--text) !important;
  font-size: 1.2rem !important;
}

.about-skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.about-skills li {
  padding: 0.4rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 500;
  color: var(--accent);
}

.about-visual {
  display: flex;
  justify-content: center;
}

.tech-card {
  width: 160px;
  height: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.tech-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.tech-icon {
  font-size: 2.5rem;
}

/* ========== National Service ========== */
.ns-section {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-card) 50%, var(--bg-dark) 100%);
}

.ns-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  align-items: start;

}

.ns-badge {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid var(--accent);
  border-radius: 8px;
}

.ns-rank {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.ns-role {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.ns-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.ns-highlights {
  list-style: none;
  margin-top: 1rem;
}

.ns-highlights li {
  padding: 0.35rem 0;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.ns-highlights li:last-child {
  border-bottom: none;
}

/* ========== Projects ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.project-media {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.project-card:hover .project-media img {
  transform: scale(1.05);
}

.project-video-link {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: var(--accent);
  color: var(--bg-dark);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 4px;
  opacity: 0.95;
}

.project-video-link:hover {
  opacity: 1;
  color: var(--bg-dark);
}

.project-body {
  padding: 1.5rem;
}

.project-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ========== Academics ========== */
.academics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.academic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.academic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
}

.academic-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.academic-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.academic-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.academic-card-clickable {
  cursor: pointer;
  border: 1px solid var(--border);
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.academic-card-clickable .gallery-hint {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

/* ========== Gallery modals ========== */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.gallery-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery-modal.is-open .gallery-modal-inner {
  transform: scale(1);
}

.gallery-modal[hidden] {
  display: none !important;
}

.gallery-modal:not([hidden]).is-open {
  display: flex;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.gallery-modal-inner {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s;
}

.gallery-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.gallery-modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  margin: 0;
}

.gallery-close {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.gallery-close:hover {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.1);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.gallery-item {
  width: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.gallery-item img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.gallery-caption {
  padding: 0.75rem 1rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
}

/* ========== Lightbox ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox:not([hidden]).is-open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}

.lightbox-close:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 90vh;
}

#lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  margin: 1rem 0 0;
  padding: 0 1rem;
  max-width: 600px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* ========== Contact ========== */
.contact-box {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
}

.contact-email {
  display: block;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(0, 212, 170, 0.06);
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: background 0.3s;
}

.contact-email:hover {
  background: rgba(0, 212, 170, 0.12);
}

.contact-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contact-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.social-icon {
  width: 22px;
  height: 22px;
}

.contact-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.contact-note code {
  background: var(--bg-dark);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ========== Footer ========== */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.footer-social .social-link {
  width: 40px;
  height: 40px;
}

.footer-social .social-icon {
  width: 20px;
  height: 20px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
  }

  .gallery-item {
    width: 100%;
    max-width: 300px;
    justify-self: center;
  }

  .gallery-item img {
    width: 100%;
    height: 300px;
    max-width: 300px;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 280px;
    background: var(--bg-card);
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    border-left: 1px solid var(--border);
    transition: right 0.3s;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .ns-card {
    grid-template-columns: 1fr;
  }

  .ns-badge {
    max-width: 200px;
    margin: 0 auto;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ========== New Animations ========== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* .animate-name {
  animation: slideInLeft 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  display: inline-block;
} */

.animate-name .letter {
  opacity: 0;
  display: inline-block;
  animation: revealLetter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay);
  transform: translateX(-20px);
}

@keyframes revealLetter {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== Tools Marquee Section ========== */
.tools-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  /* Hide overflow for marquee */
}

.tools-title {
  text-align: center;
  font-family: var(--font-display);
  color: #ffbb00;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.marquee-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  /* Mask to fade edges */
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: scrollLeft 25s linear infinite;
  padding: 1rem 0;
}

/* Hover pauses the animation for better ux */
.marquee-track:hover {
  animation-play-state: paused;
}

@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }

  /* Move by half since we duplicated the list */
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  min-width: 80px;
  /* Ensure consistent width */
  transition: transform 0.3s;
}

.tool-card:hover {
  transform: translateY(-5px) scale(1.1);
}

.tool-card i {
  font-size: 3.5rem;
  transition: all 0.3s;
}

.tool-card span {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ========== NS Section Updates ========== */
.ns-img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ns-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ========== Project Placeholder ========== */
.project-placeholder {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
}

.project-placeholder span {
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.2);
}

/* ========== Roadmap Modal ========== */
.roadmap-container {
  padding: 2rem;
  overflow-y: auto;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  /* Adjust for mobile/desktop */
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 3rem;
  /* Space for dot and line */
  margin-bottom: 3rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 11px;
  /* Align with line */
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 2;
}

.timeline-date {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.timeline-content h3 {
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 1.2rem;
}

.timeline-content h4 {
  color: #ffbb00;
  /* Subtext highlighting */
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* ========== Contact Form & New Layout ========== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .contact-wrapper {
    grid-template-columns: 3fr 2fr;
  }
}

.contact-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.contact-form h3 {
  font-family: var(--font-display);
  margin-bottom: 1.5rem;
  color: #00d4aa;
  font-size: 1.8rem;
}

.contact-form .form-group {
  margin-bottom: 1.25rem;
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.3s, background 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.05);
}

.contact-form .btn-primary {
  width: 100%;
  background: #00d4aa;
  /* border-color: #8b5cf6; */
  color: black;
  padding: 1rem;
  font-size: 1.1rem;
  margin-top: 1rem;
  font-weight: bold;
}

.contact-form .btn-primary:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.contact-card h4 {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* ========== Social Icons Minimal ========== */
.social-section-minimal {
  margin-top: 2rem;
}

.social-section-minimal h4 {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.social-icons-row {
  display: flex;
  gap: 1rem;
}

.social-square {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--bg-dark);
  /* Darker than card */
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 1.8rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-square:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 212, 170, 0.2);
}

/* Specific colors for brands on hover if desired, or keep uniform accent */
.social-square:hover .devicon-github-original {
  color: #fff;
}

.social-square:hover .devicon-linkedin-plain {
  color: #0077b5;
}

.social-square:hover .devicon-twitter-original {
  color: #1DA1F2;
}
/* Gallery Grid Fix */
.gallery-grid {
  display: grid;
  /* Automatically fits as many cards as possible, at least 250px wide */
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
  gap: 20px;
  padding: 20px;
  max-height: 70vh; /* Limits height so header stays visible */
  overflow-y: auto;
}

/* Gallery Item Styling */
.gallery-item {
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--accent-color, #007bff);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover; /* Ensures images fill the area without stretching */
  display: block;
}

/* Caption Appearance */
.gallery-caption {
  padding: 10px;
  margin: 0;
  font-size: 14px;
  color: #ccc;
  text-align: center;
  background: #1a1a1a;
  border-top: 1px solid #333;
}

/* Special Grid for Achievements */
.achievement-special-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  padding: 25px;
}

/* Achievement Card Styling */
.achievement-card {
  background: linear-gradient(145deg, #1e1e2f, #121212);
  border: 1px solid #444;
  border-radius: 15px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.achievement-card:hover {
  transform: translateY(-10px);
  border-color: #ffd700; /* Gold Highlight */
  box-shadow: 0 15px 30px rgba(255, 215, 0, 0.15);
}

/* Elite Badge for things like SIH */
.achievement-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ffd700;
  color: #000;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 2;
  letter-spacing: 1px;
}

.achievement-card img {
  width: 100%;
  height: 220px;
  object-fit: contain; /* Better for certificates to show the whole page */
  background: #000;
  padding: 10px; /* Gives a "framed" look */
}

/* Achievement Captions */
.achievement-card .gallery-caption {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 500;
  padding: 15px;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  font-size: 0.95rem;
}

