@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Instrument+Sans:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
  --bg: #FFFFFF;
  --paper: #FFFFFF;
  --card-bg: #FAFAFC;
  --ink: #0F1014;
  --muted: #5C606B;
  --subtle: #8E929E;
  --line: rgba(15, 16, 20, 0.08);
  --line-strong: rgba(15, 16, 20, 0.16);
  --accent: #111215;
  --hero-lockup-gap: clamp(28px, 5vw, 56px);
  --hero-top-gap: clamp(24px, 4vw, 48px);
  --display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1400px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
  --bg: #0C0D10;
  --paper: #121318;
  --card-bg: #161820;
  --ink: #F3F4F6;
  --muted: #9CA3AF;
  --subtle: #6B7280;
  --line: rgba(243, 244, 246, 0.1);
  --line-strong: rgba(243, 244, 246, 0.2);
  --accent: #FFFFFF;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body {
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

body {
  margin: 0;
  padding-top: 74px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

b, strong {
  font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  max-width: 100%;
  display: block;
}

/* ---------- Loading screen ---------- */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  width: min(28vw, 130px);
  height: auto;
  opacity: 0;
  animation: loadingPulse 1.4s ease-in-out infinite;
}

.loading-logo[src]:not([src=""]) {
  opacity: 0.95;
}

@keyframes loadingPulse {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* ---------- Top bar Navigation ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr !important;
  height: 68px;
  padding: 0 var(--gutter);
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}

.logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 2;
}

.logo:hover {
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(0.97);
}

.logo:active {
  transform: translate(-50%, -50%) scale(0.93);
}

.logo img,
.logo-secondary {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.logo-fallback {
  font-family: var(--display);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.8vw, 42px);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.topnav--left {
  flex-shrink: 0;
}

.topnav--right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.topnav a {
  position: relative;
  color: var(--muted);
  padding: 8px 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  transition: color 0.25s var(--ease);
}

.nav-word {
  display: inline;
  white-space: nowrap;
}

.topnav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

.topnav a:hover {
  color: var(--ink);
}

.topnav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: all 0.25s var(--ease);
  user-select: none;
  -webkit-user-select: none;
}

.nav-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(15, 16, 20, 0.04);
  transform: translateY(-1px);
}

[data-theme="dark"] .nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-btn:active {
  transform: scale(0.96);
}

.nav-btn--lang {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

html[lang="en"] .nav-btn--lang {
  font-family: var(--font-ar);
  font-weight: 500;
  font-size: 13px;
  padding: 0 13px 1px;
}

html[lang="ar"] .nav-btn--lang {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  padding: 0 12px;
}

.nav-btn--theme {
  width: 32px;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.theme-icon {
  position: absolute;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s var(--ease);
}

.theme-icon--sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.theme-icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-icon--sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .theme-icon--moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

@media (max-width: 680px) {
  body {
    padding-top: 68px;
  }
  .topbar {
    height: 64px;
    padding: 0 clamp(8px, 2.5vw, 14px);
  }
  .topnav {
    gap: clamp(6px, 1.8vw, 12px);
    font-size: clamp(11px, 2.9vw, 12.5px);
  }
  .topnav a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    padding: 2px 0;
    gap: 1px;
    white-space: normal;
  }
  .topnav a::after {
    bottom: 0px;
  }
  .nav-word {
    display: block;
    white-space: nowrap;
  }
  .nav-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    flex-shrink: 0;
  }
  html[lang="en"] .nav-btn--lang {
    font-size: 11px;
    padding: 0 8px 1px;
  }
  html[lang="ar"] .nav-btn--lang {
    font-size: 10.5px;
    padding: 0 7px;
  }
  .nav-btn--theme {
    width: 28px;
    height: 28px;
    padding: 0;
  }
  .theme-icon {
    width: 14px;
    height: 14px;
  }
  .logo img, .logo-secondary {
    height: 26px;
  }
  .logo-fallback {
    font-size: 16px;
  }
}

/* ---------- Hero Section ---------- */

.hero {
  padding: var(--hero-top-gap) var(--gutter) clamp(48px, 8vw, 96px);
  max-width: var(--max);
  margin: 0 auto;
}

