/* ==========================================================================
   Portfolio site — styles ported 1:1 from the Claude Design prototype,
   plus Arabic typography fixes and a mobile layout.
   ========================================================================== */

:root {
  --bg: #07070a;
  --ink: #ffffff;
  --ink-soft: #f6f7fa;
  --ink-2: #dfe2e8;
  --muted: #a8adba;
  --muted-2: #7d8492;
  --silver: #c6cbd6;

  --font: 'Manrope', sans-serif;
  --display: 'Archivo Black', sans-serif;
  --display-weight: 400;
  --label: 'Manrope', sans-serif;
  --upper: uppercase;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* Arabic: Cairo everywhere, no uppercase, no tracking (tracking breaks letter joins). */
html[lang="ar"] {
  --font: 'Cairo', sans-serif;
  --display: 'Cairo', sans-serif;
  --display-weight: 900;
  --label: 'Cairo', sans-serif;
  --upper: none;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; }
a { color: inherit; }

@keyframes cpGlowA { 0%, 100% { transform: translate(0, 0) scale(1); opacity: .7; } 50% { transform: translate(40px, 30px) scale(1.15); opacity: 1; } }
@keyframes cpGlowB { 0%, 100% { transform: translate(0, 0) scale(1); opacity: .6; } 50% { transform: translate(-30px, -40px) scale(1.1); opacity: .9; } }
@keyframes cpFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blFade { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Background layer (grid + glows) ---------- */

.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.glow { position: absolute; border-radius: 50%; }
.glow-a { width: 560px; height: 560px; top: -160px; left: -120px; background: radial-gradient(circle, rgba(255,255,255,0.05), transparent 70%); filter: blur(50px); animation: cpGlowA 14s ease-in-out infinite; }
.glow-b { width: 480px; height: 480px; bottom: -160px; right: -100px; background: radial-gradient(circle, rgba(255,255,255,0.04), transparent 70%); filter: blur(50px); animation: cpGlowB 17s ease-in-out infinite; }
.glow-c { width: 420px; height: 420px; top: 35%; left: 50%; background: radial-gradient(circle, rgba(255,255,255,0.03), transparent 70%); filter: blur(60px); animation: cpGlowA 20s ease-in-out infinite reverse; }

.page-content { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.page-content > .site-footer { margin-top: auto; }

/* ---------- Navigation ---------- */

.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 2.7%;
  background: rgba(7,7,10,0.72);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-family: var(--font);
}

.nav-logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; white-space: nowrap;
  font-family: var(--display); font-weight: var(--display-weight);
  font-size: 19px; letter-spacing: 0.12em;
  transition: opacity .4s ease;
}
.nav-logo:hover { opacity: .75; }
.nav-logo img { height: 40px; width: auto; max-width: 160px; object-fit: contain; display: block; }

.nav-links { display: flex; align-items: center; gap: 34px; flex: 1; justify-content: flex-start; margin-inline-start: 44px; }
.nav-links a {
  display: inline-block;
  color: rgba(255,255,255,0.55); text-decoration: none;
  font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: var(--upper);
  border-bottom: 1px solid transparent; padding-bottom: 6px;
  transition: color .3s ease, transform .3s var(--ease-out), border-color .3s ease;
}
html[lang="ar"] .nav-links a { font-size: 14px; letter-spacing: 0.04em; }
.nav-links a.is-active { color: #fff; border-bottom-color: #fff; }
.nav-links a:hover { color: #fff; transform: translateY(-2px); border-bottom: 2px solid #fff; }

.lang-btn {
  background: transparent; border: 1px solid rgba(255,255,255,0.22); color: rgba(255,255,255,0.7);
  font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  padding: 8px 13px; border-radius: 2px; cursor: pointer; text-decoration: none;
  transition: all .3s var(--ease-out);
}
.lang-btn:hover { border-color: #fff; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,255,255,0.18); }

.nav-toggle { display: none; }

/* ---------- Shared bits ---------- */

.kicker {
  color: var(--muted); font-family: var(--label); font-weight: 600;
  font-size: 11px; letter-spacing: 0.3em; text-transform: var(--upper); margin-bottom: 16px;
}
.back-link {
  display: inline-block; color: rgba(255,255,255,0.65); text-decoration: none;
  font-family: var(--label); font-weight: 600; font-size: 11px; letter-spacing: 0.22em;
  text-transform: var(--upper); margin-bottom: 26px; transition: color .3s ease;
}
.back-link:hover { color: #fff; }
.back-link--bright { color: #fff; font-weight: 400; font-size: 12px; letter-spacing: 1px; margin-bottom: 28px; }

html[lang="ar"] .kicker,
html[lang="ar"] .back-link,
html[lang="ar"] .stat-label,
html[lang="ar"] .contact-card-label,
html[lang="ar"] .project-tag,
html[lang="ar"] .home-kicker,
html[lang="ar"] .home-cta,
html[lang="ar"] .section-title,
html[lang="ar"] .nav-logo,
html[lang="ar"] .footer-brand-title { letter-spacing: 0; }
html[lang="ar"] .kicker,
html[lang="ar"] .back-link,
html[lang="ar"] .contact-card-label { font-size: 13px; }
html[lang="ar"] .stat-label { font-size: 12px; }

/* ---------- Home ---------- */

.page-home { overflow: hidden; }
.page-home .site-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }

.home-stage {
  position: relative; width: 100%; height: 100vh; height: 100svh; min-height: 520px;
  container-type: size; background: var(--bg); overflow: hidden;
}
.home-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,7,10,0.88) 0%, rgba(7,7,10,0.55) 38%, rgba(7,7,10,0.12) 62%, rgba(7,7,10,0.35) 100%); }
.home-shade-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(0deg, rgba(7,7,10,0.85), transparent); }

.home-social {
  position: absolute; inset-inline-end: 4%; top: 36%; z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: max(14px, 1.6cqw);
}
.home-social a {
  display: block; width: clamp(16px, 1.25cqw, 22px); height: clamp(16px, 1.25cqw, 22px);
  color: #d3d7e0; opacity: .8; transition: opacity .3s ease; text-decoration: none;
}
.home-social a svg { width: 100%; height: 100%; display: block; }
.home-social a.is-text {
  width: auto; height: auto;
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: clamp(13px, 1.15cqw, 20px); line-height: 1;
}
.home-social a:hover { opacity: 1; }
.home-social-rule { width: 1px; height: max(34px, 3.4cqw); background: rgba(255,255,255,0.28); }

.home-hero {
  position: absolute; left: 0; right: 0; bottom: 6%; z-index: 4;
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px;
  animation: blFade 1.1s ease .05s both;
}
.home-kicker {
  color: #cfd3dc; font-family: var(--label); font-weight: 600;
  font-size: clamp(11px, 1.05cqw, 17px); letter-spacing: 0.34em; text-transform: var(--upper);
  margin-bottom: 1.5cqw;
}
.home-title {
  color: #fff; font-family: var(--display); font-weight: var(--display-weight);
  font-size: clamp(28px, 4.6cqw, 78px); line-height: 0.98; margin: 0 0 max(18px, 2cqw);
  letter-spacing: -0.01em; text-transform: var(--upper);
}
html[lang="ar"] .home-title { letter-spacing: 0; line-height: 1.2; }
.home-cta {
  display: inline-block; padding: max(10px, 1cqw) max(18px, 1.8cqw);
  border: 1px solid rgba(255,255,255,0.38); color: #e8ebf2; text-decoration: none;
  font-family: var(--label); font-weight: 600; font-size: clamp(12px, 0.95cqw, 15px);
  letter-spacing: 0.16em; text-transform: var(--upper);
  transition: border-color .3s ease, color .3s ease;
}
.home-cta:hover { border-color: rgba(255,255,255,0.85); color: #fff; }

/* ---------- Portfolio ---------- */

.portfolio-header { max-width: 1200px; margin: 0 auto; padding: 64px 36px 24px; text-align: center; width: 100%; }
.portfolio-kicker {
  margin: 0; color: var(--ink-soft); font-family: var(--display); font-weight: var(--display-weight);
  text-transform: var(--upper); font-size: clamp(46px, 11vw, 132px); letter-spacing: -0.01em; line-height: 1;
}
html[lang="ar"] .portfolio-kicker { letter-spacing: 2px; line-height: 1.25; }

.portfolio-tabs { max-width: 1200px; margin: 0 auto; padding: 0 36px 40px; width: 100%; }
.cat-row {
  display: flex; gap: 6px; height: 360px; border-radius: 3px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
}
.cat-card {
  position: relative; height: 100%; flex: 1 1 0%; min-width: 0; overflow: hidden; display: block;
  background: #0b0b0e; text-decoration: none;
  transition: flex-grow .9s cubic-bezier(.16, .7, .24, 1);
}
.cat-card:hover, .cat-card:focus-visible { flex-grow: 3.4; }
.cat-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.85) brightness(0.75); transition: filter .9s ease;
}
.cat-card:hover img, .cat-card:focus-visible img { filter: grayscale(0) brightness(1); }
.cat-card-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,8,9,0.85) 0%, rgba(8,8,9,0.1) 55%, rgba(8,8,9,0.3) 100%); }
.cat-card-text { position: absolute; inset-inline: 0; bottom: 0; padding: 18px 22px; white-space: nowrap; overflow: hidden; }
.cat-card-title {
  display: inline-block; color: var(--ink-soft); font-family: var(--display); font-weight: var(--display-weight);
  text-transform: var(--upper); font-size: 20px; margin: 0 0 6px;
  background: rgba(10,10,12,0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 8px 14px; border-radius: 3px;
}

/* ---------- Category ---------- */

.page-header { max-width: 1200px; margin: 0 auto; padding: 56px 36px 24px; width: 100%; }
.page-title {
  color: var(--ink-soft); font-family: var(--display); font-weight: var(--display-weight);
  text-transform: var(--upper); font-size: clamp(32px, 5vw, 62px); letter-spacing: -0.01em; margin: 0; line-height: 1.02;
}
html[lang="ar"] .page-title { letter-spacing: 0; line-height: 1.3; }

.grid-section { max-width: 1200px; margin: 0 auto; padding: 24px 36px 90px; width: 100%; }
.masonry { column-count: 4; column-gap: 16px; }
.masonry-cell { break-inside: avoid; margin-bottom: 16px; animation: cpFadeIn .5s ease both; }
.masonry-item {
  position: relative; display: block; overflow: hidden; border-radius: 3px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08); background: #0b0b0e; text-decoration: none;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.masonry-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.masonry-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
  background: linear-gradient(0deg, rgba(10,10,11,0.92), transparent 60%);
  opacity: 0; transition: opacity .3s ease;
}
.masonry-caption { color: var(--ink-soft); font-family: var(--font); font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.masonry-item:hover, .masonry-item:focus-visible { border-color: #fff; transform: translateY(-6px); box-shadow: 0 16px 34px rgba(0,0,0,0.5); }
.masonry-item:hover .masonry-overlay, .masonry-item:focus-visible .masonry-overlay { opacity: 1; }
.empty-note { color: var(--muted-2); font-family: var(--font); font-size: 15px; padding: 20px 0; text-align: center; }

/* ---------- Project ---------- */

.project-header { max-width: 900px; margin: 0 auto; padding: 56px 36px 40px; width: 100%; }
.project-tag { color: var(--muted); font-family: var(--label); font-size: 13px; letter-spacing: 3px; margin-bottom: 14px; }
.project-title {
  color: var(--ink-soft); font-family: var(--display); font-weight: var(--display-weight);
  text-transform: var(--upper); font-size: clamp(30px, 5vw, 54px); margin: 0 0 22px; line-height: 1.05;
}
html[lang="ar"] .project-title { line-height: 1.3; }
.project-desc { color: #9aa2b8; font-family: var(--font); font-size: 17px; line-height: 1.8; max-width: 700px; margin: 0; }

.gallery { max-width: 1100px; margin: 0 auto; padding: 0 36px 100px; display: flex; flex-direction: column; gap: 16px; width: 100%; }
.gallery-hero {
  position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 3px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.03);
}
.gallery-hero > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,20,23,0.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.22); color: var(--ink-soft); font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--font);
  transition: background .3s ease, border-color .3s ease;
}
.gallery-arrow:hover { background: rgba(40,40,45,0.75); border-color: rgba(255,255,255,0.5); }
.gallery-prev { inset-inline-start: 14px; }
.gallery-next { inset-inline-end: 14px; }
.gallery-counter {
  position: absolute; bottom: 14px; inset-inline-end: 14px;
  background: rgba(20,20,23,0.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18); color: var(--ink-soft);
  font-family: 'Manrope', sans-serif; font-size: 12px; padding: 6px 12px; border-radius: 999px;
}
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumb {
  width: 86px; height: 64px; border-radius: 3px; overflow: hidden; padding: 0; cursor: pointer; background: transparent;
  border: 2px solid rgba(255,255,255,0.14); opacity: .65; transition: all .2s ease;
}
.gallery-thumb.is-active { border-color: #fff; opacity: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.not-found { max-width: 900px; margin: 0 auto; padding: 100px 36px; text-align: center; width: 100%; }
.not-found-text { color: var(--muted-2); font-family: var(--font); font-size: 18px; margin-bottom: 20px; }

/* ---------- About ---------- */

.about-hero {
  max-width: 1200px; margin: 0 auto; padding: 72px 36px; width: 100%;
  display: grid; grid-template-columns: 340px 1fr; gap: 56px; align-items: center;
}
.about-photo { position: relative; width: 100%; aspect-ratio: 3 / 4; transition: filter .4s ease; }
.about-photo:hover { filter: brightness(1.05); }
.about-photo img, .about-photo-empty { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; }
.about-photo-empty { background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.2); }
.frame-corner { position: absolute; width: 32px; height: 32px; pointer-events: none; transition: all .4s ease; }
.frame-corner--start { top: -8px; inset-inline-start: -8px; border-top: 2px solid #fff; border-inline-start: 2px solid #fff; }
.frame-corner--end { bottom: -8px; inset-inline-end: -8px; border-bottom: 2px solid var(--muted); border-inline-end: 2px solid var(--muted); }
.about-photo:hover .frame-corner--start { top: -12px; inset-inline-start: -12px; }
.about-photo:hover .frame-corner--end { bottom: -12px; inset-inline-end: -12px; }

.about-name {
  color: #fff; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--upper);
  letter-spacing: -0.01em; font-size: clamp(30px, 4.5vw, 52px); margin: 0 0 22px; line-height: 1.02;
}
html[lang="ar"] .about-name { letter-spacing: 0; line-height: 1.3; }
.about-text { color: var(--muted); font-family: var(--font); font-size: 17px; line-height: 1.8; margin: 0 0 32px; }

.stats-row { display: flex; gap: 32px; flex-wrap: wrap; }
.stat-box {
  background: rgba(255,255,255,0.03); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 3px; padding: 14px 16px;
  transition: transform .35s var(--ease-out), box-shadow .35s ease, background .35s ease;
}
.stat-box:hover { transform: translateY(-4px); background: rgba(255,255,255,0.06); box-shadow: 0 14px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.22); }
.stat-num { color: #fff; font-family: var(--display); font-weight: var(--display-weight); font-size: 30px; }
.stat-label { color: var(--muted-2); font-family: var(--font); font-size: 11px; letter-spacing: 0.2em; text-transform: var(--upper); margin-top: 6px; }

.tools-section { max-width: 1200px; margin: 0 auto; padding: 0 36px 90px; width: 100%; }
.section-title {
  color: #fff; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--upper);
  font-size: 24px; letter-spacing: 0.02em; margin: 0 0 30px;
}
.tools-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.tool-chip {
  border: 1px solid rgba(255,255,255,0.16); color: var(--ink-2); background: rgba(255,255,255,0.04);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 0.16em;
  padding: 12px 20px; border-radius: 3px;
  transition: transform .3s var(--ease-out), box-shadow .3s ease, background .3s ease;
}
.tool-chip:hover { transform: translateY(-3px); background: rgba(255,255,255,0.08); box-shadow: 0 10px 22px rgba(255,255,255,0.27); }

/* ---------- Contact ---------- */

.contact-hero { max-width: 1200px; margin: 0 auto; padding: 72px 36px 24px; width: 100%; }
.contact-title {
  color: #fff; font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--upper);
  letter-spacing: -0.01em; font-size: clamp(30px, 4.5vw, 54px); margin: 0 0 18px; line-height: 1.02;
}
html[lang="ar"] .contact-title { letter-spacing: 0; line-height: 1.3; }
.contact-subtitle { color: var(--muted); font-family: var(--font); font-size: 17px; max-width: 560px; line-height: 1.6; margin: 0; }

.contact-grid {
  max-width: 1200px; margin: 0 auto; padding: 24px 36px 100px; width: 100%;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.contact-card {
  position: relative; display: block;
  background: rgba(255,255,255,0.03); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 3px; padding: 28px 24px; text-decoration: none;
  transition: transform .3s var(--ease-out), background .3s ease, border-color .3s ease;
}
a.contact-card:hover { transform: translateY(-3px); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.4); }
.contact-card-label {
  color: var(--muted-2); font-family: var(--label); font-weight: 600; font-size: 10px;
  letter-spacing: 0.24em; text-transform: var(--upper); margin-bottom: 12px;
}
.contact-card-value { color: #fff; font-family: var(--font); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.contact-card-value--muted { color: var(--ink-2); font-weight: 400; font-size: 16px; }
.contact-card-arrow { position: absolute; top: 24px; inset-inline-end: 24px; color: var(--muted); font-size: 16px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg); border-top: 1px solid rgba(255,255,255,0.08);
  padding: 52px 2.7% 26px; font-family: var(--font);
}
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 24px; max-width: 1200px; margin: 0 auto 32px; }
.footer-brand { max-width: 420px; }
.footer-brand-title { font-family: var(--display); font-weight: var(--display-weight); color: #fff; font-size: 17px; letter-spacing: 0.14em; margin-bottom: 10px; }
.footer-brand-sub { color: var(--muted); font-size: 14px; line-height: 1.6; }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social a {
  min-width: 44px; height: 44px; border-radius: 2px; border: 1px solid rgba(255,255,255,0.16);
  background: transparent; padding: 0 12px; display: flex; align-items: center; justify-content: center;
  color: var(--silver); text-decoration: none;
  font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  transition: border-color .35s ease, color .35s ease;
}
.footer-social a:hover { border-color: rgba(255,255,255,0.7); color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  max-width: 1200px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px;
}
.footer-copy { color: var(--muted-2); font-size: 13px; }

/* ---------- Focus ---------- */

a:focus-visible, button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Touch devices: no hover, so show the "hovered" look ---------- */

@media (hover: none) {
  .cat-card img { filter: grayscale(0) brightness(0.9); }
  .masonry-overlay { opacity: 1; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1000px) {
  .masonry { column-count: 3; }
  .about-hero { grid-template-columns: 280px 1fr; gap: 40px; }
}

/* ---------- Mobile ---------- */

@media (max-width: 820px) {
  .site-nav { padding: 16px 20px; gap: 12px; }
  .nav-logo img { height: 34px; }
  .lang-btn { margin-inline-start: auto; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 40px; height: 36px; padding: 0 9px; background: transparent; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.22); border-radius: 2px;
  }
  .nav-toggle span { display: block; height: 1px; background: #fff; transition: transform .3s ease; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(7,7,10,0.96); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 8px 20px 16px;
    display: none;
  }
  .site-nav.is-open .nav-links { display: flex; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13px; }
  html[lang="ar"] .nav-links a { font-size: 16px; }
  .nav-links a.is-active { border-bottom-color: rgba(255,255,255,0.06); }
  .nav-links a:hover { transform: none; border-bottom: 1px solid rgba(255,255,255,0.06); }

  .home-social { top: auto; bottom: calc(6% + 70px); }

  .portfolio-header, .portfolio-tabs, .page-header, .grid-section, .project-header,
  .gallery, .not-found, .about-hero, .tools-section, .contact-hero, .contact-grid { padding-left: 20px; padding-right: 20px; }
  .portfolio-header { padding-top: 40px; }
  .cat-row { flex-direction: column; height: auto; }
  .cat-card { flex: none; height: 200px; }
  .cat-card:hover, .cat-card:focus-visible { flex-grow: 0; }

  .masonry { column-count: 2; column-gap: 12px; }
  .masonry-cell { margin-bottom: 12px; }
  .masonry-item { height: auto !important; aspect-ratio: 3 / 4; }

  .about-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 48px; }
  .about-photo { max-width: 320px; margin: 0 auto; }
  .stats-row { gap: 12px; }
  .stat-box { flex: 1 1 90px; }

  .page-header, .project-header, .contact-hero { padding-top: 40px; }
  .gallery-arrow { width: 38px; height: 38px; font-size: 20px; }
  .gallery-thumb { width: 70px; height: 52px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .masonry { column-count: 1; }
  .masonry-item { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
