/*
  Bento redesign — Phase 1 foundation.
  Namespaced `bn-` throughout (classes AND custom properties) because
  webelle.css already defines --bg, --ink, --line and uses .hero, .faq,
  .container. Unprefixed names here would silently repaint the old page
  through shared :root custom properties, not just class collisions.
  Loaded AFTER css/webelle.css on index.html / ar/index.html only.
*/

/* ---------- 1. Fonts ----------
   Real variable fonts + metric-matched local() fallbacks, so the
   fallback-to-webfont swap doesn't shift layout (CLS). Overrides were
   computed from the actual .woff2 files (fontTools) against the real
   Arial/Tahoma metrics on this machine, not estimated. */

@font-face {
  font-family: "Plus Jakarta Sans Variable";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  font-style: normal;
  font-weight: 200 800;
  src: local("Arial");
  ascent-override: 78.32%;
  descent-override: 16.75%;
  line-gap-override: 0%;
  size-adjust: 132.53%;
  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;
}

@font-face {
  font-family: "Readex Pro Variable";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("../fonts/readex-pro-latin-wght-normal.woff2") format("woff2-variations");
  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;
}
@font-face {
  font-family: "Readex Pro Variable";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("../fonts/readex-pro-arabic-wght-normal.woff2") format("woff2-variations");
  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: "Readex Pro Fallback";
  font-style: normal;
  font-weight: 160 700;
  src: local("Arial");
  ascent-override: 80.84%;
  descent-override: 20.21%;
  line-gap-override: 0%;
  size-adjust: 123.70%;
  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;
}
@font-face {
  font-family: "Readex Pro Fallback";
  font-style: normal;
  font-weight: 160 700;
  src: local("Tahoma");
  ascent-override: 72.13%;
  descent-override: 18.03%;
  line-gap-override: 0%;
  size-adjust: 138.63%;
  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;
}

/* ---------- 2. Design tokens ---------- */

:root {
  --bn-bg: #EDEFF5;
  --bn-fg: #14151A;
  --bn-muted: rgba(20, 21, 26, .68);
  --bn-line: transparent;

  --bn-white: #FFFFFF;
  --bn-lilac: #D9D2FF;
  --bn-mint: #C5F2DC;
  --bn-sky: #C7E4FF;
  --bn-peach: #FFD3C2;
  --bn-butter: #FFE9A8;
  --bn-pink: #FFC7E4;
  --bn-ink: #14151A;
  --bn-ink-fg: #FFFFFF;

  --bn-btn-bg: #14151A;
  --bn-btn-fg: #FFFFFF;
  --bn-alt-bg: #EDEFF5;
  --bn-nav-bg: rgba(255, 255, 255, .86);

  --bn-lime: #C8FF3D;
  --bn-blue: #2B7BFF;
  /* --bn-blue is tuned as a vivid accent for large/decorative use (it
     only clears the 3:1 non-text/large-text threshold). Small bold
     text (the required-field marker) needs its own darker shade to
     clear 4.5:1 on a white tile — verified 6.36:1 light / 6.24:1 dark. */
  --bn-blue-text: #1558CC;

  --bn-font-sans: "Plus Jakarta Sans Variable", "Plus Jakarta Sans Fallback", "Readex Pro Variable", "Readex Pro Fallback", system-ui, sans-serif;
  --bn-font-ar: "Readex Pro Variable", "Readex Pro Fallback", system-ui, sans-serif;

  --bn-radius: 30px;
  --bn-gap: 14px;
  --bn-tile-pad: 1.7rem;
  --bn-wrap-pad: clamp(1rem, 3.5vw, 2.5rem);
}

