/*
 * Reda Mohamed — portfolio.
 *
 * Visual language: near-black and deep-purple grounds, one coral accent,
 * very large light-weight lowercase display type, square corners, hairline
 * grids and a quarter-circle + square motif. One stylesheet for both
 * languages. Layout uses logical properties only, so the Arabic page mirrors
 * automatically.
 *
 * Each section sets a small theme (--fg, --muted, --line, --surface…), and
 * components read those tokens, so a tile or row works on light and dark.
 */

:root {
  --night: #0a0014;
  --night-2: #140326;
  --night-3: #1c0935;
  --purple: #4f008c;
  --purple-2: #6a1bb0;
  --violet: #8a3ffc;
  --coral: #ff375e;
  --coral-2: #e8254c;
  --coral-ink: #d1193f;
  --white: #ffffff;
  --mist: #f5f2fa;
  --wa: #25d366;
  --wa-2: #1ebe5b;
  --wa-ink: #04210f;

  --container: 78rem;
  --gutter: 1.25rem;
  --header-h: 4rem;
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', 'Geeza Pro', Tahoma, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* default (dark) theme tokens */
  --fg: var(--white);
  --muted: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.14);
  --line-solid: #2a2138;
  --surface: var(--night);
  --surface-hover: var(--night-3);
  --accent-ink: var(--coral);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-block-start: var(--header-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  background: var(--night);
  overflow-wrap: break-word;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-inline-size: 100%;
}

.sprite {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.container {
  inline-size: 100%;
  max-inline-size: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 768px) {
  :root {
    --gutter: 2.5rem;
  }
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--coral);
  color: var(--white);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.accent {
  color: var(--coral);
}

/* ---------- Section themes ---------- */

.section-light,
.section-mist {
  --fg: var(--purple);
  --muted: #5b4d6e;
  --line: rgba(79, 0, 140, 0.16);
  --line-solid: #e3d9ee;
  --surface: var(--white);
  --surface-hover: #faf6fe;
  --accent-ink: var(--coral-ink);
  color: var(--fg);
  color-scheme: light;
}

.section-mist {
  --surface: var(--mist);
  --surface-hover: var(--white);
  background: var(--mist);
}

.section-light {
  background: var(--white);
}

.section-night {
  background: var(--night);
}

.section-deep {
  --surface: var(--night-2);
  background: linear-gradient(180deg, var(--night-2), var(--purple) 160%);
}

/* ---------- Utility bar + header ---------- */

.topbar {
  background: var(--night);
  border-block-end: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.topbar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  min-block-size: 2.25rem;
  align-items: center;
}

.topbar a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: 2.25rem;
  text-decoration: none;
}

.topbar svg {
  inline-size: 0.85rem;
  block-size: 0.85rem;
  color: var(--coral);
}

