/* Adobatech — see DESIGN.md for the system behind these tokens */

/* Alexandria by Mohamed Gaber, SIL Open Font License 1.1 (see assets/fonts/OFL.txt).
   Self-hosted variable font, subset by script. */

@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(assets/fonts/alexandria-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(assets/fonts/alexandria-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url(assets/fonts/alexandria-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* Palette: Nile (default). Alternatives below, chosen with data-palette. */
  --canvas: #F4F5F2;
  --paper: #E9ECE7;
  --ink: #0D1714;
  --muted: #4E5C57;
  --line: #D3D9D4;
  --grid: #E8EBE6;
  --accent: #08745F;
  --accent-hover: #065C4B;
  --on-accent: #FFFFFF;
  --accent-on-ink: #5FD3B4;
  --on-ink-muted: #A9B8B2;

  --font: "Alexandria", "Segoe UI", system-ui, sans-serif;

  /* The brand's weight rule: heavy = built right, light = fast */
  --w-heavy: 900;
  --w-base: 520;
  --w-light: 250;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.4vw, 5.25rem);
  --step-hero: min(clamp(2.6rem, .6rem + 8.4vw, 9.5rem), 11.5svh);

  --gutter: clamp(1rem, 4vw, 3rem);
  --section: clamp(5rem, 10vw, 9rem);
  --radius: 2px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* Hibiscus red, from Egyptian karkadeh */
html[data-palette="karkadeh"] {
  --canvas: #F6F5F2; --paper: #EDECE7; --ink: #16130F; --muted: #5C5852;
  --line: #DAD7D0; --grid: #ECEAE5;
  --accent: #C2123F; --accent-hover: #A10E34; --on-accent: #FFFFFF;
  --accent-on-ink: #FF7A99; --on-ink-muted: #B7B1A9;
}
/* Near-monochrome */
html[data-palette="graphite"] {
  --canvas: #F5F5F4; --paper: #EBEBE9; --ink: #121212; --muted: #5A5A57;
  --line: #D6D6D3; --grid: #EAEAE7;
  --accent: #121212; --accent-hover: #3A3A38; --on-accent: #FFFFFF;
  --accent-on-ink: #FFFFFF; --on-ink-muted: #A3A3A0;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { line-height: 1.9; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100;
  padding: .75rem 1rem; background: var(--ink); color: var(--canvas); text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; min-height: 3.25rem; padding: 0 1.5rem;
  background: var(--accent); color: var(--on-accent); border-radius: var(--radius);
  font-weight: 500; text-decoration: none; transition: background-color .2s;
}
.btn:hover { background: var(--accent-hover); }
.btn-small { min-height: 2.5rem; padding: 0 1rem; font-size: var(--step--1); }

.link {
  font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: .35em; text-decoration-color: var(--line); transition: text-decoration-color .2s;
}
.link:hover { text-decoration-color: currentColor; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: 1rem; }

.wordmark { display: inline-flex; align-items: center; color: var(--ink); }
.wm-svg { display: block; height: 1.375rem; width: auto; }
.wm-svg.wm-ar { height: 1.9rem; }

.nav { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); }
.nav > a:not(.btn):not(.lang) { font-size: var(--step--1); font-weight: 400; text-decoration: none; }
.nav > a:not(.btn):not(.lang):hover { color: var(--accent); }

.lang {
  font: inherit; font-size: var(--step--1); font-weight: 500; color: var(--ink);
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .35rem .7rem; cursor: pointer; transition: border-color .2s;
}
.lang:hover { border-color: var(--ink); }
a.lang { display: inline-flex; align-items: center; text-decoration: none; }

@media (max-width: 40rem) { .nav > a:not(.btn):not(.lang) { display: none; } }

/* ---------- Hero: kinetic type ---------- */

.hero { position: relative; isolation: isolate; overflow: hidden; }

/* Faint construction grid, drawn in on load */
.grid-lines {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  display: grid; grid-template-columns: repeat(6, 1fr);
  width: 100%; max-width: 82rem; margin-inline: auto; padding-inline: var(--gutter);
}
.grid-lines i { border-inline-start: 1px solid var(--grid); transform-origin: top; }
.grid-lines i:last-child { border-inline-end: 1px solid var(--grid); }

.hero-inner {
  min-height: calc(100svh - 4.25rem);
  display: grid; align-content: space-between; gap: 3rem;
  padding-block: clamp(2rem, 6vh, 4rem) clamp(2rem, 5vh, 3.5rem);
}

.kinetic {
  font-size: var(--step-hero);
  font-weight: var(--w-base);
  line-height: .98;
  letter-spacing: -0.045em;
}
.kinetic .row { display: block; overflow: hidden; padding-block: .04em .1em; }
.kinetic .row-in { display: inline-block; }
.w-fast { font-weight: var(--w-light); letter-spacing: -0.03em; }
.w-last { font-weight: var(--w-heavy); }

html[lang="ar"] .kinetic { font-size: calc(var(--step-hero) * .72); letter-spacing: 0; line-height: 1.3; }
html[lang="ar"] .w-fast { letter-spacing: 0; }

.swap {
  display: inline-flex; align-items: center; position: relative;
  height: 1.12em; padding-inline: .14em; margin-inline-start: -.04em;
  color: var(--on-accent); background: var(--accent); vertical-align: bottom;
  overflow: hidden; white-space: nowrap;
}
html[lang="ar"] .swap { height: auto; padding-block: .02em .24em; line-height: 1.5; }
.swap .w, .swap .ch { display: inline-block; }

/* The same line in the other language, changing in step */
.echo {
  margin-top: 1.5rem;
  font-size: clamp(1.1rem, .9rem + 1vw, 1.7rem);
  font-weight: 500; color: var(--muted);
}
.echo[dir="rtl"] { text-align: end; }
.echo b { font-weight: 500; color: var(--accent); }

.hero-below {
  display: grid; gap: 2rem; align-items: end;
  border-top: 1px solid var(--line); padding-top: 1.5rem;
}
@media (min-width: 56rem) { .hero-below { grid-template-columns: 1fr auto; } }
.lede { max-width: 38rem; font-size: 1.1875rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 1.25rem 1.75rem; align-items: center; }

/* Hidden until the intro plays (only when JS runs) */
.js .kinetic .row-in, .js .echo, .js .hero-below { opacity: 0; }
.is-ready .kinetic .row-in, .is-ready .echo, .is-ready .hero-below { opacity: 1; }

/* ---------- Section headings ---------- */

.services-intro h2, .process h2, .origin h2 {
  font-size: var(--step-3); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance;
}
html[lang="ar"] :is(.services-intro h2, .process h2, .origin h2) { letter-spacing: 0; line-height: 1.4; }

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

.services { padding-block: var(--section); background: var(--paper); }
.services-grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) {
  .services-grid { grid-template-columns: 4fr 8fr; gap: 4rem; }
  .services-intro { position: sticky; top: 7rem; align-self: start; }
}
.services-intro p { margin-top: 1.25rem; max-width: 26rem; color: var(--muted); }

