:root {
  /* Dark mode (default) */
  --bg-body: #0b0f17;
  --bg-card: #131e28;
  --bg-tool: #1f2f3a;
  --bg-input: #1f2a36;
  --bg-polaroid: #d9e2ec;
  --primary: #00e0b0;
  --secondary: #ff5e7d;
  --tertiary: #3b9eff;
  --accent-glow: #8a2be2;
  --text-light: #e2ecff;
  --text-muted: #a0b3d9;
  --grad-1: linear-gradient(145deg, #00e0b0, #3b9eff);
  --grad-2: linear-gradient(145deg, #ff5e7d, #8a2be2);
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.6);
  --font-main: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --placeholder-color: #a0b3d9;
  --input-text: #e2ecff;
}

/* Light theme overrides */
body.light-mode {
  --bg-body: #f0f4fa;
  --bg-card: #ffffff;
  --bg-tool: #e2eaf1;
  --bg-input: #ffffff;
  --bg-polaroid: #e0e7f0;
  --primary: #00897b;
  --secondary: #c2185b;
  --tertiary: #1565c0;
  --accent-glow: #7b1fa2;
  --text-light: #1e2a3a;
  --text-muted: #3e4b5e;
  --grad-1: linear-gradient(145deg, #00897b, #1565c0);
  --grad-2: linear-gradient(145deg, #c2185b, #7b1fa2);
  --border-light: rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --placeholder-color: #6c757d;
  --input-text: #1e2a3a;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-body);
  color: var(--text-light);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.2s ease;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  color: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 0 15px var(--primary);
  transition: transform 0.2s, background-color 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle i {
  line-height: 1;
}

.particle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
}

/* scroll progress bar */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 9999;
}

.progress-bar {
  height: 4px;
  background: var(--grad-1);
  width: 0%;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px var(--primary);
}

/* ===== header cyber grid ===== */
.cyber-header {
  background-image:
    linear-gradient(rgba(0, 224, 176, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 224, 176, 0.05) 1px, transparent 1px);
  background-size: 35px 35px;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 0 30px rgba(0, 224, 176, 0.2);
  position: relative;
  z-index: 2;
}

.glitch-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 10vw, 4rem);
  font-weight: 800;
  text-transform: uppercase;
  color: white;
  text-shadow: 0.05em 0 0 var(--secondary), -0.05em -0.025em 0 var(--primary);
  animation: glitch 6s infinite;
  letter-spacing: 4px;
  word-break: break-word;
}

@keyframes glitch {

  0%,
  100% {
    transform: none;
    opacity: 1;
  }

  7% {
    transform: skew(-0.5deg, -0.9deg);
    opacity: 0.9;
  }

  10% {
    transform: none;
  }
}

.subhead {
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--primary);
  font-weight: 500;
  text-shadow: 0 0 8px var(--primary);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.ats-headline {
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  color: var(--text-light);
  background: rgba(0, 224, 176, 0.1);
  padding: 8px 20px;
  border-radius: 40px;
  display: inline-block;
  max-width: 90%;
  border: 1px solid var(--primary);
}

.fixed-text {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .subhead {
    flex-direction: column;
    gap: 0;
  }
}

/* ===== decorations ===== */
.deco {
  position: absolute;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  opacity: 0.5;
  animation: float 5s infinite ease-in-out;
  pointer-events: none;
}

.top-left {
  top: 10px;
  left: 10px;
}

.top-right {
  top: 10px;
  right: 10px;
}

.bottom-left {
  bottom: 10px;
  left: 10px;
}

.bottom-right {
  bottom: 10px;
  right: 10px;
}

.footer-left {
  left: 10px;
  bottom: 5px;
}

.footer-right {
  right: 10px;
  bottom: 5px;
}

.footer-center {
  left: 50%;
  transform: translateX(-50%);
  bottom: 30px;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ===== polaroid card ===== */
.polaroid-card {
  width: min(260px, 85%);
  background: var(--bg-polaroid);
  padding: 12px 12px 18px;
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--shadow-color), 0 0 0 4px var(--secondary);
  transform: rotate(-1.5deg);
  transition: transform 0.3s ease;
  position: relative;
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.02);
}

.polaroid-inner img {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--primary);
  cursor: pointer;
  transition: 0.3s;
}

.polaroid-caption {
  background: var(--grad-1);
  color: #000;
  font-weight: 700;
  padding: 8px;
  margin-top: 12px;
  border-radius: 30px;
  text-align: center;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

.photo-stickers {
  position: absolute;
  top: -15px;
  right: -15px;
  display: flex;
  gap: 5px;
}

.sticker {
  background: var(--secondary);
  padding: 5px 10px;
  border-radius: 40px;
  font-size: 1.4rem;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--secondary) 70%, black);
}

