:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --navy: #1e1b4b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.28);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 18px;
  --font: "Inter", "Cairo", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: hidden; overflow-x: clip; }
html[dir="rtl"] { --font: "Cairo", "Inter", system-ui, sans-serif; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body:not(.loaded) { overflow: hidden; }
::selection { background: rgba(79, 70, 229, 0.18); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); font-weight: 500; }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 1.1rem/1 "Inter", sans-serif; letter-spacing: -0.2px; color: var(--text);
  white-space: nowrap;
}
.logo-eng {
  display: inline-grid; place-items: center; padding: 6px 9px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 0.78rem; font-weight: 800; letter-spacing: 1px;
  transition: background 0.3s, transform 0.4s var(--ease);
}
.logo-sep { color: var(--accent); font-weight: 800; }
.logo:hover .logo-eng { background: var(--navy); transform: rotate(-4deg); }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: var(--surface);
  transition: transform 0.9s var(--ease) 0.1s, opacity 0.6s ease 0.4s;
}
body.loaded .loader { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.loader-logo { display: flex; align-items: center; gap: 10px; font: 700 1.8rem/1.2 "Inter", sans-serif; overflow: hidden; }
.loader-logo > span { display: inline-block; transform: translateY(120%); animation: loaderIn 0.8s var(--ease) forwards; }
.loader-logo > span:nth-child(2) { animation-delay: 0.1s; }
.loader-logo > span:nth-child(3) { animation-delay: 0.2s; }
.loader-logo .logo-eng { font-size: 1.1rem; padding: 8px 12px; border-radius: 10px; }
.loader-bar { width: 180px; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: var(--primary); transform-origin: left; transform: scaleX(0); animation: loaderBar 1.2s var(--ease) 0.2s forwards; }
@keyframes loaderIn { to { transform: none; } }
@keyframes loaderBar { to { transform: scaleX(1); } }

/* ---------- Global effects ---------- */
.scroll-progress {
  position: fixed; inset: 0 0 auto; height: 3px; z-index: 120;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0); transform-origin: left;
}
html[dir="rtl"] .scroll-progress { transform-origin: right; }

/* Custom cursor */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; border-radius: 50%; display: none; }
.has-cursor .cursor-dot, .has-cursor .cursor-ring { display: block; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--primary); }
.cursor-ring {
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1.5px solid rgba(79, 70, 229, 0.45);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease), background 0.3s, border-color 0.3s, opacity 0.3s;
  align-items: center; justify-content: center;
}
.cursor-hover .cursor-ring { width: 56px; height: 56px; margin: -28px 0 0 -28px; background: rgba(79, 70, 229, 0.08); border-color: var(--primary); }
.cursor-view .cursor-ring { width: 80px; height: 80px; margin: -40px 0 0 -40px; background: rgba(79, 70, 229, 0.9); border-color: transparent; }
.cursor-view .cursor-ring::after { content: "⤢"; font-size: 1.3rem; color: #fff; }
.has-cursor.cursor-view .cursor-ring { display: flex; }
.cursor-down .cursor-ring { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.cursor-hidden .cursor-dot, .cursor-hidden .cursor-ring { opacity: 0; }

/* Language switch transition */
main { overflow-x: clip; }
main, .footer { transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s var(--ease); }
body.switching main, body.switching .footer { opacity: 0; filter: blur(6px); transform: translateY(12px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.9s var(--ease) 0.3s;
}
body.loaded .nav { transform: none; }
.nav.scrolled { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(14px) saturate(160%); border-color: var(--border); box-shadow: var(--shadow-sm); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { position: relative; color: var(--muted); font-weight: 500; font-size: 0.95rem; padding: 4px 0; transition: color 0.25s; }
.nav-links a::after {
  content: ""; position: absolute; inset: auto 0 -3px; height: 2px; border-radius: 2px;
  background: var(--primary); transform: scaleX(0); transition: transform 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-btn {
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: var(--surface); transition: border-color 0.2s, background 0.2s, color 0.2s, translate 0.3s var(--ease);
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.menu-btn span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s var(--ease); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  transition: box-shadow 0.3s, background 0.3s, border-color 0.3s, color 0.3s, translate 0.3s var(--ease);
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px -10px rgba(79, 70, 229, 0.7); }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.3) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform 0.7s var(--ease);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 14px 30px -10px rgba(79, 70, 229, 0.85); }
.btn-primary:hover::before { transform: translateX(120%); }
.btn-arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(5px); }
html[dir="rtl"] .btn-arrow { transform: scaleX(-1); }
html[dir="rtl"] .btn:hover .btn-arrow { transform: scaleX(-1) translateX(5px); }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); background: var(--text); color: #fff; }
.btn-small { padding: 8px 16px; font-size: 0.85rem; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; }
.btn-small:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 110px 0 80px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  mask: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%);
  opacity: 0.6;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 60px; align-items: center; }
