/* =========================================================================
   Mamdouh Aboammar : portfolio page
   One stylesheet serves both the LTR English page and the RTL Arabic page.
   Direction-sensitive values go through logical properties or the --sx flip.
   Tokens follow the repository's Patter design system (see DESIGN.md).
   ========================================================================= */

:root {
  --peach:        #df9367;
  --peach-deep:   #c97a4c;
  --peach-light:  #f3d3bd;
  --peach-cream:  #fff8ef;

  --ink:          #000000;
  --ink-2:        #1a1a1a;
  --ink-body:     #2b2b2b;
  --ink-muted:    #5a5a5a;

  --bg:           #f2efe9;
  --surface:      #ffffff;
  --surface-2:    #faf8f5;
  --surface-dark: #14161c;
  --line:         #000000;
  --line-soft:    #e3ded6;
  --live:         #2ea043;

  /* Playful accent set. Each card claims one through data-accent. */
  --a1: #df9367;   /* peach, the brand anchor */
  --a2: #c6e86c;   /* lime */
  --a3: #8fbef5;   /* sky */
  --a4: #c9a8f2;   /* lilac */
  --a5: #7fd6b4;   /* mint */
  --a6: #f6cf63;   /* butter */
  --accent: var(--a1);
  --accent-ink: #16120e;

  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --bw: 2px;
  --sx: 5px;                       /* horizontal shadow offset, flipped in RTL */
  --sy: 5px;
  --shadow: var(--sx) var(--sy) 0 0 var(--line);
  --shadow-sm: calc(var(--sx) * 0.6) calc(var(--sy) * 0.6) 0 0 var(--line);
  --shadow-lg: calc(var(--sx) * 1.6) calc(var(--sy) * 1.6) 0 0 var(--line);

  --gap: clamp(14px, 2vw, 22px);
  --pad: clamp(18px, 2.4vw, 30px);
  --shell: clamp(16px, 4vw, 44px);
  --section-gap: clamp(56px, 8vw, 116px);
  --maxw: 1280px;

  --focus: var(--ink-2);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

html[lang="ar"] {
  --font-sans: "IBM Plex Sans Arabic", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

[dir="rtl"] { --sx: -5px; }

[data-accent="1"] { --accent: var(--a1); }
[data-accent="2"] { --accent: var(--a2); }
[data-accent="3"] { --accent: var(--a3); }
[data-accent="4"] { --accent: var(--a4); }
[data-accent="5"] { --accent: var(--a5); }
[data-accent="6"] { --accent: var(--a6); }

/* --- dark theme ---------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --peach: #f3a579;
    --peach-deep: #df9367;
    --peach-light: #3a2618;
    --peach-cream: #261911;
    --ink: #000000;
    --ink-2: #f2f2f2;
    --ink-body: #d8dbe0;
    --ink-muted: #9aa1ad;
    --bg: #0b0d12;
    --surface: #161920;
    --surface-2: #1b1f27;
    --surface-dark: #000000;
    --line: #000000;
    --line-soft: #2c313b;
    --a1: #f0a077;
    --a2: #cdeb7a;
    --a3: #9cc8fa;
    --a4: #d3b6f7;
    --a5: #8fe0c1;
    --a6: #f8d876;
  }
}

:root[data-theme="dark"] {
  --a1: #f0a077;
  --a2: #cdeb7a;
  --a3: #9cc8fa;
  --a4: #d3b6f7;
  --a5: #8fe0c1;
  --a6: #f8d876;
  --peach: #f3a579;
  --peach-deep: #df9367;
  --peach-light: #3a2618;
  --peach-cream: #261911;
  --ink: #000000;
  --ink-2: #f2f2f2;
  --ink-body: #d8dbe0;
  --ink-muted: #9aa1ad;
  --bg: #0b0d12;
  --surface: #161920;
  --surface-2: #1b1f27;
  --surface-dark: #000000;
  --line: #000000;
  --line-soft: #2c313b;
}

/* --- base ---------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-block-start: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink-muted) 22%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: clamp(15px, 0.35vw + 14px, 16.5px);
  line-height: 1.65;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  color: var(--ink-2);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.3; }

p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

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

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

/* Dark surfaces need the ring inverted to stay visible against them. */
.pill-dark,
.card-prepilot,
.card-prepilot * { --focus: #f2efe9; }

/* Text for screen readers only, such as the note that a link opens a new tab.
   Matches the definition in assets/portfolio/styles.css. The two stay separate
   copies because this page deliberately loads no stylesheet but its own. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--shell);
  z-index: 200;
  padding: 10px 18px;
  background: var(--peach);
  color: #000;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  font-weight: 600;
  transition: inset-block-start 0.2s var(--ease);
}
.skip-link:focus { inset-block-start: 14px; }

.i { width: 18px; height: 18px; flex: none; }
[dir="rtl"] .i-arrow { transform: scaleX(-1); }

/* --- shell --------------------------------------------------------------- */

main {
  width: min(100% - var(--shell) * 2, var(--maxw));
  margin-inline: auto;
  padding-block: clamp(20px, 4vw, 40px) 0;
}

.section { margin-block-start: var(--section-gap); }

.section-head { max-width: 62ch; margin-block-end: clamp(24px, 3.5vw, 44px); }

.section-title { font-size: clamp(1.7rem, 3.4vw, 2.7rem); }

.section-lede {
  margin-block-start: 14px;
  color: var(--ink-muted);
  font-size: clamp(0.98rem, 0.9vw + 0.75rem, 1.12rem);
}

.section-foot { margin-block-start: clamp(22px, 3vw, 34px); }

/* --- kicker chip --------------------------------------------------------- */

.kicker { margin-block-end: 16px; display: flex; align-items: center; gap: 10px; }

.kicker::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--a3);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  transform: rotate(18deg);
}

.kicker > span {
  display: inline-block;
  padding: 5px 14px;
  background: var(--peach);
  color: #16120e;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[lang="ar"] .kicker > span {
  font-family: var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}

/* --- cards --------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: var(--pad);
}

.card-title { font-size: clamp(1.02rem, 0.7vw + 0.86rem, 1.16rem); }

.card-body {
  margin-block-start: 10px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background-color 0.16s var(--ease);
}

.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.topbar .btn { white-space: nowrap; }

.btn-primary { background: var(--peach); color: #16120e; }
.btn-ghost { background: var(--surface); color: var(--ink-2); }

.btn:hover {
  transform: translate(calc(var(--sx) * -0.5), -2px);
  box-shadow: var(--shadow);
}
.btn:active { transform: translate(0, 0); box-shadow: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface);
  color: var(--ink-2);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color 0.16s var(--ease), transform 0.16s var(--ease);
}
.icon-btn:hover { background: var(--peach); color: #16120e; }
.icon-btn .i { width: 19px; height: 19px; grid-area: 1 / 1; }

/* theme icon swap */
.i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }

