﻿:root {
  --accent: #217ec4;
  --accent-soft: rgba(33, 126, 196, 0.12);
  --ink: #111827;
  --muted: #6b7280;
  --bg: #f9fafb;
  --card: #ffffff;
  --line: #e5e7eb;
  --nav-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  --btn-glow: 0 8px 20px rgba(0, 0, 0, 0.14);
  --radius: 16px;
  --nav-h: 64px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --bg: #0b1120;
  --card: #131c2e;
  --line: #24304a;
  --nav-bg: rgba(11, 17, 32, 0.92);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --btn-glow: 0 8px 20px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
}

html[lang="ar"] body {
  font-family: "Tajawal", "Inter", system-ui, -apple-system, sans-serif;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: none;
  height: 40px;
  width: auto;
  transition: transform 0.28s ease;
}

html:not([data-theme="dark"]) .brand .brand-logo:not(.brand-logo-dark) { display: block; }
html[data-theme="dark"] .brand .brand-logo.brand-logo-dark { display: block; }

.brand:hover .brand-logo { transform: scale(1.03); }
html[data-theme="dark"] .brand:hover .brand-logo { filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.5)); }

/* ---------- Splash screen ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  background: #ffffff;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

html[data-theme="dark"] .splash { background: #05070a; }

.splash-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splash-float 2.8s ease-in-out infinite;
}

.splash-logo-wrap::before {
  content: "";
  position: absolute;
  inset: -32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35), rgba(59, 130, 246, 0) 70%);
  opacity: 0.7;
  animation: splash-glow 2.8s ease-in-out infinite;
}

html[data-theme="light"] .splash-logo-wrap::before { display: none; }

.splash-logo {
  display: none;
  height: 120px;
  width: auto;
  animation: splash-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash-logo-dark { display: none; }
html:not([data-theme="dark"]) .splash-logo:not(.splash-logo-dark) { display: block; }
html[data-theme="dark"] .splash-logo.splash-logo-dark { display: block; }

.splash-bar {
  width: 180px;
  height: 3px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

html[data-theme="dark"] .splash-bar { background: #1e293b; }

.splash-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #3b82f6);
  width: 0;
  animation: splash-fill 0.7s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.splash.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.splash-lock { overflow: hidden; }

body.page-reveal main,
body.page-reveal .footer {
  animation: page-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes splash-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes splash-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

@keyframes splash-glow {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

@keyframes splash-fill {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes page-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-link {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

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

.nav-link.active { color: var(--accent); }

.nav-link.active::after { transform: scaleX(1); }

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout helpers ---------- */
  section { scroll-margin-top: var(--nav-h); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h2.title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 40px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-h) + 40px) 24px 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--accent-soft) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 75%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 75%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  inset-inline-end: -80px;
  top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  pointer-events: none;
}

.hero > .wrap { position: relative; z-index: 1; }

.hero .wrap {
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 32px;
}

.hero h1 {
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 12px 0 0;
  background: linear-gradient(90deg, var(--ink) 0%, var(--accent) 32%, var(--ink) 64%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: text-shimmer 7s ease-in-out infinite;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .hero h1 { background: none; color: var(--ink); -webkit-text-fill-color: currentColor; }
}

@keyframes text-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

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

.hero .subtitle {
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--accent);
  margin: 6px 0 16px;
  min-height: 1.4em;
}

.type-cursor {
  color: var(--accent);
  font-weight: 700;
  margin-left: 2px;
  animation: type-blink 1s steps(1) infinite;
}

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

.hero .sentence {
  font-size: 17px;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: badgePulse 2s ease-in-out infinite;
}

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

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--btn-glow);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}

.btn-primary:hover::after { left: 160%; }

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

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

.hero-photo-wrap {
  position: relative;
  justify-self: center;
  width: min(360px, 80vw);
}

.hero-photo-wrap::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent 70deg, transparent 290deg, var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: haloSpin 10s linear infinite;
  pointer-events: none;
}

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

.hero-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--card);
  box-shadow: var(--shadow);
}

.hero-photo img, .hero-photo .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 56px;
}

/* ---------- About ---------- */
.about { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.about .grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.about-photo {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 4.4;
  box-shadow: var(--shadow);
}

.about-photo img, .about-photo .placeholder { width: 100%; height: 100%; object-fit: cover; }

.about p { margin-bottom: 16px; color: var(--muted); font-size: 16px; }

.skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
}

/* ---------- Education ---------- */
.sub-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

.edu-block { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }

.edu-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.edu-years {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.edu-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }

.edu-card .place { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

.edu-card ul { list-style: none; }

.edu-card ul li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.edu-card ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Experience ---------- */
.experience .timeline { position: relative; padding-left: 28px; }

.experience .timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.timeline .edu-card { position: relative; }

.timeline .edu-card::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card);
}

/* ---------- Projects ---------- */
.projects { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.project-card.hide { display: none; }

.featured {
  background: linear-gradient(135deg, var(--card), var(--accent-soft));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.featured-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}

.featured h3 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }

.featured p { color: var(--muted); margin-bottom: 16px; }

.featured .highlight {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.project-card.is-link { cursor: pointer; }

.project-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 1px var(--accent), 0 14px 34px var(--accent-soft); }

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-view {
  margin-inline-start: auto;
  font-size: 15px;
  color: var(--accent);
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.2s;
}

.project-card.is-link:hover .card-view { opacity: 1; transform: translate(2px, -2px); }

.project-card h4 { font-size: 17px; font-weight: 700; }

.highlight {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-card p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  margin: 4px 0 18px;
}

