:root {
  --primary-blue: #3b82f6;
  --secondary-blue: #60a5fa;
  --dark-blue: #1e1e2f;
  --card-bg: #2a2a40;
  --button-primary: #326dee;
  --button-secondary: #78a5ee;
  --text-primary: #f5f5f7;
  --text-secondary: #e4e4e7;
  --text-muted: #a1a1aa;
  --gradient-bg: linear-gradient(0deg, #1e1e2f 0%, #2f6ac9 100%);
  --terminal-bg: #111122;
}

/* Toggle Recaptcha Button Styles */
.toggle-recaptcha-btn {
  position: fixed;
  margin-bottom: 3rem;
  right: 24px;
  transform: none;
  z-index: 10001;
  padding: 12px 28px;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 8px;
  border: 2px solid var(--primary-blue);
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.toggle-recaptcha-btn:hover {
  background: var(--primary-blue);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59,130,246,0.25);
}

:root.light-theme .toggle-recaptcha-btn {
  background: #f8fafc;
  color: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59,130,246,0.10);
}
:root.light-theme .toggle-recaptcha-btn:hover {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 8px 24px rgba(59,130,246,0.18);
}

/* Light Theme */
:root.light-theme {
  --primary-blue: #3b82f6;
  --secondary-blue: #60a5fa;
  --dark-blue: #f1f5f9;
  --card-bg: #f8fafc;
  --button-primary: #3b82f6;
  --button-secondary: #60a5fa;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --gradient-bg: linear-gradient(0deg, #93c5fd 0%, #7dd3fc 100%);
  --terminal-bg: #bfdbfe;
}

/* Light Theme Card Overrides */
:root.light-theme .card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

:root.light-theme .card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

:root.light-theme #terminal-banner {
  background: #e0f2fe;
  color: #1e40af;
  border: 1px solid rgba(30, 64, 175, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

:root.light-theme .tech-item {
  color: #334155;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

:root.light-theme .tech-item:hover {
  color: #1e3a8a;
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3),
    0 0 0 3px rgba(59, 130, 246, 0.15);
}

:root.light-theme .tech-item::after {
  color: #ffffff;
  background: rgba(30, 30, 47, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

:root.light-theme .tech-item::before {
  border-bottom-color: rgba(30, 30, 47, 0.95);
}

:root.light-theme .card-button {
  color: #ffffff;
}

:root.light-theme .skill-tag {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #1e40af;
}

:root.light-theme .skill-tag:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #1e3a8a;
}

:root.light-theme footer {
  background: linear-gradient(0deg, #93c5fd 0%, #7dd3fc 100%);
  background-size: 100% 100vh;
  background-attachment: fixed;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 -10px 10px rgba(0, 0, 0, 0.05);
  color: #334155;
}

:root.light-theme .footer-tag {
  color: #3b82f6;
}

/* reCAPTCHA hide badge */
.grecaptcha-badge { 
  visibility: hidden; 
}

/* Toggle Recaptcha Button Styles */
.toggle-recaptcha-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  padding: 12px 28px;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 8px;
  border: 2px solid var(--primary-blue);
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(59,130,246,0.15);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.toggle-recaptcha-btn:hover {
  background: var(--primary-blue);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59,130,246,0.25);
}

:root.light-theme .toggle-recaptcha-btn {
  background: #f8fafc;
  color: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59,130,246,0.10);
}
:root.light-theme .toggle-recaptcha-btn:hover {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 8px 24px rgba(59,130,246,0.18);
}



/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.3);
  background: rgba(42, 42, 64, 0.7);
  backdrop-filter: blur(10px);
  color: var(--primary-blue);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.15);
}

.theme-toggle:active {
  transform: scale(0.95);
}

:root.light-theme .theme-toggle {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:root.light-theme .theme-toggle:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
}

@media (max-width: 768px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    font-size: 1rem;
    top: 15px;
    right: 15px;
  }
}

/* Skip to main content link (accessibility) */
.skip-link {
  position: absolute;
  opacity: 0;
  top: 5%;
  left: 2.5%;
  background: var(--primary-blue);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  font-weight: 500;
  transition: opacity 0.1s ease, outline 0.4s ease;
}

.skip-link:focus {
  opacity: 1;
  outline: 2px solid var(--secondary-blue);
  outline-offset: 2px;
}

*:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 4px;
  border-radius: 4px;
  transition: outline 0.2s ease, outline-offset 0.2s ease;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 3px;
  transition: outline 0.2s ease, outline-offset 0.2s ease;
}

.card:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 6px;
}

.tech-item:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 4px;
  border-radius: 12px;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
  border-color: var(--primary-blue);
}

.card-button:focus-visible,
.contact-btn:focus-visible {
  outline: 2px solid var(--secondary-blue);
  outline-offset: 4px;
}


/* Wrapper */
#wrapper {
  transform-origin: top left;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  z-index: -2;
}

/* No scrollbar */
body::-webkit-scrollbar {
  display: none;
}

