/* KARWABAR MARKETING SITE (docs/35, D-439/D-440).
 *
 * VISUAL DIRECTION (Sami, 2026-08-27): white ground; NAVY #16345F primary;
 * SAFFRON #F1A31F accent; coral and green ONLY where they carry meaning
 * (green = completed/arrival, coral sparingly). Soft coloured circles at low
 * opacity BEHIND the content — large, few, slow, PLAIN CSS: our visitors are
 * on the same low-end Android phones and slow connections the app is built
 * for, so WebGL/canvas particles and cursor-driven effects are excluded by
 * design, not omitted (a landing page that takes fifteen seconds to render
 * has already lost them; a cursor effect does nothing on a touchscreen).
 * Reference intent (21st.dev container-scroll / gradient-orb) adapted, never
 * copied — D-190.
 *
 * NO WEBFONT, deliberately: the audience's Android devices ship Noto's
 * Arabic-script faces system-wide, and a half-megabyte font download against
 * a ~5 GB monthly data basket fails the site's own cost rule (doc 24 §8's
 * reasoning). The stack below prefers the system Naskh everywhere.
 *
 * RTL-FIRST: the documents default to lang="fa" dir="rtl"; every property
 * here is logical (start/end), so the English toggle mirrors for free.
 */

:root {
  --navy: #16345f;
  --saffron: #f1a31f;
  /* Saffron is 2.15:1 on white — fine as a fill, never as text. Group
     headings use this darkened form, because a label a reader must READ
     has to pass contrast (doc 08's computed-not-eyeballed rule). */
  --saffron-ink: #8a5a00;
  --coral: #e56a54;
  --green: #1f9d5b;
  --ink: #1b1d21;
  --muted: #5a6272;
  --ground: #ffffff;
  --card: #ffffff;
  --line: #e7e9ee;
  --radius: 16px;
  --radius-lg: 24px;
  --max: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}
html[lang="en"] body { font-size: 16px; line-height: 1.6; }

/* ---------- the orbs: large, few, slow, BEHIND everything ---------- */
.orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.14; }
.orb-navy { width: 60vmax; height: 60vmax; background: var(--navy); inset-block-start: -20vmax; inset-inline-end: -20vmax; animation: drift-a 46s ease-in-out infinite alternate; }
.orb-saffron { width: 44vmax; height: 44vmax; background: var(--saffron); inset-block-start: 45%; inset-inline-start: -18vmax; animation: drift-b 58s ease-in-out infinite alternate; }
.orb-coral { width: 30vmax; height: 30vmax; background: var(--coral); inset-block-end: -12vmax; inset-inline-end: 10%; opacity: 0.10; animation: drift-a 70s ease-in-out infinite alternate-reverse; }
@keyframes drift-a { from { transform: translate(0, 0); } to { transform: translate(-6vmax, 5vmax); } }
@keyframes drift-b { from { transform: translate(0, 0); } to { transform: translate(5vmax, -6vmax); } }
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- shell ---------- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: 20px; }

header.site {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 14px; flex-wrap: wrap;
}
.logo { font-size: 24px; font-weight: 700; color: var(--navy); text-decoration: none; }
.logo b { color: var(--saffron); }
nav.site { display: flex; gap: 16px; flex-wrap: wrap; }
nav.site a { color: var(--navy); text-decoration: none; font-size: 15px; padding-block: 6px; }
nav.site a:hover { text-decoration: underline; }
.langs { display: flex; gap: 6px; }
.langs button {
  border: 1px solid var(--line); background: var(--card); color: var(--navy);
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- hero ---------- */
.hero { display: grid; gap: 32px; padding-block: 40px 56px; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr 0.85fr; padding-block: 56px 72px; } }
.badge {
  display: inline-block; background: color-mix(in srgb, var(--saffron) 16%, white);
  color: var(--navy); border: 1px solid color-mix(in srgb, var(--saffron) 45%, white);
  padding: 6px 14px; border-radius: 999px; font-size: 14px;
}
.hero h1 { color: var(--navy); font-size: clamp(30px, 6vw, 52px); line-height: 1.35; margin-block: 18px 10px; }
.hero .sub { color: var(--muted); font-size: 18px; max-width: 34em; }
.cta { display: flex; gap: 12px; margin-block-start: 26px; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none; font: inherit; font-size: 17px;
  padding: 14px 26px; border-radius: 999px; min-height: 48px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #1d4275; }
.btn-ghost { color: var(--navy); border: 1.5px solid var(--navy); background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--navy) 6%, white); }