.practice-list { border-top: 1px solid var(--ink); }
.practice { border-bottom: 1px solid var(--line); }
.practice h3 { font: inherit; }

.practice-toggle {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name icon" "short icon";
  align-items: center; gap: .25rem 1.5rem; width: 100%; padding: 1.6rem 0;
  font: inherit; color: inherit; text-align: start; background: none; border: 0; cursor: pointer;
}
@media (min-width: 48rem) {
  .practice-toggle { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; grid-template-areas: "name short icon"; }
}
.practice-name {
  grid-area: name; font-size: var(--step-2); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em;
  transition: color .25s;
}
html[lang="ar"] .practice-name { letter-spacing: 0; line-height: 1.5; }
.practice-short { grid-area: short; color: var(--muted); font-size: var(--step--1); font-weight: 400; }
.practice-toggle:hover .practice-name, .practice[data-open] .practice-name { color: var(--accent); }

.practice-icon { grid-area: icon; position: relative; width: 1.25rem; height: 1.25rem; }
.practice-icon::before, .practice-icon::after {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 100%; height: 2px; margin-top: -1px;
  background: currentColor; transition: transform .4s var(--ease-out);
}
.practice-icon::after { transform: rotate(90deg); }
.practice[data-open] .practice-icon::after { transform: rotate(0deg); }

.practice-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); }
.practice[data-open] .practice-body { grid-template-rows: 1fr; }
.practice-inner { overflow: hidden; min-height: 0; }
.practice-inner > p { max-width: 40rem; padding-bottom: 1.25rem; }
.deliverables { display: flex; flex-wrap: wrap; gap: .5rem; padding-bottom: 2rem; }
.deliverables li {
  padding: .3rem .75rem; font-size: var(--step--1); font-weight: 400;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius);
}
html:not(.js) .practice-body { grid-template-rows: 1fr; }

/* ---------- Process ---------- */

.process { padding-block: var(--section); }
.process-head { display: grid; gap: 1.25rem; }
@media (min-width: 60rem) { .process-head { grid-template-columns: 4fr 8fr; gap: 4rem; align-items: end; } }
.process-head p { max-width: 40rem; color: var(--muted); font-size: var(--step-1); }
.process-note {
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.25rem; border-top: 1px solid var(--line);
  font-size: var(--step-2); font-weight: 500; letter-spacing: -0.02em;
}
html[lang="ar"] .process-note { letter-spacing: 0; }
.steps { display: grid; gap: 2.5rem; margin-top: clamp(2.5rem, 5vw, 4rem); counter-reset: step; }
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 70rem) { .steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; } }
.step { counter-increment: step; padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.step::before {
  content: counter(step); display: block; margin-bottom: 2.5rem;
  color: var(--accent); font-size: var(--step-3); font-weight: 200; line-height: 1;
}
html[lang="ar"] .step::before { content: counter(step, arabic-indic); }
.step h3 { font-size: var(--step-1); font-weight: 600; margin-bottom: .5rem; }
.step p { color: var(--muted); max-width: 22rem; }

/* ---------- Why us ---------- */

.origin { padding-block: var(--section); background: var(--paper); }
.origin-grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .origin-grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
.facts { display: grid; gap: 2rem; }
.facts > div { display: grid; gap: .4rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) { .facts > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem; } }
.facts dt { font-size: var(--step-1); font-weight: 500; }
.facts dd { color: var(--muted); }

