/* bouhach.com: the apps' family (navy titles, cards, IBM Plex Sans Arabic, Almarai for titles).
   build.mjs points the fonts' ./assets/ addresses at their hashed files. */

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-weight: 400;
  font-display: swap;
  src: url(/assets/plex-arabic-400.6010e7fd0d.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F,
    U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-weight: 500;
  font-display: swap;
  src: url(/assets/plex-arabic-500.90aef64fea.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F,
    U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-weight: 600;
  font-display: swap;
  src: url(/assets/plex-arabic-600.16734a5adb.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F,
    U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-weight: 400;
  font-display: swap;
  src: url(/assets/plex-latin-400.9ed8dcb02e.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-weight: 500;
  font-display: swap;
  src: url(/assets/plex-latin-500.be6a3b2e37.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-weight: 600;
  font-display: swap;
  src: url(/assets/plex-latin-600.63f4757271.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Almarai';
  font-weight: 700;
  font-display: swap;
  src: url(/assets/almarai-arabic-700.006fba6fe3.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F,
    U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Almarai';
  font-weight: 700;
  font-display: swap;
  src: url(/assets/almarai-latin-700.53706a39de.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #16202c;
  --ink-2: #485465;
  --ink-3: #697586;
  --line: #dde3ea;
  --line-strong: #c3cdd9;
  --navy: #1f3a5f;
  --navy-hover: #16304f;
  --on-navy: #ffffff;
  --gold: #ad854d;
  --stage: #e6ecf3;
  --chip: #edf1f6;
  --chip-ink: #1f3a5f;
  --focus: #2d6cdf;
  --shadow: 0 1px 2px rgb(15 30 50 / 0.06), 0 20px 44px -22px rgb(15 30 50 / 0.32);
  --sheet-shadow: 0 1px 2px rgb(15 23 42 / 0.14), 0 16px 32px -14px rgb(15 23 42 / 0.38);
  --paper: none;
  --sans: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --display: 'Almarai', 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d131b;
    --surface: #141c26;
    --ink: #e8edf3;
    --ink-2: #aab5c3;
    --ink-3: #8592a2;
    --line: #243140;
    --line-strong: #34465b;
    --navy: #a9c4e8;
    --navy-hover: #c4d7f0;
    --on-navy: #0d131b;
    --gold: #c9a36a;
    --stage: #1a2533;
    --chip: #1c2937;
    --chip-ink: #c9d8ec;
    --focus: #7aa7f5;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 22px 44px -22px rgb(0 0 0 / 0.7);
    --sheet-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 32px -14px rgb(0 0 0 / 0.75);
    /* Paper stays paper, a little less bright on a dark page. */
    --paper: brightness(0.9);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The footer stays at the bottom of a short page (the 404). */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

[lang='fr'] {
  line-height: 1.6;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 640px) {
  .wrap {
    padding-inline: 28px;
  }
}

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--on-navy);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* Header */

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
}

.lang {
  padding: 4px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.875rem;
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.lang:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* Hero */

.hero {
  padding-block: 40px 44px;
}

@media (min-width: 900px) {
  .hero {
    padding-block: 80px 64px;
  }
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
  font-size: 0.9375rem;
  font-weight: 500;
}

.kicker::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--gold);
}

h1 {
  margin-top: 14px;
  color: var(--navy);
  font-family: var(--display);
  font-size: clamp(1.9rem, 1.25rem + 2.9vw, 3.1rem);
  font-weight: 700;
  line-height: 1.4;
  text-wrap: balance;
}

[lang='fr'] h1 {
  max-width: 22ch;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 62ch;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

/* Apps */

.apps {
  padding-bottom: 72px;
}

.apps h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: 600;
}

.apps h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.cards {
  display: grid;
  gap: 24px;
}

@media (min-width: 820px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.card:hover,
.card:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.card:has(.card-link:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* The whole card opens the app; the link itself is the title, so its accessible name stays short. */
.card-link {
  text-decoration: none;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
}

.card-link:focus-visible {
  outline: none;
}

.stage {
  position: relative;
  height: 250px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--stage);
}

@media (min-width: 480px) {
  .stage {
    height: 290px;
  }
}

.sheet {
  position: absolute;
  top: 34px;
  width: 190px;
  height: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: var(--sheet-shadow);
  filter: var(--paper);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 480px) {
  .sheet {
    width: 216px;
  }
}

@media (min-width: 1000px) {
  .stage {
    height: 310px;
  }

  .sheet {
    width: 236px;
  }
}

.sheet.back {
  inset-inline-start: calc(50% - 168px);
  top: 50px;
  transform: rotate(-5deg);
}

.sheet.front {
  inset-inline-start: calc(50% - 30px);
  transform: rotate(3deg);
}

@media (min-width: 480px) {
  .sheet.back {
    inset-inline-start: calc(50% - 196px);
  }
}

[dir='rtl'] .sheet.back {
  transform: rotate(5deg);
}

[dir='rtl'] .sheet.front {
  transform: rotate(-3deg);
}

.card:hover .sheet.back {
  transform: rotate(-8deg) translate(-10px, 4px);
}

.card:hover .sheet.front {
  transform: rotate(1.5deg) translateY(-8px);
}

[dir='rtl'] .card:hover .sheet.back {
  transform: rotate(8deg) translate(10px, 4px);
}

[dir='rtl'] .card:hover .sheet.front {
  transform: rotate(-1.5deg) translateY(-8px);
}

.body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 20px 22px;
}

@media (min-width: 480px) {
  .body {
    padding: 24px 26px 26px;
  }
}

.name-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon {
  flex: none;
  width: 44px;
  height: 44px;
}

h3 {
  color: var(--navy);
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.4;
}

[lang='fr'] h3 {
  line-height: 1.25;
}

.other {
  display: inline-block;
  color: var(--ink-3);
  font-size: 0.875rem;
  line-height: 1.4;
}

.audience {
  margin-top: 18px;
  color: var(--ink);
  font-weight: 500;
}

.summary {
  margin-top: 6px;
  margin-bottom: 24px;
  color: var(--ink-2);
}

.cta,
.button {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 11px;
  background: var(--navy);
  color: var(--on-navy);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s;
}

.cta {
  margin-top: auto;
}

.card:hover .cta,
.button:hover {
  background: var(--navy-hover);
}

.arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

[dir='rtl'] .arrow {
  transform: scaleX(-1);
}

.card:hover .arrow {
  transform: translateX(3px);
}

[dir='rtl'] .card:hover .arrow {
  transform: scaleX(-1) translateX(3px);
}

/* Footer */

.foot {
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.875rem;
}

.foot-row {
  padding-block: 22px 28px;
}

/* 404 */

main {
  flex: 1;
}

.missing {
  padding-block: 48px 80px;
}

.missing > * {
  max-width: 640px;
}

.missing .code {
  color: var(--gold);
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.missing h1 {
  margin-top: 18px;
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.2rem);
}

.missing p {
  margin-top: 10px;
  color: var(--ink-2);
}

.missing .button {
  margin-top: 10px;
}

.missing .missing-apps {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.missing-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s;
}

[dir='rtl'] .missing-list a {
  padding: 7px 10px 7px 16px;
}

.missing-list a:hover {
  border-color: var(--navy);
}

.missing-list img {
  width: 28px;
  height: 28px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .card:hover,
  .card:focus-within {
    transform: none;
  }
}