@media (max-width: 600px) {
  .hero {
    padding-top: clamp(24px, 5vw, 36px);
    padding-bottom: clamp(32px, 6vw, 48px);
  }
  .hero-status {
    margin-bottom: 16px;
    font-size: 12.5px;
  }
  .hero-images {
    gap: 12px;
    margin-bottom: 16px;
  }
  .hero-img {
    height: clamp(44px, 12vw, 64px);
  }
  .hero h1 {
    font-size: clamp(32px, 8.5vw, 46px);
    line-height: 1.12;
    margin-bottom: 14px;
    max-width: 100%;
  }
  .hero p {
    font-size: 16px;
    line-height: 1.55;
    max-width: 100%;
  }
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  animation: heroIn 0.8s var(--ease) 0.05s forwards;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.9); }
}

.hero-images {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 24px);
  margin-left: 0;
  margin-bottom: clamp(18px, 2.5vw, 28px);
  opacity: 0;
  filter: blur(14px);
  transform: translateY(16px);
  animation: heroIn 0.8s var(--ease) 0.15s forwards;
}

.hero-img {
  height: clamp(55px, 8vw, 95px);
  width: auto;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(42px, 6.2vw, 96px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 0 0 20px;
  max-width: 22ch;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(20px);
  animation: heroIn 0.9s var(--ease) 0.2s forwards;
}

.hero p {
  font-size: clamp(17px, 1.6vw, 22px);
  color: var(--muted);
  line-height: 1.55;
  max-width: 48ch;
  margin: 0;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(20px);
  animation: heroIn 0.9s var(--ease) 0.35s forwards;
}

@keyframes heroIn {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.hero-cta {
  margin-top: clamp(24px, 3.2vw, 36px);
  opacity: 0;
  filter: blur(14px);
  transform: translateY(20px);
  animation: heroIn 0.9s var(--ease) 0.45s forwards;
}

.hero-touch-btn {
  padding: 8px 18px;
  font-size: 13.5px;
}

/* ---------- Work / Carousel Section ---------- */

.work {
  border-top: 1px solid var(--line);
  padding: clamp(64px, 8vw, 104px) 0 clamp(48px, 8vw, 112px);
}

.work-header {
  max-width: var(--max);
  margin: 0 auto clamp(28px, 4vw, 48px);
  padding: 0 var(--gutter);
}

.work-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.025em;
  margin: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .work {
    padding-top: clamp(40px, 8vw, 64px);
  }
  .work-header {
    margin-bottom: clamp(18px, 3.5vw, 28px);
  }
  .work-title {
    font-size: clamp(28px, 7vw, 36px);
  }
}

.section-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto 24px;
}

.empty-state {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--gutter) 80px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.empty-state h3 {
  font-family: var(--display);
  font-size: 24px;
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.empty-state code {
  background: #F5F5F5;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.9em;
}

/* Project Strip Article */
.project-strip {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 4px 0;
  opacity: 0;
  filter: blur(12px);
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), filter 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: opacity, transform, filter;
}

.project-strip.in-view {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.project-strip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 2vw, 36px);
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto 4px;
}

.project-strip__info {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 2vw, 28px);
  flex: 1;
  min-width: 0;
}

.project-strip__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-shrink: 0;
}

.project-strip__num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--subtle);
  letter-spacing: 0.06em;
}

.project-strip__title-link {
  color: inherit;
  text-decoration: none;
}

.project-strip__head h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(24px, 3.2vw, 38px);
  margin: 0;
  letter-spacing: -0.025em;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.project-strip__title-link:hover h3,
.project-strip__head:hover h3 {
  color: var(--ink);
  transform: translateX(3px);
}

.project-strip__desc {
  color: var(--muted);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 450;
  line-height: 1.5;
  margin: 0;
  max-width: 56ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-strip__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.25s var(--ease);
}

.project-strip__btn:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(15, 16, 20, 0.16);
}

.project-strip__btn:active {
  transform: translateY(0) scale(0.98);
}

.project-strip__btn-arrow {
  font-size: 14px;
  transition: transform 0.25s var(--ease);
}

.project-strip__btn:hover .project-strip__btn-arrow {
  transform: translateX(3px);
}