/* ===== social panel ===== */
.social-panel {
  background: rgba(0, 224, 176, 0.05);
  backdrop-filter: blur(6px);
  border: 1px solid var(--primary);
  border-radius: 40px;
}

.panel-title {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 1px;
}

.social-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 40px;
  font-weight: 600;
  text-decoration: none;
  color: white;
  background: var(--bg-tool);
  transition: transform 0.2s, filter 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
}

.social-badge:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.ln {
  background: #0A66C2;
}

.wa {
  background: #25D366;
}

.github {
  background: #24292F;
}

.resume {
  background: #f4b642;
  color: #000;
}

.resume.downloading {
  background: var(--primary);
  color: #000;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}

.resume.downloading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: loading-shine 1.5s infinite;
}

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

.lang {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 30px;
  margin: 3px;
  font-weight: 600;
}

.english {
  background: #2c3e50;
  color: #ecf0f1;
}

.arabic {
  background: #007A3D;
}

/* ===== intro card ===== */
.intro-card {
  background: var(--bg-card);
  border-radius: 32px;
  border: 2px solid var(--tertiary);
  box-shadow: 0 20px 40px color-mix(in srgb, var(--tertiary) 25%, transparent);
}

.hello {
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  font-weight: 800;
  color: var(--secondary);
}

.wave {
  animation: wave 2s infinite;
  display: inline-block;
}

@keyframes wave {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(15deg);
  }

  75% {
    transform: rotate(-10deg);
  }
}

.name-animate {
  display: inline-block;
  animation: namePulse 2s infinite ease-in-out;
  color: var(--primary);
  text-shadow: 0 0 8px var(--primary);
}

@keyframes namePulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 5px var(--primary);
  }

  50% {
    transform: scale(1.05);
    text-shadow: 0 0 20px var(--primary), 0 0 30px var(--secondary);
  }

  100% {
    transform: scale(1);
    text-shadow: 0 0 5px var(--primary);
  }
}

.highlight {
  background: var(--grad-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.static-text {
  color: var(--text-light);
}

.stat-badge {
  background: var(--bg-tool);
  padding: 6px 18px;
  border-radius: 40px;
  border-left: 4px solid var(--primary);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .stat-badge {
    white-space: normal;
    font-size: 0.9rem;
  }
}

/* ===== core competencies ===== */
.competency-card {
  background: var(--bg-card);
  border-radius: 28px;
  border: 1px solid var(--tertiary);
  height: 100%;
}

.comp-list {
  list-style-type: none;
  padding-left: 0;
}

.comp-list li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.comp-list li::before {
  content: "▹";
  color: var(--primary);
  position: absolute;
  left: 0;
}

/* ===== specialties cards ===== */
.specialty-card {
  background: var(--bg-card);
  border-radius: 28px;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 10px 20px var(--shadow-color);
  height: 100%;
}

.specialty-card.red {
  border-top: 6px solid #ff5e7d;
}

.specialty-card.blue {
  border-top: 6px solid #3b9eff;
}

.specialty-card.purple {
  border-top: 6px solid #b283ff;
}

.specialty-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
}

.card-icon {
  font-size: 3rem;
}

.toolset {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* section title */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2rem;
  border-left: 10px solid var(--secondary);
  padding-left: 15px;
  word-break: break-word;
}

/* tools cloud with shimmer effect */
.tools-cloud {
  background: var(--bg-card);
  border-radius: 60px;
  border: 2px dashed var(--primary);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tool-badge {
  background: var(--bg-tool);
  padding: 8px 22px;
  border-radius: 60px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--tertiary);
  transition: 0.15s;
  white-space: nowrap;
  position: relative;
  cursor: default;
  overflow: hidden;
  color: var(--text-light);
}

.tool-badge:hover {
  background: var(--primary);
  color: #000;
  transform: scale(1.05);
  border-color: var(--secondary);
}

.tool-badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 20%;
  height: 200%;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(25deg);
  transition: left 0.5s;
}

.tool-badge:hover::after {
  left: 120%;
}

.tool-badge[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  transform: translateX(-50%);
  background: var(--secondary);
  color: #fff;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
}

@media (max-width: 480px) {
  .tool-badge {
    padding: 6px 14px;
    font-size: 0.9rem;
  }
}

/* certifications */
.cert-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 1rem;
  text-align: center;
  border: 2px solid var(--primary);
  transition: 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cert-card:hover {
  transform: scale(1.02);
  border-color: var(--secondary);
}

.cert-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 8px var(--primary));
}

.cert-placeholder {
  width: 80px;
  height: 80px;
  background: var(--bg-tool);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-align: center;
  line-height: 1.2;
}

.cert-title {
  font-weight: 700;
  margin-bottom: 0;
}

