/* ===== Tokens ===== */
:root {
  --navy: #0E1F38;
  --ink: #0B1626;
  --paper: #F7F7F4;
  --paper-2: #EEF1EC;
  --white: #FFFFFF;
  --teal: #17706F;
  --teal-soft: #7FD1C7;
  --coral: #E07A5F;
  --text: #4A5568;
  --text-light: #C9D6E3;
  --line: #DCE1DA;
  --radius: 22px;
  --font-head: 'Readex Pro', 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Readex Pro', Tahoma, Arial, sans-serif;
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0; line-height: 1.25; }
p { margin: 0; }
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
section { position: relative; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 28px; border-radius: 999px;
  background: var(--navy); color: var(--white);
  font-family: var(--font-head); font-weight: 600; font-size: 17px;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(14,31,56,.18); }
.product .btn { background: var(--accent, var(--navy)); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-light { background: var(--white); color: var(--navy); }
.btn-ghost-light { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.5); }
.btn-small { padding: 9px 18px; font-size: 15px; }

/* ===== Nav ===== */
.nav { position: fixed; inset-inline: 0; top: 0; z-index: 50; transition: background .3s ease, box-shadow .3s ease; }
.nav.scrolled { background: rgba(247,247,244,.82); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); box-shadow: 0 1px 0 var(--line); }
.nav-inner { width: min(var(--wrap), 100% - 48px); margin-inline: auto; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { font-family: 'Readex Pro', monospace; font-weight: 700; color: var(--teal); font-size: 18px; direction: ltr; unicode-bidi: isolate; }
.brand-name { font-family: var(--font-head); font-weight: 600; color: var(--navy); font-size: 16px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-weight: 500; color: var(--navy); opacity: .75; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-btn { font-family: var(--font-head); font-weight: 600; font-size: 14px; background: transparent; border: 1.5px solid var(--line); color: var(--navy); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.lang-btn:hover { border-color: var(--navy); }

/* ===== Hero ===== */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 140px 0 100px; overflow: hidden; }
.hero-glow { position: absolute; width: 900px; height: 900px; inset-inline-end: -250px; top: -250px; background: radial-gradient(circle, rgba(127,209,199,.45), rgba(127,209,199,0) 65%); pointer-events: none; }
.eyebrow { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--teal); letter-spacing: .04em; margin-bottom: 20px; }
.eyebrow.light { color: var(--teal-soft); }
.hero-title { font-size: clamp(42px, 7vw, 92px); font-weight: 700; line-height: 1.15; max-width: 16ch; letter-spacing: -0.01em; }
.hero-title .w { display: inline-block; white-space: pre; }
.hero-sub { font-size: clamp(18px, 1.6vw, 22px); max-width: 640px; margin-top: 28px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 32px; margin-top: 72px; }
.stat { border-top: 2px solid var(--navy); padding-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-family: var(--font-head); font-size: 56px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 16px; }
.scroll-hint { position: absolute; bottom: 32px; left: 50%; width: 26px; height: 42px; border: 2px solid rgba(14,31,56,.35); border-radius: 14px; transform: translateX(-50%); }
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; border-radius: 2px; background: var(--navy); transform: translateX(-50%); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 14px); } }

/* ===== Statement ===== */
.statement { padding: 160px 0; background: var(--navy); }
.statement-text { font-family: var(--font-head); font-weight: 600; font-size: clamp(32px, 5vw, 68px); line-height: 1.3; color: var(--white); max-width: 18ch; }
.statement-text .w { display: inline-block; white-space: pre; }
.js-motion .statement-text .w { opacity: .18; }

/* ===== Systems index ===== */
.systems-index { padding: 140px 0 80px; }
.section-title { font-size: clamp(34px, 4.6vw, 60px); font-weight: 700; max-width: 18ch; }
.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-top: 56px; }
.chip { background: var(--white); border-radius: var(--radius); height: 130px; display: flex; align-items: center; justify-content: center; padding: 22px; box-shadow: 0 1px 0 var(--line); transition: transform .3s ease, box-shadow .3s ease; }
.chip:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(14,31,56,.10); }
.chip img { max-height: 80px; width: auto; object-fit: contain; }

