/* ==========================================================================
   SahabX service catalog
   One stylesheet for the Arabic (RTL) and English (LTR) catalog pages.
   ========================================================================== */

@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/cairo-arabic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/cairo-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  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 {
  --bg: #070b14;
  --bg-soft: #0a101d;
  --surface: #0d1422;
  --surface-2: #121b2c;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --text: #e8eef8;
  --muted: #9fb0c8;
  --faint: #71839c;
  --brand: #38bdf8;
  --brand-2: #0ea5e9;
  --brand-3: #2563eb;
  --accent: #fbbf24;
  --ok: #34d399;
  --grad: linear-gradient(120deg, #38bdf8 0%, #0ea5e9 55%, #2563eb 100%);
  --radius: 18px;
  --shadow: 0 28px 60px -40px rgba(2, 8, 23, 0.95);
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --max: 1120px;
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f6f8fc;
  --bg-soft: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f4f7fd;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.2);
  --text: #0b132b;
  --muted: #43536a;
  --faint: #56677e;
  --brand: #0284c7;
  --brand-2: #0ea5e9;
  --brand-3: #2563eb;
  --accent: #b45309;
  --ok: #047857;
  --shadow: 0 28px 60px -42px rgba(15, 23, 42, 0.35);
  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 560px at 88% -10%, rgba(56, 189, 248, 0.12), transparent 62%),
    radial-gradient(700px 480px at -4% 30%, rgba(37, 99, 235, 0.1), transparent 60%),
    var(--bg);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 15%, transparent 76%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 15%, transparent 76%);
}

[data-theme='light'] body::after {
  background-image: linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

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

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

::selection {
  background: rgba(56, 189, 248, 0.32);
  color: var(--text);
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--brand);
  color: #04121f;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 14px;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--grad);
  color: #04121f;
  box-shadow: 0 16px 32px -18px rgba(14, 165, 233, 0.9);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.btn .icon {
  width: 17px;
  height: 17px;
}

/* ----------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 8px 16px rgba(14, 165, 233, 0.3));
}

.brand__word {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.lang-switch:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.lang-switch .icon {
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.theme-toggle {
  display: none;
}

.js .theme-toggle {
  display: inline-flex;
}

.theme-toggle .icon--moon {
  display: none;
}

[data-theme='light'] .theme-toggle .icon--sun {
  display: none;
}

[data-theme='light'] .theme-toggle .icon--moon {
  display: block;
}

/* ------------------------------------------------------------- catalog intro */

.catalog-intro {
  padding-block: clamp(44px, 6vw, 76px) clamp(25px, 3.5vw, 40px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

[lang='ar'] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
  font-size: 12.5px;
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.catalog-intro__title {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

[lang='ar'] .catalog-intro__title {
  line-height: 1.32;
  letter-spacing: 0;
}

.catalog-intro__lead {
  max-width: 58ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.3vw, 1.06rem);
  line-height: 1.8;
}

/* ----------------------------------------------------------------- catalog */

.catalog {
  padding-bottom: clamp(48px, 6vw, 76px);
}

.catalog__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.catalog__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog__title h2 {
  font-size: clamp(1.25rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

[lang='ar'] .catalog__title h2 {
  letter-spacing: 0;
}

.catalog__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
}

.filters__group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.filter:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.filter.is-active {
  border-color: transparent;
  background: var(--grad);
  color: #04121f;
}

.filters__status {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}

.catalog__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.catalog__note {
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.7;
}

/* ------------------------------------------------------------ service card */

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

.service-card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-accent), transparent);
  opacity: 0.75;
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--card-accent) 42%, var(--line));
}

.service-card--streamflow {
  --card-accent: #38bdf8;
}

.service-card--skyvault {
  --card-accent: #60a5fa;
}

.service-card--email {
  --card-accent: #a78bfa;
}

.service-card--kahoot {
  --card-accent: #fbbf24;
}

.service-card--brewmaster {
  --card-accent: #34d399;
}

.service-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.service-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--card-accent) 26%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--card-accent) 9%, transparent);
  overflow: hidden;
}

.service-card__icon img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
}

.service-card__titles {
  min-width: 0;
}

.service-card__category {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
}

.service-card__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.4;
}

.service-card__latin {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge {
  align-self: start;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--available {
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.1);
}

.badge--account {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(125, 211, 252, 0.1);
}

.badge--invite {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.1);
}

[data-theme='light'] .badge--available {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

[data-theme='light'] .badge--account {
  color: #0369a1;
  border-color: #bae6fd;
  background: #f0f9ff;
}

[data-theme='light'] .badge--invite {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.service-card__summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

[lang='en'] .service-card__summary {
  line-height: 1.7;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.service-card__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--card-accent);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.18s ease;
}

.service-card__link:hover {
  color: var(--text);
}

.service-card__link .icon {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  margin-top: clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 75%, transparent);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 24px;
}

.footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.footer__brand .brand img {
  width: 30px;
  height: 30px;
}

.footer__brand .brand__word {
  font-size: 16px;
}

.footer__tagline {
  padding-inline-start: 14px;
  border-inline-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.footer__rights {
  margin-inline-start: auto;
  color: var(--faint);
  font-size: 12px;
}

/* ------------------------------------------------------------------- 404 */

.page--404 {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.not-found {
  width: 100%;
  max-width: 540px;
  margin-block: 10vh;
  padding-inline: 24px;
  text-align: center;
}

.not-found__mark {
  width: 72px;
  height: 72px;
  margin-inline: auto;
  filter: drop-shadow(0 16px 30px rgba(14, 165, 233, 0.35));
}

.not-found__code {
  margin-top: 18px;
  font-size: clamp(3.2rem, 11vw, 5.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.not-found__title {
  margin-top: 10px;
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  font-weight: 800;
}

.not-found__body {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
  .catalog__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .catalog__bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    width: 100%;
    justify-content: space-between;
  }

  .catalog__grid {
    grid-template-columns: 1fr;
  }

  .footer__tagline {
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  .footer__rights {
    width: 100%;
    margin-inline-start: 0;
  }
}

@media (max-width: 600px) {
  .header__inner {
    min-height: 62px;
    gap: 12px;
  }

  .brand__word {
    font-size: 17px;
  }

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

  .lang-switch span {
    display: none;
  }

  .lang-switch {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .catalog-intro {
    padding-block: 34px 22px;
  }

  .catalog-intro__title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .service-card {
    padding: 17px;
  }

  .catalog__note {
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .service-card__head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .badge {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .filters {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------- print */

@media print {
  body::before,
  body::after,
  .site-header,
  .site-footer,
  .filters {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .service-card,
  .catalog__note {
    break-inside: avoid;
    border-color: #ccc;
    box-shadow: none;
  }
}
