/* ==========================================================
   Raseen AI — site styles
   Built to Brand System v2.2. Colours, type, radii and rules
   come from the guide; nothing here invents a new token.
   Logical properties are used throughout so this one file
   serves both the Arabic (RTL) and English (LTR) pages.
   ========================================================== */

:root {
  --ink:        #0E1116;
  --steel:      #232A3B;
  --bronze:     #9C7C3F;
  --bronze-soft:#B79A5C;
  --paper:      #F4F2EC;
  --paper-2:    #E9E5DA;
  --night:      #0A0C11;
  --night-2:    #12151F;
  --ivory:      #EFEBE0;
  --hairline:   #D9D3C3;

  --radius-control: 8px;
  --radius-card: 14px;

  --measure: 1140px;
  --gap: clamp(64px, 9vw, 128px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Arabic pages: Almarai, larger optical size, no tracking */
[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] button {
  font-family: "Almarai", "Segoe UI", Tahoma, sans-serif;
  font-size: 19px;
  line-height: 1.9;
  letter-spacing: 0;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* ---------- Typography ---------- */

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.15; }
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 { font-weight: 700; line-height: 1.45; }

h1 { font-size: clamp(34px, 5.4vw, 60px); letter-spacing: -0.02em; }
h2 { font-size: clamp(27px, 3.4vw, 40px); letter-spacing: -0.015em; }
h3 { font-size: clamp(19px, 1.6vw, 22px); letter-spacing: -0.01em; }

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 { letter-spacing: 0; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 20px;
}
[dir="rtl"] .eyebrow {
  letter-spacing: 0;
  font-size: 14px;
  text-transform: none;
  font-weight: 700;
}

.lede { font-size: clamp(18px, 2vw, 22px); line-height: 1.6; max-width: 62ch; }
[dir="rtl"] .lede { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.85; }

.muted { color: color-mix(in srgb, var(--ink) 68%, var(--paper)); }

/* ---------- Plinth: the site's signature divider ----------
   Two stacked rules echoing the base of the mark — a wide
   step and a narrower one beneath it. Used to open sections. */

.plinth { display: block; margin-block-end: 28px; }
.plinth::before,
.plinth::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
}
.plinth::before { width: 68px; }
.plinth::after  { width: 44px; margin-block-start: 6px; margin-inline-start: 12px; }

.on-dark .plinth::before,
.on-dark .plinth::after { background: var(--bronze-soft); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-block-end: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 26px;
  min-height: 76px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand img { height: 40px; width: auto; display: block; }
.brand .name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
[dir="rtl"] .brand .name { font-size: 25px; letter-spacing: 0; }

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-inline-start: auto;
  min-width: 0;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding-block: 6px;
  border-block-end: 2px solid transparent;
}
[dir="rtl"] .site-nav a { font-size: 17px; }
.site-nav a:hover { border-block-end-color: var(--bronze); }

.lang {
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 7px 14px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.lang:hover { border-color: var(--bronze); }

@media (max-width: 1000px) {
  .site-nav a:not(.lang) { display: none; }
}

/* Nothing should ever push the page sideways */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-control);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform .15s ease, background-color .15s ease;
}
[dir="rtl"] .btn { font-size: 18px; }

.btn-primary { background: var(--ink); color: var(--ivory); }
.btn-primary:hover { background: var(--steel); }

.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--paper-2); }

.on-dark .btn-primary { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.on-dark .btn-primary:hover { background: #fff; }
.on-dark .btn-secondary { color: var(--ivory); border-color: color-mix(in srgb, var(--ivory) 45%, transparent); }
.on-dark .btn-secondary:hover { background: var(--night-2); }

.btn:active { transform: translateY(1px); }

/* Bronze is a signal, never a surface — focus only */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark a:focus-visible,
.on-dark summary:focus-visible { outline-color: var(--bronze-soft); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-block-start: 36px;
}

/* ---------- Sections ---------- */

section { padding-block: var(--gap); }

.on-dark { background: var(--night); color: var(--ivory); }
.on-dark .muted { color: color-mix(in srgb, var(--ivory) 66%, var(--night)); }
.on-dark .eyebrow { color: var(--bronze-soft); }

.section-head { max-width: 68ch; margin-block-end: 56px; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(72px, 11vw, 128px) var(--gap); }
.hero .lockup { height: clamp(96px, 13vw, 132px); width: auto; margin-block-end: 40px; }
.hero h1 { max-width: 19ch; }
[dir="rtl"] .hero h1 { max-width: 22ch; }
.hero .lede { margin-block-start: 28px; }

/* ---------- Grids ---------- */

.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
}

.card {
  background: var(--paper-2);
  border-radius: var(--radius-card);
  padding: 34px 30px;
}
.on-dark .card { background: var(--night-2); }

.card h3 { margin-block-end: 12px; }
.card p { font-size: 16px; }
[dir="rtl"] .card p { font-size: 18px; }

/* Steps — numbered because the assessment genuinely is a sequence */
.step { position: relative; padding-block-start: 8px; }
.step .num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--bronze);
  display: block;
  margin-block-end: 14px;
}
[dir="rtl"] .step .num { letter-spacing: 0; font-size: 15px; }
.step h3 { margin-block-end: 10px; }
.step::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 40px;
  height: 2px;
  background: var(--hairline);
}
.on-dark .step::before { background: color-mix(in srgb, var(--ivory) 25%, transparent); }

.note {
  margin-block-start: 44px;
  padding: 22px 26px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  font-weight: 500;
}
.on-dark .note { border-color: color-mix(in srgb, var(--ivory) 22%, transparent); }

/* ---------- FAQ ---------- */

.faq { max-width: 82ch; }
.faq details {
  border-block-end: 1px solid var(--hairline);
  padding-block: 22px;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
[dir="rtl"] .faq summary { font-size: 20px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--bronze);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  flex: none;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-block-start: 14px; }

/* ---------- Contact ---------- */

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-block-start: 36px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--paper-2);
  border-block-start: 1px solid var(--hairline);
  padding-block: 52px;
  font-size: 15px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
  margin-block-end: 36px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Compliance line — legally required, present on every page.
   Arabic first, English second. Arial fallback per the guide. */
.compliance {
  border-block-start: 1px solid var(--hairline);
  padding-block-start: 26px;
  line-height: 1.9;
}
.compliance .ar {
  font-family: "Almarai", Arial, sans-serif;
  direction: rtl;
  font-size: 15px;
  margin: 0 0 6px;
}
.compliance .en {
  font-family: "Space Grotesk", Arial, sans-serif;
  direction: ltr;
  font-size: 14px;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 66%, var(--paper-2));
}
[dir="rtl"] .compliance .en { text-align: right; }

/* ---------- Prose (compliance & about pages) ---------- */

.prose { max-width: 76ch; }
.prose h2 { margin-block: 56px 18px; }
.prose h3 { margin-block: 34px 10px; }
.prose ul { padding-inline-start: 22px; margin: 0 0 1em; }
.prose li { margin-block-end: 10px; }

.table-wrap { overflow-x: auto; margin-block: 28px 8px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
[dir="rtl"] table { font-size: 17px; }
th, td {
  text-align: start;
  padding: 14px 16px;
  border-block-end: 1px solid var(--hairline);
  vertical-align: top;
}
th { font-weight: 600; white-space: nowrap; }

/* ---------- Motion ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