@media (max-width: 860px) {
  .project-strip__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 0 auto 4px;
  }
  .project-strip__info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
  .project-strip__desc {
    max-width: 100%;
  }
  .project-strip__btn {
    align-self: flex-start;
    margin-top: 2px;
  }
}

/* Homepage strip touch footer & project page touch prompt */
.project-strip__foot {
  max-width: var(--max);
  margin: 10px auto 14px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.project-strip__touch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.project-strip__touch-text {
  font-family: var(--display);
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 450;
  letter-spacing: -0.01em;
}

@media (max-width: 860px) {
  .project-strip__foot {
    justify-content: flex-start;
    margin: 8px auto 12px;
  }
  .project-strip__touch {
    gap: 10px;
    flex-wrap: wrap;
  }
}

.project-touch-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--gutter) 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.project-touch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.project-touch-prompt {
  font-family: var(--display);
  font-size: 15px;
  color: var(--muted);
  font-weight: 450;
  letter-spacing: -0.01em;
}

@media (max-width: 860px) {
  .project-touch-section {
    justify-content: flex-start;
    padding: 16px var(--gutter) 36px;
  }
  .project-touch-wrap {
    gap: 10px;
    flex-wrap: wrap;
  }
  .project-touch-prompt {
    font-size: 14px;
  }
}

/* Marquee track with edge frosted blur overlays */
.project-strip__track {
  position: relative;
  overflow: hidden;
  padding: 0;
  direction: ltr;
}

/* Subtle edge vignettes with reduced opacity and size */
.project-strip__track::before,
.project-strip__track::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(18px, 4vw, 44px);
  z-index: 3;
  pointer-events: none;
}

.project-strip__track::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, rgba(255, 255, 255, 0.28) 40%, transparent 100%);
  mask-image: linear-gradient(to right, black, transparent);
  -webkit-mask-image: linear-gradient(to right, black, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project-strip__track::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 0%, rgba(255, 255, 255, 0.28) 40%, transparent 100%);
  mask-image: linear-gradient(to left, black, transparent);
  -webkit-mask-image: linear-gradient(to left, black, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .project-strip__track::before {
  background: linear-gradient(to right, var(--bg) 0%, rgba(12, 13, 16, 0.35) 40%, transparent 100%);
}

[data-theme="dark"] .project-strip__track::after {
  background: linear-gradient(to left, var(--bg) 0%, rgba(12, 13, 16, 0.35) 40%, transparent 100%);
}

.project-strip__marquee {
  display: flex;
  gap: 4px;
  width: max-content;
  direction: ltr;
  animation: marquee linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.project-strip.in-view .project-strip__marquee,
.project-strip.is-animating .project-strip__marquee {
  animation-play-state: running;
}

.project-strip__track:hover .project-strip__marquee {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Individual Carousel Card Frame */
.frame {
  flex: 0 0 auto;
  width: min(65vw, 390px);
  aspect-ratio: 380 / 260;
  border-radius: 0;
  overflow: hidden;
  background: var(--paper);
  position: relative;
  border: none;
  box-shadow: none;
  transition: transform 0.4s var(--ease);
}

.frame:hover {
  transform: translateY(-4px);
}

.frame:active {
  transform: translateY(-3px) scale(0.99);
}

.frame__img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  background: #EDEDF0;
}

/* Elegant shimmer placeholder while image loads */
.frame__img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(235, 235, 238, 0.7) 0%,
    rgba(250, 250, 252, 0.95) 50%,
    rgba(235, 235, 238, 0.7) 100%
  );
  background-size: 200% 100%;
  animation: imgShimmer 1.6s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}

.frame__img-wrap.is-loaded::before {
  opacity: 0;
  animation: none;
}