.topbar a:hover {
  color: var(--white);
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: rgba(10, 0, 20, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-inline-size: 0;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  inline-size: 1.75rem;
  block-size: 1.75rem;
  flex-shrink: 0;
}

.brand-mark::before,
.brand-mark::after {
  content: '';
  position: absolute;
}

/* Quarter circle + square: the site's motif in miniature. */
.brand-mark::before {
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 1.1rem;
  block-size: 1.1rem;
  background: var(--coral);
  border-start-start-radius: 100%;
}

.brand-mark::after {
  inset-block-end: 0;
  inset-inline-end: 0;
  inline-size: 0.75rem;
  block-size: 0.75rem;
  background: var(--white);
}

.brand-name {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  line-height: 1.15;
  font-weight: 500;
  font-size: 1rem;
}

.brand-name > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-name small {
  font-weight: 300;
  font-size: 0.7rem;
  color: var(--muted);
}

.nav {
  display: none;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.8rem;
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.nav a::after {
  content: '';
  position: absolute;
  inset-inline: 0.8rem;
  inset-block-end: -1px;
  block-size: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

.nav a:hover {
  color: var(--white);
}

.nav a:hover::after,
.nav a[aria-current='location']::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-inline: 1rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-inline-start: 1px solid var(--line);
}

.lang-switch::before {
  content: '';
  inline-size: 0.55rem;
  block-size: 0.55rem;
  background: var(--coral);
}

.lang-switch:hover {
  color: var(--coral);
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  inline-size: 3.5rem;
  border: 0;
  border-inline-start: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.mobile-nav {
  display: none;
  padding-block: 0.5rem 1.25rem;
  border-block-start: 1px solid var(--line);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: flex;
  justify-content: space-between;
  padding-block: 0.85rem;
  font-size: 1.1rem;
  text-decoration: none;
  border-block-end: 1px solid var(--line);
}

.mobile-nav a::after {
  content: '→';
  color: var(--coral);
}

[dir='rtl'] .mobile-nav a::after {
  content: '←';
}

@media (max-width: 419px) {
  .header-inner {
    gap: 0.5rem;
  }

  .lang-switch {
    padding-inline: 0.7rem;
  }

  .lang-switch::before {
    display: none;
  }

  .menu-toggle {
    inline-size: 2.9rem;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .brand-name small {
    font-size: 0.64rem;
  }

  .topbar .topbar-wa {
    display: none;
  }
}

@media (min-width: 1200px) {
  .nav {
    display: flex;
  }

  .menu-toggle,
  .mobile-nav,
  .mobile-nav.is-open {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-block-size: 3rem;
  padding-inline: 1.4rem;
  border: 1px solid transparent;
  border-radius: 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn svg {
  inline-size: 1.15rem;
  block-size: 1.15rem;
  flex-shrink: 0;
}

.btn .arrow::before {
  content: '→';
  display: inline-block;
  transition: translate 0.2s var(--ease);
}

[dir='rtl'] .btn .arrow::before {
  content: '←';
}

.btn:hover .arrow::before {
  translate: 4px 0;
}

[dir='rtl'] .btn:hover .arrow::before {
  translate: -4px 0;
}

.btn-coral {
  background: var(--coral);
  color: var(--white);
}

.btn-coral:hover {
  background: var(--coral-2);
}

.btn-line {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
}

.btn-line:hover {
  border-color: var(--white);
}

/* WhatsApp: official green, dark ink for readable text. */
.btn-wa {
  min-block-size: 3.25rem;
  padding-inline: 1.3rem 1.6rem;
  background: var(--wa);
  color: var(--wa-ink);
  font-weight: 500;
}

.btn-wa svg {
  inline-size: 1.4rem;
  block-size: 1.4rem;
}

.btn-wa:hover {
  background: var(--wa-2);
}

.header-cta.btn {
  display: none;
  min-block-size: auto;
  padding-inline: 1.4rem;
}

@media (min-width: 1024px) {
  .header-cta.btn {
    display: inline-flex;
  }
}

/* ---------- Typography ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
}

.eyebrow::before {
  content: '';
  inline-size: 0.5rem;
  block-size: 0.5rem;
  background: currentColor;
}

html[lang='ar'] .eyebrow {
  letter-spacing: 0;
  font-size: 0.85rem;
}

.display {
  margin: 0;
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

html[lang='en'] .display {
  text-transform: lowercase;
}

html[lang='ar'] .display {
  line-height: 1.3;
  letter-spacing: 0;
}

/* Acronyms in the cycling word keep their case. */
html[lang='en'] .display .keep-case {
  text-transform: none;
}

.display-xl {
  font-size: clamp(2.35rem, 8.6vw, 6.75rem);
}

.display-lg {
  font-size: clamp(2rem, 5.2vw, 3.75rem);
}

html[lang='ar'] .display-xl {
  font-size: clamp(2.1rem, 6.4vw, 5.25rem);
}

html[lang='ar'] .display-lg {
  font-size: clamp(1.85rem, 4.4vw, 3.25rem);
}

.lede {
  margin: 0;
  max-inline-size: 38rem;
  font-size: 1.05rem;
  color: var(--muted);
}

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

.hero {
  position: relative;
  overflow: hidden;
  min-block-size: calc(100svh - 6.25rem);
  display: flex;
  background:
    radial-gradient(38rem 28rem at 88% 18%, rgba(138, 63, 252, 0.55), transparent 65%),
    radial-gradient(30rem 22rem at 70% 90%, rgba(255, 55, 94, 0.22), transparent 70%),
    linear-gradient(160deg, var(--night) 20%, var(--purple) 140%);
}

[dir='rtl'] .hero {
  background:
    radial-gradient(38rem 28rem at 12% 18%, rgba(138, 63, 252, 0.55), transparent 65%),
    radial-gradient(30rem 22rem at 30% 90%, rgba(255, 55, 94, 0.22), transparent 70%),
    linear-gradient(200deg, var(--night) 20%, var(--purple) 140%);
}

/* Light beams, drawn with gradients only. */
.hero::before {
  content: '';
  position: absolute;
  inset-block: -20%;
  inset-inline-end: -10%;
  inline-size: 60%;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0) 0 22px, rgba(216, 180, 254, 0.07) 22px 24px);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
}

[dir='rtl'] .hero::before {
  background: repeating-linear-gradient(65deg, rgba(255, 255, 255, 0) 0 22px, rgba(216, 180, 254, 0.07) 22px 24px);
  mask-image: linear-gradient(270deg, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(270deg, transparent, #000 60%);
}

.hero > .container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding-block: 3.5rem 4.5rem;
}

@media (min-width: 768px) {
  .hero > .container {
    padding-block: 6rem 5rem;
  }
}

.hero-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.12em;
  color: var(--coral);
}

.hero-title::before {
  content: '';
  flex-shrink: 0;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  background: currentColor;
}

html[lang='ar'] .hero-title {
  letter-spacing: 0;
  font-size: 0.95rem;
}

.hero-line {
  display: block;
}

/* All words sit in one grid cell; the invisible ones reserve the space of the
   longest, so the cycling word never shifts the layout. */
.cycle-wrap {
  display: grid;
  color: var(--coral);
}

.cycle-wrap > * {
  grid-area: 1 / 1;
}

.cycle-sizer {
  visibility: hidden;
}

.hero-bottom {
  display: grid;
  gap: 2.5rem;
  align-items: end;
}

@media (min-width: 1024px) {
  .hero-bottom {
    grid-template-columns: minmax(0, 1fr) 27rem;
    gap: 4rem;
  }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 1.75rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--line);
}

@media (min-width: 640px) and (max-width: 1023px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  padding-block-start: 1.25rem;
  padding-inline-end: 1rem;
}

.stat strong {
  display: block;
  white-space: nowrap;
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  font-weight: 300;
  line-height: 1.05;
}

.stat span {
  display: block;
  margin-block-start: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Corner shapes: coral quarter circle beside two squares. */
.shapes {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  display: grid;
  grid-template-columns: repeat(2, 3.5rem);
  grid-template-rows: repeat(2, 3.5rem);
  pointer-events: none;
}

.shapes span:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  background: var(--coral);
  border-start-start-radius: 100%;
}

.shapes span:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
  background: var(--white);
}

.shapes span:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
  background: var(--purple);
}

@media (max-width: 767px) {
  .shapes {
    grid-template-columns: repeat(2, 2rem);
    grid-template-rows: repeat(2, 2rem);
  }
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding-block: 5rem;
  scroll-margin-block-start: var(--header-h);
}

@media (min-width: 768px) {
  .section {
    padding-block: 7rem;
  }
}

.split {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 5rem;
  }

  .split > .section-head {
    position: sticky;
    inset-block-start: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

.section-head .display {
  margin-block-start: 1rem;
}

.section-head p:not(.eyebrow) {
  margin: 1.25rem 0 0;
  max-inline-size: 34rem;
  color: var(--muted);
}

/* ---------- Tiles (track record / capabilities) ---------- */

.tiles {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}

@media (min-width: 640px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tiles-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tiles-spaced {
  margin-block-start: 3rem;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.9rem 1.6rem;
  background: var(--surface);
  transition: background-color 0.25s;
}

.tile::after {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  background: var(--coral);
  border-end-start-radius: 100%;
  transform: scale(0);
  transform-origin: var(--corner-origin, 100% 0);
  transition: transform 0.3s var(--ease);
}

[dir='rtl'] .tile::after,
[dir='rtl'] .work-card::after {
  --corner-origin: 0 0;
}

.tile:hover {
  background: var(--surface-hover);
}

.tile:hover::after {
  transform: scale(1);
}

.tile-icon {
  inline-size: 1.75rem;
  block-size: 1.75rem;
  color: var(--coral);
}

.tile h3 {
  margin: 0.25rem 0 0;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.35;
}

.tile p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

.tile .tag {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
}

/* ---------- Work (the showpiece) ---------- */

.section-work {
  --line-solid: #2a2138;
  overflow: hidden;
  background:
    radial-gradient(44rem 30rem at 100% 0%, rgba(79, 0, 140, 0.45), transparent 70%),
    var(--night);
}

[dir='rtl'] .section-work {
  background:
    radial-gradient(44rem 30rem at 0% 0%, rgba(79, 0, 140, 0.45), transparent 70%),
    var(--night);
}

.work-head {
  display: grid;
  gap: 2rem;
  align-items: end;
}

@media (min-width: 1024px) {
  .work-head {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 4rem;
  }
}

/* Filter chips appear only when the script can drive them. */
.filters {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.js .filters {
  display: flex;
}

@media (min-width: 1024px) {
  .js .filters {
    justify-content: flex-end;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-block-size: 2.75rem;
  padding-inline: 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: 0.88rem;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--coral);
}

.chip-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed='true'] {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
}

.chip[aria-pressed='true'] .chip-count {
  color: rgba(255, 255, 255, 0.85);
}

.work-grid {
  display: grid;
  gap: 1px;
  margin: 3rem 0 0;
  padding: 1px;
  list-style: none;
}

@media (min-width: 640px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card.is-lead {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .work-card {
    grid-column: span 3;
  }

  .work-card.is-lead {
    grid-column: span 6;
  }

  .work-grid.is-filtered .work-card {
    grid-column: span 4;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .work-grid.is-filtered .work-card.is-lead {
    grid-column: auto;
  }
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-block-size: 18rem;
  padding: 1.6rem 1.5rem 1.5rem;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-solid);
  transition: background-color 0.25s;
}

.work-card[hidden],
.more-row[hidden] {
  display: none;
}

.work-card::after {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  background: var(--coral);
  border-end-start-radius: 100%;
  transform: scale(0.35);
  transform-origin: var(--corner-origin, 100% 0);
  transition: transform 0.35s var(--ease);
}

.work-card:hover {
  background: var(--surface-hover);
}

.work-card:hover::after,
.work-card:focus-within::after {
  transform: scale(1);
}

.work-card.is-lead {
  min-block-size: 22rem;
  padding: 2rem 2rem 1.75rem;
  background:
    linear-gradient(160deg, rgba(79, 0, 140, 0.35), transparent 60%),
    var(--surface);
}

.work-card.is-lead:hover {
  background:
    linear-gradient(160deg, rgba(79, 0, 140, 0.5), transparent 60%),
    var(--surface-hover);
}

.work-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-inline-end: 2.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

html[lang='ar'] .work-top {
  letter-spacing: 0;
  font-size: 0.8rem;
}

.work-index {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.work-tag {
  color: var(--coral);
}

.work-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.work-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.25;
}

.work-card.is-lead .work-name {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

html[lang='ar'] .work-card.is-lead .work-name {
  line-height: 1.3;
  letter-spacing: 0;
}

.work-alt {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.work-desc {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

.work-card.is-lead .work-desc {
  max-inline-size: 34rem;
  font-size: 1rem;
}

.work-meta {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: auto;
}

/* Store / website badges: drawn in the site style, not vendor artwork. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-block-size: 2.75rem;
  padding-inline: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: #000;
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.badge svg {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  flex-shrink: 0;
}

.badge .ext {
  inline-size: 0.8rem;
  block-size: 0.8rem;
  margin-inline-start: -0.15rem;
  opacity: 0.7;
}

[dir='rtl'] .badge .ext,
[dir='rtl'] .mini-link .ext,
[dir='rtl'] .text-link .ext {
  transform: scaleX(-1);
}

.badge.is-web {
  background: var(--white);
  border-color: var(--white);
  color: var(--night);
}

.badge:hover {
  border-color: var(--coral);
}

.badge.is-web:hover {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
}

/* More projects: a compact disclosure list. */
.more-work {
  margin-block-start: 3rem;
  border-block: 1px solid var(--line);
}

.more-work summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-block-size: 4rem;
  cursor: pointer;
  list-style: none;
  font-size: 1.15rem;
  font-weight: 400;
}

.more-work summary::-webkit-details-marker {
  display: none;
}

.more-work summary:hover .more-label {
  color: var(--coral);
}

.more-count {
  display: inline-grid;
  place-items: center;
  min-inline-size: 1.75rem;
  block-size: 1.75rem;
  padding-inline: 0.4rem;
  background: var(--coral);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 500;
}

.more-work .row-toggle {
  margin-inline-start: auto;
}

.more-work .when-open,
.more-work[open] .when-closed {
  display: none;
}

.more-work[open] .when-open {
  display: inline;
}

.more-list {
  margin: 0;
  padding: 0 0 1.5rem;
  list-style: none;
}

.more-row {
  display: grid;
  gap: 0.35rem 1.5rem;
  padding-block: 1.1rem;
  border-block-start: 1px solid var(--line);
}

@media (min-width: 900px) {
  .more-row {
    grid-template-columns: minmax(0, 15rem) 8rem minmax(0, 1fr) auto;
    align-items: baseline;
  }
}

.more-name {
  display: flex;
  flex-direction: column;
  font-weight: 400;
  line-height: 1.4;
}

.more-name small {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--muted);
}

.more-tag {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--coral);
}

html[lang='ar'] .more-tag {
  letter-spacing: 0;
  font-size: 0.8rem;
}

.more-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.mini-link,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: 2.75rem;
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  border-block-end: 1px solid transparent;
}

.mini-link svg {
  inline-size: 1rem;
  block-size: 1rem;
  color: var(--coral);
}

.mini-link .ext,
.text-link .ext {
  inline-size: 0.8rem;
  block-size: 0.8rem;
  color: currentColor;
  opacity: 0.7;
}

.mini-link:hover,
.text-link:hover {
  color: var(--coral);
}

/* ---------- Experience (expandable rows) ---------- */

.rows {
  border-block-start: 1px solid var(--line);
}

.row {
  border-block-end: 1px solid var(--line);
}

.row summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding-block: 1.35rem;
  cursor: pointer;
  list-style: none;
}

.row summary::-webkit-details-marker {
  display: none;
}

.row summary:hover .row-title {
  color: var(--accent-ink);
}

.row-title {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.4;
  transition: color 0.2s;
}

.row-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.row-meta .company {
  color: var(--accent-ink);
  font-weight: 400;
}

/* Plus that turns into a cross. */
.row-toggle {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  inline-size: 2rem;
  block-size: 2rem;
  flex-shrink: 0;
  transition: rotate 0.25s var(--ease);
}

.row-toggle::before,
.row-toggle::after {
  content: '';
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: 0.95rem;
  block-size: 1.5px;
  margin-block-start: -0.75px;
  margin-inline-start: -0.475rem;
  background: var(--accent-ink);
}

.row-toggle::after {
  rotate: 90deg;
}

.row[open] .row-toggle,
.more-work[open] .row-toggle {
  rotate: 45deg;
}

.row-body {
  padding-block-end: 1.5rem;
  color: var(--muted);
}

.row-body ul {
  margin: 0;
  padding-inline-start: 1.1rem;
}

.row-body li + li {
  margin-block-start: 0.4rem;
}

.row-body li::marker {
  color: var(--accent-ink);
}

.row-link {
  margin: 0.75rem 0 0;
}

.row-body .text-link {
  color: var(--fg);
  min-block-size: auto;
  border-block-end-color: var(--line);
}

/* ---------- Chips (skills) ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  font-size: 0.87rem;
}

.skill-groups {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .skill-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.skill-group h3 {
  margin: 0 0 1rem;
  padding-block-end: 0.75rem;
  border-block-end: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
}

html[lang='ar'] .skill-group h3 {
  letter-spacing: 0;
  font-size: 0.9rem;
}

/* ---------- Education list ---------- */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--line);
}

