/* ==========================================================================
   Altayebaat — marketing site design system
   "Refined Natural": calm, organic, premium. Mirrors the app's tokens.
   RTL-aware throughout via CSS logical properties (margin-inline, inset-*,
   text-align:start) so the Arabic (dir="rtl") view needs no extra CSS.
   ========================================================================== */

:root {
  /* Brand palette (from plans/01 §4.1) */
  --green-900: #16301f;
  --green-700: #1f4d32;
  --green-500: #2e7d52;
  --green-200: #c9decf;
  --cream-50:  #fbf8f1;
  --cream-100: #f4eee1;
  --gold-500:  #c9a24b;
  --gold-200:  #e8d9b0;
  --ink-900:   #1c2620;
  --ink-500:   #5a6660;

  /* Frequency-level semantics */
  --lvl-basic:     #2e7d52;
  --lvl-daily:     #6fae7d;
  --lvl-weekly:    #d9a441;
  --lvl-sometimes: #8e6fb0;
  --lvl-forbidden: #c0473b;

  /* Shape & depth */
  --r-card: 20px;
  --r-btn: 16px;
  --r-pill: 999px;
  --shadow: 0 8px 24px rgba(22, 48, 31, 0.06);
  --shadow-lg: 0 24px 60px rgba(22, 48, 31, 0.12);

  /* Type */
  --font-display: "Fraunces", "IBM Plex Sans Arabic", Georgia, serif;
  --font-body: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --maxw: 1140px;
  --nav-h: 72px;
}

/* Arabic view swaps the display face to the Arabic family. */
html[lang="ar"] {
  --font-display: "IBM Plex Sans Arabic", "Fraunces", serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink-900);
  background-color: var(--cream-50);
  /* Faint paper-grain warmth (SVG noise, very low alpha). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  line-height: 1.6;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- Typography -------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--green-900); line-height: 1.12; font-weight: 600; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
p  { color: var(--ink-500); font-size: 1.05rem; }
a  { color: var(--green-700); text-decoration: none; }

.eyebrow {
  display: block;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-500);
  margin-bottom: 14px;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 0.95rem; margin-bottom: 18px; }

/* Arabic glyphs carry diacritics above the line — give headings more room so
   they never collide with the eyebrow/label above them. */
html[lang="ar"] h1 { line-height: 1.4; }
html[lang="ar"] h2 { line-height: 1.4; }
html[lang="ar"] h3, html[lang="ar"] h4 { line-height: 1.5; }
html[lang="ar"] .hero h1 { padding-top: 4px; }

/* ---- Layout primitives ------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
section { padding-block: clamp(64px, 9vw, 120px); position: relative; }
.center { text-align: center; }
.muted { color: var(--ink-500); }
.lead { font-size: 1.2rem; max-width: 52ch; }
.center .lead { margin-inline: auto; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border-radius: var(--r-btn);
  border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--green-700); color: var(--cream-50); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--green-900); box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--green-700); border-color: var(--green-200); }
.btn-ghost:hover { background: rgba(46, 125, 82, 0.06); }
.btn svg { width: 20px; height: 20px; }

/* ---- Navbar ----------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(251, 248, 241, 0.72);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.nav.scrolled { border-color: var(--green-200); box-shadow: 0 4px 20px rgba(22,48,31,.04); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--green-900); }
.brand .mark { width: 34px; height: 34px; }
.brand .ar { font-family: "IBM Plex Sans Arabic", serif; font-size: 1.15rem; color: var(--gold-500); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink-900); font-weight: 500; font-size: .98rem; position: relative; }
.nav-links a::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -6px; width: 0; height: 2px; background: var(--gold-500); transition: width .25s; }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream-100); border: 1px solid var(--green-200); border-radius: var(--r-pill);
  padding: 6px 14px; font-weight: 600; font-size: .85rem; color: var(--green-700); cursor: pointer;
  font-family: var(--font-body); transition: background .2s;
}
.lang-toggle:hover { background: var(--gold-200); }

.menu-btn { display: none; background: none; border: 0; cursor: pointer; color: var(--green-900); }
.menu-btn svg { width: 28px; height: 28px; }

/* ---- Hero ------------------------------------------------------------- */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(64px, 10vw, 128px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 .accent { color: var(--green-500); }
.hero .lead { margin-block: 22px 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-note { margin-top: 18px; font-size: .9rem; color: var(--ink-500); display: flex; align-items: center; gap: 8px; }
.hero-note .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl-basic); box-shadow: 0 0 0 4px rgba(46,125,82,.15); }

