/* sa3d — identity system
   ink / paper / ember. The "3" is the ع in سعد: the bridge between two languages. */
:root {
  --ink: #0b0c0e; --ink-2: #111317; --ink-3: #181b21;
  --paper: #f3eee4; --muted: #a7a196; --dim: #6f6b64;
  --ember: #ff5a1f; --ember-2: #ff8a4c; --alt: #ff5a1f; --on-a: #160700;
  --ink-rgb: 11 12 14; --ink2-rgb: 17 19 23; --paper-rgb: 243 238 228; --a-rgb: 255 90 31;
  --ember-glow: rgb(var(--a-rgb) / .18);
  --line: rgb(var(--paper-rgb) / .09);
  --line-2: rgb(var(--paper-rgb) / .16);
  --sand: #d9c7a3;
  --ok: #4ade80;
  --warn: #fbbf24;
  --radius: 18px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --f-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Alexandria", system-ui, sans-serif;
  --f-latin: "Space Grotesk", "Alexandria", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
/* palettes */
html[data-pal="b"] { --ink:#06090a; --ink-2:#0d1312; --ink-3:#131b19; --paper:#e6f2ec; --muted:#8fa39a; --dim:#5e6e67; --ember:#2be38b; --ember-2:#5cf0a8; --alt:#ffb020; --on-a:#03140b; --ink-rgb:6 9 10; --ink2-rgb:13 19 18; --paper-rgb:230 242 236; --a-rgb:43 227 139; }
html[data-pal="c"] { --ink:#0a0709; --ink-2:#140e12; --ink-3:#1c1419; --paper:#f4ecef; --muted:#a8979e; --dim:#6e6168; --ember:#ff2d55; --ember-2:#ff5c7a; --alt:#3ddcff; --on-a:#19020a; --ink-rgb:10 7 9; --ink2-rgb:20 14 18; --paper-rgb:244 236 239; --a-rgb:255 45 85; }
html[data-pal="d"] { --ink:#08080f; --ink-2:#11111c; --ink-3:#181826; --paper:#eeeefb; --muted:#9c9cb8; --dim:#64647e; --ember:#7c5cff; --ember-2:#9c85ff; --alt:#22d3ee; --on-a:#ffffff; --ink-rgb:8 8 15; --ink2-rgb:17 17 28; --paper-rgb:238 238 251; --a-rgb:124 92 255; }
html[data-pal="e"] { --ink:#070b14; --ink-2:#0e1424; --ink-3:#141c30; --paper:#f2eadb; --muted:#a39c8c; --dim:#6b6759; --ember:#e3b45c; --ember-2:#f0c97a; --alt:#f5d79a; --on-a:#1a1203; --ink-rgb:7 11 20; --ink2-rgb:14 20 36; --paper-rgb:242 234 219; --a-rgb:227 180 92; }
html[data-pal="f"] { --ink:#0b0c08; --ink-2:#13150e; --ink-3:#1b1e14; --paper:#eef0e4; --muted:#a2a691; --dim:#6a6e5a; --ember:#d4ff3a; --ember-2:#e6ff8a; --alt:#b9a6ff; --on-a:#0b0c08; --ink-rgb:11 12 8; --ink2-rgb:19 21 14; --paper-rgb:238 240 228; --a-rgb:212 255 58; }
html[data-pal="g"] { --ink:#070a1f; --ink-2:#0d1230; --ink-3:#141a40; --paper:#f1eee8; --muted:#a3a6bf; --dim:#666a88; --ember:#ffb38a; --ember-2:#ffd0b5; --alt:#5b6cff; --on-a:#1a0d05; --ink-rgb:7 10 31; --ink2-rgb:13 18 48; --paper-rgb:241 238 232; --a-rgb:255 179 138; }
html[data-pal="h"] { --ink:#0e0708; --ink-2:#180d0f; --ink-3:#221316; --paper:#efe6da; --muted:#a99c90; --dim:#6f625a; --ember:#c8a15a; --ember-2:#e0c084; --alt:#c22a45; --on-a:#140b05; --ink-rgb:14 7 8; --ink2-rgb:24 13 15; --paper-rgb:239 230 218; --a-rgb:200 161 90; }
html[data-pal="i"] { --ink:#031013; --ink-2:#081a1e; --ink-3:#0e252a; --paper:#e8f4f1; --muted:#8fb0aa; --dim:#557570; --ember:#00e5c3; --ember-2:#6bf3dc; --alt:#ff6b5a; --on-a:#02110e; --ink-rgb:3 16 19; --ink2-rgb:8 26 30; --paper-rgb:232 244 241; --a-rgb:0 229 195; }
html[data-pal="j"] { --ink:#060608; --ink-2:#0e0e12; --ink-3:#16161c; --paper:#f2f2f5; --muted:#a0a0ad; --dim:#666673; --ember:#8af3ff; --ember-2:#c9a7ff; --alt:#ff7ce5; --on-a:#060608; --ink-rgb:6 6 8; --ink2-rgb:14 14 18; --paper-rgb:242 242 245; --a-rgb:138 243 255; }
html[data-pal="k"] { --ink:#efeae0; --ink-2:#e6e0d4; --ink-3:#ddd6c8; --paper:#111114; --muted:#55514a; --dim:#8a857b; --ember:#2b3bff; --ember-2:#5563ff; --alt:#ff4d2e; --on-a:#ffffff; --ink-rgb:239 234 224; --ink2-rgb:230 224 212; --paper-rgb:17 17 20; --a-rgb:43 59 255; color-scheme: light; }
html[data-pal="k"] body::before { opacity: .035; mix-blend-mode: multiply; }
html[data-pal="k"] .sc::after { background: #fff; }
html[data-pal="k"] .alert.bad { color: #9b1c1c; }

/* G — light variant (explicit choice, or system light when no choice) */
html[data-pal="g"][data-theme="light"] { --ink:#f5f1ea; --ink-2:#ece6db; --ink-3:#e2dbce; --paper:#0b1033; --muted:#4a4f6e; --dim:#878aa3; --ember:#3046ff; --ember-2:#5b6cff; --alt:#f0875a; --on-a:#ffffff; --ink-rgb:245 241 234; --ink2-rgb:236 230 219; --paper-rgb:11 16 51; --a-rgb:48 70 255; color-scheme: light; }
html[data-pal="g"][data-theme="light"] body::before { opacity: .04; mix-blend-mode: multiply; }
html[data-pal="g"][data-theme="light"] .sc::after { background: #fff; }
html[data-pal="g"][data-theme="light"] .alert.bad { color: #9b1c1c; }
html[data-pal="g"][data-theme="light"] .mq-track .o { -webkit-text-stroke-color: rgb(var(--paper-rgb) / .28); }
@media (prefers-color-scheme: light) {
  html[data-pal="g"]:not([data-theme="dark"]) { --ink:#f5f1ea; --ink-2:#ece6db; --ink-3:#e2dbce; --paper:#0b1033; --muted:#4a4f6e; --dim:#878aa3; --ember:#3046ff; --ember-2:#5b6cff; --alt:#f0875a; --on-a:#ffffff; --ink-rgb:245 241 234; --ink2-rgb:236 230 219; --paper-rgb:11 16 51; --a-rgb:48 70 255; color-scheme: light; }
  html[data-pal="g"]:not([data-theme="dark"]) body::before { opacity: .04; mix-blend-mode: multiply; }
  html[data-pal="g"]:not([data-theme="dark"]) .sc::after { background: #fff; }
  html[data-pal="g"]:not([data-theme="dark"]) .alert.bad { color: #9b1c1c; }
  html[data-pal="g"]:not([data-theme="dark"]) .mq-track .o { -webkit-text-stroke-color: rgb(var(--paper-rgb) / .28); }
}
html[lang="en"] { --f-body: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif; --f-display: "Space Grotesk", "Alexandria", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
body::before { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: var(--ember); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }
html[lang="ar"] .mono { letter-spacing: 0; font-size: 13.5px; font-family: "IBM Plex Sans Arabic", var(--f-mono), sans-serif; font-weight: 500; }
html[lang="ar"] .glyph-cap, html[lang="ar"] .story-mark .tag, html[lang="ar"] .scroll-cue { font-family: var(--f-mono); letter-spacing: .06em; }
.ar-txt { letter-spacing: 0 !important; font-family: "IBM Plex Sans Arabic", sans-serif; text-transform: none; }
.latin { font-family: var(--f-latin); }
.ember { color: var(--ember); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgb(var(--ink-rgb) / .72); backdrop-filter: blur(14px) saturate(1.3); border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; direction: ltr; }
.brand .mark { width: 34px; height: 34px; }
.brand .word { font-family: var(--f-latin); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1; }
.brand .word b { color: var(--ember); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 15px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--paper); background: rgb(var(--paper-rgb) / .06); }
.nav-tools { display: flex; align-items: center; gap: 8px; }
.lang-btn {
  border: 1px solid var(--line-2); background: transparent; border-radius: 999px; height: 38px; min-width: 46px; padding: 0 12px;
  cursor: pointer; font-family: var(--f-latin); font-weight: 500; font-size: 14px; transition: border-color .2s, background .2s;
}
.lang-btn:hover { border-color: var(--ember); }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: var(--paper); margin: 4px auto; transition: transform .25s; }
@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; padding: 12px 16px 20px; gap: 2px;
    background: rgb(var(--ink-rgb) / .97); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .25s; }
  .nav-links a { padding: 14px 12px; font-size: 18px; border-radius: 12px; }
  .nav.open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
  .nav.open { background: rgb(var(--ink-rgb) / .97); }
  .nav.open .menu-btn span:first-child { transform: translateY(2.75px) rotate(45deg); }
  .nav.open .menu-btn span:last-child { transform: translateY(-2.75px) rotate(-45deg); }
  .menu-btn { display: block; }
  .nav-tools .btn { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--paper); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: transform .2s, background .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn.ember { --bg: var(--ember); --fg: var(--on-a); box-shadow: 0 10px 40px -10px var(--ember-glow); }
.btn.ember:hover { --bg: var(--ember-2); box-shadow: 0 14px 50px -10px rgb(var(--a-rgb) / .45); }
.btn.ghost { --bg: transparent; --fg: var(--paper); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--paper); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(-4px); }
html[dir="ltr"] .btn .arr { transform: scaleX(-1); }
html[dir="ltr"] .btn:hover .arr { transform: scaleX(-1) translateX(-4px); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 110px 0 70px; overflow: hidden; isolation: isolate; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; z-index: -1; background: linear-gradient(to bottom, transparent, var(--ink)); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); padding: 7px 14px 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: rgb(var(--ink2-rgb) / .6); backdrop-filter: blur(6px); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(74, 222, 128, .15); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
.hero h1 {
  font-family: var(--f-display); font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(44px, 7.4vw, 104px); line-height: 1.08; margin: 26px 0 22px;
}
html[lang="en"] .hero h1 { letter-spacing: -.045em; line-height: 1.0; }
.rotator { position: relative; display: inline-block; color: var(--ember); min-width: 4ch; }
.rotator span { display: inline-block; transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .45s, filter .45s; }
.rotator span.out { transform: translateY(-40%); opacity: 0; filter: blur(6px); }
.rotator span.in { transform: translateY(40%); opacity: 0; filter: blur(6px); }

.hero .lede { font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); max-width: 560px; margin: 0 0 36px; }
.hero .lede strong { color: var(--paper); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.glyph-stage { position: relative; aspect-ratio: 1; width: min(420px, 100%); justify-self: center; }
.glyph-stage .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-2); }
.glyph-stage .ring.r2 { inset: 12%; border-style: dashed; border-color: rgb(var(--a-rgb) / .28); animation: spin 60s linear infinite; }
.glyph-stage .ring.r3 { inset: 26%; background: radial-gradient(circle, var(--ember-glow), transparent 70%); border-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.glyph { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; line-height: 1; color: var(--ink);
  -webkit-text-stroke: 4px var(--ember); paint-order: stroke fill; transition: opacity .9s, transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s; }
.glyph.g3 { font-family: var(--f-latin); font-size: clamp(170px, 22vw, 290px); }
.glyph.ga { font-family: "Alexandria", sans-serif; font-size: clamp(150px, 19vw, 250px); transform: translateY(-4%); }
.glyph.hide { opacity: 0; transform: scale(.86) rotate(-8deg); filter: blur(8px); }
.glyph-cap { position: absolute; bottom: -6px; inset-inline: 0; text-align: center; color: var(--dim); direction: ltr; }
.glyph-cap b { color: var(--paper); font-weight: 500; }

.scroll-cue { position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(50%); color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 8px; }
html[dir="ltr"] .scroll-cue { transform: translateX(-50%); }
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(var(--dim), transparent); animation: cue 2s infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .glyph-stage { width: min(190px, 52vw); order: -1; margin-top: 4px; }
  .glyph.g3 { font-size: 120px; } .glyph.ga { font-size: 104px; }
  .glyph { -webkit-text-stroke-width: 3px; }
  .hero { padding-top: 96px; }
  .scroll-cue { display: none; }
}

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--ink-2); direction: ltr; }
.marquee .track { display: flex; gap: 44px; width: max-content; animation: marq 38s linear infinite; }
.marquee span { font-family: var(--f-display); font-size: clamp(22px, 3vw, 36px); font-weight: 600; color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 44px; }
.marquee span::after { content: "✦"; color: var(--ember); font-size: .55em; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section.block { padding: clamp(80px, 11vw, 150px) 0; position: relative; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: end; margin-bottom: 56px; }
.sec-head .k { color: var(--ember); margin-bottom: 14px; display: block; }
.sec-head h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(32px, 4.6vw, 60px); line-height: 1.12; letter-spacing: -.02em; margin: 0; }
html[lang="en"] .sec-head h2 { letter-spacing: -.035em; }
.sec-head p { color: var(--muted); margin: 0; max-width: 480px; justify-self: end; }
@media (max-width: 800px) { .sec-head { grid-template-columns: 1fr; } .sec-head p { justify-self: start; } }

/* services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc {
  position: relative; display: flex; flex-direction: column; min-height: 460px; padding: 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--ink-2), var(--ink)); border: 1px solid var(--line); overflow: hidden;
  transition: border-color .35s, transform .35s;
}
.svc::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgb(var(--a-rgb) / .13), transparent 45%); }
.svc:hover { border-color: rgb(var(--a-rgb) / .45); transform: translateY(-4px); }
.svc:hover::before { opacity: 1; }
.svc .num { color: var(--dim); display: flex; justify-content: space-between; align-items: center; }
.svc .ico { width: 64px; height: 64px; margin: 34px 0 26px; color: var(--alt); }
.svc h3 { font-family: var(--f-display); font-size: 30px; font-weight: 700; margin: 0 0 10px; letter-spacing: -.01em; }
.svc p { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.svc ul { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.svc li { font-size: 13.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--paper); opacity: .85; }
.svc .go { margin-top: auto; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--paper); }
.svc .go .arr { color: var(--ember); transition: transform .25s; }
.svc:hover .go .arr { transform: translateX(-6px); }
html[dir="ltr"] .svc .go .arr { transform: scaleX(-1); }
html[dir="ltr"] .svc:hover .go .arr { transform: scaleX(-1) translateX(-6px); }
@media (max-width: 980px) { .services { grid-template-columns: 1fr; } .svc { min-height: 0; } }

/* process */
.process { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.step { padding: 34px 26px 10px 0; position: relative; }
html[dir="ltr"] .step { padding: 34px 0 10px 26px; }
.step + .step { border-inline-start: 1px solid var(--line); padding-inline-start: 26px; }
.step::before { content: ""; position: absolute; top: -4px; inset-inline-start: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); border: 1px solid var(--ember); }
.step .mono { color: var(--ember); }
.step h4 { font-family: var(--f-display); font-size: 24px; margin: 14px 0 8px; font-weight: 600; }
.step p { color: var(--muted); font-size: 15.5px; margin: 0; padding-inline-end: 18px; }
@media (max-width: 860px) {
  .process { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .step:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .process { grid-template-columns: 1fr; }
  .step + .step { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); }
}

/* principles */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 70px; }
.pr { padding: 24px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); }
.pr .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgb(var(--a-rgb) / .1); color: var(--ember); margin-bottom: 16px; }
.pr h5 { font-size: 17px; margin: 0 0 6px; font-weight: 600; }
.pr p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
@media (max-width: 980px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .principles { grid-template-columns: 1fr; } }

/* story ("3 = ع") */
.story { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; }
.story-mark { aspect-ratio: 1; border-radius: 28px; background: var(--ink-2); border: 1px solid var(--line); display: grid; place-items: center; position: relative; overflow: hidden; }
.story-mark .eq { display: flex; align-items: center; gap: .25em; font-size: clamp(80px, 11vw, 150px); font-weight: 700; direction: ltr; line-height: 1; }
.story-mark .eq .l { font-family: var(--f-latin); color: var(--ember); }
.story-mark .eq .s { color: var(--dim); font-size: .45em; font-family: var(--f-latin); }
.story-mark .eq .a { font-family: "Alexandria", sans-serif; color: var(--paper); transform: translateY(-.08em); }
.story-mark .tag { position: absolute; bottom: 18px; inset-inline: 18px; display: flex; justify-content: space-between; color: var(--dim); direction: ltr; }
.story h2 { font-family: var(--f-display); font-size: clamp(30px, 4vw, 52px); line-height: 1.15; margin: 14px 0 20px; letter-spacing: -.02em; }
.story p { color: var(--muted); font-size: 18px; margin: 0 0 16px; }
.story p strong { color: var(--paper); font-weight: 500; }
@media (max-width: 860px) { .story { grid-template-columns: 1fr; gap: 36px; } .story-mark { max-width: 420px; } }

/* support band */
.support-band { border-radius: 28px; padding: clamp(32px, 5vw, 64px); position: relative; overflow: hidden;
  background: radial-gradient(800px 400px at 85% 0%, rgb(var(--a-rgb) / .16), transparent 60%), var(--ink-2); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
html[dir="ltr"] .support-band { background: radial-gradient(800px 400px at 15% 0%, rgb(var(--a-rgb) / .16), transparent 60%), var(--ink-2); }
.support-band h2 { font-family: var(--f-display); font-size: clamp(30px, 4vw, 52px); line-height: 1.12; margin: 14px 0 16px; letter-spacing: -.02em; }
.support-band p { color: var(--muted); margin: 0 0 28px; max-width: 520px; }
.sb-cards { display: grid; gap: 12px; }
.sb-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 14px; background: rgb(var(--ink-rgb) / .6); border: 1px solid var(--line); transition: border-color .25s, transform .25s; }
.sb-card:hover { border-color: rgb(var(--a-rgb) / .5); transform: translateX(-3px); }
html[dir="ltr"] .sb-card:hover { transform: translateX(3px); }
.sb-card .ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgb(var(--a-rgb) / .1); color: var(--alt); }
.sb-card b { display: block; font-weight: 600; }
.sb-card small { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .support-band { grid-template-columns: 1fr; } }

/* contact */
.contact { text-align: center; padding: clamp(90px, 12vw, 170px) 0; position: relative; overflow: hidden; }
.contact .k { color: var(--ember); }
.contact h2 { font-family: var(--f-display); font-size: clamp(38px, 6.6vw, 92px); line-height: 1.05; letter-spacing: -.03em; margin: 18px auto 28px; max-width: 14ch; }
.mail-link { display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-latin); font-size: clamp(20px, 3.2vw, 38px); font-weight: 500; direction: ltr;
  border-bottom: 2px solid var(--line-2); padding-bottom: 6px; transition: color .25s, border-color .25s; word-break: break-all; }
.mail-link:hover { color: var(--ember); border-color: var(--ember); }
.contact .note { color: var(--muted); margin: 26px auto 34px; max-width: 520px; }
.contact .cta-row { justify-content: center; }

/* footer */
footer.site { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: 14.5px; }
footer.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 20px; }
footer.site nav a:hover { color: var(--paper); }

/* reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2, .8, .2, 1), transform .8s cubic-bezier(.2, .8, .2, 1); }
.rv.on { opacity: 1; transform: none; }
.rv.d1 { transition-delay: .08s; } .rv.d2 { transition-delay: .16s; } .rv.d3 { transition-delay: .24s; }

/* ---------- inner pages / forms ---------- */
.page-head { padding: 140px 0 40px; position: relative; }
.page-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(700px 320px at 80% 0%, rgb(var(--a-rgb) / .12), transparent 65%); }
.page-head h1 { font-family: var(--f-display); font-size: clamp(38px, 6vw, 76px); line-height: 1.08; letter-spacing: -.025em; margin: 16px 0 14px; }
.page-head p { color: var(--muted); max-width: 620px; font-size: 18px; margin: 0; }
.page-head .k { color: var(--ember); }

.panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 44px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .field .lbl { display: block; font-size: 14.5px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.field label .req { color: var(--ember); }
.input, .field input, .field select, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 15px; font-size: 16px; color: var(--paper);
  transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: left 18px center, left 13px center; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 36px; }
html[dir="ltr"] .field select { background-position: right 13px center, right 18px center; padding-left: 15px; padding-right: 36px; }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.65; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 4px rgb(var(--a-rgb) / .14); }
.field.err input, .field.err select, .field.err textarea { border-color: #f87171; }
.field .hint { font-size: 13px; color: var(--dim); margin-top: 6px; }
.ltr-input { direction: ltr; text-align: left; }
html[dir="rtl"] .ltr-input::placeholder { text-align: right; }

.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choice-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .choice-grid, .choice-grid.cols-5 { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice .box { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--ink); height: 100%; transition: border-color .2s, background .2s; }
.choice .box svg { width: 26px; height: 26px; color: var(--muted); transition: color .2s; }
.choice .box b { font-weight: 600; font-size: 15.5px; }
.choice .box small { color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.choice input:checked + .box { border-color: var(--ember); background: rgb(var(--a-rgb) / .07); }
.choice input:checked + .box svg { color: var(--ember); }
.choice input:focus-visible + .box { outline: 2px solid var(--ember); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .choice .box { flex-direction: row; padding: 9px 16px; border-radius: 999px; }
.chips .choice .box b { font-size: 14.5px; font-weight: 500; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-foot small { color: var(--dim); max-width: 460px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.alert { padding: 14px 16px; border-radius: 12px; font-size: 15px; margin-top: 16px; display: none; }
.alert.show { display: block; }
.alert.bad { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca; }

.success { text-align: center; padding: 30px 10px; display: none; }
.success.show { display: block; animation: pop .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.success .seal { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: rgb(var(--a-rgb) / .12); color: var(--ember); }
.success h2 { font-family: var(--f-display); font-size: clamp(28px, 4vw, 40px); margin: 0 0 10px; }
.success p { color: var(--muted); margin: 0 auto 22px; max-width: 480px; }
.code-pill { display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: clamp(22px, 4vw, 30px); letter-spacing: .08em; padding: 12px 14px 12px 22px; border-radius: 14px; border: 1px dashed rgb(var(--a-rgb) / .6); background: rgb(var(--a-rgb) / .06); direction: ltr; }
.copy-btn { border: 1px solid var(--line-2); background: var(--ink); border-radius: 10px; height: 38px; padding: 0 12px; cursor: pointer; font-size: 13px; font-family: var(--f-body); }
.copy-btn:hover { border-color: var(--ember); }

.layout-side { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.side-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 20px; padding: 24px; position: sticky; top: 96px; }
.side-card h4 { margin: 0 0 14px; font-size: 16px; }
.side-card ol { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: 15px; }
.side-card ol li { margin-bottom: 10px; }
.side-card .mail { display: block; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.side-card .mail a { color: var(--paper); direction: ltr; display: inline-block; word-break: break-all; }
.side-card .mail a:hover { color: var(--ember); }
@media (max-width: 900px) { .layout-side { grid-template-columns: 1fr; } .side-card { position: static; } }

/* tabs */
.tabs { display: inline-flex; padding: 5px; border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { border: 0; background: transparent; padding: 10px 20px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 15px; transition: .2s; }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); }
[role="tabpanel"][hidden] { display: none; }

/* thread */
.case-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.case-head h3 { margin: 4px 0 0; font-size: 22px; font-family: var(--f-display); }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.open { color: var(--warn); } .badge.in_progress { color: #60a5fa; } .badge.answered { color: var(--ok); } .badge.closed { color: var(--dim); }
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg .body { unicode-bidi: plaintext; }
.msg { max-width: 86%; padding: 14px 16px; border-radius: 16px; background: var(--ink); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.msg.admin { align-self: flex-end; background: rgb(var(--a-rgb) / .08); border-color: rgb(var(--a-rgb) / .3); }
.msg .meta { display: flex; gap: 10px; font-size: 12.5px; color: var(--dim); margin-bottom: 6px; white-space: normal; }
.msg.admin .meta b { color: var(--ember); }
.reply-box { margin-top: 22px; display: grid; gap: 12px; }

/* 404 */
.nf { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 40px 16px; }
.nf .big { font-family: var(--f-latin); font-size: clamp(120px, 26vw, 260px); font-weight: 700; line-height: 1; letter-spacing: -.06em; direction: ltr; }
.nf .big b { color: var(--ember); }

/* prose */
.prose { max-width: 760px; }
.prose h2 { font-family: var(--f-display); font-size: 24px; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}

/* Arabic display type needs more vertical room for dots & descenders */
html[lang="ar"] .hero h1 { line-height: 1.22; }
html[lang="ar"] .page-head h1 { line-height: 1.28; margin-bottom: 22px; }
html[lang="ar"] .sec-head h2, html[lang="ar"] .story h2, html[lang="ar"] .support-band h2 { line-height: 1.3; }
html[lang="ar"] .contact h2 { line-height: 1.25; }
@media (max-width: 760px) { .choice-grid.cols-5 .choice:last-child { grid-column: 1 / -1; } }

/* simplified home */
.sec-head.simple { grid-template-columns: 1fr; margin-bottom: 36px; }
.services.four { grid-template-columns: repeat(4, 1fr); }
.services.four .svc { min-height: 330px; }
.services.four .svc .ico { margin: 26px 0 22px; width: 54px; height: 54px; }
.services.four .svc h3 { font-size: 26px; }
@media (max-width: 1080px) { .services.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .services.four { grid-template-columns: 1fr; } .services.four .svc { min-height: 0; } }
.hero h1 .ember { color: var(--ember); }
.hero h1 { font-size: clamp(44px, 6.6vw, 96px); }
.hero h1 > span:first-child { white-space: nowrap; }

/* theme toggle */
.theme-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--paper); transition: border-color .2s, transform .5s cubic-bezier(.16,1,.3,1); }
.theme-btn:hover { border-color: var(--ember); transform: rotate(-25deg); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
html.is-light .theme-btn .sun { display: block; } html.is-light .theme-btn .moon { display: none; }
html:not([data-pal="g"]) .theme-btn { display: none; }

/* logo mark — follows the active palette and light/dark mode */
.mark .mk-bg { fill: var(--ink-2); transition: fill .4s; }
.mark .mk-line { fill: none; stroke: rgb(var(--paper-rgb) / .16); stroke-width: 1.5; }
.mark .mk-3 { fill: none; stroke: var(--ember); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
html.is-light .mark .mk-bg { fill: #fff; }
