/* ===========================================================================
   KeraCRM — editorial identity: warm paper, ink, teal + amber. Bilingual/RTL.
   Aesthetic direction: confident editorial B2B (deliberately not the generic
   purple-gradient-on-white AI look).
   =========================================================================== */
:root {
    --paper: #f6f7f9;       /* cool white */
    --paper-2: #eceff4;     /* alt section bg */
    --ink: #0b1020;         /* near-black, cool */
    --ink-2: #232838;
    --muted: #5a6173;       /* cool grey body */
    --line: #e2e6ec;        /* cool border */
    --teal: #2563eb;        /* primary accent (electric blue) */
    --teal-bright: #3b82f6;
    --amber: #2563eb;       /* unified single accent */
    --amber-soft: #dbeafe;

    --radius: 14px;
    --radius-sm: 8px;
    --container: 1160px;
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Manrope', sans-serif;
    --font-ar: 'Tajawal', system-ui, sans-serif;
    --shadow: 0 18px 40px -24px rgba(11, 16, 32, .3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--ink-2);
    background: var(--paper);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-family: var(--font-ar); letter-spacing: 0; font-weight: 800; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 28px; }

/* ---------- Buttons (solid ink = premium/editorial) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font); font-weight: 600; font-size: .95rem; border: 1.5px solid transparent; cursor: pointer;
    padding: .72rem 1.4rem; border-radius: 999px; transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
    white-space: nowrap;
}
html[lang="ar"] .btn { font-family: var(--font-ar); }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--teal); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--light:hover { background: var(--teal); color: var(--paper); }
.btn--lg { padding: .95rem 1.9rem; font-size: 1.02rem; }
.btn--block { display: flex; width: 100%; }

.pill {
    display: inline-flex; align-items: center; gap: .5rem; padding: .4rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
    background: var(--amber-soft); color: #1e3a8a; border: 1px solid #bfdbfe;
}
.eyebrow {
    display: inline-block; color: var(--teal); font-family: var(--font-display); font-weight: 600; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .14em;
}
.eyebrow::before { content: "— "; color: var(--amber); font-weight: 700; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(250, 248, 243, .85); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.is-scrolled { border-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 1.5rem; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--ink); letter-spacing: -.01em; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); }
.brand__mark svg path { fill: var(--teal-bright); }
.brand__accent { color: var(--teal); }
.brand--light { color: var(--paper); }
.brand--light .brand__accent { color: var(--amber); }
.nav__links { display: flex; gap: 1.7rem; margin-inline-start: auto; font-weight: 500; font-size: .96rem; }
.nav__links a { color: var(--ink-2); position: relative; padding: .2rem 0; }
.nav__links a::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -2px; height: 2px; width: 0; background: var(--amber); transition: width .2s ease; }
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: .6rem; }
.lang-toggle { background: none; border: 1.5px solid var(--line); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: .82rem; padding: .45rem .85rem; border-radius: 999px; cursor: pointer; transition: all .15s; }
.lang-toggle:hover { border-color: var(--ink); }
.nav__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- Hero (asymmetric, editorial) ---------- */
.hero { position: relative; background: var(--paper); overflow: hidden; padding: 5.5rem 0 6rem; border-bottom: 1px solid var(--line); }
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(80% 70% at 70% 20%, #000, transparent 70%);
    mask-image: radial-gradient(80% 70% at 70% 20%, #000, transparent 70%);
}
.hero__blob { display: none; } /* drop the generic gradient blobs */
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3.5rem; align-items: center; }
.hero__copy { color: var(--ink); }
.hero__title { color: var(--ink); font-size: clamp(2.5rem, 5.2vw, 4.1rem); font-weight: 700; margin: 1.2rem 0; letter-spacing: -.03em; }
html[lang="ar"] .hero__title { letter-spacing: 0; }
.hero__title::after { content: ""; display: block; width: 84px; height: 6px; background: var(--amber); margin-top: 1.2rem; border-radius: 2px; }
.hero__sub { color: var(--muted); font-size: 1.15rem; max-width: 34em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 2.4rem; }
.hero__stats { display: flex; gap: 2.6rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.6rem; }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong { font-family: var(--font-display); font-size: 1.9rem; color: var(--ink); font-weight: 700; }
.hero__stats span { font-size: .85rem; color: var(--muted); }