/* floating botanical accents */
.float { position: absolute; font-size: 2rem; opacity: .5; filter: saturate(.8); animation: float 9s ease-in-out infinite; pointer-events: none; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-18px) rotate(6deg); } }

/* ---- Phone mockup (verdict reveal) ----------------------------------- */
.phone {
  position: relative; width: 300px; max-width: 86%; margin-inline: auto;
  aspect-ratio: 300 / 620; border-radius: 42px; background: var(--green-900);
  padding: 12px; box-shadow: var(--shadow-lg); transform: rotate(2deg);
}
.phone::before { content:""; position:absolute; top:14px; inset-inline:0; margin-inline:auto; width:120px; height:24px; background:var(--green-900); border-radius:var(--r-pill); z-index:3; }
.phone-screen { height: 100%; border-radius: 32px; background: var(--cream-50); overflow: hidden; position: relative; display: flex; flex-direction: column; }
.phone-top { padding: 38px 20px 14px; background: linear-gradient(180deg, var(--green-700), var(--green-500)); color: var(--cream-50); }
.phone-top .s { font-size: .72rem; opacity: .85; letter-spacing: .12em; text-transform: uppercase; }
.phone-top .q { font-family: var(--font-display); font-size: 1.4rem; margin-top: 4px; }
.verdict-card { margin: 16px; padding: 18px; border-radius: var(--r-card); background: var(--cream-100); box-shadow: var(--shadow); flex: 0 0 auto; }
.verdict-card .row { display: flex; align-items: center; gap: 12px; }
.verdict-emoji { font-size: 2.2rem; }
.verdict-name { font-family: var(--font-display); font-size: 1.25rem; color: var(--green-900); }
.lvl-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: var(--r-pill); font-size: .82rem; font-weight: 600; color: #fff; margin-top: 10px; }
.lvl-chip .d { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.85); }
.verdict-why { margin-top: 14px; font-size: .92rem; color: var(--ink-500); line-height: 1.5; }
.phone-foot { margin-top: auto; padding: 14px 18px 22px; display:flex; gap:10px; }
.phone-foot .pill { flex:1; text-align:center; padding:10px; border-radius:var(--r-btn); background:var(--green-700); color:var(--cream-50); font-size:.85rem; font-weight:600; }
.phone-foot .pill.alt { background: var(--cream-100); color: var(--green-700); }

/* ---- Frequency spectrum (signature interactive) ---------------------- */
.spectrum { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 40px; }
.lvl {
  background: var(--cream-100); border-radius: var(--r-card); padding: 22px 18px;
  box-shadow: var(--shadow); border-top: 4px solid var(--c);
  transition: transform .25s ease, box-shadow .25s ease;
}
.lvl:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.lvl .dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 18%, transparent); margin-bottom: 18px; }
.lvl .tag { display: block; }
.lvl h4 { margin-top: 6px; color: var(--ink-900); }
.lvl .tag { font-size: .8rem; color: var(--c); font-weight: 700; }
.lvl p { font-size: .9rem; margin-top: 8px; }
.lvl .ex { margin-top: 12px; font-size: .85rem; color: var(--ink-900); }

