/**
 * sections.css
 * ────────────
 * Page section styles: hero, trust bar, projects, services, about,
 * case study pages, and device mockups.
 *
 * Shared UI (buttons, nav, cards) lives in components.css.
 * Breakpoint overrides live in responsive.css.
 */

html[dir="rtl"] {
  --font-display: "Cairo", system-ui, sans-serif;
}

html[dir="ltr"] {
  --font-display: "Inter", "Cairo", system-ui, sans-serif;
}

body {
  font-family: var(--font-display);
}

.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.bg-shape--1 {
  width: 420px;
  height: 420px;
  background: #f0f0f0;
  top: -120px;
  inset-inline-end: -80px;
}

.bg-shape--2 {
  width: 320px;
  height: 320px;
  background: #f5f5f5;
  bottom: 20%;
  inset-inline-start: -100px;
}

.bg-shape--3 {
  width: 260px;
  height: 260px;
  background: #ececec;
  top: 45%;
  inset-inline-end: 15%;
  opacity: 0.2;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  background: transparent;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(236, 236, 236, 0.85);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-switch__divider {
  color: var(--border);
  font-size: 12px;
  user-select: none;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.3s, color 0.3s;
}

.lang-switch__btn.is-active {
  background: var(--accent);
  color: var(--bg);
}

.lang-switch--mobile {
  margin-bottom: 24px;
  width: fit-content;
}

.nav-cta svg,
.btn-primary svg {
  transition: transform 0.35s var(--ease);
}

html[dir="rtl"] .nav-cta svg,
html[dir="rtl"] .btn-primary svg {
  transform: scaleX(-1);
}

.nav-cta:hover svg,
.btn-primary:hover svg {
  transform: translateX(3px);
}

html[dir="rtl"] .nav-cta:hover svg,
html[dir="rtl"] .btn-primary:hover svg {
  transform: scaleX(-1) translateX(-3px);
}

/* ══════════════════════════════════════
   HERO (homepage top section)
   ══════════════════════════════════════ */

.hero {
  position: relative;
  box-sizing: border-box;
  padding: 55px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  margin-bottom: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.hero-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 24px;
}

.hero-text {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.hero-tech__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
}

.hero-tech__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}

.hero-tech__icon svg {
  width: 22px;
  height: 22px;
}

.hero-tech__item span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-tech__item:hover .hero-tech__icon {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-inline: 12px;
  overflow: visible;
}

.hero-macbook {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  transition: transform 0.8s var(--ease);
}

.hero-macbook__float {
  animation: floatMac 7s ease-in-out infinite;
  will-change: transform;
}

.hero-macbook img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.8s var(--ease);
}

html[dir="rtl"] .hero-macbook__img--en {
  display: none;
}

html[dir="ltr"] .hero-macbook__img--ar {
  display: none;
}

.hero-macbook__shadow {
  position: absolute;
  bottom: 2%;
  left: 8%;
  right: 8%;
  height: 52px;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.05) 50%, transparent 75%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.8s var(--ease);
}