.list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding-block: 1.15rem;
  border-block-end: 1px solid var(--line);
}

.list strong {
  font-weight: 400;
}

.list span {
  font-size: 0.88rem;
  color: var(--muted);
}

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

.band {
  overflow: hidden;
  background:
    radial-gradient(40rem 26rem at 90% 10%, rgba(138, 63, 252, 0.5), transparent 70%),
    linear-gradient(135deg, var(--purple), var(--night-2));
}

[dir='rtl'] .band {
  background:
    radial-gradient(40rem 26rem at 10% 10%, rgba(138, 63, 252, 0.5), transparent 70%),
    linear-gradient(225deg, var(--purple), var(--night-2));
}

.band {
  --line: rgba(255, 255, 255, 0.2);
  --muted: rgba(255, 255, 255, 0.74);
}

.contact-list {
  display: grid;
  align-content: start;
  border-block-start: 1px solid var(--line);
}

.contact-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding-block: 1.2rem;
  border-block-end: 1px solid var(--line);
  text-decoration: none;
}

.contact-item > svg {
  inline-size: 1.4rem;
  block-size: 1.4rem;
  color: var(--coral);
}

.contact-item small {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

html[lang='ar'] .contact-item small {
  letter-spacing: 0;
  font-size: 0.82rem;
}

.contact-item b {
  display: block;
  font-weight: 400;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

/* Phone and e-mail read left-to-right but line up with the Arabic labels. */
[dir='rtl'] .contact-item b.ltr {
  text-align: end;
}

.contact-item .go::before {
  content: '→';
  display: inline-block;
  color: var(--coral);
  transition: translate 0.2s var(--ease);
}

[dir='rtl'] .contact-item .go::before {
  content: '←';
}

a.contact-item:hover b {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-underline-offset: 4px;
}

a.contact-item:hover .go::before {
  translate: 4px 0;
}

[dir='rtl'] a.contact-item:hover .go::before {
  translate: -4px 0;
}

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

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--purple);
  color: var(--white);
  padding-block-end: 1rem;
}