/* ---- Feature cards ---------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--cream-100); border-radius: var(--r-card); padding: 28px;
  box-shadow: var(--shadow); transition: transform .25s ease, box-shadow .25s ease;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card .ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--green-200); color: var(--green-700); font-size: 1.6rem; margin-bottom: 18px;
}
.card.prime .ic { background: var(--gold-200); color: var(--gold-500); }
.card h3 { margin-bottom: 8px; }
.badge-prime {
  position: absolute; inset-inline-end: 16px; inset-block-start: 16px;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-500); background: var(--gold-200); padding: 4px 10px; border-radius: var(--r-pill);
}

/* ---- Section heading -------------------------------------------------- */
.sec-head { max-width: 60ch; margin-inline: auto; text-align: center; margin-bottom: 48px; }
.sec-head p { margin-top: 14px; }

/* ---- Leaf divider ---------------------------------------------------- */
.leaf-div { display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--gold-500); opacity: .8; padding-block: 8px; }
.leaf-div .ln { height: 1px; width: 80px; background: linear-gradient(90deg, transparent, var(--gold-500)); }
.leaf-div .ln.r { background: linear-gradient(90deg, var(--gold-500), transparent); }

/* ---- Stat band ------------------------------------------------------- */
.band { background: var(--green-900); color: var(--cream-50); border-radius: 28px; }
.band h2, .band h3, .band h4 { color: var(--cream-50); }
.band p { color: rgba(251,248,241,.78); }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; text-align: center; }
.stat .n { font-family: var(--font-display); font-size: clamp(2.2rem,5vw,3.2rem); color: var(--gold-500); font-weight: 600; }
.stat .l { font-size: .92rem; color: rgba(251,248,241,.8); margin-top: 6px; }

