/* ---------------------------------------------------------------
   Zomrah — token system

   ink    #14283F  deep navy — hero/footer background, primary text
   blue   #0E4C92  brand blue — the logo's own color; also drives links, CTAs, chrome
   sand   #EFE6D3  warm limestone — section backgrounds, cards
   paper  #FBF8F2  lightest warm neutral — page background
   clay   #B5602E  terracotta accent — used sparingly (Qartina tint, hover)
   fog    #8A93A2  cool grey — matches the wordmark's weight in secondary text
   ----------------------------------------------------------------*/

:root {
  --ink: #14283F;
  --ink-deep: #0E1D30;
  --blue: #0E4C92;
  --blue-bright: #2569A8;
  --sand: #EFE6D3;
  --paper: #FBF8F2;
  --clay: #B5602E;
  --fog: #8A93A2;

  --tint-qartina: #B5602E;
  --tint-manzool: #A6812F;
  --tint-mudabir: #5B6B7A;
  --tint-menzely: #6B7D4F;

  --line: rgba(20, 40, 63, 0.12);
  --line-dark: rgba(255, 255, 255, 0.16);

  --font-logo: 'Ahlan', 'Almarai', 'Segoe UI', sans-serif;
  --font-ar-display: 'Almarai', 'Segoe UI', sans-serif;
  --font-ar-body: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  --font-en-display: 'Plus Jakarta Sans', sans-serif;
  --font-en-body: 'Inter', sans-serif;

  --wrap: 1180px;
}