/* ---------- the phone (container-scroll intent, adapted): tilted, then
   straightening once scrolled into view. The screen inside is a DIMENSIONED
   SLOT drawn in CSS — the D-191 rule: never a stand-in pretending to be a
   real screenshot; the real one drops in at the design pass. ---------- */
.phone-stage { display: flex; justify-content: center; perspective: 1200px; }
.phone {
  width: min(270px, 70vw); aspect-ratio: 9 / 19; border-radius: 36px;
  background: var(--navy); padding: 10px; box-shadow: 0 30px 60px -30px rgba(22, 52, 95, 0.45);
  transform: rotate(-7deg) rotateY(-12deg) translateY(10px);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.phone.straight { transform: rotate(0deg) rotateY(0deg) translateY(0); }
@media (prefers-reduced-motion: reduce) { .phone { transform: none; transition: none; } }
.phone-screen {
  width: 100%; height: 100%; border-radius: 28px; background: #faf8f4;
  display: flex; flex-direction: column; gap: 8px; padding: 12px; overflow: hidden;
}
.ps-bar { height: 34px; border-radius: 10px; background: var(--navy); }
.ps-hero { height: 76px; border-radius: 12px; background: linear-gradient(120deg, var(--navy), #2a62a8); }
.ps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ps-tile { aspect-ratio: 1; border-radius: 10px; background: color-mix(in srgb, var(--saffron) 24%, white); }
.ps-tile:nth-child(2) { background: color-mix(in srgb, var(--navy) 14%, white); }
.ps-tile:nth-child(4) { background: color-mix(in srgb, var(--green) 18%, white); }
.ps-tile:nth-child(6) { background: color-mix(in srgb, var(--navy) 10%, white); }
.ps-row { height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }

/* ---------- sections ---------- */
section.block { padding-block: 44px; }
section.block h2 { color: var(--navy); font-size: clamp(24px, 4.4vw, 34px); margin-block-end: 8px; }
section.block > .wrap > p.lead { color: var(--muted); max-width: 40em; margin-block-end: 26px; }

.steps { display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .steps.four { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: 0 14px 34px -26px rgba(22, 52, 95, 0.28);
}
.stepnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; background: var(--saffron); color: var(--navy);
  font-size: 20px; font-weight: 700; margin-block-end: 12px;
}
.card h3 { color: var(--navy); font-size: 19px; margin-block-end: 6px; }
.card p { color: var(--muted); font-size: 15.5px; }

.aud { display: grid; gap: 16px; }
@media (min-width: 860px) { .aud { grid-template-columns: repeat(2, 1fr); } }
.aud .card h3::before { content: "●"; color: var(--saffron); margin-inline-end: 8px; font-size: 12px; vertical-align: 3px; }

/* Deep pages: one column of step sections. */
.longsteps { display: grid; gap: 18px; max-width: 720px; }
.longsteps .card { padding: 26px; }
.plain-rule { border-inline-start: 4px solid var(--coral); padding-inline-start: 14px; }
.good { border-inline-start: 4px solid var(--green); padding-inline-start: 14px; }

/* ---------- video slots: NOTHING renders while empty (docs/35 §3) ---------- */
.video-slot { margin-block-start: 14px; }
.video-slot:empty { display: none; margin: 0; }
.video-facade {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0;
  border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--navy); display: block;
}
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; display: block; }
.video-facade .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.video-facade .play span {
  width: 62px; height: 62px; border-radius: 50%; background: var(--saffron);
  display: flex; align-items: center; justify-content: center; color: var(--navy); font-size: 24px;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.5);
}
.video-slot iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); display: block; }

/* ---------- footer ---------- */
footer.site { border-block-start: 1px solid var(--line); margin-block-start: 40px; padding-block: 28px 40px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; color: var(--muted); font-size: 14.5px; }
footer.site a { color: var(--navy); text-decoration: none; }
footer.site a:hover { text-decoration: underline; }

