:root {
  --bg: #07111f;
  --bg-2: #0d1728;
  --panel: rgba(12, 19, 34, 0.78);
  --panel-strong: rgba(20, 29, 49, 0.92);
  --card: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef4ff;
  --muted: #aebbd3;
  --accent: #66e3c4;
  --accent-2: #7aa2ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

body[data-theme='light'] {
  --bg: #eef3fb;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --card: rgba(17, 24, 39, 0.03);
  --line: rgba(17, 24, 39, 0.08);
  --text: #0f1a2e;
  --muted: #58657d;
  --accent: #08a6c4;
  --accent-2: #4f7ef6;
  --shadow: 0 18px 50px rgba(15, 26, 46, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'Inter', 'Tajawal', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(122, 162, 255, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(102, 227, 196, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  transition: background 220ms ease, color 220ms ease;
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.5;
}

.ambient-1 {
  width: 340px;
  height: 340px;
  top: 40px;
  left: -80px;
  background: rgba(122, 162, 255, 0.18);
}

.ambient-2 {
  width: 320px;
  height: 320px;
  top: 260px;
  right: -110px;
  background: rgba(102, 227, 196, 0.14);
}

body[dir='rtl'] {
  font-family: 'Tajawal', 'Inter', sans-serif;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 20px auto 44px;
  position: relative;
  z-index: 1;
}

.panel,
.feature-card,
.skill-card,
.timeline-item,
.cert-card,
.metric-card,
.profile-card {
  backdrop-filter: blur(16px);
}

.hero,
.section {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(122, 162, 255, 0.12), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(102, 227, 196, 0.1), transparent 24%);
  pointer-events: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 800;
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-text strong {
  font-size: 1rem;
}

.brand-text small {
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: background 180ms ease, color 180ms ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--card);
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
}

.lang-btn,
.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.lang-btn {
  min-width: 42px;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07111f;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 22px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.eyebrow,
.section-heading span,
.timeline-year,
.contact-section span {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4.3vw, 4rem);
  line-height: 1.06;
  margin: 14px 0 18px;
  max-width: 12ch;
}

.lead,
.feature-card p,
.skill-card p,
.timeline-item p,
.cert-card p,
.contact-section p,
.profile-heading p,
.info-list span,
.contact-link span,
.avatar-wrap small {
  color: var(--muted);
}

.lead {
  max-width: 62ch;
  line-height: 1.8;
  font-size: 1.03rem;
}

.section-intro {
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.75;
  margin: 10px 0 0;
}

.hero-actions,
.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin: 28px 0 18px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.trust-strip span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.btn-primary {
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), #88f3db);
}

.btn-secondary {
  color: var(--text);
  background: var(--card);
  border-color: var(--line);
}

.btn-whatsapp {
  color: var(--text);
  background: linear-gradient(135deg, rgba(27, 194, 114, 0.16), rgba(102, 227, 196, 0.12));
  border-color: rgba(27, 194, 114, 0.28);
}

.hero-metrics,
.info-list,
.feature-grid,
.skills-grid,
.timeline,
.cert-grid {
  display: grid;
  gap: 16px;
}

.hero-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.profile-card,
.feature-card,
.skill-card,
.timeline-item,
.cert-card,
.contact-link {
  border: 1px solid var(--line);
  background: var(--card);
}

.metric-card,
.feature-card,
.skill-card,
.timeline-item,
.cert-card {
  border-radius: 22px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric-card::before,
.feature-card::before,
.skill-card::before,
.timeline-item::before,
.cert-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.8;
}

.metric-card strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.profile-card {
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}

.profile-top {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(135deg, rgba(102, 227, 196, 0.26), rgba(122, 162, 255, 0.24));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 18px 30px rgba(0,0,0,0.16);
}

.profile-heading h2,
.section-heading h3,
.feature-card h4,
.skill-card h4,
.timeline-item h4,
.cert-card h4,
.contact-section h3 {
  margin: 0;
}

.profile-heading p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.info-list div,
.contact-link {
  padding: 14px 16px;
  border-radius: 16px;
}

.info-list strong,
.contact-link strong {
  display: block;
  margin-top: 5px;
}

.contact-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.contact-link {
  text-decoration: none;
  color: var(--text);
  transition: transform 180ms ease, background 180ms ease;
}

.contact-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
}

.section {
  margin-top: 22px;
  padding: 28px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-top: 8px;
}

.feature-grid,
.skills-grid,
.timeline,
.cert-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tech-stack-wrap {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.03);
}

.stack-title {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-stack span {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 0.94rem;
}

.contact-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.contact-section > div:first-child {
  max-width: 700px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

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

@media (max-width: 960px) {
  .hero-grid,
  .feature-grid,
  .skills-grid,
  .timeline,
  .cert-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .contact-section {
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  .hero-badges,
  .trust-strip {
    width: 100%;
  }

  .page-shell {
    width: min(100% - 16px, 100%);
  }

  .hero,
  .section {
    padding: 18px;
    border-radius: 22px;
  }

  .topbar,
  .topbar-right {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
  }

  .profile-top {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}