/* Dark tokens, keyed the same two ways the existing pre-paint script
   already supports (explicit data-theme) plus the OS-preference path
   it doesn't use yet (:root with no data-theme at all) — ready for
   when the toggle script is changed to allow a "system" state. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bn-bg: #0D0E13;
    --bn-fg: #F1F2F6;
    --bn-muted: rgba(241, 242, 246, .68);
    --bn-line: rgba(255, 255, 255, .08);

    --bn-white: #1A1B23;
    --bn-lilac: #2B2660;
    --bn-mint: #12392C;
    --bn-sky: #143654;
    --bn-peach: #4C2B21;
    --bn-butter: #4C4218;
    --bn-pink: #4D2039;
    --bn-ink: #050609;
    --bn-ink-fg: #F1F2F6;

    --bn-btn-bg: #F1F2F6;
    --bn-btn-fg: #14151A;
    --bn-alt-bg: rgba(255, 255, 255, .08);
    --bn-nav-bg: rgba(26, 27, 35, .86);
    --bn-blue-text: #5B9CFF;
  }
}
:root[data-theme="dark"] {
  --bn-bg: #0D0E13;
  --bn-fg: #F1F2F6;
  --bn-muted: rgba(241, 242, 246, .68);
  --bn-line: rgba(255, 255, 255, .08);

  --bn-white: #1A1B23;
  --bn-lilac: #2B2660;
  --bn-mint: #12392C;
  --bn-sky: #143654;
  --bn-peach: #4C2B21;
  --bn-butter: #4C4218;
  --bn-pink: #4D2039;
  --bn-ink: #050609;
  --bn-ink-fg: #F1F2F6;

  --bn-btn-bg: #F1F2F6;
  --bn-btn-fg: #14151A;
  --bn-alt-bg: rgba(255, 255, 255, .08);
  --bn-nav-bg: rgba(26, 27, 35, .86);
  --bn-blue-text: #5B9CFF;
}

/* ---------- 3. RTL-safe base ---------- */
/* Scoped to a .bn-root wrapper, not html/body/*, so this stylesheet
   can sit next to the old markup without repainting it before Phase 2
   swaps the markup over. New markup should be wrapped in .bn-root. */

.bn-root, .bn-root * , .bn-root *::before, .bn-root *::after {
  box-sizing: border-box;
}
.bn-root {
  background: var(--bn-bg);
  color: var(--bn-fg);
  font-family: var(--bn-font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.bn-root:lang(ar) {
  line-height: 1.8;
}
:where(.bn-root) h1, :where(.bn-root) h2, :where(.bn-root) h3, :where(.bn-root) p {
  margin: 0;
}
/* Balanced wrapping avoids orphans in English ("one / team.") and
   avoids breaking Arabic headings mid-word. */
.bn-root h1, .bn-root h2, .bn-root h3, .bn-root .bn-tile-title {
  text-wrap: balance;
}
:where(.bn-root) ul, :where(.bn-root) ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
:where(.bn-root) a {
  color: inherit;
  text-decoration: none;
}
:where(.bn-root) button {
  font: inherit;
  color: inherit;
}
.bn-root :focus-visible {
  outline: 3px solid var(--bn-fg);
  outline-offset: 3px;
  border-radius: 8px;
}
.bn-tile--ink :focus-visible {
  outline-color: var(--bn-ink-fg);
}

/* Arabic heading rule (non-negotiable per CLAUDE.md §3):
   disconnected letters if letter-spacing isn't reset to 0, and
   line-height must stay >= 1.35 or ascenders/descenders clip. Also
   covers the .bn-tile-title/.bn-foot-title <p> stand-ins used where a
   decorative or repeated label must not skip a heading level (see
   §6/7 below) — they carry the exact same type rules as the h3/h4
   they replaced. */
.bn-root:lang(ar) h1,
.bn-root:lang(ar) h2,
.bn-root:lang(ar) h3,
.bn-root:lang(ar) .bn-tile-title,
.bn-root:lang(ar) .bn-foot-title {
  letter-spacing: 0 !important;
  line-height: 1.35 !important;
  font-family: var(--bn-font-ar) !important;
}

/* Visually hidden but still announced — used for section headings
   that must exist for correct heading order but are redundant next
   to a visible h1/heading right above (e.g. "All services"). */
.bn-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  margin: -1px;
  padding: 0;
}

/* Skip-to-content link: first focusable element on every page, offscreen
   until focused so it never disturbs the visual layout. */
.bn-skip {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 100;
  padding: .85rem 1.4rem;
  background: var(--bn-btn-bg);
  color: var(--bn-btn-fg);
  font-weight: 700;
  font-size: .95rem;
  border-radius: 14px;
  transform: translateY(-200%);
  transition: transform .15s ease;
}
.bn-skip:focus-visible {
  transform: translateY(0);
}

.bn-wrap {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--bn-wrap-pad);
}