body {
  font-family: "Montserrat", sans-serif;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

@supports (scrollbar-width: none) {
  html {
    scrollbar-width: none;
  }
}

/* Global Styles */
html {
  overflow-anchor: none;
}

.page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  padding: 2rem 2rem 5rem;
  position: relative;
  z-index: 1;
}

/* Hero Section */
#hero {
  text-align: center;
  margin-bottom: 3vh;
  color: var(--text-primary);
  animation: fadeInDown 0.8s ease;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  margin: 0;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 12px;
  margin-bottom: 1.5rem;
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.social-link {
  color: var(--text-secondary);
  font-size: 1.3rem;
  transition: all 0.3s ease;
  position: relative;
}

.social-link:hover {
  color: var(--primary-blue);
  transform: translateY(-3px);
}

.social-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 0;
  height: 2px;
  background: var(--primary-blue);
  transition: width 0.3s ease;
}

.social-link:hover::after {
  width: 100%;
}

/* Terminal Banner */
#terminal-banner {
  font-family: "Fira Code", monospace;
  position: relative;
  background: var(--terminal-bg);
  color: var(--primary-blue);
  padding: 14px 20px;
  border-radius: 10px;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 20px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  font-size: clamp(0.9rem, 1.8vw, 1.2rem);
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.3s ease;
  border: 1px solid rgba(59, 130, 246, 0.2);
  overflow: hidden;
  white-space: nowrap;
}

#terminal-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.1),
    transparent
  );
  animation: scan 3s infinite;
}

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

  100% {
    left: 100%;
  }
}

#terminal-banner:hover {
  box-shadow: 0 6px 30px rgba(59, 130, 246, 0.3);
  transform: scale(1.02);
}

.terminal-prompt {
  color: #4ade80;
  font-weight: bold;
}

#typing-code {
  color: var(--text-primary);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background-color: var(--primary-blue);
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Cards Section */
#cards {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12vh;
  width: min(90vw, 800px);
  padding: 0;
  box-sizing: border-box;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(42, 42, 64, 0.7);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  text-align: center;
  padding: clamp(24px, 3vw, 40px);
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeInUp 0.8s ease backwards;
  overflow: visible;
}

.card:nth-child(2) {
  animation-delay: 0.2s;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.3),
    rgba(139, 92, 246, 0.3)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Title Card */
.title-heading {
  font-size: clamp(1.4rem, 2vw, 2rem);
  margin: 10px 0;
  font-weight: 500;
  color: var(--text-secondary);
}

.card-subtitle {
  color: var(--text-muted);
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Tech Stack */
.tech-stack {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.8rem);
  margin-top: 1.5rem;
  flex-wrap: wrap;
  padding: 0.5rem;
}

.tech-item {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-muted);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  padding: clamp(0.6rem, 1.5vw, 0.8rem);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.03);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(50px, 10vw, 65px);
  min-height: clamp(50px, 10vw, 65px);
  backdrop-filter: blur(5px);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tech-item:hover {
  color: var(--primary-blue);
  transform: translateY(-8px);
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2),
    0 0 0 3px rgba(59, 130, 246, 0.05);
}

.tech-item::after {
  content: attr(title);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%) translateY(13px); /* match arrow's initial position */
  font-size: clamp(0.65rem, 1.2vw, 0.75rem);
  color: var(--text-primary);
  background: rgba(30, 30, 47, 0.95);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.tech-item::before {
  content: "";
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%) translateY(13px); /* start grouped with tooltip */
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(30, 30, 47, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 101;
}

.tech-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tech-item:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Content Card */
.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-header .card-text {
  margin: 0;
}

.card-text {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--text-primary);
  font-weight: 400;
  margin-bottom: 2rem;
}

/* Card Button */
.card-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: clamp(14px, 2vw, 18px) clamp(32px, 4vw, 48px);
  border: none;
  background: linear-gradient(
    135deg,
    var(--button-secondary) 0%,
    var(--button-primary) 50%,
    var(--button-secondary) 100%
  );
  background-size: 200% 100%;
  background-position: left center;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(14, 85, 236, 0.3);
  width: 100%;
  text-decoration: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.card-button::before {
  content: "";
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 50%;
  height: 100%;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  transition: width 0.4s ease, opacity 0.4s ease, border-radius 0.4s ease;
  pointer-events: none;
}

.card-button:hover::before {
  width: 100%;
  opacity: 1;
  border-radius: 12px;
}

.card-button:hover {
  background-position: right center;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(14, 85, 236, 0.4);
}

.card-button:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(14, 85, 236, 0.3);
}

.button-arrow {
  transition: transform 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
}

.card-button.expanded .button-arrow {
  transform: rotate(180deg);
}