.site-footer::after {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: 7rem;
  block-size: 7rem;
  background: var(--coral);
  border-end-start-radius: 100%;
  opacity: 0.9;
  pointer-events: none;
}

.footer-top {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.5rem;
  padding-block: 4.5rem 3rem;
}

@media (min-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.footer-statement {
  max-inline-size: 12ch;
}

html[lang='ar'] .footer-statement {
  max-inline-size: 14ch;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.5rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--coral);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
  border-block-start: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.78);
}

.rights {
  margin: 0;
}

.social {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  color: var(--white);
}

.social a:hover {
  color: var(--coral);
}

.social svg {
  inline-size: 1.2rem;
  block-size: 1.2rem;
}

/* ---------- Floating WhatsApp button ---------- */

.wa-float {
  position: fixed;
  z-index: 60;
  inset-inline-end: calc(1.25rem + env(safe-area-inset-right, 0px));
  inset-block-end: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  inline-size: 56px;
  block-size: 56px;
  border-radius: 50%;
  background: var(--wa);
  color: var(--wa-ink);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s var(--ease), opacity 0.25s, visibility 0.25s, background-color 0.2s;
}

[dir='rtl'] .wa-float {
  inset-inline-end: calc(1.25rem + env(safe-area-inset-left, 0px));
}