@keyframes imgShimmer {
  0% { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

.frame img,
.frame video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  opacity: 0;
  filter: blur(22px);
  transform: scale(1.05);
  transition: opacity 0.65s var(--ease),
              filter 0.75s var(--ease),
              transform 0.75s var(--ease);
  will-change: opacity, filter, transform;
}

.frame img.is-loaded,
.frame video.is-loaded {
  opacity: 1;
  filter: none !important;
  transform: scale(1);
  will-change: auto !important;
  image-rendering: auto;
}

.frame:hover img.is-loaded,
.frame:hover video.is-loaded {
  transform: scale(1.08);
}

/* Floating Frosted Glass Caption Pill */
.frame__title {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  background: rgba(15, 16, 20, 0.74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.frame:hover .frame__title {
  opacity: 1;
  transform: translateY(0);
}

.frame__title-arrow {
  font-size: 15px;
  transition: transform 0.25s var(--ease);
}

.frame:hover .frame__title-arrow {
  transform: translateX(4px);
}

@media (max-width: 640px) {
  .frame {
    width: clamp(280px, 62vw, 390px);
  }
}

/* ---------- Services Section ---------- */

.services {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 112px) var(--gutter) clamp(40px, 6vw, 64px);
  border-top: 1px solid var(--line);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.services h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.025em;
  margin: 0;
}

.services-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.services-col {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.services-col:hover {
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

.services-col h4 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 16px;
}

.services-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.services-col li {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.services-col li:first-child {
  border-top: none;
  padding-top: 4px;
}

.services-col li:hover {
  transform: translateX(4px);
  color: var(--ink);
}

/* Stats Section */
.services-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: clamp(36px, 5vw, 56px);
  border-top: 1px solid var(--line);
}

.stat {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  transition: transform 0.3s var(--ease);
}

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

.stat-number {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: 12px;
  color: var(--ink);
}

.stat p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
  max-width: 28ch;
}

@media (max-width: 768px) {
  .services {
    padding: clamp(40px, 8vw, 64px) var(--gutter) clamp(32px, 6vw, 48px);
  }
  .services-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .services h2 {
    font-size: clamp(28px, 7vw, 36px);
  }
  .services-categories {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .services-col {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }
  .services-stats {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 36px;
    padding-top: 28px;
  }
  .stat {
    padding: 0;
    border-radius: 0;
  }
  .stat-number {
    font-size: clamp(32px, 9vw, 44px);
    margin-bottom: 6px;
  }
  .stat p {
    font-size: 14px;
    max-width: 100%;
  }
}

@media (min-width: 580px) and (max-width: 768px) {
  .services-categories {
    grid-template-columns: 1fr 1fr;
  }
}

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

.about {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 104px) var(--gutter);
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.about h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.025em;
}

.about-content p {
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.7;
  color: #363942;
  margin: 0 0 24px;
  max-width: 66ch;
}

.about-content p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .about {
    padding: clamp(40px, 8vw, 64px) var(--gutter);
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .about h2 {
    font-size: clamp(28px, 7vw, 36px);
    margin-bottom: 0;
  }
  .about-content p {
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 18px;
  }
}

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

.contact {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 104px) var(--gutter) clamp(72px, 10vw, 120px);
  border-top: 1px solid var(--line);
}

.contact h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  margin: 0 0 16px;
  letter-spacing: -0.025em;
}

.contact p {
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 20px);
  max-width: 54ch;
  margin: 0;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

@media (max-width: 640px) {
  .contact {
    padding: clamp(40px, 8vw, 64px) var(--gutter) clamp(48px, 9vw, 72px);
  }
  .contact h2 {
    font-size: clamp(28px, 7vw, 36px);
  }
  .contact p {
    font-size: 16px;
  }
  .contact-links {
    gap: 10px;
    margin-top: 24px;
  }
  .contact-btn {
    padding: 11px 20px;
    font-size: 14.5px;
  }
  .contact-phone {
    margin-top: 20px;
    font-size: 14.5px;
  }
}

.contact-phone {
  margin-top: 28px;
  font-size: clamp(15px, 1.3vw, 17px);
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.contact-phone__val {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease);
}

.contact-phone__val:hover {
  color: var(--muted);
  text-decoration: underline;
}

[data-theme="dark"] .contact-phone__val {
  color: var(--ink);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  transition: all 0.3s var(--ease);
}

.contact-btn:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -6px rgba(15, 16, 20, 0.2);
}

.contact-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.contact-btn__arrow {
  font-size: 15px;
  transition: transform 0.3s var(--ease);
}

