/* ============================================================
   Asas Landing Experiment — standalone stylesheet
   Tokens mirror the Atelier design system (CLAUDE.md §10).
   RTL-first: logical properties everywhere.
   ============================================================ */

/* ---------- Fonts (binaries gitignored; Fraunces is the fallback) ---------- */
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("../assets/fonts/thmanyah-serif-display-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("../assets/fonts/thmanyah-serif-display-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("../assets/fonts/thmanyah-serif-display-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Text";
  src: url("../assets/fonts/thmanyah-serif-text-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #0B1E36;
  --ink-2: #1E3554;
  --ink-soft: #4A5F7A;
  --slate: #8195AD;
  --slate-soft: #B8C5D4;
  --paper: #F4F1EA;
  --paper-2: #ECE7DC;
  --paper-3: #E3DCC9;
  --surface: #FBF9F4;
  --brand: #C9501C;
  --brand-soft: #E8B89C;
  --ok: #2D6A4F;
  --warn: #B08900;
  --err: #9B2226;
  --line: rgba(11, 30, 54, 0.12);
  --line-strong: rgba(11, 30, 54, 0.24);
  --panel-ink: #0A0A0A;

  --radius: 4px;
  --radius-hero: 28px;

  --shadow-sm: 0 1px 2px rgba(11, 30, 54, 0.06);
  --shadow: 0 6px 18px rgba(11, 30, 54, 0.08);
  --shadow-lg: 0 16px 40px rgba(11, 30, 54, 0.12);

  --font-display: "Thmanyah Serif Display", "Fraunces", serif;
  --font-heading: "Thmanyah Serif Text", "Thmanyah Serif Display", "Fraunces", serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
html[dir="ltr"] body { font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", sans-serif; }

/* Blueprint grid — ONE viewport-anchored lattice shared by the paper and the
   apricot hero panel (the panel's ::before reuses the identical cell size +
   a viewport-fixed background so the lines stay continuous across the panel
   edge). Single low-alpha INK ruling reads the same weight on both surfaces. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 30, 54, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 30, 54, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
.mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 1rem; }

/* ---------- Topbar (overlays the hero panel) ---------- */
.topbar {
  position: absolute;
  top: 0;
  inset-inline: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  /* top-align so the enlarged wordmark shares the toggle's top offset (its
     larger height no longer makes it poke above the toggle); the extra
     top padding gives both breathing room from the edge */
  align-items: flex-start;
  padding: clamp(1.9rem, 2.4vw, 2.4rem) clamp(1.6rem, 4vw, 3.2rem);
  color: var(--panel-ink);
}
/* nudge the toggle to sit on the wordmark's optical line (its cap-height
   starts a touch below the box top of the big display wordmark) */
.topbar .lang-toggle { margin-block-start: 0.35rem; }
.topbar-brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0;
  white-space: nowrap; /* never wrap the wordmark in the header row */
}
.topbar-bang { color: var(--brand); }

.lang-toggle {
  display: flex;
  border: 1px solid rgba(10, 10, 10, 0.4);
  border-radius: 3px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(251, 249, 244, 0.35);
}
.lang-toggle button {
  padding: 0.4rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--panel-ink);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--panel-ink);
  color: var(--surface);
}

/* ---------- 1 · Hero ---------- */
.hero {
  min-height: 100svh;
  padding: 14px;
  display: flex;
}
.hero-panel {
  flex: 1;
  position: relative;
  overflow: hidden; /* clip the grid to the rounded corners */
  background: var(--brand-soft);
  border-radius: var(--radius-hero);
  color: var(--panel-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(2.4rem, 5vh, 4rem);
  padding: 7rem 1.5rem 5rem;
}
/* Blueprint grid on the apricot panel — IDENTICAL ink color, cell size, AND
   lattice origin as body::before. background-attachment:fixed anchors the
   tiling to the viewport (same as the body's position:fixed grid), so the
   lines are continuous across the panel edge and rounded corner instead of
   being an independent panel-origin grid. Behind the text; never intercepts
   the wordmark reveal (pointer-events:none, z-index below content). */
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(11, 30, 54, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 30, 54, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed; /* share the viewport lattice → continuous lines */
  pointer-events: none;
  z-index: 0;
}
.hero-panel > * { position: relative; z-index: 1; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.7rem, 9vw, 7.2rem);
  line-height: 1.45; /* generous: tashkeel must never clip */
  color: var(--panel-ink);
}
html[dir="ltr"] .wordmark { line-height: 1.15; }

.wordmark-mask {
  display: inline-block;
  overflow: hidden;
  /* padding keeps tashkeel/descenders inside the mask; margins cancel the layout shift */
  padding: 0.34em 0.16em 0.2em;
  margin: -0.34em -0.16em -0.2em;
}
.wordmark-line { display: inline-block; }

/* The brand signature " !" lives in the text flow — bidi puts it at the
   visual end of the headline (left in RTL, right in LTR). Color only;
   it reveals inside the same masked line as the words (inline-block so
   the shared stagger can transform it). */
.bang { color: var(--brand); display: inline-block; }

/* Hero lede — Thmanyah Serif Display (regular weight), reads as a subtitle
   under the black-weight wordmark. ONE line in both languages (nowrap); sized
   so the longer EN string holds on a single line down to 390px. The mask/line
   wrapper lets it ride the same masked-slide reveal as the wordmark. */
.hero-tagline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(0.97rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink); /* near-black, matches the wordmark/headline */
  white-space: nowrap;
}
.tagline-mask {
  display: inline-block;
  overflow: hidden;
  padding: 0.25em 0.08em; /* keep descenders/ink inside the mask */
  margin: -0.25em -0.08em;
}
.tagline-line { display: inline-block; }

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.7rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-primary {
  background: var(--panel-ink);
  color: var(--surface);
}
.btn-primary:hover { background: var(--brand); transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid rgba(10, 10, 10, 0.4);
  color: var(--panel-ink);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* Intro pre-states: hidden only between first paint and the intro timeline
   starting (html.js is removed once the intro completes, or by the 2s
   watchdog if it never begins — a broken animation must degrade to VISIBLE).
   FAILSAFE RULE: hide via opacity/visibility channels ONLY — never via a CSS
   transform. The reveal tween owns the transform channels (yPercent); a CSS
   translateY() gets parsed into GSAP's separate pixel `y` channel and
   survives the tween untouched — that was the invisible-wordmark bug. */
@media (prefers-reduced-motion: no-preference) {
  html.js .wordmark-line { visibility: hidden; }
  html.js .tagline-line { visibility: hidden; }
  html.js .hero-ctas .btn { opacity: 0; }
}

/* ---------- Section furniture ---------- */
.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
html[dir="rtl"] .section-label { letter-spacing: 0.04em; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 3.5rem; }
.section-head .section-label { margin-bottom: 1.1rem; }

h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.6;
  letter-spacing: 0;
}
html[dir="ltr"] h2 { line-height: 1.2; }
.section-sub { color: var(--ink-soft); margin-top: 0.8rem; font-size: 1rem; }