/* ---------- 4. Navbar ---------- */

.bn-navwrap {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  z-index: 30;
  padding-block: 10px 0;
}
.bn-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  max-width: 100%;
  padding-inline: 1.4rem .6rem;
  padding-block: .55rem;
  background: var(--bn-nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 999px;
  border: 1px solid var(--bn-line);
  box-shadow: 0 8px 30px rgba(20, 21, 26, .08);
}
.bn-nav > * {
  min-width: 0;
}
.bn-logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  margin-inline-end: auto;
  unicode-bidi: isolate;
  flex: 0 1 auto;
  min-width: 0;
}
/* Logo is allowed to shrink in the nav (not the footer) so it never
   forces the nav pill wider than the viewport. clamp() alone handles
   every width from 320px up with no extra media query. */
.bn-navwrap .bn-logo img {
  display: block;
  max-width: clamp(96px, 30vw, 150px);
  width: 100%;
  height: auto;
}
/* Logo.webp is a single flat dark color: invert it to white instead of
   shipping a second asset. Nav logo follows the active theme; footer
   logo is pinned white because .bn-foot always sits on the ink tile,
   which is dark in both themes. */
:root[data-theme="dark"] .bn-navwrap .bn-logo img {
  filter: brightness(0) invert(1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .bn-navwrap .bn-logo img {
    filter: brightness(0) invert(1);
  }
}
.bn-tile--ink .bn-logo img {
  filter: brightness(0) invert(1);
}
.bn-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .25rem;
  font-size: .93rem;
  font-weight: 500;
  opacity: .8;
}
.bn-nav-link:hover {
  opacity: 1;
}
.bn-langbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bn-alt-bg);
  border: 0;
  border-radius: 999px;
  padding-inline: 1rem;
  min-height: 44px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.bn-menubtn {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bn-alt-bg);
  border: 0;
  border-radius: 999px;
  padding-inline: 1rem;
  min-height: 44px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.bn-menu {
  display: none;
}
@media (max-width: 860px) {
  .bn-nav {
    gap: .45rem;
    padding-inline: .45rem;
    padding-block: .45rem;
  }
  .bn-nav-link { display: none; }
  /* The bar-level "Get a quote" pill moves into the dropdown as
     .bn-menu-cta so the bar itself only ever holds 4 items. */
  .bn-nav > .bn-pill.bn-pill--sm { display: none; }
  .bn-menubtn { display: inline-flex; }
  body.bn-menu-open .bn-menu {
    display: grid;
    gap: .3rem;
    width: 100%;
    margin-top: 8px;
    padding: 1rem;
    background: var(--bn-white);
    border-radius: 26px;
    border: 1px solid var(--bn-line);
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
  }
  .bn-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding-inline: .9rem;
    border-radius: 14px;
    font-weight: 600;
  }
  .bn-menu a:hover {
    background: var(--bn-alt-bg);
  }
  .bn-menu-cta {
    width: 100%;
    justify-content: center;
    margin-top: .3rem;
    min-height: 48px;
  }
}
@media (min-width: 861px) {
  .bn-menu { display: none !important; }
}

/* ---------- 5. Pill ---------- */

.bn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .78rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  border: 0;
  background: var(--bn-btn-bg);
  color: var(--bn-btn-fg);
  transition: transform .18s ease;
  font-family: inherit;
}
.bn-pill:hover {
  transform: translateY(-2px);
}
.bn-pill--alt {
  background: var(--bn-alt-bg);
  color: var(--bn-fg);
}
.bn-pill--sm {
  padding: .55rem 1.1rem;
  min-height: 44px;
  font-size: .88rem;
}
.bn-row {
  margin-top: 1.7rem;
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}

/* ---------- 6. Tile (bento grid primitive) ---------- */