.contact-btn:hover .contact-btn__arrow {
  transform: translate(3px, -3px);
}

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

.site-footer {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  background: #FFFFFF;
}

.footer-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Project detail page ---------- */

.project-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) var(--gutter) clamp(20px, 3vw, 36px);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 28px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.back-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateX(-4px);
}

.project-hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 20ch;
}

.project-hero__text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 4.5vw, 64px);
  margin: clamp(24px, 4vw, 48px) 0 clamp(32px, 5vw, 56px);
}

@media (max-width: 680px) {
  .project-hero {
    padding: clamp(20px, 4vw, 32px) var(--gutter) clamp(16px, 3vw, 24px);
  }
  .project-hero h1 {
    font-size: clamp(32px, 8.5vw, 46px);
    max-width: 100%;
  }
  .back-link {
    margin-bottom: 20px;
  }
  .project-hero__text {
    grid-template-columns: 1fr;
    gap: 22px;
    margin: clamp(20px, 4vw, 32px) 0 clamp(24px, 4.5vw, 36px);
  }
}

#project-description,
.project-direction-wrap {
  min-width: 0;
}

#project-description p {
  color: var(--muted);
  font-size: clamp(13px, 1.25vw, 18px);
  line-height: 1.65;
  margin: 0 0 16px;
}

#project-description p:last-child {
  margin-bottom: 0;
}

.project-direction-wrap h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(11.5px, 1vw, 13px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
  margin: 0 0 16px;
}

.project-direction-wrap p {
  color: var(--ink);
  font-size: clamp(13px, 1.25vw, 18px);
  line-height: 1.65;
  margin: 0 0 16px;
}

.project-direction-wrap p:last-child {
  margin-bottom: 0;
}

.project-rows {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(48px, 8vw, 96px);
}

.row {
  margin-bottom: 4px;
}

.row .frame__img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #EDEDF0;
}

.row .frame__img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(235, 235, 238, 0.7) 0%,
    rgba(250, 250, 252, 0.95) 50%,
    rgba(235, 235, 238, 0.7) 100%
  );
  background-size: 200% 100%;
  animation: imgShimmer 1.6s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}

.row .frame__img-wrap.is-loaded::before {
  opacity: 0;
  animation: none;
}

.row--pair .frame__img-wrap {
  aspect-ratio: 1 / 1;
}

.row--large .frame__img-wrap {
  min-height: clamp(200px, 45vw, 540px);
}

.row--large .frame__img-wrap.is-loaded {
  min-height: 0;
}

.row img,
.row video {
  position: relative;
  z-index: 2;
  width: 100%;
  display: block;
  border-radius: 0;
  transition: opacity 0.75s var(--ease), filter 0.8s var(--ease), transform 0.75s var(--ease);
  opacity: 0;
  filter: blur(22px);
  transform: translateY(22px) scale(1.02);
  will-change: opacity, filter, transform;
}

.row--pair img,
.row--pair video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.row img.visible,
.row video.visible,
.row img.is-loaded,
.row video.is-loaded {
  opacity: 1;
  filter: none !important;
  transform: translateY(0) scale(1);
  will-change: auto !important;
  image-rendering: auto;
}

.row .frame__img-wrap:hover img.visible,
.row .frame__img-wrap:hover video.visible,
.row .frame__img-wrap:hover img.is-loaded,
.row .frame__img-wrap:hover video.is-loaded {
  transform: scale(1.04);
}

.row--pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

@media (max-width: 700px) {
  .row--pair {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
}

.project-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
  border-top: 1px solid var(--line);
}

.project-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  transition: all 0.3s var(--ease);
}

.project-nav a:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  transform: translateX(4px);
  box-shadow: 0 12px 24px -6px rgba(15, 16, 20, 0.2);
}

/* ---------- Dark Theme Specifics ---------- */

[data-theme="dark"] .topbar {
  background: #0C0D10;
}

[data-theme="dark"] .loading-screen {
  background: rgba(12, 13, 16, 0.92);
}

[data-theme="dark"] .site-footer {
  background: #0C0D10;
}

