@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&family=Orbitron:wght@600;800&display=swap');

:root {
  --bg-primary: #0b132b; /* Dark bluish vibe */
  --bg-secondary: #131f3d; /* Card backgrounds */
  --accent: #d4ff00; /* Neon yellow-green */
  --accent-hover: #b0d600;
  --text-main: #ffffff;
  --text-muted: #9aa5ce;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(19, 31, 61, 0.7);
  --header-bg: rgba(11, 19, 43, 0.95);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Offset for fixed header */
  overflow-x: hidden;
  font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Network Mesh Overlay */
#network-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
}

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

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-tag {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

/* Modern Header */
header {
  height: 80px;
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  position: fixed;
  top: -80px; /* Initially hidden for animation */
  left: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: top 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

header.loaded {
  top: 0;
}

header .container {
  height: 100%;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  letter-spacing: -1px;
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem !important;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
}

.nav-resume-btn:hover {
  background-color: rgba(212, 255, 0, 0.1) !important;
  box-shadow: 0 0 10px rgba(212, 255, 0, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #000;
  padding: 0.9rem 2.8rem;
  border-radius: 50px !important; /* PILL SHAPED */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(212, 255, 0, 0.5); /* BRIGHTER GLOW */
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50px !important;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #fff;
  transform: translateY(-2px);
  color: #fff;
  box-shadow: none;
}

/* Cyber Matrix Button */
.btn-cyber {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 0.8rem 1.5rem;
}

.btn-cyber::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 255, 0, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-cyber:hover {
  background: rgba(212, 255, 0, 0.15);
  box-shadow: 0 0 20px rgba(212, 255, 0, 0.5); 
  transform: translateY(-3px);
  backdrop-filter: blur(8px);
}

.btn-cyber:hover::before {
  left: 100%;
}

/* Hero / Architect Layout */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 4rem;
}

.hero-heading {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.highlight-name {
  color: var(--accent);
  margin-right: 15px;
}

.tagline-sub {
  color: var(--text-muted);
  font-weight: 400;
}

.motivation-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-btns {
  display: flex;
  gap: 1.5rem;
}

/* Button System Redesign: Pill-Shaped Glassmorphism */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 1rem 2.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 50px; /* Changed from default to Pill shape */
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  border: 2px solid transparent;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 255, 0, 0.1);
}

.btn:hover {
  transform: translateY(-5px) scale(1.02);
  background: var(--accent-hover);
  box-shadow: 0 0 25px rgba(212, 255, 0, 0.6); /* Intense neon glow */
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  backdrop-filter: blur(8px); /* Glassmorphism effect */
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Secondary Cyber Buttons */
.btn-cyber {
  position: relative;
  background: rgba(212, 255, 0, 0.05);
  color: var(--accent);
  padding: 0.8rem 1.8rem;
  border: 1px solid rgba(212, 255, 0, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 50px; /* Consistently pill-shaped */
  overflow: hidden;
  transition: all 0.4s ease;
  backdrop-filter: blur(5px);
}

.btn-cyber:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(212, 255, 0, 0.4);
  transform: scale(1.05);
}

.btn-cyber::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-cyber:hover::after {
  left: 100%;
}

/* Image Area / ID Badge Wrapper */
.hero-image-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1000px;
}

.lanyard-string-container {
    width: 100%;
    height: 100px;
    position: relative;
    z-index: 5;
    pointer-events: none;
}

.lanyard-svg {
    width: 100%;
    height: 100%;
}

.id-badge-wrapper {
  width: 300px;
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  user-select: none;
  cursor: grab;
  transform-origin: top center;
  transition: transform 0.1s ease-out; /* Smooth hover transition */
}

.id-badge-wrapper:active {
    cursor: grabbing;
}

.id-badge-frame {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 2px solid #333;
}

.badge-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 10;
}

.id-image-container {
  width: 100%;
  height: 380px;
  background: #111;
  position: relative;
}

.architect-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1);
  opacity: 0.9;
}

.pinned-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent);
  color: #000;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 0.6rem;
  text-align: right;
  border-radius: 2px;
}

.badge-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.badge-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #333;
  font-weight: 700;
  letter-spacing: 0px;
}

/* About Section */
.about {
  padding: 10rem 0;
  background: linear-gradient(to bottom, transparent, rgba(19, 31, 61, 0.3));
}

.about-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 5rem;
}