@keyframes floatMac {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

/* ══════════════════════════════════════
   TRUST BAR (stats below hero)
   ══════════════════════════════════════ */

.trust-bar {
  padding: 48px 0 64px;
  border-block: 1px solid var(--border);
  background: rgba(250, 250, 250, 0.6);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.trust-item {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.45s var(--ease), box-shadow 0.45s;
}

.trust-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.trust-item__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.trust-item__value {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.trust-item__label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.service-card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
}

.why-card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.about-visual {
  display: flex;
  justify-content: center;
}

.about-image {
  padding: 48px;
  display: grid;
  place-items: center;
  min-height: 360px;
  background: var(--card);
}

.about-image img {
  width: min(280px, 70%);
  height: auto;
  object-fit: contain;
}

/* ══════════════════════════════════════
   PROJECTS (homepage grid)
   ══════════════════════════════════════ */

.projects-section {
  padding: var(--section-gap) 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-card__image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eee;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.project-card:hover .project-card__image img {
  transform: scale(1.05);
}

.project-card__body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
}

.project-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.project-card__category {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.project-card__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-card__desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* ══════════════════════════════════════
   SERVICES
   ══════════════════════════════════════ */

.services-section {
  padding: var(--section-gap) 0;
  background: var(--card);
  border-block: 1px solid var(--border);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  padding: 40px 32px;
  background: var(--bg);
}

.service-card__number {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.service-card__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.service-card__desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   WHY US
   ══════════════════════════════════════ */

.why-section {
  padding: var(--section-gap) 0;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.why-card {
  padding: 36px 28px;
}

.why-card__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.why-card__desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   ABOUT
   ══════════════════════════════════════ */

.about-section {
  padding: var(--section-gap) 0;
  background: var(--card);
  border-block: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(48px, 8vw, 100px);
  align-items: center;
}

.about-content p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-top: 24px;
}

/* ══════════════════════════════════════
   CASE STUDY PAGES (/pages/*.html)
   Content HTML is injected by case-study.js
   ══════════════════════════════════════ */

.case-hero {
  padding: calc(var(--nav-height) + 60px) 0 80px;
}

.case-hero__image {
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 48px;
  border: 1px solid var(--border);
}

.case-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 32px;
}

.case-meta__item span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.case-meta__item strong {
  font-size: 16px;
  font-weight: 600;
}

.case-content {
  padding-bottom: var(--section-gap);
}

.case-block {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: clamp(32px, 5vw, 64px);
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.case-block:last-child {
  border-bottom: none;
}

.case-block__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.case-block__content h3 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.case-block__content p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.case-block__content ul {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.case-block__content li {
  position: relative;
  padding-inline-start: 24px;
  font-size: 16px;
  color: var(--text-secondary);
}

.case-block__content li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ══════════════════════════════════════
   DEVICE SHOWCASE — "Designed for Every Screen"
   CSS-only iMac + iPhone mockups.
   Images come from desktopImage / mobileImage in projects-data.js.
   Layout responsive rules are in responsive.css.
   ══════════════════════════════════════ */

.screenshots-section {
  padding: clamp(96px, 14vw, 180px) 0;
  background: var(--bg);
}

.screenshots-section .section-header {
  text-align: center;
  margin-bottom: clamp(48px, 8vw, 96px);
}

.screenshots-section .section-subtitle {
  margin-inline: auto;
  text-align: center;
}

.device-showcase {
  display: flex;
  justify-content: center;
}

/* ── Stage: positions phone (absolute) + desktop (relative) ── */
.device-showcase__stage {
  position: relative;
  width: min(920px, 100%);
  min-height: clamp(380px, 52vw, 520px);
  padding: clamp(32px, 5vw, 64px) clamp(16px, 3vw, 32px) clamp(48px, 6vw, 72px);
  perspective: 1600px;
}

.device-mockup {
  margin: 0;
}

/* ── iMac / Studio Display ── */

.device-mockup--desktop {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px;
  margin-inline: auto;
  margin-inline-start: clamp(88px, 16vw, 132px);
}

.device-imac {
  transform: rotateX(1.5deg);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.14))
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
}

.device-mockup--desktop:hover .device-imac {
  transform: translateY(-14px) scale(1.02) rotateX(0deg);
  filter: drop-shadow(0 40px 64px rgba(0, 0, 0, 0.18))
    drop-shadow(0 0 48px rgba(0, 0, 0, 0.06))
    drop-shadow(0 12px 24px rgba(0, 0, 0, 0.1));
}

/* ── iMac shell: outer frame, bezel, screen, aluminum chin/neck/stand ── */
.device-imac__shell {
  background: linear-gradient(180deg, #2b2b2d 0%, #1d1d1f 100%);
  border-radius: 20px 20px 0 0;
  padding: 10px 10px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.device-imac__bezel {
  background: #0a0a0a;
  border-radius: 14px;
  padding: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.device-imac__screen {
  aspect-ratio: 16 / 10;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
}

/* Screenshot fills the screen area */
.device-imac__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.device-imac__chin {
  height: clamp(22px, 3vw, 28px);
  background: linear-gradient(
    180deg,
    #ececee 0%,
    #d2d2d7 38%,
    #b8b8bd 100%
  );
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.device-imac__neck {
  width: clamp(64px, 10vw, 88px);
  height: clamp(36px, 5vw, 48px);
  margin-inline: auto;
  background: linear-gradient(
    90deg,
    #c8c8cd 0%,
    #e8e8ed 30%,
    #f5f5f7 50%,
    #e8e8ed 70%,
    #c8c8cd 100%
  );
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.device-imac__stand {
  width: clamp(140px, 22vw, 200px);
  height: clamp(10px, 1.6vw, 14px);
  margin-inline: auto;
  margin-top: -2px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(
    180deg,
    #d1d1d6 0%,
    #e8e8ed 40%,
    #b0b0b5 100%
  );
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ── iPhone ── */

/* Absolute left, rotated -6deg, overlaps desktop by ~80px */
.device-mockup--phone {
  position: absolute;
  inset-inline-start: clamp(0px, 1vw, 8px);
  bottom: clamp(36px, 8vw, 72px);
  z-index: 3;
  width: clamp(148px, 22vw, 210px);
  transform: rotate(-6deg);
  transform-origin: center bottom;
  animation: device-phone-float 5.5s ease-in-out infinite;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.device-mockup--phone:hover {
  animation-play-state: paused;
  transform: translateY(-10px) rotate(-3deg) scale(1.04);
}

/* Gentle up/down float (disabled on prefers-reduced-motion) */
@keyframes device-phone-float {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg);
  }

  50% {
    transform: translateY(-14px) rotate(-6deg);
  }
}

.device-phone__frame {
  position: relative;
  padding: 9px;
  border-radius: 42px;
  background: linear-gradient(
    145deg,
    #3a3a3c 0%,
    #1c1c1e 35%,
    #0a0a0a 65%,
    #2c2c2e 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 24px 48px rgba(0, 0, 0, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.device-phone__screen {
  aspect-ratio: 9 / 19.5;
  border-radius: 34px;
  overflow: hidden;
  background: #000;
  position: relative;
}

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

/* Dynamic Island pill at top of phone frame */
.device-phone__island {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  min-width: 72px;
  max-width: 96px;
  height: clamp(22px, 4.5vw, 28px);
  border-radius: 999px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.6);
  z-index: 2;
  pointer-events: none;
}

.device-phone__glare {
  position: absolute;
  inset: 9px;
  border-radius: 34px;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 18%,
    transparent 42%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 3;
}

.device-phone__edge {
  position: absolute;
  inset: 0;
  border-radius: 42px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 4;
}

.device-mockup__label {
  margin-top: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
}

.device-mockup--phone .device-mockup__label {
  margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .device-mockup--phone {
    animation: none;
  }

  .device-mockup--desktop:hover .device-imac,
  .device-mockup--phone:hover {
    transform: none;
  }
}

.case-hero .btn-group {
  margin-top: 32px;
}

.case-hero .section-title {
  margin-bottom: 0;
}

/* ══════════════════════════════════════
   CTA SECTIONS (homepage + case study bottom)
   ══════════════════════════════════════ */

.cta-section {
  padding: clamp(64px, 10vw, 96px) 0;
  background: var(--card);
  border-block: 1px solid var(--border);
}

.cta-section .section-subtitle {
  margin-inline: auto;
  text-align: center;
}

.cta-section .btn-group {
  margin-top: 32px;
}

.case-cta {
  padding: 80px 0;
  text-align: center;
}

.case-cta .section-title {
  margin-bottom: 32px;
}