/* ===== Product sections ===== */
.product { padding: 130px 0; overflow: hidden; }
.product.alt { background: var(--white); }
.product-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 72px; align-items: center; }
.product.alt .product-grid { grid-template-columns: 7fr 5fr; }
.product.alt .product-copy { order: 2; }
.product.alt .product-visual { order: 1; }
.product-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.product-logo { height: 64px; width: auto; }
.badge { background: var(--accent); color: var(--white); font-family: var(--font-head); font-weight: 600; font-size: 14px; padding: 5px 14px; border-radius: 999px; }
.tagline { font-size: clamp(30px, 3.4vw, 46px); font-weight: 700; color: var(--navy); line-height: 1.25; }
.tagline.light { color: var(--white); }
.product-desc { margin-top: 20px; font-size: 19px; }
.features { list-style: none; padding: 0; margin: 28px 0 36px; display: flex; flex-direction: column; gap: 14px; }
.features li { position: relative; padding-inline-start: 30px; font-size: 17px; color: var(--navy); }
.features li::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 14px; height: 3px; border-radius: 2px; background: var(--accent); }
.product-visual { position: relative; }
.device { background: var(--white); border-radius: 18px; overflow: hidden; box-shadow: 0 2px 0 rgba(14,31,56,.04), 0 40px 80px -20px rgba(14,31,56,.28); border: 1px solid var(--line); }
.device-bar { height: 34px; display: flex; align-items: center; gap: 7px; padding-inline: 16px; background: var(--paper-2); border-bottom: 1px solid var(--line); direction: ltr; }
.device-bar i { width: 11px; height: 11px; border-radius: 50%; background: #CBD2C9; }
.device img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }
.product-visual.stack { padding-bottom: 70px; }
.device-float { position: absolute; width: 58%; inset-inline-start: -6%; bottom: 0; }