.motivation-text-static {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.about-details {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.detail-heading {
  font-family: 'Orbitron', sans-serif;
  color: var(--accent);
  margin-bottom: 1rem;
}

.detail-list {
  display: grid;
  gap: 1rem;
}

.detail-label {
  color: #fff;
  font-weight: 700;
  margin-right: 10px;
}

.swing-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 350px;
  transform-origin: top center;
  /* EPIC SWING ADDED HERE */
  animation: floatProfile 4s ease-in-out infinite;
}

.reveal-about.active .code-image-wrapper {
    animation: swingInFromBack 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes floatProfile {
  0%, 100% { transform: translateY(-15px) rotate(8deg); }
  50% { transform: translateY(15px) rotate(-8deg); }
}

.hero-code-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transition: opacity 0.5s ease-in-out;
}

.pic1 {
  animation: swapWithSwing1 4s infinite ease-in-out;
  z-index: 2;
}

.pic2 {
  animation: swapWithSwing2 4s infinite ease-in-out;
  z-index: 1;
}

/* 6s total = one full swing cycle C -> R -> C -> L -> C */
/* Swaps at 25% (Peak Right) and 75% (Peak Left) */

@keyframes swapWithSwing1 {
  0%, 24% { opacity: 1; }
  25%, 74% { opacity: 0; }
  75%, 100% { opacity: 1; }
}

@keyframes swapWithSwing2 {
  0%, 24% { opacity: 0; }
  25%, 74% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

/* Sections */
section {
  padding: 8rem 0;
}

section + section {
  position: relative;
}

section + section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 4rem);
  max-width: 1160px; /* Aligns smoothly with container max-width */
  height: 1px;
  background: linear-gradient(to right, 
    transparent, 
    rgba(212, 255, 0, 0.15), 
    transparent
  );
}

.section-tag {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2rem;
  margin-bottom: 1rem;
  display: block;
}

.section-title {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  margin-bottom: 3rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

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

.project-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 255, 0, 0.3);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.project-img {
  width: 100%;
  height: 200px;
  background: #000;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: all 0.5s ease;
}

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

/* Skills/Bento Section */
.bento-section {
  background: var(--bg-primary);
}

.bento-title {
  font-family: 'Orbitron', sans-serif;
  letter-spacing: -2px;
}

.bento-subtitle {
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 4rem;
}

.stem-container {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  align-items: center;
  position: relative;
  gap: 4rem 0;
}

.stem-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  transform: translateX(-50%);
}

.stem-node-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 2;
  box-shadow: 0 0 15px rgba(212, 255, 0, 0.3);
  margin: 0 auto;
}

.stem-card {
  background: var(--bg-secondary);
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.left-card { text-align: right; }
.right-card { text-align: left; }

.pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.left-card .pill-container { justify-content: flex-end; }

.pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.section-divider-small {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.divider-line {
  height: 1px;
  flex-grow: 1;
  background: var(--border-color);
}

.divider-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 4px;
}

/* Contact Section */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

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

.contact-item h5 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.contact-item p {
  font-size: 1.1rem;
  color: #fff;
  line-height: 1.6;
}

.contact-form {
  background: var(--bg-secondary);
  padding: 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 1rem;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-link {
    color: var(--text-main);
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-link:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(212, 255, 0, 0.5);
}

.modern-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    opacity: 0.7;
    letter-spacing: 1px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
}

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

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
}

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

.social-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader-content {
  text-align: center;
  width: 80%;
  max-width: 400px;
}

.loader-text {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  margin-bottom: 1rem;
}

