/* maplecoreenterprise.com — v1
   Brand tokens from brand/letterhead + brand/carousel (handover v2, 14 Oct 2026).
   One accent (maple red). Inter for Latin, Cairo for Arabic. Logical properties so RTL needs no mirroring. */

:root {
  --ink: #1B2022;
  --red: #A32026;
  --red-dark: #76141A;
  --grey1: #D6D3CE;   /* warm stone */
  --grey2: #EBE9E5;   /* pale stone */
  --paper: #FCFBF9;
  --soft: #6B6E70;    /* secondary text, AA on paper */
  --mute: #8D8D8D;    /* brand grey — small/decorative text only */
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --arab: "Cairo", "Inter", system-ui, Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[lang="ar"] body { font-family: var(--arab); font-size: 18px; line-height: 1.75; }

/* ---------- language switch: both languages are in the markup; CSS shows one ---------- */
html[data-lang="en"] [lang="ar"] { display: none !important; }
html[data-lang="ar"] [lang="en"] { display: none !important; }
[lang="ar"] { font-family: var(--arab); }
html[data-lang="ar"] [dir="ltr"] { font-family: var(--sans); unicode-bidi: isolate; }

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p a, address a, dd a { text-decoration: underline; text-decoration-color: var(--grey1); text-underline-offset: 3px; }
p a:hover, address a:hover, dd a:hover { text-decoration-color: var(--red); }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.35; font-weight: 700; }
address { font-style: normal; }
.soft { color: var(--soft); }
.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; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r); z-index: 100; }
.skip:focus { top: 8px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; position: relative; }

/* ---------- leaf + play + rule ---------- */
.leaf { color: var(--red); fill: currentColor; width: 28px; height: auto; flex: none; }
.rule { display: block; width: 72px; height: 4px; background: var(--red); }
.rule--paper { background: var(--paper); }
.play { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); flex: none; }
.play::after { content: ""; display: block; width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent var(--paper); margin-inline-start: 4px; }
.play--lg { width: 72px; height: 72px; }
.play--lg::after { border-width: 14px 0 14px 24px; margin-inline-start: 6px; }