/* ===== Sahati ===== */
.sahati { background: var(--ink); color: var(--text-light); padding: 150px 0; overflow: hidden; }
.sahati-head { display: flex; align-items: center; gap: 36px; }
.sahati-logo { background: var(--white); border-radius: var(--radius); padding: 18px; width: 150px; flex: none; }
.sahati-desc { font-size: clamp(19px, 1.7vw, 23px); max-width: 820px; margin-top: 36px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 56px; }
.pillar { border-top: 2px solid rgba(127,209,199,.5); padding-top: 22px; }
.pillar h3 { color: var(--white); font-size: 22px; margin-bottom: 8px; }
.pillar p { font-size: 16px; }
/* Sahati: diagram opens from "Join the vision" */
.sahati-open { margin-top: 48px; border: none; cursor: pointer; }
.sahati-arrow { display: inline-block; transition: transform .4s ease; }
.sahati-open.open .sahati-arrow { transform: rotate(180deg); }
.sahati-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s ease; }
.sahati-reveal.open { grid-template-rows: 1fr; }
.sahati-reveal-inner { overflow: hidden; min-height: 0; }
.sahati-reveal:not(.open) .sahati-reveal-inner { visibility: hidden; transition: visibility 0s .6s; }
/* Sahati diagram */
.sahati-diagram { margin: 40px 0 32px; background: var(--white); border-radius: 28px; padding: 36px; color: var(--text); }
.sd-title { font-size: 26px; color: var(--navy); }
.sd-sub { font-size: 15px; margin-top: 4px; }
.sd-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sd-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--navy); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.sd-chip i, .sd-ptitle i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.sd-canvas { margin-top: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sd-canvas svg { display: block; width: 100%; min-width: 680px; height: auto; font-family: var(--font-head); }
.sd-edge line { stroke: #CBD5E1; stroke-width: 3; transition: stroke .3s, stroke-width .3s, opacity .3s; }
.sd-elabel rect { fill: #fff; stroke: #E2E8F0; stroke-width: 1.5; transition: opacity .3s; }
.sd-elabel text { font-size: 20px; font-weight: 600; fill: #64748B; transition: fill .3s; }
.sd-edge.on line { stroke: #2563EB; stroke-width: 6; }
.sd-edge.on .sd-elabel rect { stroke: #BFDBFE; }
.sd-edge.on .sd-elabel text { fill: #1D4ED8; }
.sd-focus .sd-edge:not(.on) line { opacity: .25; }
.sd-focus .sd-edge:not(.on) .sd-elabel { opacity: 0; }
.sd-node { cursor: pointer; outline: none; transition: opacity .35s, transform .35s; }
.sd-halo { opacity: 0; transition: opacity .3s; }
.sd-node.on .sd-halo { opacity: .22; }
.sd-lbg { fill: #F8FAFC; stroke: #E2E8F0; stroke-width: 1.5; transition: fill .3s; }
.sd-ltxt { font-size: 24px; font-weight: 700; fill: #0E1F38; transition: fill .3s; }
.sd-node.on .sd-lbg { fill: #0E1F38; }
.sd-node.on .sd-ltxt { fill: #fff; }
.sd-focus .sd-node:not(.on):not(.near) { opacity: .2; transform: scale(.94); }
.sd-panel { margin-top: 18px; background: var(--navy); color: var(--text-light); border-radius: 18px; padding: 18px 22px; min-height: 64px; }
.sd-hint { font-size: 15px; text-align: center; }
.sd-ptitle { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; color: var(--white); font-size: 17px; }
.sd-plist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sd-prow { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 6px 12px; font-size: 14px; }
/* Draw-in when the diagram scrolls into view */
.sd-anim .sd-edge line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.sd-anim .sd-elabel, .sd-anim .sd-node { opacity: 0; }
.sd-anim .sd-node { transform: scale(.6); }
.sd-anim.sd-in .sd-edge line { stroke-dashoffset: 0; transition: stroke-dashoffset 1s ease calc(.35s + var(--i) * .04s), stroke .3s, stroke-width .3s, opacity .3s; }
.sd-anim.sd-in .sd-elabel { opacity: 1; transition: opacity .5s ease calc(1s + var(--i) * .03s); }
.sd-anim.sd-in .sd-node { opacity: 1; transform: scale(1); transition: opacity .5s ease calc(var(--i) * .05s), transform .6s cubic-bezier(.2,.9,.3,1.3) calc(var(--i) * .05s); }
.sd-anim.sd-in.sd-focus .sd-node:not(.on):not(.near) { opacity: .2; transform: scale(.94); transition: opacity .35s, transform .35s; }
.sd-anim.sd-in.sd-focus .sd-elabel { transition: opacity .3s; }

/* ===== About ===== */
.about { padding: 140px 0; }
.about-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 80px; align-items: start; }
.about-text { font-size: 19px; margin-top: 22px; max-width: 640px; }
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 30px; padding-inline-start: 32px; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--paper); }
.t-year { font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: 20px; }
.t-text { font-size: 16px; }

/* ===== Contact ===== */
.contact { background: var(--navy); padding: 150px 0; text-align: center; }
.contact-title { color: var(--white); font-size: clamp(34px, 5vw, 64px); font-weight: 700; max-width: 18ch; margin-inline: auto; }
.contact-sub { color: var(--text-light); font-size: 20px; margin-top: 22px; }
.contact-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

/* ===== Footer ===== */
.footer { background: var(--ink); color: #9FB3C8; font-size: 14px; padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .product-grid, .about-grid, .product.alt .product-grid { grid-template-columns: 1fr; gap: 48px; }
  .product.alt .product-copy, .product.alt .product-visual { order: initial; }
  .chips { grid-template-columns: repeat(3, 1fr); }
  .pillars { grid-template-columns: 1fr; }
  .sahati-diagram { padding: 22px; }
  .product, .about, .sahati, .contact, .systems-index { padding: 96px 0; }
  .statement { padding: 110px 0; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .brand-name { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
  .stat-num { font-size: 40px; }
  .stat-label { font-size: 14px; }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .chip { height: 104px; }
  .sahati-head { flex-direction: column; align-items: flex-start; gap: 24px; }
  .sahati-logo { width: 110px; }
  .product-logo { height: 52px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sahati-reveal, .sahati-arrow { transition: none; }
  .scroll-hint span { animation: none; }
  .statement-text .w { opacity: 1; }
}