.bn-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--bn-gap);
  margin-top: var(--bn-gap);
}
.bn-tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--bn-radius);
  padding: var(--bn-tile-pad);
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--bn-line);
  transition: transform .25s ease;
}
a.bn-tile:hover {
  transform: translateY(-4px);
}
.bn-tile h3,
.bn-tile-title {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  font-weight: 800;
  line-height: 1.2;
}
.bn-tile p {
  margin-top: .35rem;
  font-size: .93rem;
  color: var(--bn-muted);
  font-family: var(--bn-font-ar);
  font-weight: 400;
}
.bn-tile--white { background: var(--bn-white); }
.bn-tile--lilac { background: var(--bn-lilac); }
.bn-tile--mint { background: var(--bn-mint); }
.bn-tile--sky { background: var(--bn-sky); }
.bn-tile--peach { background: var(--bn-peach); }
.bn-tile--butter { background: var(--bn-butter); }
.bn-tile--pink { background: var(--bn-pink); }
.bn-tile--ink {
  background: var(--bn-ink);
  color: var(--bn-ink-fg);
}
.bn-tile--ink p {
  color: rgba(255, 255, 255, .7);
}
.bn-tile--s2 { grid-column: span 2; }
.bn-tile--s3 { grid-column: span 3; }
.bn-tile--s4 { grid-column: span 4; }
.bn-tile--r2 { grid-row: span 2; }
@media (max-width: 960px) {
  .bn-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bn-tile--s3, .bn-tile--s4 { grid-column: span 2; }
}
@media (max-width: 560px) {
  .bn-bento { grid-template-columns: 1fr; }
  .bn-tile--s2, .bn-tile--s3, .bn-tile--s4 { grid-column: auto; }
  .bn-tile--r2 { grid-row: auto; }
}

/* Fixed 3-column modules (process, pricing, related-service tiles) used
   to hardcode grid-template-columns:repeat(3,minmax(0,1fr)) as an
   inline style, which — being inline — beat every media query above
   and never collapsed on small screens. This class carries the same 3
   columns at desktop but stacks straight to 1 column on phones/small
   tablets instead of passing through an awkward 2-then-orphan step,
   since 3 is not evenly divisible by 2. The extra .bn-bento--3
   selector weight (0,2,0) wins over plain .bn-bento (0,1,0)
   regardless of source order. */
.bn-bento.bn-bento--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .bn-bento.bn-bento--3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- 7. Footer tile ---------- */

.bn-foot {
  min-height: 0;
  padding: 2.2rem 1.9rem;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
  font-size: .95rem;
}
.bn-foot h4,
.bn-foot-title {
  margin: 0 0 .8rem;
  font-size: 1rem;
}
.bn-foot ul {
  display: grid;
  gap: .45rem;
}
.bn-foot a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0;
}
.bn-foot a:hover {
  color: var(--bn-lime);
}
.bn-foot .bn-about {
  max-width: 34ch;
  color: rgba(255, 255, 255, .7);
  font-family: var(--bn-font-ar);
}
.bn-legal {
  margin-top: 1.4rem;
  width: 100%;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .85rem;
  opacity: .65;
}

/* ---------- 8. Section head ---------- */

.bn-head {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem 3rem;
  align-items: end;
}
.bn-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.bn-head p {
  color: var(--bn-muted);
  max-width: 44ch;
  font-family: var(--bn-font-ar);
}
@media (max-width: 760px) {
  .bn-head { grid-template-columns: 1fr; }
}

/* ---------- 9. Hero + language-demo tile ---------- */