.gallery-item {
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
  cursor: zoom-in;
  border: 1px solid var(--line);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img { transform: scale(1.06); }

.featured .gallery { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.94);
  display: flex;
  flex-direction: column;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.open { opacity: 1; }

.lightbox[hidden] { display: none; }

.lightbox-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: default;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-viewport.dragging,
.lightbox-viewport.dragging img { cursor: grabbing; }

.lightbox-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  max-height: none;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox.open .lightbox-stage { opacity: 1; transform: scale(1); }

.lightbox-stage.anim-out-next { animation: lboxOutNext 0.18s ease forwards; }
.lightbox-stage.anim-out-prev { animation: lboxOutPrev 0.18s ease forwards; }
.lightbox-stage.anim-in-next { animation: lboxInNext 0.22s cubic-bezier(0.22, 0.8, 0.34, 1) both; }
.lightbox-stage.anim-in-prev { animation: lboxInPrev 0.22s cubic-bezier(0.22, 0.8, 0.34, 1) both; }

@keyframes lboxOutNext { to { opacity: 0; transform: translateX(-48px) scale(0.98); } }
@keyframes lboxOutPrev { to { opacity: 0; transform: translateX(48px) scale(0.98); } }
@keyframes lboxInNext { from { opacity: 0; transform: translateX(48px) scale(0.98); } }
@keyframes lboxInPrev { from { opacity: 0; transform: translateX(-48px) scale(0.98); } }

.lightbox-btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: background 0.2s, border-color 0.2s, opacity 0.28s ease;
}

.lightbox.open .lightbox-btn { opacity: 1; transition-delay: 0.06s; }
.lightbox.open .lightbox-btn:disabled { opacity: 0.35; }

.lightbox-btn:hover { background: rgba(17, 24, 39, 0.78); border-color: rgba(255, 255, 255, 0.7); }
.lightbox-btn:disabled { opacity: 0.35; cursor: default; }
.lightbox-btn:disabled:hover { background: rgba(17, 24, 39, 0.55); border-color: rgba(255, 255, 255, 0.35); }

.lightbox-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
}

.lightbox-arrow {
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.lightbox-arrow svg { display: block; }

html[dir="rtl"] .lightbox-arrow svg { transform: scaleX(-1); }

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

html[dir="rtl"] .lightbox-prev { left: auto; right: 20px; }
html[dir="rtl"] .lightbox-next { right: auto; left: 20px; }
html[dir="rtl"] .lightbox-close { right: auto; left: 24px; }

.lightbox-bar {
  position: relative;
  z-index: 2;
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.open .lightbox-bar { opacity: 1; transition-delay: 0.12s; }

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.lightbox-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 42px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-thumb:hover { opacity: 0.9; }
.lightbox-thumb.active { opacity: 1; border-color: var(--accent); }

.lightbox.open .lightbox-thumb { opacity: 0.6; transition-delay: 0.1s; }
.lightbox.open .lightbox-thumb:hover { opacity: 0.9; }
.lightbox.open .lightbox-thumb.active { opacity: 1; }

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lightbox-toolbar .lightbox-btn {
  position: static;
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.lightbox-zoom-label {
  min-width: 52px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.open .lightbox-zoom-label { opacity: 0.85; transition-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox-stage,
  .lightbox-btn,
  .lightbox-thumb,
  .lightbox-bar,
  .lightbox-zoom-label {
    opacity: 1 !important;
    transition: none !important;
    animation: none !important;
  }
  .lightbox.open .lightbox-btn:disabled { opacity: 0.35 !important; }
}

/* ---------- Contact ---------- */
.contact { text-align: center; }

.contact .title { margin-bottom: 12px; }

.contact .line {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 32px;
  font-size: 17px;
}

.contact .cta-row { justify-content: center; }

.contact-email {
  display: inline-block;
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s;
}

.contact-email:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
  text-align: center;
  background: var(--bg);
}

.footer-text { color: var(--muted); font-size: 14px; }

.footer-note { margin-top: 6px; font-size: 12px; }

.footer-note a { color: var(--muted); opacity: 0.6; }

.footer-note a:hover { color: var(--accent); }

/* ---------- Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal="left"] { transform: translateX(-36px); }
[data-reveal="right"] { transform: translateX(36px); }
[data-reveal="zoom"] { transform: scale(0.92); }
[data-reveal="fade"] { transform: none; }

[data-reveal].in { opacity: 1; transform: none; }

/* ---------- RTL ---------- */
html[dir="rtl"] .experience .timeline { padding-left: 0; padding-right: 28px; }
html[dir="rtl"] .experience .timeline::before { left: auto; right: 7px; }
html[dir="rtl"] .timeline .edu-card::before { left: auto; right: -28px; }
html[dir="rtl"] .edu-card ul li { padding-left: 0; padding-right: 18px; }
html[dir="rtl"] .edu-card ul li::before { left: auto; right: 2px; }
html[dir="rtl"] .featured { border-left: 1px solid var(--line); border-right: 4px solid var(--accent); }
html[dir="rtl"] .hero .wrap { text-align: right; }
html[dir="rtl"] .about .grid { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hamburger { display: flex; }

  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    gap: 0;
    padding: 8px 24px 16px;
    transform: translateY(-120%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, visibility 0.25s, opacity 0.25s;
  }

  .nav-links.open {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link { padding: 12px 0; border-bottom: 1px solid var(--line); }

  .hero .wrap,
  .about .grid { grid-template-columns: 1fr; gap: 32px; }

  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 24px); }

  .hero-photo-wrap { order: -1; margin: 0 auto; }

  .hero::after { width: 320px; height: 320px; inset-inline-end: -100px; }
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}