/* ---------- 2 · Manifesto ---------- */
.manifesto { padding: clamp(6rem, 14vh, 9rem) 1.5rem; }
.manifesto-text {
  max-width: 900px;
  margin: 0 auto;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 2;
  text-align: center;
  color: var(--ink);
}
html[dir="ltr"] .manifesto-text { line-height: 1.55; }

/* ---------- 4 · Features — numbered drawing sheets ----------
   One motif across the page: every vignette is a drawing sheet carrying a
   mini title-block strip. ONE card chrome, ONE shadow rule, fixed mock
   viewport per breakpoint; rows alternate sides on a logical grid (RTL
   mirrors automatically). */
.features { padding: 4rem clamp(1.25rem, 4vw, 3rem) 7rem; max-width: 1180px; margin: 0 auto; }

.sheets { display: flex; flex-direction: column; gap: 96px; margin-top: 1rem; }

.sheet-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.sheet-row:nth-child(even) .sheet { grid-column: 2; grid-row: 1; }
.sheet-row:nth-child(even) .sheet-text { grid-column: 1; grid-row: 1; }

.sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm); /* the single shadow rule for all sheets */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet-mock {
  height: 380px; /* fixed mock viewport per breakpoint — rows read calm */
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sheet-strip {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.62rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.sheet-no { color: var(--ink); font-weight: 500; }

.sheet-text .kicker {
  color: var(--brand);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
}
.sheet-text h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  line-height: 1.7;
}
html[dir="ltr"] .sheet-text h3 { line-height: 1.3; }
.sheet-text > p { color: var(--ink-soft); font-size: 1.08rem; line-height: 1.6; margin-top: 0.6rem; max-width: 44ch; }

/* mocks are layout-only — the sheet owns all chrome. Ink/paper tones inside;
   at most ONE brand accent per mock; ok-green only where status demands. */
.mock { display: flex; flex-direction: column; justify-content: center; gap: 0.9rem; }

/* a · Dashboard */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.kpi-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.kpi-label { font-size: 0.74rem; color: var(--ink-soft); }
.kpi-value { font-size: 1.7rem; font-weight: 500; color: var(--ink); }

.activity { display: flex; flex-direction: column; gap: 0.55rem; }
.act-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
}
.act-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }

