/* ═══════════════════════════════════════════════════════════════════
   Estava | ستافا — Light edition
   Warm ivory paper · deep navy ink · brushed gold
   EN: Fraunces (display) + Manrope (body)   ·   AR: Zain + IBM Plex Sans Arabic
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --paper:    #FBF8F3;
  --paper-2:  #F4EFE6;
  --surface:  #FFFFFF;
  --ink:      #16233F;
  --ink-soft: #3B4A66;
  --muted:    #64708A;
  --gold:     #B07E30;
  --gold-hi:  #D9AC5C;
  --gold-lo:  #8A5F1E;
  --line:     rgba(22, 35, 63, .10);
  --line-2:   rgba(176, 126, 48, .28);
  --shadow:   0 18px 44px rgba(22, 35, 63, .09);
  --shadow-lg:0 34px 70px rgba(22, 35, 63, .14);
  --radius:   18px;

  --font-d:   'Fraunces', Georgia, serif;
  --font-b:   'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-m:   'IBM Plex Mono', Consolas, monospace;
}

/* Arabic swaps the type system, nothing else */
html[lang="ar"] {
  --font-d: 'Zain', 'IBM Plex Sans Arabic', sans-serif;
  --font-b: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  font-family: var(--font-b);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { line-height: 1.9; }

/* ── Atmosphere: paper warmth + faint star lattice ───────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 460px at 82% -8%, rgba(176,126,48,.13), transparent 62%),
    radial-gradient(760px 520px at -8% 28%, rgba(22,35,63,.06), transparent 58%),
    radial-gradient(680px 460px at 55% 108%, rgba(176,126,48,.08), transparent 62%);
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; opacity: .05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%2316233F' stroke-width='1'%3E%3Crect x='20' y='20' width='32' height='32'/%3E%3Crect x='20' y='20' width='32' height='32' transform='rotate(45 36 36)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 72px 72px;
}

::selection { background: var(--gold-hi); color: #fff; }

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
.container { width: min(1180px, 92%); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-d); line-height: 1.25; color: var(--ink); }
h1, h2 { letter-spacing: -.015em; }
html[lang="ar"] h1, html[lang="ar"] h2 { letter-spacing: 0; line-height: 1.35; }

/* ── Demo ribbon ─────────────────────────────────────────────────── */
.ribbon {
  background: linear-gradient(90deg, #7A5318, #9A6A26 45%, #7A5318);
  color: #fff;
  text-align: center;
  font-weight: 600;
  font-size: .82rem;
  padding: .45rem 1rem;
  letter-spacing: .01em;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 243, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 0; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand img { width: 44px; height: 44px; }
.brand-name {
  font-family: var(--font-d); font-weight: 700; font-size: 1.5rem;
  color: var(--ink); line-height: 1;
}
.brand-name small {
  display: block; font-family: var(--font-m); font-size: .57rem;
  color: var(--gold); letter-spacing: .42em; font-weight: 500;
  margin-top: .22rem;
}
html[lang="ar"] .brand-name { font-weight: 800; font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: 1.7rem; list-style: none; }
/* :not(.btn) matters — a bare `.nav-links a` rule outranks `.btn-gold` on
   specificity and would repaint the CTA label muted-grey on gold. */
.nav-links a:not(.btn) { font-size: .93rem; font-weight: 500; color: var(--muted); transition: color .25s; }
.nav-links a:not(.btn):hover { color: var(--gold); }
.nav-toggle {
  display: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font-size: 1.25rem;
  width: 42px; height: 42px; cursor: pointer;
}

/* Language switch */
.lang-btn {
  font-family: var(--font-m); font-size: .78rem; font-weight: 500;
  letter-spacing: .06em; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface); color: var(--gold-lo);
  padding: .42rem 1rem; transition: background .25s, color .25s, transform .2s;
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
}
.lang-btn:hover { background: var(--gold); color: #fff; transform: translateY(-1px); }
.lang-btn::before { content: '⌘'; font-size: .8em; opacity: .75; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-family: var(--font-b); font-weight: 600; font-size: .98rem;
  padding: .82rem 1.8rem; border-radius: 13px; cursor: pointer;
  border: 1px solid transparent; transition: transform .25s, box-shadow .25s, background .25s, color .25s;
  white-space: nowrap;
}
/* Gradient stays dark enough for white text to clear 4.5:1 at label sizes —
   the lighter gold reads as a highlight only, never as the text backdrop. */
.btn-gold {
  background: linear-gradient(135deg, #9A6A26, #7A5318);
  color: #fff;
  box-shadow: 0 10px 26px rgba(122,83,24,.28), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #A5722A, #6E4A14);
  transform: translateY(-3px); box-shadow: 0 16px 34px rgba(122,83,24,.36);
}
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--gold-lo); }
.btn-sm { padding: .52rem 1.2rem; font-size: .86rem; border-radius: 11px; }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 5rem 0 3.6rem; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 3rem; align-items: center; }
.kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 600; color: var(--gold-lo);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: .3rem 1rem; background: rgba(255,255,255,.8);
  margin-bottom: 1.3rem;
}
.kicker::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(176,126,48,.16); }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.8rem); font-weight: 600; margin-bottom: 1.15rem; }
html[lang="ar"] .hero h1 { font-weight: 800; }
.hero h1 em {
  font-style: normal; color: transparent;
  background: linear-gradient(115deg, var(--gold-lo), var(--gold) 45%, var(--gold-hi));
  -webkit-background-clip: text; background-clip: text;
}
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 34rem; margin-bottom: 2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }

.cred-chip {
  display: flex; align-items: center; gap: .55rem;
  margin-top: 1rem; font-family: var(--font-m); font-size: .79rem;
  color: var(--muted); direction: ltr;
  border: 1px dashed var(--line-2); border-radius: 11px;
  padding: .5rem .9rem; background: rgba(255,255,255,.75);
  width: fit-content;
}
.cred-chip b { color: var(--gold-lo); font-weight: 600; }
.cred-copy { background: none; border: none; cursor: pointer; color: var(--gold); font-size: .95rem; padding: .1rem .3rem; border-radius: 6px; }
.cred-copy:hover { background: rgba(176,126,48,.14); }

/* Mock dashboard */
.mock {
  position: relative;
  border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(165deg, #fff, var(--paper-2));
  box-shadow: var(--shadow-lg);
  padding: 1.05rem; transform: rotate(-2deg);
}
.mock-bar { display: flex; gap: .4rem; margin-bottom: .9rem; direction: ltr; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--line); }
.mock-bar i:first-child { background: var(--gold-hi); border-color: var(--gold); }
.mock-rows { display: grid; gap: .65rem; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mock-kpi { border: 1px solid var(--line); border-radius: 12px; padding: .65rem .75rem; background: #fff; }
.mock-kpi b { font-family: var(--font-d); font-size: 1.3rem; color: var(--gold-lo); display: block; line-height: 1.2; }
.mock-kpi span { font-size: .67rem; color: var(--muted); }
.mock-chart {
  height: 96px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, transparent 0 26px, rgba(22,35,63,.045) 26px 27px);
}
.mock-chart::after {
  content: ''; position: absolute; inset-inline: 8px; bottom: 10px; height: 52px;
  border-bottom: 2px solid var(--gold);
  clip-path: polygon(0 90%, 12% 70%, 26% 78%, 40% 48%, 56% 58%, 72% 26%, 86% 38%, 100% 10%, 100% 100%, 0 100%);
  background: linear-gradient(to top, rgba(176,126,48,.28), rgba(176,126,48,.02));
}
.mock-list { display: grid; gap: .42rem; }
.mock-line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, rgba(176,126,48,.22), rgba(22,35,63,.07)); }
.mock-line:nth-child(2) { width: 82%; opacity: .85; }
.mock-line:nth-child(3) { width: 64%; opacity: .65; }
.float-chip {
  position: absolute; font-size: .77rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink);
  padding: .45rem 1rem; box-shadow: var(--shadow);
  animation: floaty 5.5s ease-in-out infinite;
}
.chip-1 { top: -18px; inset-inline-start: -14px; animation-delay: .2s; }
.chip-2 { bottom: 32px; inset-inline-end: -18px; animation-delay: 1.6s; }
.chip-3 { bottom: -16px; inset-inline-start: 22%; animation-delay: 3s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ── Stats band ──────────────────────────────────────────────────── */
.stats {
  border-block: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(244,239,230,.55));
  padding: 2.3rem 0; margin-top: 1.6rem;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; text-align: center; }
.stat b {
  font-family: var(--font-d); font-weight: 600;
  font-size: clamp(1.9rem, 3.3vw, 2.8rem); color: var(--gold-lo);
  display: block; direction: ltr; line-height: 1.15;
}
html[lang="ar"] .stat b { font-weight: 800; }
.stat span { color: var(--muted); font-size: .88rem; }

/* ── Sections ────────────────────────────────────────────────────── */
.section { padding: 4.4rem 0 .6rem; }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.4rem; align-items: baseline; margin-bottom: 1.9rem; }
.section-num {
  font-family: var(--font-m); color: var(--gold); font-size: .82rem; font-weight: 500;
  border: 1px solid var(--line-2); border-radius: 10px; padding: .28rem .68rem;
  direction: ltr; background: var(--surface);
}
.section-head h2 { font-size: clamp(1.6rem, 2.9vw, 2.25rem); font-weight: 600; }
html[lang="ar"] .section-head h2 { font-weight: 800; }
.section-head p { grid-column: 2; color: var(--muted); max-width: 46rem; margin-top: -.3rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.05rem; }
.card {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  padding: 1.45rem 1.35rem 1.3rem;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(22,35,63,.04);
}
.card::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0;
  width: 3px; height: 0; background: linear-gradient(var(--gold-hi), var(--gold-lo));
  transition: height .35s;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card:hover::before { height: 100%; }