.bn-hero {
  min-height: 500px;
  justify-content: space-between;
}
.bn-hero h1 {
  font-size: clamp(2.4rem, 4.8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.bn-hero .bn-sub {
  margin-top: 1.1rem;
  max-width: 42ch;
  color: var(--bn-muted);
  font-family: var(--bn-font-ar);
  font-weight: 300;
  font-size: 1.1rem;
}
.bn-demo {
  position: absolute;
  inset: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  direction: ltr;
  height: 100px;
}
.bn-swap {
  position: relative;
  height: 3.4rem;
  flex: 1;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.bn-swap span {
  position: absolute;
  inset-inline-start: 0;
  animation: bn-swap-text 6s ease-in-out infinite;
  white-space: nowrap;
}
.bn-swap span:last-child {
  animation-delay: -3s;
  font-family: var(--bn-font-ar);
}
@keyframes bn-swap-text {
  0%, 40% { opacity: 1; transform: none; }
  50%, 90% { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: none; }
}
.bn-lang-knob {
  width: 96px;
  height: 48px;
  border-radius: 999px;
  background: var(--bn-fg);
  position: relative;
  flex: none;
}
.bn-lang-knob::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bn-bg);
  animation: bn-knob 6s ease-in-out infinite;
}
@keyframes bn-knob {
  0%, 40% { transform: translateX(0); }
  50%, 90% { transform: translateX(48px); }
  100% { transform: translateX(0); }
}
.bn-big {
  font-size: 4.2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: .6rem;
}

/* ---------- 10. Service-tile visuals ---------- */

/* Normal-flow layout instead of an absolutely positioned graphic over
   flex-end text: graphic first (fixed height, flex:none), the text
   block pushed to the bottom via margin-top:auto on whichever element
   follows it. Growing with real content (long titles, 3-line Arabic
   descriptions) instead of colliding with a pinned overlay. */
.bn-tile:has(> .bn-vis) {
  min-height: 300px;
}
.bn-tile:has(> .bn-vis) > h3,
.bn-tile:has(> .bn-vis) > .bn-tile-title-row {
  margin-top: auto;
}
.bn-vis {
  position: static;
  flex: none;
  width: 100%;
  height: 110px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.bn-vis-bar {
  flex: 1;
  border-radius: 8px 8px 0 0;
  background: var(--bn-fg);
  transform-origin: bottom;
  animation: bn-grow 3s ease-in-out infinite;
}
.bn-vis-bar:nth-child(1) { height: 35%; }
.bn-vis-bar:nth-child(2) { height: 55%; animation-delay: .2s; }
.bn-vis-bar:nth-child(3) { height: 45%; animation-delay: .4s; }
.bn-vis-bar:nth-child(4) { height: 80%; animation-delay: .6s; }
.bn-vis-bar:nth-child(5) { height: 100%; animation-delay: .8s; }
@keyframes bn-grow {
  0%, 100% { transform: scaleY(.35); }
  50% { transform: scaleY(1); }
}
.bn-vis--eq .bn-vis-bar { animation-duration: 1.1s; }
.bn-vis--eq .bn-vis-bar:nth-child(2) { animation-duration: .8s; }
.bn-vis--eq .bn-vis-bar:nth-child(3) { animation-duration: 1.4s; }
.bn-vis--eq .bn-vis-bar:nth-child(4) { animation-duration: .9s; }
.bn-vis--eq .bn-vis-bar:nth-child(5) { animation-duration: 1.2s; }
.bn-vis--code {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  direction: ltr;
}
.bn-vis--code i {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: var(--bn-fg);
  animation: bn-type 4s steps(12) infinite;
}
.bn-vis--code i:nth-child(1) { width: 60%; }
.bn-vis--code i:nth-child(2) { width: 85%; background: var(--bn-blue); animation-delay: .5s; }
.bn-vis--code i:nth-child(3) { width: 45%; animation-delay: 1s; }
.bn-vis--code i:nth-child(4) { width: 70%; background: var(--bn-blue); animation-delay: 1.5s; }
@keyframes bn-type {
  0% { clip-path: inset(0 100% 0 0); }
  60%, 100% { clip-path: inset(0 0 0 0); }
}
.bn-vis--swatches {
  align-items: center;
  gap: 10px;
}
.bn-vis--swatches i {
  flex: 1;
  height: 90px;
  border-radius: 18px;
  animation: bn-hue 6s linear infinite;
}
.bn-vis--swatches i:nth-child(1) { background: #FF5A5F; }
.bn-vis--swatches i:nth-child(2) { background: #FFB400; animation-delay: -1.5s; }
.bn-vis--swatches i:nth-child(3) { background: #00A699; animation-delay: -3s; }
.bn-vis--swatches i:nth-child(4) { background: #484848; }
@keyframes bn-hue {
  to { filter: hue-rotate(360deg); }
}
.bn-vis--layout {
  align-items: stretch;
  gap: 8px;
  direction: ltr;
}
.bn-vis--layout i {
  border-radius: 12px;
  background: var(--bn-fg);
  opacity: .9;
  animation: bn-pulse 3s ease-in-out infinite;
}
.bn-vis--layout i:nth-child(1) { flex: 2; }
.bn-vis--layout i:nth-child(2) { flex: 1; background: var(--bn-blue); animation-delay: .6s; }
@keyframes bn-pulse {
  50% { opacity: .4; }
}
.bn-vis--heart {
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: #E0245E;
  animation: bn-beat 1.4s ease-in-out infinite;
}
@keyframes bn-beat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.25); }
  40% { transform: scale(1); }
  60% { transform: scale(1.15); }
}
.bn-vis--play {
  align-items: center;
  justify-content: center;
}
.bn-vis--play b {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--bn-fg);
  display: grid;
  place-items: center;
  color: var(--bn-white);
  font-size: 1.6rem;
}
.bn-vis--play b::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--bn-fg);
  animation: bn-ring 2s ease-out infinite;
}
@keyframes bn-ring {
  to { transform: scale(1.9); opacity: 0; }
}
.bn-vis--line svg {
  width: 100%;
  height: 100%;
}
.bn-vis--line path {
  fill: none;
  stroke: var(--bn-lime);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: bn-draw 3.5s ease-in-out infinite;
}
@keyframes bn-draw {
  0% { stroke-dashoffset: 400; }
  60%, 100% { stroke-dashoffset: 0; }
}
/* Sits inline next to the title (not pinned over the graphic) so it
   can never overlap or get clipped by any visual at any width. */