/* live progress cards */
.stat-card {
  background: var(--bg-card);
  border-radius: 24px;
  border: 2px solid var(--tertiary);
  transition: 0.2s;
  height: 100%;
  text-align: center;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.stat-card h5 {
  color: var(--primary);
  font-weight: 700;
}

.stat-detail {
  margin: 8px 0;
  font-size: 1rem;
}

.stat-value {
  font-weight: 800;
  color: var(--text-light);
  font-size: 1.3rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.stat-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 10px;
}

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

/* GitHub projects */
.github-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 1.5rem;
  border: 2px solid var(--tertiary);
  transition: 0.2s;
  height: 100%;
}

.github-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
}

.github-card h5 {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.github-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.github-stats {
  display: flex;
  gap: 15px;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.github-stats i {
  color: var(--secondary);
}

.github-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

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

/* lab experience */
.lab-card {
  background: var(--bg-card);
  border-radius: 28px;
  border: 1px solid var(--tertiary);
}

.lab-list {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
}

.lab-list li {
  margin-bottom: 10px;
  padding-left: 24px;
  position: relative;
}

.lab-list li::before {
  content: "⚡";
  color: var(--primary);
  position: absolute;
  left: 0;
  font-size: 1rem;
}

/* experience cards */
.exp-card {
  background: var(--bg-card);
  border-radius: 28px;
  border: 1px solid var(--border-light);
  height: 100%;
}

.exp-list li {
  margin-bottom: 8px;
}

.text-accent {
  color: var(--primary);
  font-weight: 500;
}

/* achievements */
.achieve-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 1.5rem 0.5rem;
  border: 2px solid var(--secondary);
  transition: 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.achieve-card:hover {
  background: color-mix(in srgb, var(--bg-card) 90%, var(--primary));
  transform: scale(1.02);
}

.achieve-card h5 {
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

.achieve-card p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* availability banner with pulse */
.availability-banner {
  background: var(--grad-1);
  border-radius: 60px;
  color: #000;
  font-weight: 700;
  font-size: clamp(1rem, 4vw, 1.25rem);
  border: 2px solid var(--secondary);
  box-shadow: 0 0 20px rgba(0, 224, 176, 0.5);
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 224, 176, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(0, 224, 176, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 224, 176, 0);
  }
}

/* contact form */
.contact-card {
  background: var(--bg-card);
  border-radius: 32px;
  border: 2px solid var(--tertiary);
}

.form-control {
  background: var(--bg-input);
  border: 2px solid transparent;
  color: var(--input-text);
  border-radius: 40px;
  padding: 12px 20px;
}

.form-control:focus {
  background: var(--bg-input);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 224, 176, 0.25);
  color: var(--input-text);
}

.form-control::placeholder {
  color: var(--placeholder-color);
  opacity: 0.8;
}

.btn-submit {
  background: var(--grad-1);
  border: none;
  padding: 12px 36px;
  border-radius: 40px;
  font-weight: 700;
  color: #000;
  transition: transform 0.2s, filter 0.2s;
}

.btn-submit:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.btn-submit:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.form-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#formStatus {
  text-align: center;
  font-size: 0.95rem;
  transition: opacity 0.3s;
}

.status-success {
  color: #00e0b0;
  background: rgba(0, 224, 176, 0.1);
  padding: 8px;
  border-radius: 40px;
}

.status-error {
  color: #ff5e7d;
  background: rgba(255, 94, 125, 0.1);
  padding: 8px;
  border-radius: 40px;
}

/* footer */
.cyber-footer {
  border-top: 3px solid var(--primary);
  background: var(--bg-body);
  color: var(--text-muted);
  margin-top: 4rem;
  position: relative;
  font-size: 0.95rem;
}

/* professional alert with close button */
.work-alert {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: 90%;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 2px solid var(--primary);
  border-radius: 60px;
  padding: 12px 24px;
  box-shadow: 0 10px 30px rgba(0, 224, 176, 0.3);
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.3s ease;
  color: var(--text-light);
  font-weight: 500;
}

.work-alert.show {
  display: block;
  opacity: 1;
  animation: slideUpFade 0.5s;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.alert-content i {
  font-size: 1.5rem;
  color: var(--primary);
}

.alert-content span {
  font-size: 1rem;
  white-space: nowrap;
}

.alert-content .btn-close {
  filter: invert(1) brightness(2);
  opacity: 0.8;
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 1rem;
  transition: opacity 0.5s;
}

.alert-content .btn-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .work-alert {
    width: 90%;
    padding: 12px 18px;
  }

  .alert-content span {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .work-alert {
    font-size: 0.9rem;
  }
}

/* responsive spacing */
@media (max-width: 768px) {
  .section-title {
    margin-bottom: 1.5rem;
  }

  .hero {
    margin-top: 1rem;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}