/* Card Details - Enhanced */
.card-details {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.card-details.expanded {
  max-height: 600px;
  overflow: hidden;
  user-select: none;
}

.card-details-content {
  padding-top: 1.5rem;
  text-align: left;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h4 {
  color: var(--primary-blue);
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-section h4 i {
  font-size: 1rem;
}

.detail-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Skills List */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.4rem 0.8rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  color: var(--secondary-blue);
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.skill-tag:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}

/* Mini Projects */
.mini-projects {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mini-project {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  transition: all 0.3s ease;
  user-select: none;
  text-decoration: none;
  color: inherit;
}

.mini-project:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(5px);
}

.mini-project i {
  color: var(--primary-blue);
  font-size: 1.2rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.mini-project span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Contact Buttons */
.contact-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.contact-btn {
  flex: 1;
  font-family: "Montserrat", sans-serif;
  min-width: 140px;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 10px;
  border: none;
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.contact-btn::before {
  content: "";
  position: absolute;
  opacity: 0;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 50%;
  height: 100%;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.15);
  transition: width 0.5s ease, opacity 0.5s ease, border-radius 0.5s ease;
}

.contact-btn:hover::before {
  width: 100%;
  opacity: 1;
  border-radius: 10px;
}

.contact-btn.secondary::before {
  background: rgba(255, 255, 255, 0.04);
}

.contact-btn.primary {
  background: linear-gradient(
    135deg,
    var(--button-primary),
    var(--button-secondary)
  );
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.contact-btn.primary:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-4px);
}

.contact-btn.primary:active {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.contact-btn.secondary {
  background: rgba(59, 130, 246, 0.05);
  color: var(--primary-blue);
  border: 1.5px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.contact-btn.secondary:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  transform: translateY(-4px);
}

.contact-btn.secondary:active {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.contact-btn i {
  font-size: 1.1em;
  transition: transform 0.3s ease;
}

.contact-btn:hover i {
  transform: scale(1.1);
}

/* Footer - Enhanced with full background coverage */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1rem 0;
  background: linear-gradient(0deg, #1e1e2f 0%, #2f6ac9 100%);
  background-size: 100% 100vh;
  background-attachment: fixed;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 10px rgba(0, 0, 0, 0.3);
}

footer p {
  margin: 0;
  position: relative;
  z-index: 1;
}

.footer-tag {
  color: var(--primary-blue);
  font-weight: 500;
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Rotate Popup */
#rotate-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 9999;
  backdrop-filter: blur(20px);
  background: rgba(30, 30, 47, 0.95);
}

.rotate-popup-inner {
  max-width: 90%;
  padding: 2rem;
  font-size: 1.5rem;
  color: white;
  margin: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  #cards {
    width: 85vw;
  }
}

@media (max-width: 768px) {
  .page-container {
    padding: 1rem;
  }

  #cards {
    width: 90vw;
    gap: 4vh;
  }

  .tech-stack {
    gap: 0.8rem;
    padding: 0.3rem;
  }

  .tech-item {
    font-size: 1.4rem;
    min-width: 48px;
    min-height: 48px;
    padding: 0.5rem;
  }

  .tech-item::after {
    font-size: 0.65rem;
    bottom: -30px;
  }

  .contact-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

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

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .card {
    padding: 20px;
  }

  .card-button {
    font-size: 0.95rem;
    padding: 12px 24px;
  }

  .skill-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Tablet Portrait Orientation */
@media (min-width: 768px) and (max-width: 1400px) and (orientation: portrait) {
  #rotate-popup {
    display: flex;
  }
}

/* Contact Modal (global) */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 18, 30, 0.7);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.3s ease;
}

.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: min(760px, 92vw);
  background: rgba(30, 30, 47, 0.98);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.08);
  color: var(--text-primary);
}

.modal-content h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.25rem;
  color: var(--primary-blue);
}

.modal-subtitle {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.modal-content label {
  display: block;
  margin-top: 0.8rem;
  margin-bottom: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.modal-content textarea {
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.contact-status {
  margin-top: 0.8rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Spinner inside submit button */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.85);
  vertical-align: middle;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 160ms ease, transform 160ms ease;
}

.btn-spinner.spinning {
  opacity: 1;
  transform: scale(1);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.contact-status.success {
  color: #4ade80;
}
.contact-status.error {
  color: #fb7185;
}

.modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 1rem;
  }
  .modal-close {
    right: 0.6rem;
    top: 0.6rem;
  }
}

/* Light Theme Overrides for Modal */
:root.light-theme .modal-content {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  color: #1e293b;
  border: 1px solid rgba(59, 130, 246, 0.08);
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.08);
}

:root.light-theme .modal-content h2 {
  color: #3b82f6;
}

:root.light-theme .modal-subtitle {
  color: #334155;
}

:root.light-theme .modal-content label {
  color: #334155;
}

:root.light-theme .modal-content input,
:root.light-theme .modal-content textarea {
  background: rgba(59, 130, 246, 0.07);
  color: #1e293b;
  border: 1px solid rgba(59, 130, 246, 0.12);
}

:root.light-theme .modal-content textarea {
  resize: vertical;
}

:root.light-theme .modal-close {
  color: #64748b;
}

:root.light-theme .contact-status {
  color: #334155;
}

:root.light-theme .contact-status.success {
  color: #22c55e;
}

:root.light-theme .contact-status.error {
  color: #ef4444;
}