/* ---------- Team and pricing (sections are commented out in index.html until filled) ---------- */

.team, .pricing { padding-block: var(--section); }
.pricing { background: var(--paper); }
.team-grid, .pricing-grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .team-grid, .pricing-grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
:is(.team, .pricing) h2 { font-size: var(--step-3); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; }
:is(.team, .pricing) h2 + p { margin-top: 1.25rem; max-width: 26rem; color: var(--muted); }
.people { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.person img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--paper); }
.person h3 { margin-top: 1rem; font-size: var(--step-1); font-weight: 600; }
.person .role { color: var(--accent); font-weight: 500; font-size: var(--step--1); }
.person p:not(.role) { margin-top: .5rem; color: var(--muted); }
.person .link { display: inline-block; margin-top: .75rem; }
.prices { display: grid; border-top: 1px solid var(--ink); }
.prices > div { display: grid; gap: .25rem 2rem; padding-block: 1.5rem; border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) { .prices > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); align-items: baseline; } }
.prices dt { font-size: var(--step-1); font-weight: 500; }
.prices .price { font-size: var(--step-1); font-weight: 600; }
.prices dd { margin: 0; color: var(--muted); }
.prices dd.price { color: var(--ink); }

/* ---------- Questions ---------- */

.faq { padding-block: var(--section); }
.faq-grid { display: grid; gap: 2.5rem; }
@media (min-width: 60rem) { .faq-grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
.faq h2 { font-size: var(--step-3); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
html[lang="ar"] .faq h2 { letter-spacing: 0; line-height: 1.4; }
.faq-list { border-top: 1px solid var(--ink); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.4rem 0; font-size: var(--step-1); font-weight: 500; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }
.faq-item[open] .practice-icon::after { transform: rotate(0deg); }
.faq-item .practice-icon { flex: none; }
.faq-item p { max-width: 42rem; padding-bottom: 1.5rem; color: var(--muted); }

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

.contact { padding-block: var(--section); background: var(--ink); color: var(--canvas); }
.contact h2 {
  font-size: var(--step-4); font-weight: 600; line-height: 1.04; letter-spacing: -0.035em;
  max-width: 14ch; text-wrap: balance;
}
html[lang="ar"] .contact h2 { letter-spacing: 0; line-height: 1.4; }
.contact p { margin-top: 1.5rem; max-width: 32rem; font-size: var(--step-1); color: var(--on-ink-muted); }
.contact-email {
  display: inline-block; margin-top: 3rem; font-size: var(--step-3); font-weight: 500; letter-spacing: -0.02em;
  color: var(--canvas); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .3em;
  text-decoration-color: var(--accent-on-ink); word-break: break-all; transition: color .2s;
}
.contact-email:hover { color: var(--accent-on-ink); }
.contact .contact-status { margin-top: 3rem; font-size: var(--step--1); font-weight: 400; color: var(--on-ink-muted); }
.contact :focus-visible { outline-color: var(--accent-on-ink); }
html[lang="ar"] .contact-email { direction: ltr; unicode-bidi: isolate; }

/* ---------- Footer: the wordmark, full width ---------- */

.site-footer { background: var(--ink); color: var(--on-ink-muted); font-size: var(--step--1); font-weight: 400; }
.site-footer > .wrap { padding-top: clamp(3rem, 7vw, 6rem); }
.footer-mark { display: block; width: 100%; height: auto; color: var(--canvas); }
.footer-mark[data-logo-ar] { width: auto; height: clamp(5rem, 18vw, 16rem); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  margin-top: clamp(2rem, 4vw, 3rem); padding-block: 1.5rem 2rem; border-top: 1px solid rgba(255,255,255,.12);
}
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--canvas); }
.site-footer :focus-visible { outline-color: var(--accent-on-ink); }

/* ---------- Comfortable tap targets on touch screens ---------- */

@media (pointer: coarse) {
  .lang, .btn-small { min-height: 2.75rem; }
  .link, .footer-inner a, .wordmark { display: inline-flex; align-items: center; min-height: 2.75rem; }
}

/* ---------- Palette review switcher (only with ?review in the URL; remove before launch) ---------- */

.palette-review {
  position: fixed; inset-inline-end: 1rem; bottom: 1rem; z-index: 200;
  display: flex; gap: .25rem; align-items: center; padding: .35rem;
  background: var(--canvas); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .35); font-size: .8125rem;
}
.palette-review span { padding-inline: .5rem; color: var(--muted); }
.palette-review button {
  display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .65rem;
  font: inherit; color: var(--ink); background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
}
.palette-review button[aria-pressed="true"] { border-color: var(--ink); }
.palette-review i { width: .8rem; height: .8rem; border-radius: 50%; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; }
  .js .kinetic .row-in, .js .echo, .js .hero-below { opacity: 1; }
}