/* a · Dashboard — lightweight inline-SVG charts (page tokens; exactly ONE
   brand-accent slice/stroke per chart, the rest ink/slate/paper). Secondary
   to the KPIs: small, sitting below them. */
.dash-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.chart-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.chart-title { font-size: 0.64rem; color: var(--ink-soft); font-weight: 500; }
.chart-donut-wrap { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.donut { width: 56px; height: 56px; flex: none; }
.chart-legend { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: flex; align-items: center; gap: 0.32rem; font-size: 0.56rem; color: var(--ink-soft); white-space: nowrap; min-width: 0; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.chart-legend span { overflow: hidden; text-overflow: ellipsis; }
.line-chart { width: 100%; height: 56px; display: block; }

/* b · Mini Kanban (click-to-advance — no drag-and-drop) */
.board { flex-direction: row; align-items: stretch; gap: 0.5rem; }
.kcol {
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.khead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
  /* equalise header height so every column's slot starts at the same y even
     when phase names wrap to 1 vs 2 lines */
  min-height: 3.1rem;
}
.khead-num { font-size: 0.7rem; color: var(--slate); }
.kname {
  font-size: 0.66rem;
  line-height: 1.18;
  font-weight: 500;
  color: var(--ink-soft);
  /* names are longer than the placeholder numbers — allow a clean wrap */
  overflow-wrap: anywhere;
}
/* flex column so a column can hold up to TWO cards, stacked with a gap (the
   first→second offset the kanban reflow animates against) */
.kslot { flex: 1; min-height: 150px; display: flex; flex-direction: column; gap: 0.4rem; }
.kcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.kcard-code { font-size: 0.6rem; color: var(--slate); }
.kcard-name { font-size: 0.84rem; font-weight: 600; color: var(--ink); }

/* c · Clients */
.clients { gap: 0.6rem; }
.client-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  transition: transform 0.2s;
}
.client-card:hover { transform: translateY(-2px); }
.client-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 600;
}
.client-name { position: relative; flex: 1; min-width: 0; height: 1.3em; }
.cname {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.96rem;
  font-weight: 600;
}
.cname-ar { font-family: "IBM Plex Sans Arabic", sans-serif; }
.cname-en { font-family: "IBM Plex Sans", sans-serif; opacity: 0; }

.pill {
  display: inline-block;
  padding: 0.12em 0.55em;
  border-radius: 2px;
  font-size: 0.78rem;
  font-weight: 600;
}
.client-type { background: var(--paper-2); color: var(--ink-soft); flex: none; }

/* d · Files — six type chips (office + CAD + PDF) in a 2-column grid */
.file-drop { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
}
.chip-ext { font-size: 0.9rem; font-weight: 500; color: var(--ink); position: relative; padding-inline-start: 0.9em; }
.chip-ext::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  margin-top: -0.27em;
  width: 0.54em;
  height: 0.54em;
  background: var(--brand);
  border-radius: 1px;
}
.chip-size { font-size: 0.8rem; color: var(--slate); }

/* e · Invoices */
.invoice-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
}
/* line-height:1 on every row item so the mono number/amount, the Arabic client
   name, the currency unit, and the pill all centre on ONE baseline (mono and
   Arabic fonts have different intrinsic line boxes — without this they drift,
   worst in RTL). align-items:center then centres the equal-height items. */
.inv-number { font-size: 0.86rem; line-height: 1; color: var(--ink); font-weight: 500; flex: none; }
.inv-client {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  line-height: 1;
  color: var(--ink-soft);
}
/* amount + currency are ONE unit: tight internal gap, baseline-aligned, pushed
   to the inline-end as a block so "48,750 ر.س" never splits across the row gap.
   margin-inline-start:auto anchors money + pill to the inline-end edge so the
   pills form a clean column across all three rows. */