[data-theme="dark"] .contact-btn {
  background: var(--card-bg);
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .contact-btn:hover {
  background: #FFFFFF;
  color: #0C0D10;
  border-color: #FFFFFF;
}

[data-theme="dark"] .project-nav a {
  background: var(--card-bg);
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .project-nav a:hover {
  background: #FFFFFF;
  color: #0C0D10;
  border-color: #FFFFFF;
}

[data-theme="dark"] .project-strip__btn:hover {
  background: #FFFFFF;
  color: #0C0D10;
  border-color: #FFFFFF;
}

[data-theme="dark"] .back-link {
  background: var(--card-bg);
  color: var(--muted);
  border-color: var(--line);
}

[data-theme="dark"] .back-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

[data-theme="dark"] .stat {
  background: transparent;
  border: none;
}

/* Dark mode logo overrides: turn black elements into white */
[data-theme="dark"] .hero-img[src*="Title.png"],
[data-theme="dark"] img[src*="Title.png"] {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .footer-img,
[data-theme="dark"] img[src*="footer-01.png"] {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] .logo img,
[data-theme="dark"] .loading-logo,
[data-theme="dark"] .hero-img[src*="logo.png"],
[data-theme="dark"] .hero-img[src*="logo-dark.png"] {
  content: url('../assets/logo-dark.png');
}

[data-theme="dark"] .hero-status {
  background: var(--card-bg);
  border-color: var(--line);
}

[data-theme="dark"] .about-content p {
  color: #D1D5DB;
}

[data-theme="dark"] .frame {
  background: var(--paper);
  border-color: var(--line);
}

[data-theme="dark"] .frame__img-wrap,
[data-theme="dark"] .row .frame__img-wrap {
  background: #171920;
}

[data-theme="dark"] .frame__img-wrap::before,
[data-theme="dark"] .row .frame__img-wrap::before {
  background: linear-gradient(
    90deg,
    rgba(25, 27, 34, 0.7) 0%,
    rgba(38, 41, 52, 0.95) 50%,
    rgba(25, 27, 34, 0.7) 100%
  );
  background-size: 200% 100%;
}

/* ---------- Arabic & RTL Layout ---------- */

html[lang="ar"],
html[dir="rtl"] {
  font-family: var(--font-ar);
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] .logo-fallback,
html[lang="ar"] .topnav,
html[lang="ar"] .contact-btn,
html[lang="ar"] .project-nav a,
html[lang="ar"] .back-link,
html[lang="ar"] .stat-number,
html[lang="ar"] .frame__title,
html[lang="ar"] .nav-btn,
html[lang="ar"] .project-strip__num {
  font-family: var(--font-ar);
}

html[dir="rtl"] .topnav a::after {
  left: auto;
  right: 0;
  transform-origin: left;
}
html[dir="rtl"] .topnav a:hover::after {
  transform-origin: right;
}

html[dir="rtl"] .frame__title {
  direction: rtl;
}

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

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

html[dir="rtl"] .contact-btn__arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .contact-btn:hover .contact-btn__arrow {
  transform: translate(-3px, -3px);
}

html[dir="rtl"] .services-col li:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .back-link:hover {
  transform: translateX(4px);
}

html[dir="rtl"] .project-nav a:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .hero p,
html[dir="rtl"] .about-content p,
html[dir="rtl"] .contact p,
html[dir="rtl"] #project-description p,
html[dir="rtl"] .project-direction-wrap p {
  line-height: 1.75;
}

/* Specific image adjustments */
.frame__img--crop-right {
  object-position: left center !important;
}

html[dir="rtl"] .hero-touch-btn:hover .project-strip__btn-arrow,
html[dir="rtl"] .project-touch-btn:hover .project-strip__btn-arrow,
html[dir="rtl"] .project-strip__touch-btn:hover .project-strip__btn-arrow {
  transform: scaleX(-1) translateX(-3px);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .loading-logo { animation: none !important; opacity: 0.95 !important; }
  .project-strip__marquee { animation: none !important; }
  .hero h1, .hero p, .hero-status, .hero-images, .hero-cta { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; }
  .frame, .frame img, .row img, .row video, .project-strip {
    transition: opacity 0.2s ease !important;
    filter: none !important;
    transform: none !important;
  }
}