/* --- pills & chips ------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 500;
}

.pill-dark {
  background: var(--surface-dark);
  color: #f4f1ec;
  transition: transform 0.16s var(--ease);
}
a.pill-dark:hover { transform: translateY(-2px); }
.pill-dark .i { width: 15px; height: 15px; color: var(--peach); }

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: clamp(22px, 3vw, 30px);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row-tight { gap: 6px; margin-block-start: 18px; }

.chip {
  padding: 5px 12px;
  background: var(--surface-2);
  color: var(--ink-body);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 500;
}

.chip-solid { background: var(--peach); color: #16120e; border-color: var(--line); font-weight: 600; }
.chip-mono { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 16px; }

.tag {
  padding: 3px 10px;
  background: var(--peach-cream);
  color: var(--peach-deep);
  border: 1.5px solid var(--peach-light);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --- topbar -------------------------------------------------------------- */

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  width: min(100% - var(--shell) * 2, var(--maxw));
  margin-inline: auto;
  margin-block-start: 14px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: var(--bw) solid var(--line);
  object-fit: cover;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 0.92rem; color: var(--ink-2); white-space: nowrap; }
.brand-text small { font-size: 0.72rem; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { margin-inline-start: auto; }

.nav-list { display: flex; align-items: center; gap: 4px; }

.nav-list a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-muted);
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}
.nav-list a:hover { color: var(--ink-2); background: var(--surface-2); }
.nav-list a[aria-current="true"] { color: var(--ink-2); background: var(--peach-cream); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.nav + .topbar-actions { margin-inline-start: 0; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  background: var(--surface-2);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
  transition: background-color 0.16s var(--ease);
}
.lang-switch:hover { background: var(--peach); color: #16120e; }
.lang-switch .i { width: 16px; height: 16px; }

.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-menu { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }

/* --- hero ---------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-block-start: clamp(26px, 4vw, 48px);
  align-items: start;
}

.hero-main { padding: clamp(24px, 3.4vw, 46px); }

.hero-title {
  font-size: clamp(2.05rem, 5.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
html[lang="ar"] .hero-title { letter-spacing: 0; font-size: clamp(1.85rem, 4.8vw, 3.5rem); }

.mark {
  display: inline-block;
  padding: 0 16px 3px;
  background: var(--peach);
  color: #16120e;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}

.hero-lede {
  max-width: 58ch;
  margin-block-start: clamp(18px, 2.4vw, 26px);
  color: var(--ink-muted);
  font-size: clamp(1rem, 0.7vw + 0.85rem, 1.15rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: clamp(22px, 3vw, 32px);
}

.hero-side { display: grid; gap: var(--gap); }

.card-portrait { padding: 12px; }

.card-portrait img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--r-md);
  border: var(--bw) solid var(--line);
}

.card-portrait figcaption {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-block-start: 14px;
  padding-inline: 6px;
  padding-block-end: 4px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 24%, transparent);
}

.card-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  background: var(--peach-cream);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.card-link:hover { transform: translate(calc(var(--sx) * -0.6), -3px); box-shadow: var(--shadow-lg); }

.card-link-label {
  grid-column: 1;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--peach-deep);
}
html[lang="ar"] .card-link-label { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; font-size: 0.78rem; }

.card-link-value { grid-column: 1; font-size: 1.3rem; color: var(--ink-2); }

.card-link-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--peach);
  color: #16120e;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
}

/* --- stats --------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-block-start: var(--gap);
}

.stat { text-align: center; padding-block: clamp(20px, 2.6vw, 30px); }

.stat-value {
  display: block;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-2);
  line-height: 1.05;
}

.stat-label {
  display: block;
  margin-block-start: 8px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.stats-note {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-align: center;
}
html[lang="ar"] .stats-note { font-family: var(--font-sans); font-size: 0.8rem; }

/* --- grids --------------------------------------------------------------- */

.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-stack > :first-child { grid-column: 1 / -1; }

/* --- capability cards ---------------------------------------------------- */

.card-cap { transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.card-cap:hover { transform: translate(calc(var(--sx) * -0.5), -3px); box-shadow: var(--shadow-lg); }

.cap-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-block-end: 18px;
  background: var(--peach-cream);
  color: var(--peach-deep);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
}
.cap-icon .i { width: 22px; height: 22px; }

/* --- project cards ------------------------------------------------------- */

.card-project {
  display: flex;
  flex-direction: column;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.card-project:hover { transform: translate(calc(var(--sx) * -0.5), -3px); box-shadow: var(--shadow-lg); }
.card-project .tag-row { margin-block-start: auto; padding-block-start: 16px; }

.project-link { display: block; }

.project-link .card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-go {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-pill);
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.project-go .i { width: 15px; height: 15px; }
.card-project:hover .project-go { background: var(--peach); border-color: var(--line); color: #16120e; }

/* --- stack cards --------------------------------------------------------- */

.stack-title {
  margin-block-end: 16px;
  padding-block-end: 12px;
  border-block-end: 1.5px dashed var(--line-soft);
  font-size: 0.98rem;
}

/* --- principles ---------------------------------------------------------- */

.card-principle { background: var(--surface-2); }

.principle-num {
  display: block;
  margin-block-end: 14px;
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--peach);
  -webkit-text-stroke: 1px var(--line);
  line-height: 1;
}

/* --- background ---------------------------------------------------------- */

.bg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.card-prose { grid-column: span 2; display: grid; gap: 15px; }
.card-prose p { color: var(--ink-muted); }
.card-prose p:first-child { color: var(--ink-body); font-size: 1.05rem; }

.card-quote { background: var(--peach-cream); }
.card-prepilot { grid-column: 1 / -1; background: var(--surface-dark); color: #d9d5cf; }
.card-prepilot .card-title { color: #fff; }
.card-prepilot .card-body { color: #b6b1aa; max-width: 76ch; }
.card-prepilot .btn { margin-block-start: 20px; }

/* --- faq ----------------------------------------------------------------- */

.faq-list { display: grid; gap: 12px; }

.card-faq { padding: 0; }

.card-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 2vw, 22px) var(--pad);
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
}
.card-faq summary::-webkit-details-marker { display: none; }

.faq-mark {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-pill);
}
.faq-mark::before,
.faq-mark::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 9px;
  height: 1.7px;
  background: var(--ink-2);
  transform: translate(-50%, -50%);
  transition: transform 0.2s var(--ease);
}
.faq-mark::after { transform: translate(-50%, -50%) rotate(90deg); }
.card-faq[open] .faq-mark::after { transform: translate(-50%, -50%) rotate(0deg); }
.card-faq[open] .faq-mark { background: var(--peach); border-color: var(--line); }

.card-faq > p {
  padding: 0 var(--pad) var(--pad);
  margin-block-start: -4px;
  color: var(--ink-muted);
  max-width: 82ch;
}

/* --- contact ------------------------------------------------------------- */

.card-contact {
  padding: clamp(26px, 4vw, 56px);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-block-start: clamp(26px, 3.4vw, 38px);
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.contact-card:hover { transform: translate(calc(var(--sx) * -0.5), -2px); box-shadow: var(--shadow); }

.contact-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: var(--peach);
  color: #16120e;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
}

.contact-meta { display: flex; flex-direction: column; min-width: 0; }
.contact-meta small { font-size: 0.72rem; color: var(--ink-muted); }
.contact-meta strong { font-size: 0.86rem; color: var(--ink-2); overflow-wrap: anywhere; }

.availability {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(22px, 4vw, 56px);
  margin-block-start: clamp(26px, 3.4vw, 38px);
  padding-block-start: clamp(22px, 3vw, 32px);
  border-block-start: 1.5px dashed var(--line-soft);
}
.availability-block h3 { margin-block-end: 12px; font-size: 0.85rem; color: var(--ink-muted); font-weight: 600; }

#copy-email { margin-block-start: clamp(22px, 3vw, 30px); }

/* --- footer -------------------------------------------------------------- */

.footer { margin-block-start: var(--section-gap); padding-block-end: clamp(26px, 4vw, 48px); }

.footer-inner {
  width: min(100% - var(--shell) * 2, var(--maxw));
  margin-inline: auto;
  padding-block-start: clamp(24px, 3vw, 36px);
  border-block-start: var(--bw) solid var(--line-soft);
  display: grid;
  gap: 18px;
}

.footer-note { color: var(--ink-muted); font-size: 0.88rem; max-width: 60ch; }

.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }

.footer-links a {
  padding: 7px 15px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.footer-links a:hover { background: var(--peach); color: #16120e; border-color: var(--line); }

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}
html[lang="ar"] .footer-meta { font-family: var(--font-sans); font-size: 0.82rem; }
.footer-meta a { text-decoration: underline; text-underline-offset: 3px; }

/* --- responsive ---------------------------------------------------------- */

@media (min-width: 1800px) {
  :root { --maxw: 1440px; }
}

@media (max-width: 1220px) {
  .brand-text small { display: none; }
  .nav {
    position: fixed;
    inset-block-start: 84px;
    inset-inline: var(--shell);
    z-index: 99;
    padding: 12px;
    background: var(--surface);
    border: var(--bw) solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { padding: 12px 16px; border-radius: var(--r-md); font-size: 0.95rem; }
  .menu-btn { display: inline-grid; }
  .topbar-actions { margin-inline-start: auto; }
}

@media (max-width: 960px) {
  html { scroll-padding-block-start: 84px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bg-grid { grid-template-columns: minmax(0, 1fr); }
  .card-prose { grid-column: auto; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-cta { display: none; }
  .brand-text small { display: none; }
}

@media (max-width: 720px) {
  :root { --sx: 4px; --sy: 4px; }
  [dir="rtl"] { --sx: -4px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-stack { grid-template-columns: minmax(0, 1fr); }
  .hero-side { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .availability { gap: 24px; }
}

@media (max-width: 480px) {
  .topbar { padding: 8px 10px; gap: 8px; }
  .brand-avatar { width: 34px; height: 34px; }
  .brand-text strong { font-size: 0.84rem; }
  .lang-switch { padding: 9px 12px; }
  .lang-switch span { display: none; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .pill { font-size: 0.8rem; padding: 8px 13px; }
  .footer-meta { flex-direction: column; }
}

@media (max-width: 360px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
}

/* --- motion & print ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar, .footer-links, .skip-link, #copy-email { display: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; border-color: #999; }
  .section { margin-block-start: 28px; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.7em; color: #555; }
}

/* =========================================================================
   Playful layer
   Colour rotation, stickers, sparkles, the spinning badge and the ticker.
   Everything decorative is aria-hidden in the markup and motion respects
   the reduced-motion preference.
   ========================================================================= */

/* --- accent-driven details ----------------------------------------------- */

.cap-icon {
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform 0.25s var(--ease), border-radius 0.25s var(--ease);
}
.card-cap:hover .cap-icon { transform: rotate(-8deg) scale(1.08); border-radius: var(--r-pill); }
[dir="rtl"] .card-cap:hover .cap-icon { transform: rotate(8deg) scale(1.08); }

.card-cap::after,
.card-project::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 5px;
  background: var(--accent);
  border-block-end: var(--bw) solid var(--line);
  border-start-start-radius: calc(var(--r-lg) - var(--bw));
  border-start-end-radius: calc(var(--r-lg) - var(--bw));
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.card-cap, .card-project, .card-stack, .stat, .contact-card, .card-principle { position: relative; overflow: hidden; }
.hero-main, .card-contact, .card-portrait, .card-link { position: relative; }
.card-cap:hover::after, .card-project:hover::after { opacity: 1; }

.tag {
  background: color-mix(in srgb, var(--accent) 26%, var(--surface));
  color: var(--ink-2);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.card-project:hover .project-go { background: var(--accent); }

.stat { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); }
.stat-value { color: var(--ink-2); }

.stat::before {
  content: "";
  position: absolute;
  inset-block-end: -28px;
  inset-inline-end: -28px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.28;
}

.principle-num { color: var(--accent); }

.card-principle::before {
  content: "";
  position: absolute;
  inset-block-start: -18px;
  inset-inline-start: -18px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.22;
}

.stack-title::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-inline-end: 9px;
  background: var(--accent);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  transform: rotate(12deg);
}

.contact-icon { background: var(--accent); }
.chip:hover { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); border-color: var(--line); }

/* --- sparkles ------------------------------------------------------------ */

.spark {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  animation: twinkle 4.5s var(--ease) infinite;
}

.spark-a { inset-block-end: 74px; inset-inline-end: 38px; color: var(--a3); }
.spark-b { inset-block-end: 40px; inset-inline-end: 78px; width: 17px; height: 17px; color: var(--a2); animation-delay: 1.4s; }
.spark-c { inset-block-start: 30px; inset-inline-end: 42px; color: var(--a4); }
.spark-d { inset-block-end: 40px; inset-inline-start: 34px; width: 18px; height: 18px; color: var(--a6); animation-delay: 2.1s; }

@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(0.72) rotate(28deg); opacity: 0.45; }
}

/* --- stickers ------------------------------------------------------------ */

.sticker-row {
  position: absolute;
  inset-block-start: clamp(18px, 2.6vw, 30px);
  inset-inline-end: clamp(18px, 2.6vw, 34px);
  display: flex;
  gap: 8px;
  pointer-events: none;
}

.sticker {
  padding: 5px 13px;
  background: var(--accent);
  color: var(--accent-ink);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sticker:nth-child(1) { transform: rotate(-6deg); }
.sticker:nth-child(2) { transform: rotate(3deg); }
.sticker:nth-child(3) { transform: rotate(-3deg); }

html[lang="ar"] .sticker {
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}

/* --- spinning open-to-work badge ----------------------------------------- */

.spin-badge {
  position: absolute;
  inset-block-end: 58px;
  inset-inline-start: -26px;
  z-index: 3;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.spin-badge > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: spin 18s linear infinite;
}

.spin-badge text {
  font-family: var(--font-mono);
  font-size: 9.4px;
  font-weight: 700;
  letter-spacing: 0.06em;
  fill: var(--ink-2);
}

html[lang="ar"] .spin-badge text { font-family: var(--font-sans); font-size: 10.2px; letter-spacing: 0; }

.spin-badge-core {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--a2);
  color: #16120e;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}
.spin-badge-core .i { width: 19px; height: 19px; transform: rotate(-45deg); }
[dir="rtl"] .spin-badge-core .i { transform: scaleX(-1) rotate(-45deg); }

@keyframes spin { to { transform: rotate(360deg); } }

/* --- squiggle under section titles --------------------------------------- */

.section-title { position: relative; display: inline-block; padding-block-end: 12px; }

.squiggle {
  position: absolute;
  inset-block-end: -2px;
  inset-inline-start: 0;
  width: clamp(120px, 34%, 200px);
  height: 11px;
  color: var(--a1);
  opacity: 0.85;
}

/* --- marquee ticker ------------------------------------------------------- */

.marquee {
  position: relative;
  display: flex;
  gap: 0;
  width: 100vw;
  margin-inline-start: 50%;
  transform: translateX(-50%);
  margin-block-start: clamp(34px, 5vw, 56px);
  padding-block: 16px;
  background: var(--surface-dark);
  border-block: var(--bw) solid var(--line);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
[dir="rtl"] .marquee { margin-inline-start: 0; margin-inline-end: 50%; transform: translateX(50%); }

.marquee-track {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  padding-inline-end: 14px;
  animation: ticker 34s linear infinite;
}
[dir="rtl"] .marquee-track { animation-name: ticker-rtl; }

.marquee-track li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f2efe9;
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
  font-weight: 600;
  white-space: nowrap;
}

.marquee-track li::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  transform: rotate(45deg);
}

@keyframes ticker { to { transform: translateX(-100%); } }
@keyframes ticker-rtl { to { transform: translateX(100%); } }

.marquee:hover .marquee-track { animation-play-state: paused; }

/* --- method as a connected path ------------------------------------------ */

.method-path { position: relative; }

.method-path::before {
  content: "";
  position: absolute;
  inset-block-start: 46px;
  inset-inline: 8%;
  border-block-start: 2.5px dashed var(--line-soft);
  z-index: 0;
}

.card-principle { z-index: 1; }

.principle-num {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  background: var(--accent);
  color: var(--accent-ink);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  font-size: 1.15rem;
  -webkit-text-stroke: 0;
}

/* --- wobble on the hero call to action ----------------------------------- */

.hero-actions .btn-primary .i-arrow { transition: transform 0.2s var(--ease); }
.hero-actions .btn-primary:hover .i-arrow { transform: translateX(4px); }
[dir="rtl"] .hero-actions .btn-primary:hover .i-arrow { transform: scaleX(-1) translateX(4px); }

.card-link:hover .card-link-go { animation: nudge 0.6s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(-3px) rotate(-8deg); } }

/* --- confetti burst on copy ---------------------------------------------- */

.confetti {
  position: fixed;
  z-index: 300;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  pointer-events: none;
}

/* --- playful layer: responsive & motion ---------------------------------- */

@media (max-width: 960px) {
  .method-path::before { display: none; }
  .spin-badge { width: 86px; height: 86px; inset-block-end: 44px; inset-inline-start: -18px; }
  .spin-badge-core { width: 36px; height: 36px; }
}

@media (max-width: 720px) {
  .sticker-row { position: static; margin-block-end: 18px; flex-wrap: wrap; }
  .sticker-row li { transform: none; }
  .spark-a, .spark-c { inset-block-start: 14px; inset-inline-end: 16px; width: 20px; height: 20px; }
  .spark-b, .spark-d { display: none; }
  .squiggle { width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .spin-badge > svg,
  .marquee-track,
  .spark,
  .card-link:hover .card-link-go { animation: none; }
}