.bn-tile-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.bn-tagp {
  background: var(--bn-ink);
  color: var(--bn-ink-fg);
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .75rem;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}

/* ---------- 11. Steps (process) ---------- */

.bn-step {
  min-height: 260px;
}
.bn-step .bn-n {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  position: absolute;
  top: 1.3rem;
  inset-inline-start: 1.7rem;
}

/* ---------- 12. Tier (pricing) ---------- */

.bn-tier {
  justify-content: flex-start;
  min-height: 0;
  gap: 0;
}
.bn-tier h3 {
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}
.bn-tier .bn-lead {
  margin-top: .5rem;
}
.bn-tier ul {
  margin: 1.4rem 0;
  display: grid;
  gap: .65rem;
  flex: 1;
}
.bn-tier li {
  position: relative;
  padding-inline-start: 1.5rem;
  font-family: var(--bn-font-ar);
  font-size: .95rem;
}
.bn-tier li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bn-blue);
}
.bn-tier--ink li::before {
  background: var(--bn-lime);
}
.bn-tier .bn-price {
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.bn-tier .bn-pill {
  align-self: flex-start;
}
.bn-tier--ink .bn-pill {
  background: var(--bn-lime);
  color: #14151A;
}
.bn-tier .bn-pop {
  align-self: flex-start;
  margin-bottom: 1rem;
  background: var(--bn-lime);
  color: #14151A;
  font-size: .78rem;
  font-weight: 800;
  padding: .2rem .8rem;
  border-radius: 999px;
}

/* ---------- 13. Client marks ---------- */

.bn-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.2rem;
  align-items: center;
  margin-top: 1.4rem;
}
.bn-marks img {
  height: 28px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: grayscale(1) opacity(.55);
  transition: filter .2s ease;
}
.bn-marks a:hover img {
  filter: none;
}
:root[data-theme="dark"] .bn-marks img {
  filter: grayscale(1) opacity(.6) invert(.85);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .bn-marks img {
    filter: grayscale(1) opacity(.6) invert(.85);
  }
}
.bn-marks img.bn-logo-empa {
  filter: grayscale(1) opacity(.6) invert(.35);
}
:root[data-theme="dark"] .bn-marks img.bn-logo-empa {
  filter: grayscale(1) opacity(.75);
}
.bn-marks a:hover img.bn-logo-empa {
  filter: invert(.35);
}
:root[data-theme="dark"] .bn-marks a:hover img.bn-logo-empa {
  filter: none;
}

/* ---------- 14. FAQ ---------- */

.bn-faq details {
  border-top: 1px solid rgba(127, 127, 127, .28);
}
.bn-faq details:first-child {
  border-top: 0;
}
.bn-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  padding: 1.15rem 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.bn-faq summary::-webkit-details-marker {
  display: none;
}
.bn-faq summary::after {
  content: "+";
  font-size: 1.7rem;
  line-height: 1;
  transition: transform .2s ease;
  flex: none;
}
.bn-faq details[open] summary::after {
  transform: rotate(45deg);
}
.bn-faq details p {
  margin: 0 0 1.2rem;
  max-width: 60ch;
}
.bn-faqside {
  justify-content: space-between;
}
/* .bn-faq is span 3 at desktop (4-col grid) and grows to span 2 (full
   width of the 2-col grid) at <=960px per the shared rule above.
   .bn-faqside has no span class of its own, so at that same breakpoint
   it must also become span 2 or it's left as a half-width orphan next
   to the now full-width FAQ card. */