.loader-bar {
  height: 2px;
  width: 100%;
  background: rgba(212, 255, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: loading 2s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

.slide-up-curtain {
  transform: translateY(-100%);
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Reveal Logic */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Content Reveal Masks */
.reveal-mask {
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.slide-in-right {
    transform: translateX(100px);
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero-revealed .slide-in-right {
    transform: translateX(0);
    opacity: 1;
}

/* Archive Page Entrance Animations */
@keyframes contentFadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.archive-hero h1 {
    animation: contentFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.archive-hero p {
    animation: contentFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    animation-delay: 0.15s;
}

.archive-grid .showcase-card {
    animation: contentFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.archive-grid .showcase-card:nth-child(1) { animation-delay: 0.25s; }
.archive-grid .showcase-card:nth-child(2) { animation-delay: 0.35s; }
.archive-grid .showcase-card:nth-child(3) { animation-delay: 0.45s; }
.archive-grid .showcase-card:nth-child(4) { animation-delay: 0.55s; }
.archive-grid .showcase-card:nth-child(5) { animation-delay: 0.65s; }
.archive-grid .showcase-card:nth-child(6) { animation-delay: 0.75s; }

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.4s; }
.delay-4 { transition-delay: 0.6s; }

/* Resume Button */
.nav-resume-btn {
    border: 1px solid var(--accent);
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    color: var(--accent) !important;
}

.nav-resume-btn:hover {
    background: var(--accent);
    color: var(--bg-primary) !important;
}

/* Skill Rotator */
.skill-rotator {
    display: flex;
    flex-direction: column;
    height: 30px;
    overflow: hidden;
}

.rotator-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--accent);
    height: 30px;
    line-height: 30px;
    animation: rotate 15s infinite;
}

@keyframes rotate {
    0%, 10% { transform: translateY(0); }
    12.5%, 22.5% { transform: translateY(-30px); }
    25%, 35% { transform: translateY(-60px); }
    37.5%, 47.5% { transform: translateY(-90px); }
    50%, 60% { transform: translateY(-120px); }
    62.5%, 72.5% { transform: translateY(-150px); }
    75%, 85% { transform: translateY(-180px); }
    87.5%, 97.5% { transform: translateY(-210px); }
}

/* ID Badge Animation Helpers */
.id-badge-wrapper {
    will-change: transform;
    transform-style: preserve-3d;
}

/* Typwriter Cursor */
.typewriter-cursor::after {
    content: '_';
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (OVERHAUL)
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-container {
    gap: 2rem;
  }
}

@media (max-width: 991px) {
  .hero-heading {
    font-size: 3rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  /* Navbar Overhaul */
  .menu-toggle {
    display: block;
    cursor: pointer;
    z-index: 1001;
  }

  .menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background: var(--accent);
  }

  .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
  .menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav-links {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background: var(--bg-primary);
    width: 100%;
    height: calc(100vh - 70px);
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
    z-index: 1000;
    overflow-y: auto; /* Fixes missing resume button */
  }

  .nav-links.active {
    left: 0;
    border-top: 1px solid var(--border-color);
  }

  .nav-links li {
    margin: 1.2rem 0; /* Slightly reduced margin to fit better */
  }

  .logo {
    font-size: 1.2rem;
  }

  .hero {
    height: auto !important;
    min-height: 100vh;
    padding-top: 100px; /* Clear the 80px fixed header */
  }

  /* Hero Section Stacking */
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
    padding-top: 0;
  }

  .hero-content {
    order: 2; /* Move text below image on mobile for better flow */
  }

  .hero-image-area {
    order: 1;
    max-width: 60%;
    margin: 0 auto;
  }

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

  .motivation-text {
    max-width: 100%;
  }

  /* Section Padding */
  section {
    padding: 6rem 1.5rem 4rem 1.5rem; /* Increased top padding to clear header */
  }
  
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-heading {
    font-size: 2.5rem;
  }
  
  .logo {
    font-size: 1.1rem;
  }

  .hero-image-area {
    max-width: 80%;
  }

  .id-badge-frame {
     width: min(280px, 85vw) !important;
     height: auto !important;
     aspect-ratio: 240/340;
  }

  .id-image-container {
      width: 100%;
      height: 100% !important; /* Forces image to match frame proportions to stop top cropping */
      aspect-ratio: auto; /* Removes the squashing override */
  }

  .hero-image-area {
      max-width: 100%;
      overflow: visible;
  }

  .lanyard-string-container {
      height: 60px; /* Shorter lanyard on mobile to save space */
  }

  .id-badge-wrapper {
      transform: rotate(0deg) scale(0.9) !important; /* Set to 0deg to be perfectly straight */
  }

  .btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
  }
}

/* --- MOBILE SPECIFIC OVERRIDES --- */
@media (max-width: 768px) {

  /* --- Skills (Stem) Mobile Stacking --- */
  .stem-container {
      grid-template-columns: 1fr;
      gap: 3rem;
  }

  .stem-line {
      left: 20px;
      transform: none;
  }

  .stem-node-icon {
      margin: 0;
      margin-left: 0;
      position: absolute;
      left: 0;
      grid-column: 1 !important;
      grid-row: auto !important;
      transform: translateY(20px);
  }

  .stem-card {
      padding: 1.5rem;
      text-align: left !important;
      margin-left: 40px;
      width: calc(100% - 40px);
      grid-column: 1 !important; /* Force override inline styles */
      grid-row: auto !important;
      margin-bottom: 2rem;
  }

  .left-card .pill-container {
      justify-content: flex-start;
  }

  .stem-card h3 {
      font-size: 1.2rem;
  }

  /* --- Archive Grid Fix --- */
  .archive-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 2rem;
  }

  /* --- Contact Section & Email Fix --- */
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-item p {
    font-size: 0.95rem;
  }

  .contact-link {
    font-size: clamp(0.7rem, 3.8vw, 1.1rem); /* Force one line */
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modern-label {
    font-size: 0.7rem;
    margin-right: 5px;
  }

  /* Fix global overflow issues */
  body, html {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    box-sizing: border-box;
  }
}

  .contact-line-wrapper {
      display: flex;
      align-items: center;
      justify-content: flex-start; /* Ensure left alignment */
      flex-wrap: nowrap;
      width: 100%;
      overflow: hidden;
      gap: 8px;
  }