/* App mockup — clean bordered window */
.mock { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 10px 10px 0 var(--ink); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
html[dir="rtl"] .mock { box-shadow: -10px 10px 0 var(--ink); }
.mock:hover { transform: translate(-3px, -3px); box-shadow: 14px 14px 0 var(--teal); }
html[dir="rtl"] .mock:hover { box-shadow: -14px 14px 0 var(--teal); }
.mock__bar { display: flex; gap: 7px; padding: 13px 16px; background: var(--paper-2); border-bottom: 1.5px solid var(--ink); }
.mock__bar span { width: 11px; height: 11px; border-radius: 50%; background: #d6cfc0; }
.mock__bar span:nth-child(1) { background: var(--amber); }
.mock__bar span:nth-child(2) { background: var(--teal-bright); }
.mock__bar span:nth-child(3) { background: var(--ink); }
.mock__body { display: grid; grid-template-columns: 72px 1fr; min-height: 300px; }
.mock__side { background: var(--ink); padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.mock__logo { height: 16px; border-radius: 4px; background: var(--amber); }
.mock__nav { height: 11px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
.mock__nav--on { background: var(--teal-bright); }
.mock__main { padding: 20px; background: #fff; }
.mock__tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.mock__tile { background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px; padding: 12px; }
.mock__tile b { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); display: block; }
.mock__tile i { display: block; height: 6px; width: 60%; border-radius: 3px; background: var(--teal); margin-top: 8px; }
.mock__row { height: 13px; border-radius: 4px; background: var(--paper-2); margin-bottom: 12px; }
.mock__row--w { width: 70%; }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; }
.section--alt { background: var(--paper-2); }
.section__head { max-width: 680px; margin: 0 auto 3.2rem; text-align: center; }
.section__head h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); margin: .7rem 0; }
.section__head p { color: var(--muted); font-size: 1.1rem; }

/* Features — numbered editorial index */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: feat; border-top: 1.5px solid var(--ink); }
.card {
    position: relative; counter-increment: feat; background: transparent; padding: 1.8rem 1.5rem 2rem;
    border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line);
    transition: background .2s ease;
}
.card::before {
    content: counter(feat, decimal-leading-zero); font-family: var(--font-display); font-weight: 700; font-size: .8rem;
    color: var(--amber); letter-spacing: .1em;
}
.card:hover { background: #fff; }
.card__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; margin: .8rem 0 1rem; background: var(--paper-2); border: 1.5px solid var(--line); transition: transform .2s ease, border-color .2s ease; }
.card:hover .card__icon { transform: translateY(-2px); border-color: var(--teal); }
.card h3 { font-size: 1.1rem; margin-bottom: .45rem; }
.card p { color: var(--muted); font-size: .94rem; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step { background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 2rem; }
.step__n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--ink); color: var(--paper); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin-bottom: 1.1rem; }
.step h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.step p { color: var(--muted); }