.wa-float svg {
  inline-size: 30px;
  block-size: 30px;
}

.wa-float:hover {
  background: var(--wa-2);
  transform: translateY(-2px);
}

.wa-float:focus-visible {
  outline-offset: 4px;
}

/* One-time attention ring. */
.wa-float::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  pointer-events: none;
}

/* Runs once, the first time the button comes into view (class set by JS). */
@media (prefers-reduced-motion: no-preference) {
  .wa-float.is-greeted::before {
    animation: wa-pulse 1.6s ease-out 0.6s 2 both;
  }
}

@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  }

  100% {
    box-shadow: 0 0 0 18px rgba(37, 211, 102, 0);
  }
}

/* Tooltip label (desktop pointers only). */
.wa-tip {
  position: absolute;
  inset-inline-end: calc(100% + 0.75rem);
  inset-block-start: 50%;
  padding: 0.45rem 0.8rem;
  background: var(--white);
  color: var(--night);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translate(6px, -50%);
  transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
  pointer-events: none;
}

[dir='rtl'] .wa-tip {
  transform: translate(-6px, -50%);
}

@media (hover: hover) and (pointer: fine) {
  .wa-float:hover .wa-tip,
  .wa-float:focus-visible .wa-tip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
  }
}

.wa-float.is-away {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .topbar,
  .site-header,
  .hero-cta,
  .filters,
  .band .hero-cta,
  .wa-float,
  .shapes,
  .site-footer::after {
    display: none !important;
  }

  body,
  .hero,
  .section,
  .work-card,
  .tile {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  .more-work .more-list {
    display: block;
  }
}


/* The corner shapes would sit on top of the last stat until the hero is wide
   enough to give them their own corner. */
@media (max-width: 1299px) {
  .hero .shapes {
    display: none;
  }
}

/* Without JavaScript the menu button has nothing to open. */
html:not(.js) .menu-toggle {
  display: none;
}

/* =========================================================================
   Palette B — charcoal with a muted gold accent (chosen 2026-09-28).
   Replaces the purple/coral look: no gradients, no light beams, no corner
   shapes. Sections alternate between two charcoals; gold appears only on the
   call to action, one word per heading and the small labels. The floating
   WhatsApp button keeps its own green.
   ========================================================================= */

:root {
  --night: #111214;
  --night-2: #16171a;
  --night-3: #1f2024;
  --purple: #1b1c20;
  --purple-2: #232428;
  --violet: #e2b25c;
  --coral: #e2b25c;
  --coral-2: #d4a24e;
  --coral-ink: #e2b25c;
  --mist: #1b1c20;
  --white: #f1f1ef;
  --on-gold: #111214;

  --fg: #f1f1ef;
  --muted: #a6a8ad;
  --line: rgba(255, 255, 255, 0.1);
  --line-solid: #2c2e33;
  --surface: var(--night);
  --surface-hover: var(--night-3);
  --accent-ink: var(--coral);
}

/* The former light sections become the second charcoal. */
.section-light,
.section-mist {
  --fg: #f1f1ef;
  --muted: #a6a8ad;
  --line: rgba(255, 255, 255, 0.1);
  --line-solid: #2c2e33;
  --surface: #1b1c20;
  --surface-hover: #232428;
  --accent-ink: #e2b25c;
  background: #1b1c20;
  color-scheme: dark;
}

/* Flat grounds everywhere. */
.hero,
[dir='rtl'] .hero,
.section-work,
[dir='rtl'] .section-work {
  background: var(--night);
}

.hero::before,
.shapes,
.hero .shapes {
  display: none;
}

.section-deep {
  background: var(--night-2);
}

.work-card.is-lead,
.work-card.is-lead:hover {
  background: var(--night-3);
}

.band,
[dir='rtl'] .band {
  background: #1b1c20;
}

.site-footer {
  background: #0c0d0f;
  border-block-start: 1px solid var(--line);
}

.site-header {
  background: rgba(17, 18, 20, 0.9);
}

/* Dark ink on gold for legibility. */
.skip-link,
.btn-coral,
.btn-coral:hover,
.chip[aria-pressed='true'],
.more-count,
.badge.is-web:hover {
  color: var(--on-gold);
}

/* Palette B keeps the page quiet: no decorative quarter circles. */
.tile::after,
.work-card::after,
.site-footer::after {
  display: none;
}

/* Softer whites: nothing on the page is pure bright white. */
:root {
  --white: #dedcd4;
  --fg: #dedcd4;
  --muted: #9a9ca1;

  /* WhatsApp takes the site's colours: gold buttons, grey floating button. */
  --wa: #e2b25c;
  --wa-2: #d4a24e;
  --wa-ink: #111214;
}

.section-light,
.section-mist {
  --fg: #dedcd4;
  --muted: #9a9ca1;
}

.wa-float {
  background: #34353a;
  color: #e2b25c;
  box-shadow: 0 0 0 1px rgba(226, 178, 92, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.wa-float:hover {
  background: #3d3e44;
}

.wa-float::before {
  box-shadow: 0 0 0 0 rgba(226, 178, 92, 0.45);
}

@keyframes wa-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(226, 178, 92, 0.45);
  }

  100% {
    box-shadow: 0 0 0 18px rgba(226, 178, 92, 0);
  }
}
