/* Ain group sites — Direction A "Studio Grotesk" (picked 2026-11-29)
 * Bricolage Grotesque (display) + Inter (text) + Readex Pro (Arabic).
 * <html data-site="umbrella"|"vision" lang dir>
 */

/* ---------- tokens ---------- */
:root {
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display-weight: 700;
  --display-track: -0.035em;
  --display-lh: .98;
  --radius: 18px;
  --radius-sm: 10px;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
:root[data-site="umbrella"] {
  --bg: #f4f1ec;  --bg-2: #ebe6de;  --surface: #fffdf9;
  --ink: #16121c; --muted: #5f5868; --line: #dcd5ca;
  --accent: #3b1270; --accent-ink: #ffffff; --accent-2: #7b4fd6;
  --inverse-bg: #16121c; --inverse-ink: #f4f1ec;
}
:root[data-site="vision"] {
  --bg: #0f0d12;  --bg-2: #17141c;  --surface: #1d1923;
  --ink: #f3f0f6; --muted: #a59fae; --line: #2e2836;
  --accent: #c6f432; --accent-ink: #0f0d12; --accent-2: #9d7bff;
  --inverse-bg: #c6f432; --inverse-ink: #0f0d12;
}
/* Arabic: Readex Pro everywhere, no negative tracking (it breaks letter joins) */
:root[lang="ar"] {
  --font-display: "Readex Pro", system-ui, sans-serif;
  --font-body: "Readex Pro", system-ui, sans-serif;
  --display-track: 0;
  --display-lh: 1.18;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[lang="ar"] body { line-height: 1.8; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 99; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
.latin { font-family: "Inter", system-ui, sans-serif; unicode-bidi: isolate; }

.display {
  font-family: var(--font-display); font-weight: var(--display-weight);
  letter-spacing: var(--display-track); line-height: var(--display-lh); margin: 0;
}
.display em { font-style: normal; color: var(--accent); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px;
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
[lang="ar"] .eyebrow { letter-spacing: 0; font-size: 15px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--accent); transform: rotate(45deg); border-radius: 1px; }
.lead { font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: var(--muted); max-width: 40ch; margin: 0; }
[lang="ar"] .lead { line-height: 1.75; }

/* ---------- logo (recolourable via mask) ---------- */
.mark {
  display: inline-block; width: 26px; height: 40px; background: currentColor; flex: none;
  -webkit-mask: url(img/ain-mark.png) center / contain no-repeat; mask: url(img/ain-mark.png) center / contain no-repeat;
}

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-head { background: var(--bg); } }
.site-head.scrolled { border-bottom-color: var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand .mark { color: var(--accent); }
[data-site="vision"] .brand .mark { color: var(--ink); }
.nav { display: flex; gap: 28px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.head-end { display: flex; align-items: center; gap: 16px; }
.lang { font-size: 15px; color: var(--muted); text-decoration: none; }
.lang:hover { color: var(--ink); }
.lang[lang="ar"] { font-family: "Readex Pro", sans-serif; }
.lang[lang="en"] { font-family: "Inter", sans-serif; }

/* ---------- buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--ink);
  font: 600 15px/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
  color: var(--ink); background: transparent;
  transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { --h: 40px; padding: 0 18px; font-size: 14px; }
.btn .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
[dir="rtl"] .btn:hover .arr { transform: translateX(-4px); }
.btn.menu-btn { display: none; }

/* ---------- sections ---------- */
section { padding: clamp(72px, 11vw, 160px) 0; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head h2 { font-size: clamp(40px, 6vw, 84px); }
.sec-head .lead { justify-self: end; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink);
  font: 500 15px/1.2 var(--font-body); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* marquee */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
.marquee span { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(28px, 4vw, 52px); letter-spacing: var(--display-track); white-space: nowrap; display: inline-flex; align-items: center; gap: 48px; }
.marquee span::after { content: ""; width: 14px; height: 14px; background: var(--accent); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* work */
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.work-card { grid-column: span 6; text-decoration: none; }
.work-card.wide { grid-column: span 12; }
.work-media { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.work-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.work-card:hover .work-media img { transform: scale(1.03); }
.work-meta { display: flex; justify-content: space-between; gap: 16px; padding: 16px 2px 0; flex-wrap: wrap; }
.work-meta b { font-weight: 600; font-size: 18px; }
.work-meta span { color: var(--muted); font-size: 15px; }
.work-more { margin: 28px 0 0; color: var(--muted); }
.work-grid.three .work-card { grid-column: span 4; }
.work-card.bh .work-media { aspect-ratio: 808 / 632; position: relative; }
.work-card.bh .work-media img { object-position: center; }
.badge { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 1; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.work-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.clients { margin-top: clamp(48px, 7vw, 96px); padding-top: 28px; border-top: 1px solid var(--line); }
.clients ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 36px; }
.clients li { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(20px, 2.2vw, 30px); letter-spacing: var(--display-track); color: var(--muted); }
.clients li.latin { font-family: "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; }

/* form */
.brief { display: grid; gap: 28px; }
.field { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; color: var(--muted); padding: 0; }
.field legend { margin-bottom: 10px; }
.field input, .field textarea {
  width: 100%; padding: 14px 0; font: 400 19px/1.4 var(--font-body); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0; outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.form-note { margin: 0; font-size: 14px; min-height: 1.4em; color: var(--muted); }
.brief .btn.primary { justify-self: start; }

/* prose (about, legal) */
.page-head { padding-top: clamp(48px, 8vw, 120px); padding-bottom: clamp(32px, 5vw, 64px); }
.page-head h1 { font-size: clamp(48px, 8vw, 120px); }
.page-head .lead { margin-top: 24px; }
.prose { max-width: 72ch; padding-bottom: clamp(72px, 10vw, 140px); }
.prose h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: var(--display-track); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; margin: 48px 0 12px; }
.prose p, .prose li { color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 16px; padding-inline-start: 22px; }
.prose li { margin-bottom: 8px; }
.prose .updated { color: var(--muted); font-size: 15px; }

/* footer */
.site-foot { padding: 72px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h2 { margin: 0 0 14px; color: var(--ink); font-size: 14px; font-weight: 600; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { text-decoration: none; }
.foot-grid a:hover { color: var(--ink); }
.foot-about { max-width: 34ch; margin: 16px 0 0; }
/* social: round icon buttons (footer row + fixed side rail) */
.social ul, .social-rail ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.social { margin-top: 22px; }
.social ul { flex-wrap: wrap; }
.social a, .social-rail a {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.social svg, .social-rail svg { width: 18px; height: 18px; }
.social a:hover, .social-rail a:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.social-rail {
  position: fixed; z-index: 30; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; align-items: center; gap: 12px;
}
.social-rail::before, .social-rail::after { content: ""; width: 1px; height: 56px; background: var(--line); }
.social-rail ul { flex-direction: column; }
.social-rail a {
  width: 36px; height: 36px; background: var(--bg);
}
.social-rail a:hover { transform: scale(1.08); }
.social-rail svg { width: 16px; height: 16px; }
@media (min-width: 1200px) { .social-rail { display: flex; } }
.foot-legal { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }
address { font-style: normal; }

/* reveal on scroll (only when JS is running) */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; gap: 0; position: absolute; left: 0; right: 0; top: 72px;
    padding: 8px var(--pad) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open a { padding: 14px 0; font-size: 20px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .head-end .btn.primary { display: none; }
  .btn.menu-btn { display: inline-flex; }
  .sec-head { grid-template-columns: 1fr; }
  .sec-head .lead { justify-self: start; }
  .work-card { grid-column: span 12; }
  .work-grid.three .work-card { grid-column: span 6; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 559px) {
  .work-grid.three .work-card { grid-column: span 12; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
}