/* Bilingual showcase — the contrast IS the statement */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; }
.showcase__copy h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); margin: .7rem 0 1rem; }
.showcase__copy p { color: var(--muted); font-size: 1.06rem; }
.ticks { list-style: none; margin-top: 1.5rem; display: grid; gap: .8rem; }
.ticks li { position: relative; padding-inline-start: 2rem; font-weight: 600; color: var(--ink); }
.ticks li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: 0; width: 22px; height: 22px; border-radius: 6px; background: var(--teal); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.showcase__visual { display: grid; gap: 1.2rem; }
.flag-card { border-radius: var(--radius); padding: 1.7rem; display: flex; align-items: center; gap: 1.2rem; font-weight: 700; border: 1.5px solid var(--ink); }
.flag-card span { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.2rem; flex: 0 0 auto; }
.flag-card p { font-weight: 600; }
.flag-card--en { background: var(--paper); color: var(--ink); }
.flag-card--en span { background: var(--ink); color: var(--paper); }
.flag-card--ar { background: var(--ink); color: var(--paper); }
.flag-card--ar span { background: var(--teal-bright); color: #fff; }
.flag-card--ar p { color: var(--paper); direction: rtl; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; align-items: stretch; }
.plan { background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 2rem; display: flex; flex-direction: column; position: relative; }
.plan--featured { background: var(--ink); color: var(--paper); }
.plan--featured h3, .plan--featured .plan__price { color: var(--paper); }
.plan--featured .plan li { color: #d8d3c7; }
.plan__tag { position: absolute; top: -13px; inset-inline-start: 2rem; background: var(--teal); color: #fff; font-family: var(--font-display); font-size: .76rem; font-weight: 700; padding: .3rem 1rem; border-radius: 999px; }
.plan h3 { font-size: 1.3rem; }
.plan__price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--teal); margin: .5rem 0 1.2rem; }
.plan ul { list-style: none; display: grid; gap: .65rem; margin-bottom: 1.7rem; flex: 1; }
.plan li { position: relative; padding-inline-start: 1.6rem; color: var(--ink-2); }
.plan li::before { content: "→"; position: absolute; inset-inline-start: 0; color: var(--amber); font-weight: 700; }
html[dir="rtl"] .plan li::before { content: "←"; }
.plan--featured .btn--primary { background: var(--paper); color: var(--ink); }
.plan--featured .btn--primary:hover { background: var(--teal-bright); color: #fff; }

/* CTA band — solid ink statement */
.cta-band { background: var(--ink); padding: 5rem 0; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; inset: 0; opacity: .14; background-image: radial-gradient(#fff 1.2px, transparent 1.2px); background-size: 26px 26px; }
.cta-band__inner { position: relative; text-align: center; color: var(--paper); }
.cta-band__inner h2 { color: var(--paper); font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.cta-band__inner h2::after { content: ""; display: block; width: 72px; height: 5px; background: var(--amber); margin: 1rem auto 0; border-radius: 2px; }
.cta-band__inner p { color: #cfc9bc; margin: 1.2rem 0 1.7rem; font-size: 1.12rem; }

/* Contact */
.contact { text-align: center; }
.contact__actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* Footer */
.footer { background: var(--ink); color: #cfc9bc; padding-top: 3.5rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 2.5rem; }
.footer__brand .brand { font-size: 1.4rem; }
.footer__brand p { margin-top: .6rem; color: #9b9583; max-width: 26em; }
.footer__links { display: flex; gap: 1.7rem; flex-wrap: wrap; align-items: center; }
.footer__links a { color: #cfc9bc; transition: color .15s; }
.footer__links a:hover { color: var(--amber); }
.footer__bar { border-top: 1px solid rgba(255, 255, 255, .1); padding: 1.4rem 0; font-size: .9rem; color: #9b9583; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Section heading marker grows on reveal */
.section__head h2 { position: relative; display: inline-block; }
.section__head h2::after { content: ""; position: absolute; inset-inline-start: 50%; transform: translateX(-50%); bottom: -14px; width: 0; height: 4px; border-radius: 2px; background: var(--amber); transition: width .6s ease .15s; }
.section__head.is-in h2::after { width: 52px; }

/* Scroll progress */
.scroll-progress { position: fixed; inset-block-start: 0; inset-inline-start: 0; height: 3px; width: 0; z-index: 100; background: var(--teal); transition: width .08s linear; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 0; border: 3px solid var(--paper-2); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__visual { order: -1; max-width: 460px; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .showcase { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .nav__links { position: fixed; inset: 76px 0 auto 0; flex-direction: column; background: var(--paper); padding: 1.2rem 28px; gap: 1rem; border-bottom: 1.5px solid var(--ink); transform: translateY(-130%); transition: transform .25s ease; }
    .nav__links.is-open { transform: translateY(0); }
    .nav__burger { display: flex; }
    .nav__actions .btn--ghost { display: none; }
    .steps, .plans { grid-template-columns: 1fr; }
    .hero__stats { gap: 1.6rem; }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .nav__links { margin-inline-start: 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1 !important; transform: none !important; }
}