.hero-text { will-change: translate, opacity; }

.hero-anim { opacity: 0; }
body.loaded .hero-anim { animation: heroIn 1s var(--ease) var(--d, 0s) both; }
body.loaded .hero-anim-scale { animation-name: heroScale; animation-duration: 1.2s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes heroScale { from { opacity: 0; transform: translateY(40px) scale(0.9); } to { opacity: 1; transform: none; } }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 500; color: #166534;
  border: 1px solid #bbf7d0; background: #f0fdf4;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
}
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.15; margin: 24px 0 16px; font-weight: 800; letter-spacing: -1.5px; color: var(--text); }
html[dir="rtl"] .hero h1 { letter-spacing: 0; line-height: 1.4; }
.hero h1 .muted { display: inline-block; font-size: 0.5em; letter-spacing: 0; }

.hero-name .word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.02em 0.12em; }
.hero-name .word > span { display: inline-block; transform: translateY(115%); color: var(--text); }
.hero-name .word:last-child > span { color: var(--primary); }
body.loaded .hero-name .word > span { animation: wordIn 1s var(--ease) var(--d) both; }
@keyframes wordIn { from { transform: translateY(115%); } to { transform: none; } }

.hero-role { font-size: 1.15rem; color: var(--muted); max-width: 560px; min-height: 3.6em; }
.caret { display: inline-block; width: 2px; height: 1.15em; margin-inline-start: 3px; vertical-align: -0.2em; background: var(--primary); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 44px; }
.stats { display: flex; flex-wrap: wrap; gap: 0; }
.stat { padding-inline: 28px; border-inline-start: 1px solid var(--border); }
.stat:first-child { padding-inline-start: 0; border: 0; }
.stat strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.stat span { color: var(--muted); font-size: 0.88rem; }

/* Hero device slideshow */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 520px; will-change: translate; }
.hero-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.hero-shape-1 { width: 380px; height: 380px; background: var(--primary-soft); border: 1px solid #e0e7ff; animation: breathe 8s ease-in-out infinite; }
.hero-shape-2 {
  width: 120px; height: 120px; background: var(--accent-soft); top: 8%; inset-inline-end: 8%;
  animation: float 6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.06); } }
.hero-device { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.phone.phone-hero { --dir: 1; width: 250px; padding: 8px; background: #0f172a; border-radius: 34px; box-shadow: var(--shadow-lg); }
html[dir="rtl"] .phone.phone-hero { --dir: -1; }
.phone.phone-hero img {
  position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px);
  border-radius: 27px; object-fit: cover;
  opacity: 0; transform: translateX(calc(30px * var(--dir))) scale(0.96);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
}
.phone.phone-hero img.active { opacity: 1; transform: none; z-index: 1; }
.phone.phone-hero img.leaving { opacity: 0; transform: translateX(calc(-30px * var(--dir))) scale(0.96); }
button.phone-hero:hover { transform: translateY(-6px); box-shadow: 0 40px 70px -24px rgba(79, 70, 229, 0.45); }
button.phone-hero:hover img.active { transform: none; }
.hero-caption {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 0.88rem;
}
.hero-caption strong { font-family: "Inter", sans-serif; }
.hero-caption span:last-child { color: var(--muted); font-size: 0.8rem; font-family: "Inter", sans-serif; }
.hero-caption-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero-progress { width: 140px; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.hero-progress i { display: block; height: 100%; background: var(--primary); transform-origin: left; transform: scaleX(0); }
html[dir="rtl"] .hero-progress i { transform-origin: right; }
.hero-visual.paused .hero-progress i { animation-play-state: paused !important; }
@keyframes heroProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.avatar {
  display: grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: var(--primary); font-weight: 800; color: #fff; font-family: "Inter", sans-serif;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap { position: relative; border-radius: 50%; }
.avatar-big { width: 260px; height: 260px; font-size: 4.5rem; border: 8px solid var(--surface); box-shadow: var(--shadow-lg); }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; margin-left: -13px;
  width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 14px;
}
.scroll-hint span { position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--primary); animation: scrollDot 1.8s ease-in-out infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; padding: 20px 0;
  border-block: 1px solid var(--border); background: var(--surface);
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font: 600 1.05rem "Inter", sans-serif; color: var(--muted); white-space: nowrap; transition: color 0.3s; }
.marquee span:hover { color: var(--primary); }
.marquee i { font-style: normal; color: var(--accent); font-size: 0.75rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
#skills, #awards { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 60px; }
.section-title { font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; color: var(--text); }
.section-title::after {
  content: ""; display: block; width: 56px; height: 4px; margin: 14px auto 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary) 60%, var(--accent) 60%);
  transform: scaleX(0); transition: transform 0.9s var(--ease) 0.35s;
}
.visible .section-title::after { transform: scaleX(1); }
.about-grid .section-title::after { margin-inline: 0; transform-origin: left; }
html[dir="rtl"] .about-grid .section-title::after { transform-origin: right; }
.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin-inline: auto; }

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(46px);
  transition: opacity 0.9s var(--ease) var(--d, 0s), transform 0.9s var(--ease) var(--d, 0s);
}
.reveal-left { transform: translateX(-60px); }
.reveal-right { transform: translateX(60px); }
html[dir="rtl"] .reveal-left { transform: translateX(60px); }
html[dir="rtl"] .reveal-right { transform: translateX(-60px); }
.reveal-scale { transform: scale(0.92); }
.reveal.visible { opacity: 1; transform: none; }