/* Identifiers and codes stay LTR inside RTL text (doc 08). */
.ltr { direction: ltr; unicode-bidi: isolate; }

/* THE HONESTY LINE (Sami, 2026-08-28) — the site ships before the pilot, so
   every page states plainly that Karwabar is not open yet. Saffron, because
   this is information rather than a problem (doc 08's colour meaning: red is
   for problems only). Logical properties throughout so it mirrors in Dari
   and Pashto without a second rule. */
.notopen {
  max-width: var(--max);
  margin-block: 0 8px;
  margin-inline: auto;
  padding: 10px 14px;
  border-inline-start: 4px solid var(--saffron);
  background: #fff8ec;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  border-radius: 8px;
}
@media (max-width: 720px) { .notopen { margin-inline: 12px; font-size: 14px; } }

/* THE `hidden` ATTRIBUTE MUST ACTUALLY HIDE (found by rendering, 2026-08-28).
   The hero's download button carries `hidden` until a real store URL exists,
   and it was RENDERING ANYWAY: the UA rule `[hidden] { display: none }` loses
   to any author `display` rule, and `.btn` sets one. So the site showed a
   "Download the app" button pointing at "#" — a dead control on a page about
   an app nobody can download yet, which is the exact overclaim the honesty
   line exists to prevent. Author-level and !important so no later `display`
   can quietly resurrect it. */
[hidden] { display: none !important; }

/* ── NAVIGATION FOR THIRTEEN PAGES (docs/35 §4.1, Sami 2026-08-28) ─────────
   THE FOUR GROUPS ARE THE NAVIGATION. A row of thirteen links is not
   navigation on a phone, so the header carries a MENU BUTTON and the grouped
   list opens over the page. The same grouped list is baked into every page's
   FOOTER in plain HTML — one home per page, and a reader with no JavaScript
   still has every link. The overlay is built by cloning that footer nav, so
   the two can never disagree about what pages exist. */
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--navy);
  font: inherit; font-size: 15px; cursor: pointer;
}
.menu-btn:hover { border-color: var(--navy); }
.menu-btn .bars { display: inline-block; width: 16px; height: 2px; background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor; }

.menu-panel[hidden] { display: none; }
.menu-panel {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(11, 20, 38, 0.45);
  padding: 16px; overflow-y: auto;
}
.menu-sheet {
  max-width: 720px; margin-inline: auto; margin-block: 8px 40px;
  background: var(--ground); border-radius: 18px; padding: 20px 20px 28px;
  box-shadow: 0 24px 60px rgba(11, 20, 38, 0.28);
}
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.menu-close {
  min-width: 44px; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}

/* THE GROUPS, in both the overlay and the footer. */
.navgroups { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.navgroup h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--saffron-ink);
}
.navgroup ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.navgroup a {
  display: block; padding: 10px 10px; margin-inline: -10px;
  border-radius: 10px; color: var(--navy); text-decoration: none; font-size: 16px; line-height: 1.5;
}
.navgroup a:hover { background: rgba(22, 52, 95, .06); }
.navgroup a[aria-current="page"] { background: rgba(22, 52, 95, .09); font-weight: 700; }

/* ── PAGE BODY: a heading, a lead, then numbered steps ──────────────────── */
.page { padding-block: 28px 56px; }
.page h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.25; margin: 0 0 10px; color: var(--navy); }
.page .lead { font-size: 18px; line-height: 1.7; margin: 0 0 28px; max-width: 60ch; }
.steps { display: grid; gap: 18px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px;
}
.step h2 { font-size: 19px; line-height: 1.4; margin: 0 0 6px; color: var(--navy); }
.step p { margin: 0; font-size: 16px; line-height: 1.75; max-width: 65ch; }
.step p + p { margin-top: 10px; }
/* A section describing something that does not exist yet says so, quietly. */
.step.later { border-inline-start: 4px solid var(--saffron); }
.step .later-note { margin-top: 10px; font-size: 15px; color: #6b5a3a; }

/* THE FOOTER NAV is real content, not a decoration: it is the no-JavaScript
   navigation and the source the overlay clones. */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding-block: 28px 48px; }
.site-foot .foot-note { margin-top: 24px; font-size: 14px; color: #5b6572; }