/* ---------- kicker ---------- */
.kicker { margin: 0 0 18px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: 15px; }
.kicker--paper { color: var(--grey1); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--r); font-weight: 600; font-size: 16px; line-height: 1; white-space: nowrap; border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s; }
.btn .ico { width: 20px; height: 20px; fill: currentColor; }
.btn--red { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn--red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--ink { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ink:hover { background: var(--ink); color: var(--paper); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn:focus-visible, .lang:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--grey2); }
.nav__in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 60px; }
.brand__en { height: 15px; width: auto; }
.brand__ar { height: 22px; width: auto; }
/* phones: the five page links sit in a scrollable second row; desktop: inline after the brand */
.nav__links { order: 3; display: flex; gap: 22px; width: 100%; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: 15px; font-weight: 500; color: var(--soft); }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a { padding-block: 4px; }
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); }
[id] { scroll-margin-top: 110px; }
.nav__cta { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.lang { appearance: none; background: transparent; border: 1px solid var(--grey1); color: var(--ink); border-radius: var(--r); min-height: 40px; padding: 0 12px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.lang:hover { border-color: var(--ink); }
html[data-lang="en"] .lang { font-family: var(--arab); }
html[data-lang="ar"] .lang { font-family: var(--sans); }
@media (min-width: 900px) {
  .nav__in { flex-wrap: nowrap; min-height: 64px; }
  .nav__links { order: 0; width: auto; gap: 28px; margin-inline-start: 28px; padding: 0; overflow: visible; }
  [id] { scroll-margin-top: 80px; }
}
@media (max-width: 420px) { .nav .btn--sm span { display: none !important; } .nav .btn--sm { padding: 0 11px; } }

/* ---------- shards: the letterhead / carousel corner clusters as CSS parallelograms ----------
   Geometry copied from brand/carousel/build_carousel.py shards(): top-right slabs hang from the top edge with the
   bottom edge pushed inward (skew ≈ 27°); bottom-left slabs rise from the bottom edge (skew ≈ 11°).
   Logical positioning + mirrored skew, so the RTL page gets the mirrored composition. Decorative only. */
.shards { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.shards i { position: absolute; display: block; --sh: 1; }
.shards--tr i { top: calc(-20px * var(--sh)); transform-origin: top left; transform: skewX(-27deg); }
html[dir="rtl"] .shards--tr i { transform-origin: top right; transform: skewX(27deg); }
.shards--tr .s1 { inset-inline-end: calc(-24px * var(--sh)); width: calc(240px * var(--sh)); height: calc(180px * var(--sh)); background: var(--grey2); }
.shards--tr .s2 { inset-inline-end: calc(-24px * var(--sh)); width: calc(132px * var(--sh)); height: calc(264px * var(--sh)); background: var(--grey1); }
.shards--tr .s3 { inset-inline-end: calc(236px * var(--sh)); width: calc(46px * var(--sh));  height: calc(240px * var(--sh)); background: var(--red); }
.shards--tr .s4 { inset-inline-end: calc(209px * var(--sh)); width: calc(19px * var(--sh));  height: calc(156px * var(--sh)); background: var(--red-dark); }
.shards--bl i { transform-origin: bottom left; transform: skewX(11deg); }
html[dir="rtl"] .shards--bl i { transform-origin: bottom right; transform: skewX(-11deg); }
.shards--bl .s1 { inset-inline-start: calc(-20px * var(--sh)); bottom: calc(-30px * var(--sh)); width: calc(130px * var(--sh)); height: calc(200px * var(--sh)); background: var(--grey2); }
.shards--bl .s2 { inset-inline-start: calc(-10px * var(--sh)); bottom: calc(-40px * var(--sh)); width: calc(70px * var(--sh));  height: calc(150px * var(--sh)); background: var(--grey1); }
.shards--bl .s3 { inset-inline-start: calc(16px * var(--sh)); bottom: calc(-30px * var(--sh)); width: calc(26px * var(--sh));  height: calc(180px * var(--sh)); background: var(--red); }
.shards--bl .s4 { inset-inline-start: calc(24px * var(--sh));  bottom: calc(-10px * var(--sh)); width: calc(10px * var(--sh));  height: calc(70px * var(--sh));  background: var(--red-dark); }
@media (max-width: 720px) { .shards i { --sh: 0.6; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px); overflow: hidden; }
.hero__leaf { width: clamp(76px, 11vw, 148px); margin-bottom: clamp(28px, 4vw, 48px); }
.hero h1 { font-size: clamp(2.3rem, 6.2vw, 4.5rem); max-width: 14ch; }
html[lang="ar"] .hero h1 { font-size: clamp(2rem, 5.4vw, 3.8rem); max-width: 22ch; }
.hero__sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--soft); max-width: 56ch; margin: clamp(20px, 3vw, 28px) 0 0; font-weight: 500; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(28px, 4vw, 40px); }
.hero__meta { display: flex; align-items: center; gap: 16px; margin: clamp(36px, 5vw, 56px) 0 0; font-weight: 600; color: var(--soft); font-size: 15px; }

/* ---------- who-we-are strip ---------- */
.strip { border-top: 1px solid var(--grey2); border-bottom: 1px solid var(--grey2); background: #fff; }
.strip__in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 32px; padding: 22px 0; }
.strip .kicker { margin: 0; }
.strip__line { margin: 0; font-weight: 500; font-size: 16px; }

/* ---------- sections ---------- */
.sec { position: relative; padding: clamp(56px, 8vw, 104px) 0; overflow: hidden; }
.sec--stone { background: #fff; border-top: 1px solid var(--grey2); border-bottom: 1px solid var(--grey2); }
.sec--red { background: var(--red); color: var(--paper); }
.sec--red .soft { color: var(--grey1); }
.sec h2:not(.sr-only) { font-size: clamp(1.7rem, 3.6vw, 2.6rem); max-width: 24ch; }

/* items with the red bar marker (carousel slides 3 + 6) */
.items { display: grid; gap: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 48px); grid-template-columns: 1fr; }
.item { padding-inline-start: 18px; border-inline-start: 5px solid var(--red); }
.item h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.item p { margin: 8px 0 0; color: var(--soft); max-width: 36ch; }
@media (min-width: 640px) { .items { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .items--4 { grid-template-columns: repeat(4, 1fr); } }

/* case AFRAS (slide 4) */
.case { display: grid; gap: clamp(28px, 5vw, 64px); align-items: start; }
.case__name { font-size: clamp(3.4rem, 9vw, 6.5rem); line-height: 1; letter-spacing: -0.02em; margin-top: 4px; }
.case__lead { margin: 14px 0 0; font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; max-width: 24ch; }
.case__next { margin: 28px 0 0; color: var(--grey1); font-weight: 500; }
.feats { display: grid; gap: 14px; align-content: center; font-weight: 600; font-size: clamp(1.1rem, 1.8vw, 1.35rem); }
.feats li { display: flex; align-items: center; gap: 14px; }
.feats li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); flex: none; }
@media (min-width: 820px) { .case { grid-template-columns: 1.2fr 1fr; } .feats { padding-top: 54px; } }