@font-face {
  font-family: 'Ahlan';
  src: url('../fonts/Ahlan-Regular.woff2') format('woff2'),
       url('../fonts/Ahlan-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ar-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
html[data-lang="en"] body { font-family: var(--font-en-body); line-height: 1.65; }

h1, h2, h3 { font-family: var(--font-ar-display); font-weight: 800; margin: 0; line-height: 1.35; }
html[data-lang="en"] h1,
html[data-lang="en"] h2,
html[data-lang="en"] h3 { font-family: var(--font-en-display); letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* language toggling: every bilingual node ships both spans; CSS hides the inactive one */
html[data-lang="ar"] [data-lang="en"] { display: none; }
html[data-lang="en"] [data-lang="ar"] { display: none; }

.skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { inset-inline-start: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.eyebrow {
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.9rem;
}
html[data-lang="ar"] .eyebrow { letter-spacing: 0.02em; text-transform: none; }
.eyebrow-light { color: #9FC0E8; }

.section-title { font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.35rem); max-width: 30ch; }
.section-title-light { color: var(--paper); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 242, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.9rem;
}
.brand { display: flex; align-items: center; }
.lockup { display: flex; flex-direction: column; align-items: center; }
.wordmark {
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--blue);
}
.caption {
  font-family: var(--font-en-body);
  font-weight: 500;
  font-size: 0.62rem;
  line-height: 0.75;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fog);
}
.footer-brand .wordmark { font-size: 1.5rem; }
.footer-brand .caption { font-size: 0.55rem; }
.caption-on-dark { color: #9AA9C0; }

/* in English, flip which line leads: "ZOMRAH" becomes the big blue line on
   top, the Arabic wordmark drops to a small line underneath */
html[data-lang="en"] .brand .wordmark {
  order: 2;
  font-size: 0.95rem;
  color: var(--fog);
  letter-spacing: normal;
  line-height: 1;
}
html[data-lang="en"] .brand .caption {
  order: 1;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.06em;
  line-height: 1.1;
}
html[data-lang="en"] .footer-brand .wordmark {
  order: 2;
  font-size: 0.75rem;
  color: #9AA9C0;
  letter-spacing: normal;
  line-height: 1;
}
html[data-lang="en"] .footer-brand .caption {
  order: 1;
  font-size: 1.1rem;
  font-weight: 700;
  color: #9FC0E8;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.site-nav { display: flex; gap: 2rem; margin-inline-start: auto; font-weight: 600; font-size: 0.95rem; }
.site-nav a { padding-block: 0.4rem; border-bottom: 2px solid transparent; transition: border-color 0.15s, color 0.15s; }
.site-nav a:hover { border-color: var(--blue); color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; margin-inline-start: auto; }
@media (min-width: 861px) {
  /* .site-nav already carries its own margin-inline-start: auto at this width,
     so header-actions doesn't need to push itself too */
  .header-actions { margin-inline-start: 0; }
}

.lang-toggle {
  font: inherit;
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.lang-toggle:hover { border-color: var(--blue); color: var(--blue); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px; height: 38px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding: 0.5rem 1.5rem 1rem;
}
.mobile-nav a { padding-block: 0.7rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav.open { display: flex; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------------- hero ---------------- */

.hero {
  background: radial-gradient(120% 140% at 15% -10%, #1c3a5e 0%, var(--ink) 45%, var(--ink-deep) 100%);
  color: var(--paper);
  padding-block: 4.5rem 5.5rem;
  overflow: clip;
}
html[dir="rtl"] .hero { background: radial-gradient(120% 140% at 85% -10%, #1c3a5e 0%, var(--ink) 45%, var(--ink-deep) 100%); }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 3rem;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3.15rem);
  color: var(--paper);
  max-width: 15ch;
}
.hero-sub {
  margin-top: 1.4rem;
  max-width: 46ch;
  color: #C7D3E4;
  font-size: 1.05rem;
}
.hero-cta { display: flex; gap: 1rem; margin-top: 2.2rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue-bright); color: #fff; }
.btn-primary:hover { background: #3d78c8; }
.btn-ghost { border: 1px solid rgba(255,255,255,0.3); color: var(--paper); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.6); }

/* the cluster diagram: a literal reading of "زمرة" (a gathered group) —
   Zomrah's mark at the center, four products drawn in orbit around it */
.cluster { position: relative; aspect-ratio: 1 / 1; max-width: 460px; margin-inline: auto; width: 100%; }
.cluster-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.cluster-lines line { stroke: rgba(159, 192, 232, 0.35); stroke-width: 0.4; }

.cluster-node {
  position: absolute;
  top: var(--y, 50%);
  inset-inline-start: var(--x, 50%);
  transform: translate(-50%, -50%);
}
html[dir="rtl"] .cluster-node { transform: translate(50%, -50%); }

.cluster-core {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--ink-deep);
  border: 1px solid rgba(159, 192, 232, 0.4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 8px rgba(159, 192, 232, 0.06);
}
.cluster-core .wordmark {
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--fog);
}
.cluster-core .caption {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
}

.cluster-sat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
  color: var(--paper);
  width: 108px;
}
.cluster-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tint, var(--blue-bright));
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
  margin-bottom: 0.35rem;
}
.cluster-sat[data-tint="qartina"] { --tint: var(--tint-qartina); }
.cluster-sat[data-tint="manzool"] { --tint: var(--tint-manzool); }
.cluster-sat[data-tint="mudabir"] { --tint: var(--tint-mudabir); }
.cluster-sat[data-tint="menzely"] { --tint: var(--tint-menzely); }

.cluster-name { font-weight: 700; font-size: 0.95rem; }
.cluster-tag { font-size: 0.72rem; color: #9AA9C0; }
a.cluster-sat { transition: transform 0.15s; }
a.cluster-sat:hover { transform: translate(-50%, calc(-50% - 3px)); }
html[dir="rtl"] a.cluster-sat:hover { transform: translate(50%, calc(-50% - 3px)); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .cluster { max-width: 360px; margin-top: 1.5rem; }
}
@media (max-width: 520px) {
  .cluster-sat { width: 84px; }
  .cluster-name { font-size: 0.82rem; }
  .cluster-tag { font-size: 0.65rem; }
}

/* ---------------- products ---------------- */

.products { background: var(--sand); padding-block: 5.5rem; }
.product-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (max-width: 760px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--paper);
  border-radius: 18px;
  padding: 1.8rem 1.8rem 1.6rem;
  border-top: 4px solid var(--tint, var(--blue));
  box-shadow: 0 1px 2px rgba(20,40,63,0.05);
}
.product-card[data-tint="qartina"] { --tint: var(--tint-qartina); }
.product-card[data-tint="manzool"] { --tint: var(--tint-manzool); }
.product-card[data-tint="mudabir"] { --tint: var(--tint-mudabir); }
.product-card[data-tint="menzely"] { --tint: var(--tint-menzely); }

.product-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.product-name { font-size: 1.4rem; }

.status {
  font-family: var(--font-en-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
html[data-lang="ar"] .status { letter-spacing: 0; }
.status-live { background: #E4EEE0; color: #4B6B3E; }
.status-dev { background: #EFE3D3; color: #8A5A2A; }

.product-desc { color: #3C4A5C; max-width: 52ch; }

.product-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.product-chips li {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--sand);
  color: var(--ink);
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.3rem;
  font-weight: 700;
  color: var(--blue);
  font-family: var(--font-en-body);
  font-size: 0.9rem;
}
.product-link:hover { color: var(--blue-bright); }
.product-link svg { flex-shrink: 0; }
html[dir="rtl"] .product-link svg { transform: scaleX(-1); }

/* ---------------- approach ---------------- */

.approach { padding-block: 5.5rem; }
.principle-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
@media (max-width: 860px) { .principle-grid { grid-template-columns: 1fr; gap: 2.2rem; } }

.principle { border-inline-start: 3px solid var(--blue); padding-inline-start: 1.2rem; }
.principle h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.principle p { color: #3C4A5C; max-width: 34ch; }

/* ---------------- contact ---------------- */

.contact { background: var(--ink); color: var(--paper); padding-block: 5rem; }
.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 760px) { .contact-inner { grid-template-columns: 1fr; } }
.contact-copy { color: #C7D3E4; max-width: 48ch; margin-top: 1rem; }

.contact-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-dark);
  border-radius: 18px;
  padding: 2rem;
  text-align: center;
}
.contact-email {
  display: block;
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: #9FC0E8;
}
.contact-email:hover { color: #C4DAF3; }
.contact-location { margin-top: 0.8rem; color: #9AA9C0; font-size: 0.9rem; }

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

.site-footer { background: var(--ink-deep); color: #9AA9C0; padding-block: 2.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; }
.footer-brand { display: inline-flex; }
.wordmark-on-dark { color: #9FC0E8; }

.footer-links { display: flex; gap: 1.4rem; font-size: 0.9rem; font-weight: 600; margin-inline-start: auto; }
.footer-links a:hover { color: var(--paper); }

.footer-meta, .footer-copy { width: 100%; font-size: 0.78rem; margin: 0; }
.footer-meta { margin-top: 0.4rem; }
.footer-copy { margin-top: 0.2rem; opacity: 0.7; }