.inv-money {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  flex: none;
  margin-inline-start: auto;
}
.inv-amount { font-size: 1rem; line-height: 1; font-weight: 500; color: var(--ink); flex: none; }
.inv-currency { font-size: 0.74rem; line-height: 1; color: var(--slate); flex: none; }

/* Status pills mirror the product's .badge-status EXACTLY (same tint colours,
   the 6px currentColor dot, 3px radius, 0.72rem/500). The end (colored) pill is
   in normal flow so the reduced-motion / no-JS END state is the real status;
   the neutral start pill is stacked absolute + hidden at rest and flips in via
   JS, then flips out to reveal the real status. */
.inv-status { position: relative; flex: none; display: inline-flex; }
.badge-inv {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-inv::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-inv--paid    { color: var(--ok);    background: rgba(45, 106, 79, 0.08); }
.badge-inv--pending { color: var(--warn);  background: rgba(176, 137, 0, 0.08); }
.badge-inv--overdue { color: var(--err);   background: rgba(155, 34, 38, 0.08); }
.badge-inv--neutral { color: var(--slate); background: var(--paper-2); }
.inv-status .badge-inv--neutral {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  opacity: 0;
}

/* f · Bilingual / RTL — twin mini dashboards in the real product vocabulary
   (demo: .sidebar/.nav-item/.topbar/.kpi-card/.activity-item). Each frame
   carries its OWN dir+lang; everything inside uses logical properties, so
   the sidebar and alignment mirror automatically. */
.mini-stack { position: relative; height: 312px; }
.mini-app {
  position: absolute;
  inset: 0;
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.7rem;
  color: var(--ink);
}
.mini-app[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }
.mini-app[lang="en"] { font-family: "IBM Plex Sans", sans-serif; }
.mini-app[data-state="en"] { opacity: 0; } /* AR frame on top by default */

.mini-side {
  width: 32%;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  padding: 0.55rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.mini-brand { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.8rem; margin-bottom: 0.4rem; }
.mini-brand-icon {
  width: 17px;
  height: 17px;
  flex: none;
  background: var(--ink);
  color: var(--surface);
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 600;
}
.mini-navlabel { font-size: 0.56rem; color: var(--slate); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.2rem; }
.mini-app[lang="ar"] .mini-navlabel { letter-spacing: 0; }
.mini-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  padding: 0.26rem 0.4rem;
  border-radius: 3px;
  color: var(--ink-soft);
}
.mini-nav.active { background: var(--ink); color: var(--surface); }
.mini-badge { background: var(--paper-2); color: var(--ink-soft); border-radius: 2px; padding: 0 0.3em; font-size: 0.56rem; font-weight: 500; }

.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; padding: 0.55rem 0.6rem; gap: 0.5rem; }
.mini-topbar { display: flex; justify-content: space-between; align-items: center; }
.mini-title { display: flex; flex-direction: column; }
.mini-title small { font-size: 0.54rem; color: var(--slate); }
.mini-title strong { font-size: 0.88rem; font-weight: 700; }
.mini-chip { font-size: 0.6rem; border: 1px solid var(--line-strong); border-radius: 2px; padding: 0.06rem 0.32rem; color: var(--ink-soft); }

.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.mini-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.mini-kpi small { font-size: 0.56rem; color: var(--ink-soft); }
.mini-kpi b { font-size: 0.95rem; font-weight: 500; }
.mini-kpi b i { font-style: normal; font-size: 0.54rem; color: var(--slate); }
.mini-kpi.featured { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.mini-kpi.featured small,
.mini-kpi.featured b i { color: rgba(251, 249, 244, 0.6); }

.mini-acts { display: flex; flex-direction: column; gap: 0.3rem; }
.mini-act {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.3rem 0.45rem;
  color: var(--ink-soft);
}
.mini-act > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-act em { font-style: normal; font-size: 0.54rem; color: var(--slate); flex: none; }
.mini-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); flex: none; }

/* A-06 charts — same inline-SVG vocabulary as the A-01 dashboard, shrunk to fit
   the mini-dashboard's empty space. Static per frame, so the AR↔EN fade cycle
   never breaks or duplicates them. */