/* steps (slide 5) — extra bottom room for the shard cluster */
.sec--bl { padding-bottom: clamp(150px, 18vw, 230px); }
.steps { display: grid; gap: clamp(24px, 3vw, 32px); }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step__n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: var(--paper); font-weight: 800; font-size: 18px; flex: none; font-family: var(--sans); }
.step h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); padding-top: 7px; }
.step p { margin: 6px 0 0; color: var(--soft); max-width: 40ch; }
@media (min-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }

/* studios (slide 7) + videos */
.studios { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
.studios__badge { display: inline-flex; align-items: center; gap: 16px; margin-top: clamp(24px, 3vw, 32px); }
.studios__badge:hover .play { background: var(--red-dark); }
.studios__name { display: grid; line-height: 1.25; }
.studios__name strong { font-size: 1.25rem; font-weight: 800; }
.studios__p { color: var(--soft); margin: 24px 0 18px; max-width: 40ch; }
.reel { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2.5vw, 24px); max-width: 560px; }
.vid { margin: 0; }
.vid__frame { position: relative; aspect-ratio: 9 / 16; background: var(--ink); border-radius: 8px; overflow: hidden; }
.vid__frame video { width: 100%; height: 100%; object-fit: cover; }
.vid__play { position: absolute; inset: 0; width: 100%; display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; padding: 0; }
.vid__play:hover .play { background: var(--red-dark); }
.vid__frame.is-playing .vid__play { display: none; }
.vid figcaption { margin-top: 10px; font-size: 14px; color: var(--soft); font-weight: 500; }
@media (min-width: 900px) { .studios { grid-template-columns: 1fr 1fr; } .reel { justify-self: end; width: 100%; } }

/* CTA (slide 8) */
.cta { padding: clamp(64px, 9vw, 120px) 0; }
.cta__leaf { color: var(--paper); width: clamp(64px, 8vw, 96px); margin-bottom: clamp(24px, 3vw, 36px); }
.cta h2 { font-size: clamp(1.9rem, 4.6vw, 3.4rem); max-width: 20ch; }
.cta .rule { margin: clamp(24px, 3vw, 32px) 0; }
.cta__lines { display: grid; gap: 22px; margin: 0; }
.cta__lines dt { font-size: 14px; font-weight: 500; color: var(--grey1); margin-bottom: 2px; }
.cta__lines dd { margin: 0; font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; }
.cta__lines dd a { text-decoration-color: color-mix(in srgb, var(--paper) 35%, transparent); }
.cta__lines dd a:hover { text-decoration-color: var(--paper); }
@media (min-width: 720px) { .cta__lines { grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px 56px; } }

/* contact */
.contact { display: grid; gap: clamp(28px, 4vw, 48px); }
.contact h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
html[lang="ar"] .contact h3 { letter-spacing: 0; font-size: 15px; }
.contact h3 + * + h3 { margin-top: 22px; }
.contact p, .contact address { margin: 0; font-weight: 500; }
.contact__cta { margin-top: 22px; }
@media (min-width: 720px) { .contact { grid-template-columns: 1.3fr 1fr 1fr; } }

/* footer */
.foot { border-top: 4px solid var(--red); background: #fff; padding: 36px 0 44px; font-size: 14px; color: var(--mute); }
.foot__in { display: grid; gap: 10px; }
.brand--foot { margin-bottom: 8px; }
.foot p { margin: 0; }
.foot__copy { color: var(--ink); font-weight: 500; }
@media (min-width: 720px) {
  .foot__in { grid-template-columns: auto 1fr auto; align-items: center; }
  .brand--foot { margin: 0; }
  .foot__legal { text-align: center; }
}

/* RTL: Latin address / phone blocks keep LTR order but align with the Arabic headings */
html[dir="rtl"] .contact [dir="ltr"] { text-align: right; }

/* ================= v2 — multi-page components ================= */

/* page head on inner pages (a quieter hero) */
.phead { position: relative; padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 72px); overflow: hidden; border-bottom: 1px solid var(--grey2); }
.phead h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); max-width: 20ch; }
html[lang="ar"] .phead h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); max-width: 26ch; }
.phead__sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--soft); max-width: 56ch; margin: clamp(18px, 2.5vw, 24px) 0 0; font-weight: 500; }
.phead__lines { margin: 20px 0 0; display: grid; gap: 4px; font-weight: 500; }

/* "more" link — arrow flips with the reading direction */
.more { display: inline-flex; align-items: center; gap: 8px; margin-top: clamp(28px, 3vw, 36px); font-weight: 600; color: var(--red); }
.more::after { content: "→"; transition: transform .15s; }
html[dir="rtl"] .more::after { content: "←"; }
.more:hover::after { transform: translateX(3px); }
html[dir="rtl"] .more:hover::after { transform: translateX(-3px); }
.sec--red .more { color: var(--paper); }
.more--ext::after { content: "↗"; }
html[dir="rtl"] .more--ext::after { content: "↖"; }