@media (max-width: 960px) {
  .bn-faqside {
    grid-column: span 2;
  }
}

/* ---------- 15. CTA ---------- */

.bn-cta {
  min-height: 380px;
  justify-content: space-between;
}
.bn-cta h2 {
  font-size: clamp(2.4rem, 6.6vw, 6rem);
  line-height: .96;
  letter-spacing: -0.05em;
  font-weight: 800;
  max-width: 12ch;
}

/* ---------- 16. Theme toggle ---------- */

.bn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--bn-alt-bg);
  cursor: pointer;
  flex: none;
}
.bn-theme-toggle .bn-icon-sun {
  display: none;
}
:root[data-theme="dark"] .bn-theme-toggle .bn-icon-sun {
  display: inline;
}
:root[data-theme="dark"] .bn-theme-toggle .bn-icon-moon {
  display: none;
}

.bn-root main {
  padding-bottom: 14px;
  display: block;
}

/* ---------- 17. Breadcrumb + included tile (inner pages) ---------- */

.bn-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.6rem;
  font-size: .88rem;
  color: var(--bn-muted);
}
.bn-breadcrumb a:hover {
  color: var(--bn-fg);
}
.bn-breadcrumb .bn-bc-sep {
  opacity: .5;
}
.bn-breadcrumb .bn-bc-current {
  color: var(--bn-fg);
  font-weight: 600;
}

.bn-tile--included {
  min-height: 190px;
  justify-content: flex-start;
  gap: .6rem;
}
.bn-tile--included .bn-included-icon {
  font-size: 1.5rem;
}

/* ---------- 18. Case tile (photo-filled, cases.html) ---------- */

.bn-tile--case {
  min-height: 300px;
  padding: 0;
  /* Hardcoded, not a --bn-fg token: these tiles sit on a photo, so the
     text must stay white regardless of light/dark theme. */
  color: #FFFFFF;
}
.bn-tile--case .bn-case-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bn-tile--case .bn-case-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .62) 40%, rgba(0, 0, 0, .18) 75%, rgba(0, 0, 0, .08) 100%),
    rgba(0, 0, 0, .12);
}
.bn-tile--case .bn-case-body {
  position: relative;
  z-index: 1;
  padding: var(--bn-tile-pad);
}
.bn-tile--case .bn-case-industry {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .85;
}
.bn-tile--case h3 {
  margin-top: .3rem;
  color: #FFFFFF;
}
.bn-tile--case p {
  color: rgba(255, 255, 255, .88);
  font-family: var(--bn-font-ar);
}
.bn-case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .6rem;
}
.bn-case-tags span {
  font-size: .74rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, .25);
}
.bn-tile--case .bn-case-external {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #14151A;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

/* Carousel-style cases (no JS): a static mosaic of every photo instead
   of an interactive slider, so no image from the source gallery is
   dropped and no extra script is needed. */
.bn-case-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.bn-case-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bn-tile--case video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 19. Contact form ---------- */
/* HARD RULE: this styles the existing Netlify form only — name="contact",
   data-netlify, the bot-field honeypot, every field name/id, and the
   action attribute are untouched in the markup. CSS only. */

.bn-form {
  display: grid;
  gap: 1.1rem;
}
.bn-hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.bn-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
@media (max-width: 640px) {
  .bn-form-row {
    grid-template-columns: 1fr;
  }
}
.bn-form-field {
  display: grid;
  gap: .4rem;
}
.bn-form-field label {
  font-size: .88rem;
  font-weight: 600;
}
.bn-form-field .bn-req {
  color: var(--bn-blue-text);
  font-weight: 700;
}
.bn-form-field .bn-opt {
  font-weight: 400;
  opacity: .6;
}
.bn-form-field input,
.bn-form-field select,
.bn-form-field textarea {
  width: 100%;
  padding: .8rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--bn-line, rgba(127,127,127,.3));
  background: var(--bn-bg);
  color: var(--bn-fg);
  font: inherit;
  font-size: .95rem;
}
:root:not([data-theme="dark"]) .bn-form-field input,
:root:not([data-theme="dark"]) .bn-form-field select,
:root:not([data-theme="dark"]) .bn-form-field textarea {
  border-color: rgba(20, 21, 26, .16);
}
.bn-form-field textarea {
  resize: vertical;
  min-height: 140px;
}
.bn-form-field select {
  appearance: none;
}
.bn-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .4rem;
}
.bn-form-privacy {
  font-size: .82rem;
  color: var(--bn-muted);
  max-width: 40ch;
}
.bn-form-results {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  font-size: .92rem;
}
.bn-form-results--success {
  background: var(--bn-mint);
}
.bn-form-results--error {
  background: var(--bn-peach);
}