.mini-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-top: 0.05rem; }
.mini-chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.3rem 0.38rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.mini-chart small { font-size: 0.5rem; color: var(--ink-soft); }
.mini-chart-row { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.mini-donut { width: 34px; height: 34px; flex: none; }
.mini-legend { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.mini-legend span { display: flex; align-items: center; gap: 0.22rem; font-size: 0.46rem; color: var(--slate); white-space: nowrap; }
.mini-legend i { width: 5px; height: 5px; border-radius: 1px; flex: none; }
.mini-line { width: 100%; height: 34px; display: block; }

/* ---------- 5 · Saudi ---------- */
.saudi {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem clamp(1.25rem, 4vw, 3rem) 6rem;
  border-top: 1px solid var(--line);
}
.saudi .section-label { margin-bottom: 1rem; }
.saudi h2 { margin-bottom: 2.5rem; }
.saudi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.saudi-item { border-inline-start: 2px solid var(--brand); padding-inline-start: 1rem; }
.saudi-item h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
html[dir="ltr"] .saudi-item h3 { line-height: 1.3; }
.saudi-item p { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- 6 · Footer — navy panel + inverted blueprint grid ---------- */
.footer {
  position: relative;
  overflow: hidden;
  background: var(--ink); /* solid navy #0B1E36 */
  border-top: 1px solid rgba(251, 249, 244, 0.12);
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  color: var(--surface); /* light text on navy */
}
/* Inverted grid: same 64px viewport lattice as the page, but LIGHT low-alpha
   lines so they read on navy (the dark ink lines used elsewhere are invisible
   here). Behind the text, never intercepts clicks. */
.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(251, 249, 244, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(251, 249, 244, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed; /* share the page's viewport-anchored lattice */
  pointer-events: none;
  z-index: 0;
}
.footer > * { position: relative; z-index: 1; } /* text above the grid */
.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.7rem;
  color: var(--surface);
  margin-bottom: 0.8rem;
}
.footer-contact { font-size: 0.9rem; color: rgba(251, 249, 244, 0.8); }
.footer-copy { font-size: 0.72rem; color: rgba(251, 249, 244, 0.55); margin-top: 1.2rem; }

/* ---------- Responsive ---------- */
@media (min-width: 961px) {
  /* A-02 carries five named phase columns — wider than any other mock. Give
     this ONE row's mock column more of the 12fr track (it's an even row, so the
     mock is column 2). Each .sheet-row is its own grid and the mock height stays
     a fixed 380px, so neither the other rows' alignment nor the equal-height
     rhythm is touched. */
  #v-phases { grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr); }
  /* A-06 is also an even row (mock = column 2), but its default 5fr mock is
     narrower than A-01's 7fr dashboard mock. Give it the SAME 7fr so the two
     dashboard mock windows are identical (597×380 at desktop); the mini-app
     reflows to the wider window. Other rows / the equal-height rhythm untouched. */
  #v-bilingual { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
@media (max-width: 960px) {
  .sheets { gap: 56px; }
  .sheet-row { grid-template-columns: 1fr; gap: 1.4rem; }
  /* single column: mock above text, in source order, for every row */
  .sheet-row:nth-child(even) .sheet { grid-column: auto; grid-row: auto; }
  .sheet-row:nth-child(even) .sheet-text { grid-column: auto; grid-row: auto; }
  /* keep the mock height (>= the A-06 mini-stack) so nothing clips when the
     sheet goes full-width; the mock simply reads larger on tablet/mobile */
  .sheet-mock { height: 380px; padding: 1.5rem; }
  .saudi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  html { font-size: 14px; }
  .hero { padding: 10px; }
  .hero-panel { border-radius: 22px; padding: 6.5rem 1rem 4rem; }
  .saudi-grid { grid-template-columns: 1fr; }
  .kpi-label { font-size: 0.56rem; }
  .board { gap: 0.3rem; }
  .kcol { padding: 0.3rem; }
  .kslot { min-height: 90px; }
  /* five phase names must still fit five columns at 390px — shrink + tighten */
  .khead { min-height: 3.4rem; gap: 0.1rem; padding-bottom: 0.25rem; }
  .khead-num { font-size: 0.62rem; }
  .kname { font-size: 0.5rem; line-height: 1.1; }
  /* donut + line stack to one column so neither chart gets too narrow */
  .dash-charts { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion: static page, SVG fallback, no hidden states ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* A-06 doesn't cycle — statically show the language OPPOSITE the page's,
     which still demonstrates bilinguality. (Page in EN: the AR-on-top
     default already is the opposite.) */
  html[lang="ar"] .mini-app[data-state="en"] { opacity: 1; }
  html[lang="ar"] .mini-app[data-state="ar"] { opacity: 0; }
}
