:root {
  --bg: #07111f;
  --bg-soft: #0b1727;
  --surface: rgba(17, 33, 52, .78);
  --surface-solid: #102039;
  --surface-2: #142842;
  --text: #eef6ff;
  --muted: #99a9bd;
  --line: rgba(174, 205, 236, .14);
  --line-strong: rgba(174, 205, 236, .26);
  --accent: #4ee6a8;
  --accent-2: #5aa8ff;
  --accent-3: #9e79ff;
  --danger: #ff7a8b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  --radius: 22px;
  --radius-sm: 14px;
  --container: 1180px;
  --header-h: 78px;
}

html[data-theme="light"] {
  --bg: #f4f8fc;
  --bg-soft: #edf3f8;
  --surface: rgba(255,255,255,.84);
  --surface-solid: #ffffff;
  --surface-2: #e8f0f8;
  --text: #101d2f;
  --muted: #5f7188;
  --line: rgba(20, 49, 78, .12);
  --line-strong: rgba(20, 49, 78, .22);
  --shadow: 0 24px 70px rgba(37, 73, 107, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 18px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.75;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: "Segoe UI", Arial, Tahoma, sans-serif; line-height: 1.65; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { color: #06121d; background: var(--accent); }

.skip-link {
  position: fixed; top: 12px; inset-inline-start: 12px; z-index: 9999;
  transform: translateY(-150%); background: var(--accent); color: #07111f;
  padding: 10px 16px; border-radius: 10px; font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }
.page-noise {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .17;
  background-image: radial-gradient(rgba(255,255,255,.11) .6px, transparent .6px);
  background-size: 5px 5px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.section { padding: 112px 0; position: relative; }
.section-muted { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-dark { background: #050d18; color: #f1f7ff; }
html[data-theme="light"] .section-dark { background: #0a1728; }
.two-column { display: grid; grid-template-columns: .85fr 1.35fr; gap: 76px; align-items: start; }

.site-header {
  height: var(--header-h); position: fixed; inset: 0 0 auto; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px); border-bottom: 1px solid transparent; transition: .3s ease;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.12); }
.nav-shell { height: 100%; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; direction: ltr; }
.brand-mark { width: 38px; height: 38px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); }
.brand-mark i { display: block; border-radius: 3px; background: var(--surface-2); position: relative; }
.brand-mark i::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); right: 2px; bottom: 2px; box-shadow: 0 0 8px var(--accent); }
.brand-mark i:nth-child(2)::after, .brand-mark i:nth-child(3)::after { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-family: "Segoe UI", Arial, sans-serif; font-size: .98rem; letter-spacing: -.02em; }
.brand-copy small { color: var(--muted); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.main-nav { margin-inline: auto; display: flex; align-items: center; gap: 28px; }
.main-nav a { color: var(--muted); font-size: .87rem; font-weight: 600; position: relative; transition: color .2s; }
.main-nav a::after { content: ""; position: absolute; inset: auto 0 -8px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .25s; transform-origin: center; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn, .text-btn { border: 1px solid var(--line); color: var(--text); background: var(--surface); cursor: pointer; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; }
.text-btn { height: 42px; min-width: 46px; border-radius: 12px; padding: 0 12px; font-size: .78rem; font-weight: 800; }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="dark"] .theme-toggle .moon, html[data-theme="light"] .theme-toggle .sun { display: none; }
.menu-toggle { display: none; padding: 10px; }
.menu-toggle span { display: block; width: 19px; height: 2px; background: currentColor; margin: 3px 0; transition: .25s; }

.btn { min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-weight: 700; transition: transform .2s, border-color .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #06131e; background: linear-gradient(135deg, var(--accent), #77f3c4); box-shadow: 0 10px 30px rgba(78, 230, 168, .16); }
.btn-ghost, .btn-outline { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-small { min-height: 42px; padding-inline: 15px; font-size: .8rem; }

.hero { padding-top: calc(var(--header-h) + 78px); min-height: 100vh; display: grid; align-content: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; width: 720px; height: 720px; border-radius: 50%; inset: -250px -210px auto auto; background: radial-gradient(circle, rgba(90,168,255,.18), transparent 66%); pointer-events: none; }
.hero::after { content: ""; position: absolute; width: 540px; height: 540px; border-radius: 50%; inset: auto auto -280px -180px; background: radial-gradient(circle, rgba(78,230,168,.12), transparent 66%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.02fr; gap: 76px; align-items: center; position: relative; z-index: 2; }
.eyebrow, .section-kicker { font-family: "Segoe UI", Arial, sans-serif; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; font-size: .72rem; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; background: var(--surface); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(78,230,168,.09), 0 0 12px var(--accent); animation: pulse 2s infinite; }
.hero h1 { margin: 24px 0 20px; font-size: clamp(3rem, 6vw, 6.3rem); line-height: 1.02; letter-spacing: -.065em; max-width: 760px; }
html[lang="ar"] .hero h1 { letter-spacing: -.045em; }
.hero h1 span, .hero h1 em { display: block; }
.hero h1 em { font-style: normal; color: transparent; background: linear-gradient(95deg, var(--accent), var(--accent-2) 68%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; }
.hero-lead { color: var(--muted); max-width: 650px; font-size: 1.06rem; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.hero-meta span, .tag-list span { border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 6px 10px; border-radius: 999px; font-family: "Segoe UI", Arial, sans-serif; font-size: .7rem; }
.hero-visual { position: relative; }
.rack-card { border: 1px solid var(--line-strong); border-radius: 25px; background: linear-gradient(145deg, var(--surface-solid), color-mix(in srgb, var(--surface-solid) 78%, #000)); padding: 14px; box-shadow: var(--shadow); transform: perspective(1200px) rotateY(-3deg) rotateX(1deg); direction: ltr; }
html[dir="ltr"] .rack-card { transform: perspective(1200px) rotateY(3deg) rotateX(1deg); }
.rack-topbar { display: flex; justify-content: space-between; align-items: center; padding: 1px 4px 12px; color: var(--muted); font: 600 .66rem/1 "Segoe UI", Arial, sans-serif; letter-spacing: .1em; }
.rack-topbar > div { display: flex; gap: 5px; }
.rack-topbar > div span { width: 7px; height: 7px; border-radius: 50%; background: #ff6b75; }
.rack-topbar > div span:nth-child(2) { background: #ffc35c; }.rack-topbar > div span:nth-child(3) { background: var(--accent); }
.rack-topbar p { margin: 0; }
.rack-photo { height: 390px; overflow: hidden; border-radius: 16px; position: relative; border: 1px solid var(--line); background: #07111f; }
.rack-photo img { width: 100%; height: 100%; object-fit: cover; }
.rack-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,10,18,.6), transparent 48%); }
.scan-line { position: absolute; left: 0; right: 0; height: 1px; z-index: 2; background: var(--accent); box-shadow: 0 0 15px var(--accent); animation: scan 4s linear infinite; opacity: .6; }
.photo-badge { position: absolute; left: 18px; bottom: 18px; z-index: 3; background: rgba(4,13,24,.82); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px 13px 10px 36px; min-width: 150px; }
.photo-badge span { position: absolute; left: 13px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.photo-badge strong, .photo-badge small { display: block; }.photo-badge strong { color: #fff; font-size: .78rem; }.photo-badge small { color: #a7b5c6; font-size: .65rem; }
.switch-unit { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 15px; background: rgba(2,8,15,.28); }
.switch-label span, .switch-label small { display: block; font-family: "Segoe UI", Arial, sans-serif; }.switch-label span { font-size: .68rem; font-weight: 700; color: var(--text); }.switch-label small { color: var(--muted); font-size: .5rem; margin-top: 2px; }
.ports { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.ports i { aspect-ratio: 1.18; background: #040a12; border: 1px solid rgba(255,255,255,.13); border-radius: 2px; position: relative; }
.ports i::after { content: ""; position: absolute; width: 3px; height: 3px; border-radius: 50%; bottom: -5px; left: 50%; translate: -50%; background: #35445a; }
.ports i.on::after { background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: blink 2s infinite alternate; }
.floating-chip { position: absolute; z-index: 4; padding: 12px 15px; border-radius: 15px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow); min-width: 120px; }
.floating-chip span, .floating-chip small { display: block; }.floating-chip span { font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--accent); }.floating-chip small { color: var(--muted); font-size: .7rem; }
.chip-one { left: -38px; bottom: 82px; }.chip-two { right: -24px; top: 64px; }
.stats-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 76px; position: relative; z-index: 2; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stats-strip article { padding: 23px 26px; display: flex; align-items: baseline; gap: 12px; border-inline-end: 1px solid var(--line); }
.stats-strip article:last-child { border: 0; }
.stats-strip strong { font-family: "Segoe UI", Arial, sans-serif; font-size: 1.75rem; color: var(--accent); }.stats-strip span { color: var(--muted); font-size: .82rem; }

.section-heading { max-width: 690px; }
.section-kicker { color: var(--accent); display: inline-block; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4.3vw, 4.25rem); letter-spacing: -.055em; line-height: 1.13; }
html[lang="ar"] .section-heading h2 { letter-spacing: -.035em; }
.section-heading > p, .heading-row > p { color: var(--muted); font-size: 1rem; margin: 22px 0 0; }
.heading-row { max-width: none; display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 50px; }
.heading-row > div { max-width: 740px; }.heading-row > p { max-width: 300px; margin: 0 0 8px; }
.about-grid > .section-heading { position: sticky; top: calc(var(--header-h) + 28px); }
.about-panel { display: grid; grid-template-columns: .62fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.about-photo { min-height: 510px; position: relative; background: #dce4eb; overflow: hidden; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; filter: saturate(.85); }
.about-photo::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.photo-corner { position: absolute; inset: 18px 18px auto auto; width: 44px; height: 44px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.about-content { padding: 42px; align-self: center; }
.about-content > p { color: var(--muted); margin: 0; }
.quick-facts { margin: 30px 0; display: grid; gap: 0; }
.quick-facts > div { border-top: 1px solid var(--line); padding: 14px 0; display: grid; grid-template-columns: 110px 1fr; gap: 15px; }
.quick-facts > div:last-child { border-bottom: 1px solid var(--line); }
.quick-facts dt { color: var(--muted); font-size: .77rem; }.quick-facts dd { margin: 0; font-weight: 600; font-size: .84rem; }
.text-link { color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }

.service-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.service-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; background: var(--surface); position: relative; overflow: hidden; transition: transform .25s, border-color .25s, background .25s; }
.service-card::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; left: -120px; bottom: -120px; background: radial-gradient(circle, rgba(78,230,168,.16), transparent 68%); transition: .3s; }
.service-card:hover { transform: translateY(-5px); border-color: rgba(78,230,168,.32); background: color-mix(in srgb, var(--surface-solid) 84%, var(--accent) 3%); }
.service-card:hover::after { left: -80px; bottom: -80px; }
.service-number { position: absolute; inset: 24px auto auto 28px; font: 700 .7rem/1 "Segoe UI",Arial,sans-serif; color: var(--muted); }
html[dir="ltr"] .service-number { left: auto; right: 28px; }
.service-icon { width: 54px; height: 54px; border-radius: 15px; background: rgba(78,230,168,.08); color: var(--accent); display: grid; place-items: center; margin-bottom: 28px; border: 1px solid rgba(78,230,168,.14); }
.service-icon svg { width: 27px; height: 27px; }
.service-card h3 { margin: 0 0 10px; font-size: 1.35rem; }.service-card p { color: var(--muted); margin: 0 0 22px; }
.service-card ul { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-family: "Segoe UI", Arial, sans-serif; font-size: .72rem; }
.service-card li::before { content: "+"; color: var(--accent); margin-inline-end: 6px; }

.experience-layout { display: grid; grid-template-columns: .78fr 1.25fr; gap: 90px; align-items: start; }
.sticky-heading { position: sticky; top: calc(var(--header-h) + 28px); }
.section-dark .section-heading > p { color: #90a1b6; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 12px; bottom: 22px; inset-inline-start: 8px; width: 1px; background: rgba(255,255,255,.14); }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 25px; padding-bottom: 26px; position: relative; }
.timeline-marker { padding-top: 28px; z-index: 2; }.timeline-marker span { display: block; width: 17px; height: 17px; border-radius: 50%; background: #07111f; border: 4px solid var(--accent); box-shadow: 0 0 0 5px rgba(78,230,168,.08); }
.timeline-card { border: 1px solid rgba(255,255,255,.11); background: rgba(255,255,255,.045); border-radius: var(--radius); padding: 30px; }
.timeline-head { display: flex; justify-content: space-between; gap: 25px; align-items: start; margin-bottom: 18px; }
.timeline-head p { color: var(--accent); font-family: "Segoe UI", Arial, sans-serif; font-size: .75rem; margin: 0 0 4px; }.timeline-head h3 { margin: 0; font-size: 1.22rem; }.timeline-head time { color: #8da0b8; font-family: "Segoe UI", Arial, sans-serif; font-size: .72rem; white-space: nowrap; padding-top: 5px; }
.timeline-card > p { color: #9bacc0; margin: 0 0 18px; }
.timeline-card .tag-list span { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: #aab8c8; }

.project-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -20px 0 34px; }
.filter-btn { border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; background: var(--surface); color: var(--muted); cursor: pointer; font-weight: 700; font-size: .78rem; transition: .2s; }
.filter-btn:hover, .filter-btn.active { color: #06131e; background: var(--accent); border-color: var(--accent); }
.project-grid { display: grid; grid-template-columns: repeat(12,1fr); gap: 18px; }
.project-card { grid-column: span 6; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .25s, border-color .25s; outline: none; }
.project-card:hover, .project-card:focus-visible { transform: translateY(-5px); border-color: rgba(78,230,168,.4); }
.project-card.is-hidden { display: none; }
.project-card.project-large { grid-column: span 7; }.project-card.project-large + .project-card { grid-column: span 5; }.project-card.project-wide { grid-column: span 12; }
.project-image { height: 330px; overflow: hidden; position: relative; background: var(--surface-2); }
.project-wide .project-image { height: 420px; }.project-large .project-image { height: 430px; }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1), filter .4s; }
.project-card:hover .project-image img { transform: scale(1.045); filter: saturate(1.08); }
.project-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,9,17,.35), transparent 45%); pointer-events: none; }
.project-index { position: absolute; z-index: 2; top: 15px; inset-inline-end: 15px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(3,11,20,.68); color: white; border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); font: 700 .7rem/1 "Segoe UI", Arial, sans-serif; }
.project-info { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; }
.project-info p { margin: 0 0 4px; color: var(--accent); font: 700 .68rem/1.2 "Segoe UI", Arial, sans-serif; text-transform: uppercase; letter-spacing: .08em; }.project-info h3 { margin: 0; font-size: 1.22rem; }
.round-arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; flex: 0 0 auto; transition: .2s; }.project-card:hover .round-arrow { background: var(--accent); color: #06131e; border-color: var(--accent); transform: rotate(45deg); }

.tech-cloud { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 42px; }
.tech-cloud span { border: 1px solid var(--line); background: var(--surface); border-radius: 13px; padding: 13px 17px; color: var(--muted); font-family: "Segoe UI", Arial, sans-serif; font-size: .78rem; transition: .2s; }
.tech-cloud span:hover { color: var(--text); border-color: rgba(78,230,168,.34); transform: translateY(-2px); }

.contact-section { overflow: hidden; }
.contact-section::before { content: ""; position: absolute; width: 650px; height: 650px; right: -320px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(90,168,255,.13), transparent 65%); pointer-events: none; }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: start; }
.contact-copy h2 { font-size: clamp(2.4rem, 4.7vw, 4.9rem); line-height: 1.08; letter-spacing: -.06em; margin: 0 0 24px; }
.contact-copy > p { color: var(--muted); max-width: 560px; }
.contact-links { margin-top: 34px; border-top: 1px solid var(--line); }
.contact-links a { display: grid; grid-template-columns: 95px 1fr 24px; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-links small { color: var(--muted); }.contact-links strong { font-family: "Segoe UI", Arial, sans-serif; font-size: .87rem; overflow-wrap: anywhere; }.contact-links span { color: var(--accent); }
.contact-form { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label { display: block; margin-bottom: 16px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.contact-form label > span { display: block; margin-bottom: 7px; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; border: 1px solid var(--line); color: var(--text); background: color-mix(in srgb, var(--bg) 74%, transparent); border-radius: 12px; padding: 13px 14px; outline: none; transition: border .2s, box-shadow .2s; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(78,230,168,.08); }
.contact-form textarea { resize: vertical; min-height: 145px; }.contact-form select option { color: #0b1727; background: white; }
.btn-submit { width: 100%; cursor: pointer; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; background: var(--bg-soft); }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; }
.footer-inner p { margin: 0; color: var(--muted); text-align: center; font-size: .75rem; }.socials { justify-self: end; display: flex; gap: 18px; color: var(--muted); font-size: .75rem; }.socials a:hover { color: var(--accent); }

.project-dialog { width: min(1100px, calc(100% - 28px)); max-height: calc(100dvh - 28px); border: 1px solid var(--line-strong); border-radius: 26px; padding: 0; background: var(--bg-soft); color: var(--text); box-shadow: 0 35px 120px rgba(0,0,0,.58); overflow: auto; }
.project-dialog::backdrop, .lightbox::backdrop { background: rgba(1,6,12,.82); backdrop-filter: blur(8px); }
.dialog-shell { padding: 44px; position: relative; }
.dialog-close { position: sticky; float: inline-end; top: 16px; z-index: 5; font-size: 1.7rem; background: var(--surface-solid); }
.dialog-hero { clear: both; display: grid; grid-template-columns: 1fr auto; gap: 45px; align-items: end; padding: 20px 0 34px; border-bottom: 1px solid var(--line); }
.dialog-kicker { color: var(--accent); font: 700 .72rem/1.2 "Segoe UI", Arial, sans-serif; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 12px; }.dialog-hero h2 { font-size: clamp(2rem,4vw,4rem); line-height: 1.08; letter-spacing: -.055em; margin: 0 0 16px; }.dialog-hero > div > p:last-child { color: var(--muted); max-width: 680px; margin: 0; }
.dialog-meta { display: grid; grid-template-columns: repeat(2,auto); gap: 8px; }.dialog-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; font: 600 .68rem/1.2 "Segoe UI", Arial, sans-serif; color: var(--muted); }
.dialog-content { display: grid; grid-template-columns: .65fr 1.35fr; gap: 50px; padding-top: 35px; }
.dialog-details h3 { font-size: 1rem; margin: 0 0 10px; }.dialog-details p { color: var(--muted); margin: 0 0 28px; }.dialog-details ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }.dialog-details li { color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 10px; }.dialog-details li::before { content: "↗"; color: var(--accent); margin-inline-end: 9px; }
.dialog-gallery { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; align-content: start; }.gallery-button { border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; min-height: 190px; }.gallery-button:first-child { grid-column: span 2; min-height: 330px; }.gallery-button img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }.gallery-button:hover img { transform: scale(1.035); }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 0; background: transparent; color: white; overflow: hidden; }
.lightbox[open] { display: grid; place-items: center; }.lightbox img { max-width: min(92vw, 1500px); max-height: 84dvh; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 100px rgba(0,0,0,.6); }.lightbox > button { position: fixed; border: 1px solid rgba(255,255,255,.18); color: white; background: rgba(4,12,22,.6); backdrop-filter: blur(12px); cursor: pointer; display: grid; place-items: center; z-index: 3; }.lightbox-close { top: 22px; right: 22px; width: 46px; height: 46px; border-radius: 50%; font-size: 1.7rem; }.lightbox-prev,.lightbox-next { top: 50%; translate: 0 -50%; width: 50px; height: 70px; border-radius: 14px; font-size: 2.5rem; }.lightbox-prev { left: 24px; }.lightbox-next { right: 24px; }.lightbox p { position: fixed; bottom: 20px; left: 50%; translate: -50%; color: #c4d0dd; font: 600 .72rem/1.2 "Segoe UI",Arial,sans-serif; background: rgba(4,12,22,.55); padding: 7px 12px; border-radius: 999px; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: var(--delay, 0ms); }.reveal.visible { opacity: 1; transform: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(78,230,168,0), 0 0 15px var(--accent); } }
@keyframes scan { from { top: 5%; } to { top: 95%; } }
@keyframes blink { 0%,35%{opacity:.25} 65%,100%{opacity:1} }

@media (max-width: 1050px) {
  .desktop-cv { display: none; }
  .main-nav { gap: 18px; }
  .hero-grid { gap: 38px; }
  .hero h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
  .two-column, .experience-layout { gap: 45px; }
  .about-panel { grid-template-columns: 1fr; }.about-photo { min-height: 390px; }.about-photo img { object-position: 50% 18%; }
  .project-card.project-large, .project-card.project-large + .project-card { grid-column: span 6; }
}

@media (max-width: 840px) {
  :root { --header-h: 70px; }
  .container { width: min(calc(100% - 28px), var(--container)); }
  .section { padding: 82px 0; }
  .menu-toggle { display: grid; margin-inline-start: auto; }
  .main-nav { position: fixed; top: var(--header-h); left: 14px; right: 14px; display: grid; gap: 0; padding: 10px; background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow); transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s; }
  .main-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 13px 14px; border-radius: 10px; }.main-nav a:hover { background: var(--surface-2); }.main-nav a::after { display: none; }
  .nav-actions { gap: 6px; }
  .hero { padding-top: calc(var(--header-h) + 50px); }
  .hero-grid, .two-column, .experience-layout, .contact-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 56px; }
  .hero-copy { text-align: center; }.hero-copy .eyebrow { margin-inline: auto; }.hero-lead { margin-inline: auto; }.hero-actions,.hero-meta { justify-content: center; }
  .rack-card { transform: none !important; }.rack-photo { height: 410px; }.chip-one { left: 8px; }.chip-two { right: 8px; }
  .stats-strip { margin-top: 55px; grid-template-columns: repeat(2,1fr); }.stats-strip article:nth-child(2) { border-inline-end: 0; }.stats-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .about-grid > .section-heading, .sticky-heading { position: static; }.about-grid { gap: 38px; }
  .heading-row { display: block; }.heading-row > p { margin-top: 16px; max-width: none; }
  .service-grid { grid-template-columns: 1fr; }
  .timeline-head { display: block; }.timeline-head time { display: block; margin-top: 9px; }
  .project-card, .project-card.project-large, .project-card.project-large + .project-card, .project-card.project-wide { grid-column: span 12; }.project-image,.project-large .project-image,.project-wide .project-image { height: min(62vw, 430px); }
  .footer-inner { grid-template-columns: 1fr; justify-items: center; }.socials { justify-self: center; }.footer-brand { display: none; }
  .dialog-shell { padding: 28px 20px; }.dialog-hero,.dialog-content { grid-template-columns: 1fr; gap: 28px; }.dialog-meta { justify-content: start; }.dialog-gallery { order: -1; }
}

@media (max-width: 560px) {
  .brand-copy small { display: none; }
  .nav-shell { gap: 8px; }.language-toggle { min-width: 42px; padding-inline: 8px; }.theme-toggle { width: 40px; height: 40px; }.menu-toggle { width: 40px; height: 40px; }
  .hero h1 { font-size: clamp(2.65rem, 14vw, 4rem); }.hero-lead { font-size: .96rem; }
  .hero-actions .btn { width: 100%; }.hero-meta { gap: 6px; }
  .rack-photo { height: 300px; }.switch-unit { grid-template-columns: 72px 1fr; gap: 8px; }.switch-label small { display: none; }.ports { gap: 2px; }.floating-chip { min-width: 104px; padding: 9px 11px; }.chip-one { bottom: 70px; }.chip-two { top: 45px; }
  .stats-strip article { padding: 17px 14px; display: block; }.stats-strip strong,.stats-strip span { display: block; }.stats-strip strong { font-size: 1.45rem; }
  .section-heading h2 { font-size: clamp(2rem, 10vw, 3rem); }.about-content,.service-card,.contact-form { padding: 25px; }.about-photo { min-height: 350px; }.quick-facts > div { grid-template-columns: 1fr; gap: 3px; }
  .project-info { padding: 18px; }.project-info h3 { font-size: 1rem; }.project-image,.project-large .project-image,.project-wide .project-image { height: 280px; }
  .contact-copy h2 { font-size: 2.65rem; }.form-row { grid-template-columns: 1fr; gap: 0; }.contact-links a { grid-template-columns: 72px 1fr 18px; }
  .dialog-gallery { grid-template-columns: 1fr; }.gallery-button:first-child { grid-column: span 1; min-height: 230px; }.gallery-button { min-height: 210px; }.lightbox-prev { left: 8px; }.lightbox-next { right: 8px; }
}

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

@media print {
  .site-header,.hero-visual,.hero-actions,.contact-section,.site-footer,.project-dialog,.lightbox { display: none !important; }
  body { background: white; color: #111; }.section,.hero { padding: 30px 0; min-height: auto; }.section-muted,.section-dark { background: white; color: #111; border: 0; }.reveal { opacity: 1; transform: none; }.service-card,.timeline-card,.project-card,.about-panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}


/* Standalone work index and project case studies */
.section-cta { display: flex; justify-content: center; margin-top: 34px; }
.subpage-hero { padding-top: calc(var(--header-h) + 72px); min-height: 72vh; display: grid; align-items: center; overflow: hidden; }
.subpage-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 18% 30%, rgba(78,230,168,.10), transparent 34%), radial-gradient(circle at 86% 68%, rgba(65,148,255,.11), transparent 32%); }
.subpage-hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 70px; align-items: center; }
.subpage-hero h1 { font-size: clamp(3rem, 7vw, 6.8rem); max-width: 900px; line-height: .98; letter-spacing: -.065em; margin: 14px 0 24px; }
.subpage-hero p { color: var(--muted); font-size: 1.06rem; max-width: 680px; margin: 0; }
.work-console { border: 1px solid var(--line-strong); background: linear-gradient(145deg, color-mix(in srgb,var(--surface-solid) 92%,transparent), color-mix(in srgb,var(--surface-2) 84%,transparent)); border-radius: 24px; padding: 14px; box-shadow: var(--shadow); transform: perspective(900px) rotateY(-4deg); }
[dir="ltr"] .work-console { transform: perspective(900px) rotateY(4deg); }
.console-head { display: flex; gap: 6px; align-items: center; padding: 7px 7px 15px; border-bottom: 1px solid var(--line); }
.console-head span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }.console-head span:first-child { background: #ff6f79; }.console-head span:nth-child(2) { background: #ffcc67; }.console-head span:nth-child(3) { background: var(--accent); }.console-head b { margin-inline-start: auto; font: 700 .68rem/1 "Segoe UI",Arial,sans-serif; letter-spacing: .14em; color: var(--muted); }
.console-lines { padding: 26px 18px 14px; display: grid; gap: 13px; }.console-lines p { margin: 0; padding: 14px; display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font: 600 .72rem/1.2 "Segoe UI",Arial,sans-serif; }.console-lines i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 13px var(--accent); }.console-lines strong { color: var(--accent); font-size: .62rem; }
.work-index-section { border-top: 1px solid var(--line); }.work-page-grid { display: grid; grid-template-columns: repeat(12,1fr); gap: 18px; }.work-link { grid-column: span 6; color: inherit; }.work-link.project-featured { grid-column: span 12; }.work-link.is-hidden { display: none; }.work-link .project-card { height: 100%; grid-column: auto; }.work-link.project-featured .project-image { height: min(55vw,570px); }.work-link small { display: block; color: var(--muted); margin-top: 8px; font-size: .73rem; }.work-contact { padding-top: 45px; }.work-contact-box { border: 1px solid var(--line-strong); border-radius: 26px; padding: 38px; background: linear-gradient(115deg,rgba(78,230,168,.08),var(--surface)); display: flex; justify-content: space-between; align-items: center; gap: 30px; }.work-contact-box h2 { margin: 8px 0 7px; font-size: clamp(2rem,4vw,3.6rem); }.work-contact-box p { color: var(--muted); margin: 0; }
.project-detail-page { overflow: clip; }.project-detail-hero { padding-top: calc(var(--header-h) + 55px); }.breadcrumbs { display: flex; gap: 10px; align-items: center; color: var(--muted); font: 600 .72rem/1.2 "Segoe UI",Arial,sans-serif; margin-bottom: 34px; }.breadcrumbs a:hover { color: var(--accent); }.breadcrumbs strong { color: var(--text); font-weight: 600; }
.project-detail-head { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; }.project-detail-head h1 { font-size: clamp(3rem,6vw,6.2rem); line-height: .98; letter-spacing: -.065em; margin: 10px 0 22px; }.project-lead { color: var(--muted); font-size: 1.08rem; max-width: 650px; }.standalone-meta { margin-top: 26px; display: flex; flex-wrap: wrap; }.project-cover { height: min(60vw,600px); min-height: 410px; position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); }.project-cover img { width: 100%; height: 100%; object-fit: cover; }.project-cover::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); pointer-events: none; }.project-cover > span { position: absolute; inset-inline-start: 18px; bottom: 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 8px 12px; color: white; background: rgba(4,12,22,.58); backdrop-filter: blur(10px); font: 700 .68rem/1 "Segoe UI",Arial,sans-serif; letter-spacing: .12em; }
.project-story-grid { display: grid; grid-template-columns: .62fr 1.38fr; gap: 65px; align-items: start; }.project-story { position: sticky; top: calc(var(--header-h) + 30px); }.project-story h2 { font-size: clamp(2.3rem,4vw,4rem); margin: 10px 0 18px; }.project-story > p { color: var(--muted); font-size: 1rem; }.project-story h3 { font-size: 1rem; margin: 32px 0 15px; }.project-story ul { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 10px; }.project-story li { color: var(--muted); border-bottom: 1px solid var(--line); padding: 0 0 11px; }.project-story li::before { content: "↗"; color: var(--accent); margin-inline-end: 9px; }.gallery-heading { margin-bottom: 24px; }.gallery-heading h2 { margin: 8px 0 8px; }.standalone-gallery { grid-template-columns: repeat(2,1fr); }.standalone-gallery .gallery-button { min-height: 260px; }.standalone-gallery .gallery-button:first-child { min-height: 430px; }
@media (max-width: 840px) { .subpage-hero-grid,.project-detail-head,.project-story-grid { grid-template-columns: 1fr; }.subpage-hero { min-height: auto; }.work-console { transform: none !important; }.work-link,.work-link.project-featured { grid-column: span 12; }.work-link.project-featured .project-image { height: min(68vw,430px); }.work-contact-box { align-items: flex-start; flex-direction: column; }.project-story { position: static; }.project-cover { order: -1; height: min(75vw,520px); }.standalone-gallery .gallery-button:first-child { min-height: 320px; } }
@media (max-width: 560px) { .subpage-hero h1,.project-detail-head h1 { font-size: clamp(2.7rem,14vw,4rem); }.console-lines { padding: 18px 6px 6px; }.console-lines p { grid-template-columns: 8px 1fr; }.console-lines strong { grid-column: 2; }.work-contact-box { padding: 25px; }.project-cover { min-height: 310px; }.standalone-gallery { grid-template-columns: 1fr; }.standalone-gallery .gallery-button:first-child { min-height: 250px; }.standalone-gallery .gallery-button { min-height: 230px; } }

/* Hazem RDP project details */
.remote-detail-section{padding-top:0}.privacy-note{display:grid;grid-template-columns:auto 1fr;gap:1rem;align-items:start;margin-bottom:3rem;padding:1.2rem 1.35rem;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));border-radius:1.2rem;background:color-mix(in srgb,var(--accent) 8%,var(--surface));box-shadow:var(--shadow-sm)}.privacy-note strong{color:var(--accent);white-space:nowrap}.privacy-note p{margin:0;color:var(--text-muted);line-height:1.8}.remote-flow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.remote-flow-card{position:relative;min-height:210px;padding:1.4rem;border:1px solid var(--border);border-radius:1.25rem;background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface) 84%,var(--accent) 16%));overflow:hidden}.remote-flow-card>span{display:inline-grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:.8rem;background:color-mix(in srgb,var(--accent) 18%,transparent);color:var(--accent);font-weight:800}.remote-flow-card h3{margin:1.2rem 0 .6rem;font-size:1.08rem}.remote-flow-card p{margin:0;color:var(--text-muted);line-height:1.75}.remote-flow-card:after{content:"";position:absolute;inset:auto -35px -35px auto;width:110px;height:110px;border:1px solid color-mix(in srgb,var(--accent) 22%,transparent);border-radius:50%}.remote-spec-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin-top:1rem}.remote-spec{padding:1.2rem;border:1px solid var(--border);border-radius:1rem;background:var(--surface)}.remote-spec h3{margin:0 0 .55rem;color:var(--accent);font-size:.95rem}.remote-spec p{margin:0;color:var(--text-muted);font-size:.9rem;line-height:1.7;direction:ltr;text-align:left}.project-cover img[src*="projects/remote"]{object-fit:cover}.work-link[href="remote.html"] .project-image,.project-card[data-project="remote"] .project-image{background:#06101a}.work-link[href="remote.html"] .project-image img,.project-card[data-project="remote"] .project-image img{object-fit:cover;object-position:center}.dialog-gallery img{background:#0b1018}
@media(max-width:980px){.remote-flow{grid-template-columns:repeat(2,minmax(0,1fr))}.remote-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.privacy-note{grid-template-columns:1fr}.remote-flow,.remote-spec-grid{grid-template-columns:1fr}.remote-flow-card{min-height:auto}}

/* Hazem CCTV case study */
body[data-project="cctv"]{--accent:#2f8cff;--accent-2:#4cc9ff}.project-cover img[src*="projects/cctv"]{object-fit:cover;object-position:center}.work-link[href="cctv.html"] .project-image,.project-card[data-project="cctv"] .project-image{background:#061426}.work-link[href="cctv.html"] .project-image img,.project-card[data-project="cctv"] .project-image img{object-fit:cover;object-position:center}.cctv-detail-section .remote-flow-card{background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface) 82%,#2f8cff 18%))}.cctv-detail-section .remote-flow-card:nth-child(3n+2)>span{color:#4cc9ff;background:color-mix(in srgb,#4cc9ff 16%,transparent)}

/* Hazem SoftPhone case study */
body[data-project="softphone"]{--accent:#29b6f6;--accent-2:#23d5ab}.project-cover img[src*="projects/softphone"]{object-fit:cover;object-position:center}.work-link[href="softphone.html"] .project-image,.project-card[data-project="softphone"] .project-image{background:#071426}.work-link[href="softphone.html"] .project-image img,.project-card[data-project="softphone"] .project-image img{object-fit:cover;object-position:center}.softphone-detail-section .remote-flow-card{background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface) 82%,#29b6f6 18%))}.softphone-detail-section .remote-flow-card:nth-child(even)>span{color:#23d5ab;background:color-mix(in srgb,#23d5ab 16%,transparent)}

/* =========================================================
   v6.2 — Universal mobile compatibility
   Prevents horizontal drift/overflow across Android & iOS.
   ========================================================= */
html,
body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@supports (overflow: clip) {
  html,
  body { overflow-x: clip; }
}

body,
main,
header,
footer,
section,
article,
nav,
dialog,
.container,
.nav-shell,
.hero-grid,
.two-column,
.about-grid,
.about-panel,
.about-content,
.service-grid,
.experience-layout,
.timeline,
.timeline-card,
.project-grid,
.project-card,
.project-info,
.contact-grid,
.contact-copy,
.contact-form,
.footer-inner,
.dialog-shell,
.dialog-hero,
.dialog-content,
.dialog-details,
.dialog-gallery,
.subpage-hero-grid,
.work-page-grid,
.work-link,
.work-console,
.console-lines,
.project-detail-head,
.project-story-grid,
.project-story,
.project-cover,
.standalone-gallery,
.remote-flow,
.remote-flow-card,
.remote-spec-grid,
.remote-spec {
  min-width: 0;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
li,
dd,
dt,
a,
button,
label,
small,
strong,
span {
  overflow-wrap: break-word;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

/* Respect notches and rounded display cut-outs. */
.site-header {
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-shell { height: var(--header-h); }
html { scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 18px); }

@media (max-width: 840px) {
  .container {
    width: 100%;
    max-width: var(--container);
    padding-inline-start: max(14px, env(safe-area-inset-left, 0px));
    padding-inline-end: max(14px, env(safe-area-inset-right, 0px));
  }

  .nav-shell {
    width: 100%;
    gap: 7px;
  }

  .brand { min-width: 0; gap: 9px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px; flex: 0 0 35px; }
  .brand-copy { min-width: 0; }
  .brand-copy strong { font-size: .9rem; white-space: nowrap; }

  .nav-actions {
    margin-inline-start: auto;
    flex: 0 0 auto;
    gap: 5px;
  }

  .menu-toggle {
    margin-inline-start: 0;
    flex: 0 0 40px;
  }

  .main-nav {
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    left: auto;
    right: auto;
    inset-inline-start: max(10px, env(safe-area-inset-left, 0px));
    inset-inline-end: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
    max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0px) - 20px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .main-nav a {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .hero,
  .subpage-hero,
  .project-detail-hero {
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 42px);
  }

  .hero h1,
  .subpage-hero h1,
  .project-detail-head h1,
  .dialog-hero h2,
  .contact-copy h2,
  .section-heading h2 {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  html[lang="ar"] .hero h1,
  html[lang="ar"] .subpage-hero h1,
  html[lang="ar"] .project-detail-head h1,
  html[lang="ar"] .contact-copy h2,
  html[lang="ar"] .section-heading h2 {
    letter-spacing: 0;
  }

  .hero-grid { gap: 42px; }
  .hero h1 { font-size: clamp(2.55rem, 11.5vw, 4.4rem); line-height: 1.05; }
  .hero-lead,
  .project-lead,
  .subpage-hero p { font-size: clamp(.94rem, 3.8vw, 1.04rem); }

  .hero-actions,
  .hero-meta,
  .project-filters,
  .standalone-meta,
  .dialog-meta,
  .tag-list,
  .tech-cloud { max-width: 100%; }

  .rack-photo { height: clamp(270px, 80vw, 410px); }
  .floating-chip { max-width: calc(100% - 16px); }

  .about-panel,
  .service-card,
  .timeline-card,
  .contact-form,
  .work-contact-box { width: 100%; }

  .about-photo { min-height: clamp(350px, 105vw, 510px); }
  .about-photo img { object-position: center top; }

  .project-info {
    align-items: flex-start;
    padding: 20px;
  }
  .project-info > div { min-width: 0; }
  .project-info h3 { line-height: 1.35; }

  .project-image,
  .project-large .project-image,
  .project-wide .project-image,
  .work-link.project-featured .project-image {
    height: clamp(235px, 62vw, 420px);
  }

  .contact-links a {
    grid-template-columns: minmax(62px, 82px) minmax(0, 1fr) 20px;
  }

  .dialog-shell { width: 100%; }
  .project-dialog {
    width: calc(100% - 18px);
    max-width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
    border-radius: 20px;
  }

  .project-cover {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .standalone-gallery .gallery-button,
  .standalone-gallery .gallery-button:first-child,
  .dialog-gallery .gallery-button,
  .dialog-gallery .gallery-button:first-child {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .remote-spec p,
  .console-lines p,
  .breadcrumbs,
  .contact-links strong {
    overflow-wrap: anywhere;
  }

  .lightbox img {
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 120px);
  }
}

@media (max-width: 560px) {
  .section { padding: 68px 0; }
  .nav-actions .icon-btn,
  .nav-actions .text-btn,
  .menu-toggle { width: 38px; height: 38px; min-width: 38px; }
  .language-toggle { padding-inline: 5px; }

  .hero { min-height: auto; padding-bottom: 70px; }
  .hero-grid { gap: 34px; }
  .hero h1 { font-size: clamp(2.3rem, 11.7vw, 3.35rem); }
  .hero-copy { text-align: start; }
  .hero-copy .eyebrow { margin-inline: 0; }
  .hero-lead { margin-inline: 0; }
  .hero-actions,
  .hero-meta { justify-content: flex-start; }

  .hero-actions .btn { width: 100%; }
  .rack-card { padding: 10px; border-radius: 18px; }
  .rack-photo { height: clamp(245px, 78vw, 330px); }

  .stats-strip { margin-top: 36px; }
  .stats-strip article { min-width: 0; }

  .about-content,
  .service-card,
  .timeline-card,
  .contact-form,
  .work-contact-box { padding: 22px; }

  .about-photo { min-height: clamp(330px, 110vw, 455px); }

  .project-info { gap: 12px; padding: 17px; }
  .project-info h3 { font-size: 1rem; }
  .round-arrow { width: 40px; height: 40px; }

  .project-image,
  .project-large .project-image,
  .project-wide .project-image,
  .work-link.project-featured .project-image {
    height: clamp(220px, 65vw, 310px);
  }

  .contact-copy h2 { font-size: clamp(2rem, 11vw, 2.7rem); }
  .contact-links a {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
  }
  .contact-links small { grid-column: 1 / -1; }
  .contact-links strong { grid-column: 1; }
  .contact-links span { grid-column: 2; grid-row: 2; }

  .dialog-shell { padding: 22px 15px; }
  .dialog-hero h2 { font-size: clamp(1.9rem, 10vw, 2.8rem); }
  .dialog-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-meta span { text-align: center; }

  .subpage-hero h1,
  .project-detail-head h1 {
    font-size: clamp(2.1rem, 10.8vw, 3.2rem);
    line-height: 1.05;
  }

  .console-lines p { padding: 12px 10px; }
  .project-cover { aspect-ratio: 4 / 3; }
  .standalone-gallery .gallery-button,
  .standalone-gallery .gallery-button:first-child,
  .dialog-gallery .gallery-button,
  .dialog-gallery .gallery-button:first-child { aspect-ratio: 4 / 3; }

  .breadcrumbs { flex-wrap: wrap; line-height: 1.5; }
  .work-contact-box { gap: 18px; }
  .work-contact-box .btn { width: 100%; }

  .site-footer { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 380px) {
  .container {
    padding-inline-start: max(11px, env(safe-area-inset-left, 0px));
    padding-inline-end: max(11px, env(safe-area-inset-right, 0px));
  }

  .brand-copy strong { font-size: .82rem; }
  .brand-mark { width: 33px; height: 33px; flex-basis: 33px; }
  .nav-actions .icon-btn,
  .nav-actions .text-btn,
  .menu-toggle { width: 36px; height: 36px; min-width: 36px; }
  .hero h1 { font-size: clamp(2.1rem, 11.6vw, 2.8rem); }
  .section-heading h2 { font-size: clamp(1.85rem, 9.5vw, 2.45rem); }
}

@media (max-width: 340px) {
  .brand-copy { display: none; }
  .hero h1 { font-size: 2rem; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
}