/* Mouse spotlight on cards */
[data-spot] { position: relative; isolation: isolate; }
[data-spot]::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(79, 70, 229, 0.07), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
[data-spot]:hover::after { opacity: 1; }
[data-tilt] { transform-style: preserve-3d; will-change: transform; }

.visible .chip { animation: popIn 0.5s var(--ease) backwards; animation-delay: calc(var(--d, 0s) + 0.35s + var(--i) * 0.04s); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; align-items: center; }
.about-text { color: var(--muted); font-size: 1.1rem; }
.about-card { padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; gap: 18px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; }
.info-icon { font-size: 1.1rem; width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; border-radius: 10px; background: var(--primary-soft); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-card {
  padding: 30px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border);
  transition-property: opacity, transform, border-color, box-shadow, background; transition-duration: 0.9s, 0.9s, 0.3s, 0.3s, 0.3s;
}
.skill-card:hover { border-color: #c7d2fe; background: var(--surface); box-shadow: var(--shadow); }
.skill-icon {
  font-size: 1.7rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); margin-bottom: 18px;
  transition: transform 0.5s var(--ease), background 0.3s, border-color 0.3s;
}
.skill-card:hover .skill-icon { transform: rotate(-8deg) scale(1.08); background: var(--primary-soft); border-color: #c7d2fe; }
.skill-card h3 { font-size: 1.15rem; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: #334155;
  font-family: "Inter", sans-serif; transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.chip:hover { background: var(--primary-soft); border-color: #c7d2fe; color: var(--primary); }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 40px; }
.project {
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: center;
  padding: 40px; border-radius: 24px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition-property: opacity, transform, border-color, box-shadow; transition-duration: 0.9s, 0.9s, 0.3s, 0.3s;
}
.project:hover { border-color: #c7d2fe; box-shadow: var(--shadow-lg); }
.project::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 4px; z-index: 1;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease) 0.3s;
}
html[dir="rtl"] .project::before { transform-origin: right; }
.project.visible::before { transform: scaleX(1); }
.project-bg-num {
  position: absolute; bottom: -36px; inset-inline-start: 20px; z-index: -1;
  font: 900 10rem/1 "Inter", sans-serif; color: var(--surface-2); pointer-events: none;
  transition: transform 1.2s var(--ease), color 0.4s; transform: translateY(40px);
}
.project.visible .project-bg-num { transform: none; }
.project:hover .project-bg-num { color: var(--primary-soft); }
.project:nth-child(even) .project-info { order: 2; }
.project-num { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); font-family: "Inter", sans-serif; margin-bottom: 10px; letter-spacing: 1px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--accent-soft); color: #92400e; border: 1px solid #fde68a; }
.project h3 { font-size: 2rem; font-weight: 800; margin: 14px 0 2px; font-family: "Inter", sans-serif; color: var(--text); }
.project-tagline { color: var(--primary); font-weight: 600; margin-bottom: 14px; }
.project-desc { color: var(--muted); margin-bottom: 20px; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.project-links:empty { display: none; }

.project .project-info > * { transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.project:not(.visible) .project-info > * { opacity: 0; transform: translateY(20px); }
.project .project-info > :nth-child(2) { transition-delay: 0.1s; }
.project .project-info > :nth-child(3) { transition-delay: 0.15s; }
.project .project-info > :nth-child(4) { transition-delay: 0.2s; }
.project .project-info > :nth-child(5) { transition-delay: 0.25s; }
.project .project-info > :nth-child(6) { transition-delay: 0.3s; }

.project-gallery { position: relative; min-width: 0; padding: 10px; border-radius: 18px; background: var(--surface-2); }
.shot-count { position: absolute; top: 12px; inset-inline-end: 16px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.gallery-track {
  display: flex; gap: 18px; overflow-x: auto; padding: 30px 8px 16px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.gallery-track::-webkit-scrollbar { height: 6px; }
.gallery-track::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.phone {
  flex: 0 0 auto; width: 180px; aspect-ratio: 9 / 19.5;
  border-radius: 28px; padding: 6px; background: #0f172a;
  box-shadow: 0 20px 40px -18px rgba(15, 23, 42, 0.45);
  scroll-snap-align: start; overflow: hidden; position: relative;
  transition: transform 0.45s var(--ease), box-shadow 0.45s;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 23px; transition: transform 0.6s var(--ease); }
button.phone:hover { transform: translateY(-10px); box-shadow: 0 30px 50px -18px rgba(79, 70, 229, 0.45); }
button.phone:not(.phone-hero):hover img { transform: scale(1.05); }
.project.visible .phone { animation: phoneIn 0.9s var(--ease) backwards; animation-delay: calc(0.3s + var(--i) * 0.1s); }
@keyframes phoneIn { from { opacity: 0; transform: translateY(50px) scale(0.94); } }

.phone-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); border: 2px dashed var(--border-strong); box-shadow: none; color: var(--muted); text-align: center;
}
.phone-empty span { font-size: 2rem; opacity: 0.5; }
.phone-empty small { font-size: 0.75rem; padding: 0 14px; }

@keyframes float { 50% { translate: 0 -12px; } }

/* ---------- Awards ---------- */
.awards { display: grid; gap: 20px; max-width: 860px; margin-inline: auto; }
.award {
  display: flex; gap: 22px; align-items: center; padding: 28px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fffbeb, var(--surface) 70%);
  border: 1px solid #fde68a; box-shadow: var(--shadow);
}
.award-icon {
  position: relative; overflow: hidden;
  font-size: 2.2rem; width: 70px; height: 70px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 18px; background: var(--accent-soft); animation: float 4s ease-in-out infinite;
}
.award-icon::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
  animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.award h3 { font-size: 1.2rem; }
.award-issuer { color: #b45309; font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.award p:last-child { color: var(--muted); }
.award-img { margin-inline-start: auto; width: 140px; flex-shrink: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); transition: transform 0.4s var(--ease); }
.award-img:hover { transform: scale(1.05) rotate(-2deg); }

/* ---------- Contact ---------- */
.contact-card {
  text-align: center; padding: 70px 32px; border-radius: 28px; overflow: hidden;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg);
}
.contact-card::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(500px circle at 0% 0%, rgba(79, 70, 229, 0.55), transparent 60%),
    radial-gradient(400px circle at 100% 100%, rgba(245, 158, 11, 0.25), transparent 60%);
}
.contact-card::after { background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.08), transparent 60%); }
.contact-card .section-title { color: #fff; }
.contact-card .section-title::after { background: var(--accent); }
.contact-card .section-sub { color: #c7d2fe; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 32px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); font-weight: 600; color: #fff;
  transition: border-color 0.3s, background 0.3s, color 0.3s, translate 0.3s var(--ease);
}
.contact-link:hover { background: #fff; color: var(--navy); border-color: #fff; }
.contact-link[data-brand="whatsapp"]:hover { background: #25d366; border-color: #25d366; color: #fff; }
.contact-link[data-brand="instagram"]:hover { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); border-color: transparent; color: #fff; }
.contact-link[data-brand="facebook"]:hover { background: #1877f2; border-color: #1877f2; color: #fff; }
.contact-link[data-brand="linkedin"]:hover { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.contact-link svg { transition: transform 0.4s var(--ease); }
.contact-link:hover svg { transform: scale(1.15) rotate(-8deg); }
.contact-card.visible .contact-link { animation: popIn 0.6s var(--ease) backwards; animation-delay: calc(0.4s + var(--i) * 0.1s); }

/* ---------- Footer ---------- */
.footer { padding: 28px 0; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }

.to-top {
  position: fixed; bottom: 26px; inset-inline-end: 26px; z-index: 40;
  width: 46px; height: 46px; border-radius: 12px; font-size: 1.1rem; font-weight: 700;
  background: var(--primary); color: #fff; box-shadow: 0 10px 24px -8px rgba(79, 70, 229, 0.7);
  opacity: 0; transform: translateY(20px) scale(0.8); pointer-events: none;
  transition: opacity 0.4s, transform 0.4s var(--ease), translate 0.3s var(--ease), background 0.3s;
}
.to-top:hover { background: var(--primary-dark); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 20px;
  background: rgba(15, 23, 42, 0.88); backdrop-filter: blur(10px); color: #fff;
  opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-figure { text-align: center; }
.lb-figure img {
  max-height: 84vh; max-width: 86vw; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.88) translateY(30px); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.4s;
}
.lightbox.open .lb-figure img { transform: none; opacity: 1; }
.lb-figure img.slide-next { animation: slideNext 0.45s var(--ease); }
.lb-figure img.slide-prev { animation: slidePrev 0.45s var(--ease); }
@keyframes slideNext { from { opacity: 0; transform: translateX(70px) scale(0.95); } }
@keyframes slidePrev { from { opacity: 0; transform: translateX(-70px) scale(0.95); } }
.lb-figure figcaption { margin-top: 14px; color: #cbd5e1; font-size: 0.9rem; }
.lb-close, .lb-nav { border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; transition: background 0.25s, transform 0.25s var(--ease); }
.lb-close { position: absolute; top: 20px; inset-inline-end: 24px; font-size: 1.3rem; width: 46px; height: 46px; }
.lb-close:hover { transform: rotate(90deg); }
.lb-nav { font-size: 2.2rem; width: 54px; height: 54px; line-height: 1; flex-shrink: 0; }
.lb-nav:hover, .lb-close:hover { background: var(--primary); }
.lb-nav:hover { transform: scale(1.08); }
html[dir="rtl"] .lb-prev { order: 3; }
html[dir="rtl"] .lb-next { order: -1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner, .about-grid, .project { grid-template-columns: 1fr; }
  .hero-visual { min-height: 480px; order: -1; }
  .hero-shape-1 { width: 300px; height: 300px; }
  .avatar-big { width: 200px; height: 200px; font-size: 3.5rem; }
  .project:nth-child(even) .project-info { order: 0; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .scroll-hint { display: none; }
  .reveal-left, .reveal-right,
  html[dir="rtl"] .reveal-left, html[dir="rtl"] .reveal-right { transform: translateY(40px); }
}

@media (max-width: 720px) {
  .logo { font-size: 0.95rem; }
  .nav-links {
    position: fixed; inset: 72px 0 auto; flex-direction: column; gap: 0; padding: 10px 20px 20px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    clip-path: inset(0 0 100% 0); transition: clip-path 0.5s var(--ease); z-index: -1;
  }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--border); opacity: 0; transform: translateY(-10px); transition: opacity 0.4s, transform 0.4s var(--ease), color 0.25s; }
  .nav-links a::after { display: none; }
  .menu-open .nav-links { clip-path: inset(0 0 0 0); }
  .menu-open .nav-links a { opacity: 1; transform: none; }
  .menu-open .nav-links a:nth-child(2) { transition-delay: 0.05s; }
  .menu-open .nav-links a:nth-child(3) { transition-delay: 0.1s; }
  .menu-open .nav-links a:nth-child(4) { transition-delay: 0.15s; }
  .menu-open .nav-links a:nth-child(5) { transition-delay: 0.2s; }
  .menu-btn { display: flex; }
  .menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-btn span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .skills-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .project { padding: 26px 18px; }
  .project-bg-num { font-size: 6rem; }
  .phone { width: 155px; }
  .phone.phone-hero { width: 220px; }
  .stat { padding-inline: 18px; }
  .award { flex-direction: column; text-align: center; }
  .award-img { margin-inline-start: 0; }
  .lb-nav { position: absolute; bottom: 24px; }
  .lb-prev { inset-inline-start: 30%; }
  .lb-next { inset-inline-end: 30%; }
  .footer-inner { justify-content: center; text-align: center; }
  .to-top { bottom: 18px; inset-inline-end: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