/* .bn-contact-aside has no span class of its own (it's meant to sit at
   1/4 width next to the s3 form on desktop), so like .bn-faqside above
   it's left as a half-width orphan once the form is forced to span 2
   at the 2-col breakpoint — stretch it across the full row instead. */
@media (max-width: 960px) {
  .bn-contact-aside {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }
}

.bn-contact-block {
  margin-bottom: 1.6rem;
}
.bn-contact-block:last-child {
  margin-bottom: 0;
}
.bn-contact-block-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bn-muted);
  margin-bottom: .5rem;
}
.bn-contact-block a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: .2rem;
  font-weight: 600;
}
.bn-contact-socials {
  display: flex;
  gap: .7rem;
  margin-top: .3rem;
}
.bn-contact-socials a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bn-alt-bg);
  display: grid;
  place-items: center;
}

.bn-expect-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.bn-expect-num {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  opacity: .35;
  flex: none;
}

/* ---------- 20. Related-service tile ---------- */

.bn-tile--related {
  min-height: 100px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.bn-tile--related h3 {
  font-size: 1.05rem;
  min-width: 0;
}
.bn-tile--related .bn-related-arrow {
  font-size: 1.2rem;
  opacity: .45;
  flex: none;
}

/* ---------- 21. cases.html filter (progressive enhancement) ---------- */

/* Bento-perfect packing: dense auto-flow backfills gaps left by the s2
   (wide) and s2+r2 (feature) case tiles, so 4-column and 2-column
   layouts both come out with zero empty cells (verified by simulating
   the placement algorithm — see the PR notes). */
#bn-cases-grid {
  grid-auto-flow: dense;
  grid-auto-rows: minmax(300px, auto);
}

/* When a filter narrows the visible set, js/bento.js neutralizes every
   visible tile to 1x1 and re-spans only the tail so the last row still
   fills with zero holes. Reset happens automatically when the filter
   goes back to "All" (the classes below are removed), restoring the
   default packed sizes above. */
#bn-cases-grid.bn-filtered > * {
  grid-column: span 1 !important;
  grid-row: span 1 !important;
}
@media (min-width: 961px) {
  #bn-cases-grid.bn-filtered .bn-fill-a { grid-column: span 4 !important; }
  #bn-cases-grid.bn-filtered .bn-fill-b,
  #bn-cases-grid.bn-filtered .bn-fill-c { grid-column: span 2 !important; }
}
@media (min-width: 561px) and (max-width: 960px) {
  #bn-cases-grid.bn-filtered .bn-fill-2 { grid-column: span 2 !important; }
}

.bn-filter-bar {
  display: none;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.4rem;
}
.bn-filter-bar.bn-js-ready {
  display: flex;
}
.bn-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--bn-line, rgba(127,127,127,.3));
  background: var(--bn-alt-bg);
  color: var(--bn-fg);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.bn-filter-chip.is-active {
  background: var(--bn-btn-bg);
  color: var(--bn-btn-fg);
  border-color: transparent;
}
.bn-cases-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--bn-muted);
}

/* ---------- 22. Stack/tools list (service pages) ---------- */

.bn-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.bn-stack-list li {
  padding: .5rem 1rem;
  border-radius: 999px;
  background: var(--bn-alt-bg);
  font-size: .88rem;
  font-weight: 600;
}

/* ---------- 23. Reduced motion ---------- */

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