/* ---- Community split -------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.list-feat { list-style: none; display: grid; gap: 16px; margin-top: 8px; }
.list-feat li { display: flex; gap: 14px; align-items: flex-start; }
.list-feat .ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--green-200); color: var(--green-700); display: grid; place-items: center; font-size: 1.2rem; }
.list-feat b { color: var(--ink-900); font-weight: 600; }
.list-feat span { display:block; color: var(--ink-500); font-size: .95rem; }

/* ---- Pricing --------------------------------------------------------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 820px; margin-inline: auto; }
.plan { background: var(--cream-100); border-radius: var(--r-card); padding: 34px; box-shadow: var(--shadow); border: 1.5px solid transparent; }
.plan.featured { border-color: var(--gold-500); background: #fff; position: relative; }
.plan.featured::before { content: attr(data-tag); position:absolute; inset-inline-end: 24px; inset-block-start: -13px; background: var(--gold-500); color:#fff; font-size:.72rem; font-weight:700; letter-spacing:.06em; padding:5px 14px; border-radius: var(--r-pill); }
.plan .price { font-family: var(--font-display); font-size: 2.6rem; color: var(--green-900); margin-block: 6px; }
.plan .price small { font-size: 1rem; color: var(--ink-500); font-weight: 400; }
.plan ul { list-style: none; margin: 18px 0 26px; display: grid; gap: 12px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; color: var(--ink-900); }
.plan li svg { width: 20px; height: 20px; color: var(--green-500); flex: 0 0 auto; }

/* ---- Store badges ---------------------------------------------------- */
.stores { display: flex; flex-wrap: wrap; gap: 14px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px;
  background: var(--green-900); color: var(--cream-50); border-radius: var(--r-btn); transition: transform .18s, background .18s;
}
.store:hover { transform: translateY(-2px); background: #0e2014; }
.store svg { width: 26px; height: 26px; }
.store .t { display: flex; flex-direction: column; line-height: 1.1; }
.store .t small { font-size: .66rem; opacity: .8; }
.store .t b { font-size: 1.05rem; font-weight: 600; }
.store[aria-disabled="true"] { opacity: .55; pointer-events: none; cursor: default; }

/* ---- CTA band -------------------------------------------------------- */
.cta-band { background: linear-gradient(135deg, var(--green-700), var(--green-900)); color: var(--cream-50); border-radius: 32px; text-align: center; overflow: hidden; position: relative; }
.cta-band h2 { color: var(--cream-50); }
.cta-band p { color: rgba(251,248,241,.82); margin-block: 14px 28px; }
.cta-band .float { opacity: .25; }

/* ---- Footer ---------------------------------------------------------- */
footer { background: var(--green-900); color: rgba(251,248,241,.75); padding-block: 64px 32px; margin-top: 24px; }
footer a { color: rgba(251,248,241,.75); }
footer a:hover { color: var(--gold-500); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h5 { color: var(--cream-50); font-size: .95rem; margin-bottom: 14px; letter-spacing: .04em; }
.foot-grid ul { list-style: none; display: grid; gap: 10px; font-size: .92rem; }
.foot-brand .brand { color: var(--cream-50); margin-bottom: 14px; }
.foot-brand p { color: rgba(251,248,241,.6); max-width: 34ch; font-size: .92rem; }
.foot-bottom { border-top: 1px solid rgba(251,248,241,.12); margin-top: 40px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .85rem; color: rgba(251,248,241,.55); }
.disclaimer { background: rgba(201,162,75,.12); border: 1px solid rgba(201,162,75,.3); border-radius: var(--r-btn); padding: 14px 18px; font-size: .85rem; color: rgba(251,248,241,.8); margin-top: 24px; }

/* ---- Legal / content pages ------------------------------------------ */
.doc { max-width: 760px; margin-inline: auto; }
.doc h1 { font-size: clamp(2rem,4vw,2.8rem); }
.doc .updated { color: var(--ink-500); font-size: .9rem; margin-block: 8px 32px; }
.doc h2 { font-size: 1.5rem; margin-top: 40px; margin-bottom: 12px; }
.doc h3 { font-size: 1.15rem; margin-top: 24px; margin-bottom: 8px; color: var(--green-700); }
.doc p, .doc li { color: var(--ink-900); font-size: 1rem; }
.doc ul { margin: 12px 0; padding-inline-start: 22px; display: grid; gap: 8px; }
.doc a { text-decoration: underline; }
.page-hero { background: linear-gradient(180deg, var(--cream-100), var(--cream-50)); padding-block: 56px 32px; text-align:center; border-bottom: 1px solid var(--green-200); }

/* ---- FAQ accordion --------------------------------------------------- */
.faq-item { background: var(--cream-100); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: 20px 24px; font-family: var(--font-display); font-size: 1.12rem; color: var(--green-900); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-body); font-size: 1.7rem; line-height: 1; color: var(--gold-500); transition: transform .25s ease; flex: 0 0 auto; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 24px 22px; margin: 0; color: var(--ink-500); }

/* ---- One-time language hint toast ------------------------------------ */
.lang-hint {
  position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 80; max-width: 320px;
  background: var(--green-900); color: var(--cream-50); border-radius: var(--r-card);
  box-shadow: var(--shadow-lg); padding: 16px 18px;
  transform: translateY(18px); opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.lang-hint.in { transform: none; opacity: 1; }
.lang-hint p { color: var(--cream-50); font-size: .9rem; margin: 0 0 12px; line-height: 1.45; }
.lang-hint .acts { display: flex; gap: 8px; align-items: center; }
.lang-hint button { font-family: var(--font-body); font-weight: 600; border: 0; cursor: pointer; border-radius: var(--r-pill); font-size: .85rem; }
.lang-hint .go { background: var(--gold-500); color: var(--green-900); padding: 8px 16px; }
.lang-hint .dismiss { background: transparent; color: rgba(251,248,241,.65); padding: 8px 10px; }
.lang-hint .dismiss:hover { color: var(--cream-50); }

/* ---- Scroll reveal --------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .hero-grid .phone-wrap { order: -1; }
  .grid.cols-3, .stats { grid-template-columns: repeat(2, 1fr); }
  .spectrum { grid-template-columns: repeat(2, 1fr); }
  .plans, .grid.cols-2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .menu-btn { display: inline-flex; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; position: absolute; inset-inline: 0; top: var(--nav-h);
    background: var(--cream-50); padding: 22px 24px; gap: 18px; box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--green-200);
  }
}
@media (max-width: 540px) {
  .grid.cols-3, .stats, .spectrum, .foot-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
}