.card .icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  font-size: 1.3rem; border-radius: 13px; margin-bottom: .95rem;
  background: linear-gradient(160deg, rgba(217,172,92,.18), rgba(176,126,48,.08));
  border: 1px solid var(--line-2);
}
.card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: .45rem; }
html[lang="ar"] .card h3 { font-weight: 700; }
.card p { font-size: .89rem; color: var(--muted); line-height: 1.75; }

/* ── CTA band ────────────────────────────────────────────────────── */
.cta-band { padding: 4.6rem 0; }
.cta-box {
  position: relative; text-align: center;
  border: 1px solid var(--line-2); border-radius: 28px;
  padding: 3.2rem 2rem;
  background:
    radial-gradient(600px 220px at 50% -30%, rgba(217,172,92,.22), transparent 70%),
    linear-gradient(170deg, #fff, var(--paper-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cta-box h2 { font-size: clamp(1.65rem, 3.4vw, 2.5rem); font-weight: 600; margin-bottom: .7rem; }
html[lang="ar"] .cta-box h2 { font-weight: 800; }
.cta-box p { color: var(--muted); margin-bottom: 1.8rem; }
.cta-box .hero-ctas { justify-content: center; }

/* ── Footer ──────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 2.4rem 0 1.9rem; background: rgba(255,255,255,.7); }
.foot { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; justify-content: space-between; }
.foot .brand img { width: 36px; height: 36px; }
.foot .brand-name { font-size: 1.2rem; }
.foot-links { display: flex; gap: 1.3rem; list-style: none; font-size: .88rem; color: var(--muted); }
.foot-links a:hover { color: var(--gold); }
.foot small { display: block; width: 100%; text-align: center; color: #8A93A6; margin-top: 1.3rem; font-size: .77rem; }

/* ── Contact page ────────────────────────────────────────────────── */
.contact-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 2.3rem; padding: 3.6rem 0 4.6rem; align-items: start; }
.contact-side h1 { font-size: clamp(2rem, 3.8vw, 2.9rem); font-weight: 600; margin-bottom: .9rem; }
html[lang="ar"] .contact-side h1 { font-weight: 800; }
.contact-side h1 em {
  font-style: normal; color: transparent;
  background: linear-gradient(115deg, var(--gold-lo), var(--gold) 45%, var(--gold-hi));
  -webkit-background-clip: text; background-clip: text;
}
.contact-side p.lead { color: var(--muted); margin-bottom: 1.8rem; }
.contact-cards { display: grid; gap: .8rem; }
.ccard {
  display: flex; gap: 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.15rem;
  background: var(--surface); box-shadow: 0 2px 10px rgba(22,35,63,.04);
  transition: border-color .3s, transform .3s, box-shadow .3s;
}
.ccard:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.ccard .icon { font-size: 1.35rem; }
.ccard b { display: block; font-size: .94rem; font-weight: 600; }
.ccard span { font-size: .84rem; color: var(--muted); direction: ltr; display: inline-block; }

.form { border: 1px solid var(--line); border-radius: 24px; padding: 1.9rem; background: var(--surface); box-shadow: var(--shadow); }
.form h2 { font-weight: 600; font-size: 1.35rem; margin-bottom: 1.3rem; }
html[lang="ar"] .form h2 { font-weight: 800; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .84rem; font-weight: 500; color: var(--ink); margin-bottom: .35rem; }
.field input, .field textarea {
  width: 100%; font-family: var(--font-b); font-size: .94rem;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px;
  padding: .78rem .95rem; outline: none; transition: border-color .25s, box-shadow .25s, background .25s;
}
.field input::placeholder, .field textarea::placeholder { color: #9AA4B6; }
.field input:focus, .field textarea:focus { background: #fff; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,126,48,.14); }
.form-note { font-size: .77rem; color: #8A93A6; margin-top: .85rem; }

/* ── Reveal on scroll ────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .07s; }
.reveal:nth-child(3) { transition-delay: .14s; }
.reveal:nth-child(4) { transition-delay: .21s; }
.reveal:nth-child(5) { transition-delay: .27s; }
.reveal:nth-child(6) { transition-delay: .33s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-chip { animation: none; }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 3.2rem; }
  .mock { transform: rotate(0); max-width: 560px; margin-inline: auto; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: fixed; inset-inline: 0; top: 62px; z-index: 49;
    flex-direction: column; gap: 0; padding: .5rem 0;
    background: rgba(251,248,243,.98); border-bottom: 1px solid var(--line);
    display: none; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: block; padding: .85rem; }
  .nav-toggle { display: block; }
  .cards { grid-template-columns: 1fr; }
  .hero { padding-top: 3rem; }
  .hero-ctas .btn { width: 100%; }
  .cred-chip { width: 100%; justify-content: center; flex-wrap: wrap; }
  .section-head { grid-template-columns: 1fr; }
  .section-head p { grid-column: 1; }
}