/* work cards (home teaser, software → websites) */
.cards { display: grid; gap: clamp(28px, 3vw, 32px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } .cards--2 { grid-template-columns: repeat(2, 1fr); } }
.card { display: grid; gap: 12px; align-content: start; }
.card__img { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; border: 1px solid var(--grey1); background: var(--grey2); }
.card__img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card .kicker { margin: 4px 0 0; color: var(--red); }
.card h3 { font-size: clamp(1.2rem, 1.8vw, 1.4rem); }
.card p { margin: 0; color: var(--soft); }
a.card:hover h3 { color: var(--red); }

/* software: one block per type */
.blocks { display: grid; gap: clamp(44px, 6vw, 72px); }
.block { display: grid; gap: 18px 56px; }
.block .item h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); max-width: none; }
.block__body p { margin: 0; max-width: 54ch; }
.block__body .more { margin-top: 16px; }
.block__body .cards { margin-top: 24px; }
@media (min-width: 900px) { .block { grid-template-columns: 1fr 1.4fr; } }

/* screenshot grids: phones 2-up on mobile / 4-up on desktop, web screens span two columns */
.shots { display: grid; gap: clamp(14px, 2vw, 20px); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (min-width: 720px) { .shots { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--grey1); background: #fff; }
.shot--web { grid-column: span 2; }
.shot--web img { border-radius: 8px; }
.shot figcaption { margin-top: 8px; font-size: 14px; color: var(--soft); font-weight: 500; }
.sec--red .shot img { border-color: var(--red-dark); }
.sec--red .shot figcaption { color: var(--grey1); }

/* live-site screenshots: desktop + phone side by side */
.site { display: grid; grid-template-columns: 3fr 1fr; gap: clamp(12px, 2vw, 20px); align-items: end; margin: 0; }
.site img { width: 100%; height: auto; border: 1px solid var(--grey1); border-radius: 8px; background: var(--grey2); }
.site__m img { border-radius: 14px; }

/* work page: one case per client */
.wcase { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--grey2); }
.phead + .wcase { border-top: 0; }
.wcase--alt { background: #fff; }
.wcase__head { display: grid; gap: 28px 56px; }
@media (min-width: 900px) { .wcase__head { grid-template-columns: 1fr 1fr; } }
.wcase__logo { height: 72px; width: auto; margin-bottom: 22px; }
.wcase h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.wcase__who { margin: 12px 0 0; font-size: clamp(1.05rem, 1.6vw, 1.2rem); font-weight: 600; max-width: 40ch; }
.wcase__media { margin-top: clamp(36px, 4vw, 52px); display: grid; gap: clamp(32px, 4vw, 48px); }
.wcase__label, .wcase__media h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); margin-bottom: 14px; }
html[lang="ar"] .wcase__label, html[lang="ar"] .wcase__media h3 { letter-spacing: 0; font-size: 15px; }
.ticks { display: grid; gap: 10px; font-weight: 600; font-size: clamp(1rem, 1.5vw, 1.1rem); }
.ticks li { display: flex; gap: 12px; align-items: baseline; }
.ticks li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; transform: translateY(-2px); }
.wcase .reel { max-width: 560px; }

/* contact page: the two WhatsApp doors */
.doors { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 3vw, 32px); }

/* about: offices */
.offices { display: grid; gap: clamp(28px, 4vw, 48px); }
.offices h3 { font-size: clamp(1.2rem, 1.8vw, 1.4rem); margin-bottom: 10px; }
.offices address, .offices p { margin: 0; font-weight: 500; color: var(--soft); }
@media (min-width: 720px) { .offices { grid-template-columns: 1fr 1fr; } }
html[dir="rtl"] .offices [dir="ltr"] { text-align: right; }
html[dir="rtl"] .card h3[dir="ltr"], html[dir="rtl"] .wcase h2[dir="ltr"] { text-align: right; }
.case + .shots { margin-top: clamp(40px, 5vw, 64px); }
.block .item { align-self: start; }
.note { margin: clamp(28px, 3vw, 36px) 0 0; }
.wcase__label + .ticks { margin-top: 4px; }
.wcase .reel { justify-self: start; }
.phead--long h1 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); max-width: 24ch; }
html[lang="ar"] .phead--long h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); max-width: 28ch; }
.phead__lines .strip__line { margin: 0; }
.item .more { margin-top: 14px; }
html[dir="rtl"] .item h3[dir="ltr"] { text-align: right; }
@media (max-width: 720px) { .phead { padding-top: 132px; } .phead .shards i { --sh: 0.5; } }
