/* ==========================================================================
   MRoot Tech · site.css
   Mobile-first. One breakpoint (900px). Logical properties throughout, so the
   same stylesheet works for right-to-left (Arabic) pages: set <html dir="rtl"
   lang="ar"> and the layout mirrors.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License 1.1) ---------- */
@font-face { font-family: "Figtree"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/fraunces-latin-500-normal.woff2") format("woff2"); }
/* Arabic: only downloaded when a page actually uses Arabic text */
@font-face { font-family: "Noto Kufi Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/noto-kufi-arabic-arabic-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Kufi Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/noto-kufi-arabic-arabic-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-arabic-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-arabic-arabic-600-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --midnight: #15213B;
  --midnight-2: #1F2C4B;
  --ember: #E8622C;
  --ember-deep: #B4441A;
  --ember-tint: #FBE7DC;
  --paper: #F6F2EA;
  --white: #FFFFFF;
  --stone: #5E6470;
  --line: #E2DCCF;
  --on-dark: #F6F2EA;
  --on-dark-muted: #A7ADBA;

  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ar-display: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-ar: "Noto Sans Arabic", Tahoma, sans-serif;

  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 24px;
  --wrap: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--midnight); font-family: var(--font-sans); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--ember-deep); text-underline-offset: 3px; }
a:hover { color: var(--midnight); }
:focus-visible { outline: 3px solid var(--midnight); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible { outline-color: var(--ember); }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:lang(ar) { font-family: var(--font-ar); }
:lang(ar) .display, :lang(ar) h1, :lang(ar) h2 { font-family: var(--font-ar-display); letter-spacing: 0; }

.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--midnight); color: var(--on-dark); padding: 10px 16px; border-radius: var(--radius-s); z-index: 10; }
.skip:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

/* ---------- Type ---------- */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember-deep); }
.on-dark .eyebrow { color: var(--ember); }
.display { font-family: var(--font-display); font-weight: 500; font-size: 44px; line-height: 1.04; letter-spacing: -0.02em; }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: 34px; line-height: 1.1; letter-spacing: -0.015em; }
.h3 { font-size: 21px; font-weight: 700; line-height: 1.3; }
.lead { font-size: 19px; line-height: 1.55; color: var(--stone); }
.on-dark .lead { color: var(--on-dark-muted); }
.muted { color: var(--stone); }
.small { font-size: 15px; }

/* ---------- Buttons & links ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 999px; font-size: 17px; font-weight: 700; text-decoration: none; background: var(--ember); color: var(--midnight); border: 0; }
.btn:hover { background: #F07544; color: var(--midnight); }
.btn-dark { background: var(--midnight); color: var(--on-dark); }
.btn-dark:hover { background: var(--midnight-2); color: var(--on-dark); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.text-link { display: inline-flex; align-items: center; min-height: 50px; font-size: 17px; font-weight: 600; color: var(--ember-deep); }
.on-dark .text-link { color: var(--ember); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 24px; }
.brand { display: flex; align-items: center; }
.brand svg { height: 30px; width: auto; }
.nav { display: none; }
.nav a { font-size: 16px; font-weight: 600; color: var(--midnight); text-decoration: none; padding: 10px 4px; }
.nav a:hover { color: var(--ember-deep); }
.nav a[aria-current="page"] { color: var(--ember-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.menu { display: block; position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--midnight); border-radius: 999px; font-size: 15px; font-weight: 700; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; inset-inline-end: 0; top: 54px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-width: 200px; z-index: 5; }
.menu-panel a { display: block; padding: 12px 14px; border-radius: var(--radius-s); font-weight: 600; color: var(--midnight); text-decoration: none; }
.menu-panel a:hover { background: var(--paper); }
.menu-panel a[aria-current="page"] { color: var(--ember-deep); background: var(--paper); }

/* ---------- Hero with the root line ---------- */
.hero { position: relative; overflow: hidden; background: var(--paper); }
.hero .wrap { position: relative; }
.root-line { position: absolute; inset-inline-start: 12px; top: 28px; pointer-events: none; max-width: none; }
.root-line.lg { display: none; }
.hero-inner { position: relative; padding-top: 172px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 22px; max-width: 900px; }
.page-hero .hero-inner { padding-top: 168px; padding-bottom: 56px; }
[dir="rtl"] .root-line { transform: scaleX(-1); }

/* ---------- Sections ---------- */
.section { padding-block: 64px; }
.section-white { background: var(--white); }
.section-dark { background: var(--midnight); color: var(--on-dark); }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 36px; max-width: 760px; }

.grid-2 { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 16px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.card-paper { background: var(--paper); }
.card-dashed { background: transparent; border: 2px dashed #CFC7B6; }
.card-dark { background: var(--midnight-2); border-color: var(--midnight-2); color: var(--on-dark); }

.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ember-deep); background: var(--ember-tint); border-radius: 999px; padding: 6px 12px; }
.pill-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ember); }

.product-name { font-family: var(--font-sans); font-weight: 700; font-size: 40px; line-height: 1; letter-spacing: -0.03em; }

/* ---------- Tick list (the brand's root-sign bullet) ---------- */
.ticks { display: flex; flex-direction: column; gap: 22px; }
.ticks li { display: flex; gap: 14px; align-items: flex-start; }
.tick { width: 26px; height: 26px; flex-shrink: 0; margin-top: 2px; }
.ticks .h3 { margin-bottom: 4px; }

.icon { width: 44px; height: 44px; border-radius: 12px; background: var(--ember-tint); color: var(--ember-deep); display: flex; align-items: center; justify-content: center; }
.icon svg { width: 24px; height: 24px; }

/* ---------- Mark story ---------- */
.mark-story { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 32px; align-items: center; }
.mark-tile { background: var(--midnight); border-radius: var(--radius-l); display: flex; align-items: center; justify-content: center; padding: 48px; }
.mark-tile svg { width: 220px; height: auto; }
.anatomy { display: flex; flex-direction: column; gap: 16px; }
.anatomy li { display: flex; gap: 16px; align-items: flex-start; padding-top: 16px; border-top: 1px solid var(--line); }
.num { width: 32px; height: 32px; border-radius: 16px; background: var(--midnight); color: var(--on-dark); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- CTA band ---------- */
.cta { background: var(--ember); color: var(--midnight); border-radius: var(--radius-l); padding: 36px 28px; display: flex; flex-direction: column; gap: 18px; }
.cta .lead { color: var(--midnight); }

/* ---------- Facts / definition list ---------- */
.facts { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 0; margin: 0; }
.facts div { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 14px; color: var(--stone); }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 22px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; min-height: 60px; display: flex; align-items: center; }
.faq details p { padding-bottom: 20px; color: var(--stone); }

/* ---------- Small utilities (no inline styles, so a strict CSP works) ---------- */
.stack { display: flex; flex-direction: column; }
.stack-8 { gap: 8px; } .stack-16 { gap: 16px; } .stack-18 { gap: 18px; } .stack-20 { gap: 20px; }
.align-start { align-items: start; }
.mb-0 { margin-bottom: 0; }
.mt-28 { margin-top: 28px; }
.wrap.narrow { max-width: 960px; }

/* ---------- Brand kit ---------- */
.logo-tile { border-radius: var(--radius); display: flex; align-items: center; justify-content: center; height: 180px; padding: 28px; }
.logo-tile svg { max-height: 100%; width: auto; max-width: 100%; }
.logo-tile.light { background: var(--paper); border: 1px solid var(--line); }
.logo-tile.dark { background: var(--midnight); }
.file-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; font-weight: 600; }
.grid-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.sw-midnight { background: var(--midnight); } .sw-ember { background: var(--ember); } .sw-ember-deep { background: var(--ember-deep); } .sw-paper { background: var(--paper); } .sw-stone { background: var(--stone); }
.swatch { height: 96px; border-radius: var(--radius); border: 1px solid rgba(0, 0, 0, 0.06); }
.copy-block { background: var(--paper); border-radius: var(--radius); padding: 20px; font-size: 16px; }
.do-dont { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 20px; }
.do { color: #2F6B4F; }
.dont { color: #A33A2B; }

/* ---------- Legal templates ---------- */
.template-note { background: var(--ember-tint); border: 1px solid #F3C9B0; color: var(--midnight); border-radius: var(--radius); padding: 18px 20px; font-size: 16px; }
.legal { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.legal h2 { font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.2; margin-top: 26px; }
.legal ul { list-style: disc; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.ph { background: var(--ember-tint); color: var(--ember-deep); border-radius: 4px; padding: 0 4px; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--midnight); color: var(--on-dark); padding-block: 56px 36px; }
.footer-grid { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 36px; }
.footer-brand { display: flex; flex-direction: column; gap: 16px; max-width: 380px; }
.footer-brand svg { height: 30px; width: auto; }
.footer-brand p { color: var(--on-dark-muted); font-size: 15px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-muted); margin-bottom: 4px; }
.footer-col a { color: var(--on-dark); text-decoration: none; font-weight: 500; padding: 2px 0; }
.footer-col a:hover { color: var(--ember); }
.footer-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid #2E3B57; font-size: 14px; color: var(--on-dark-muted); display: flex; flex-direction: column; gap: 6px; }

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 900px) {
  .wrap { padding-inline: 48px; }
  .display { font-size: 76px; }
  .h2 { font-size: 48px; }
  .h3 { font-size: 22px; }
  .lead { font-size: 21px; }

  .header-row { min-height: 84px; }
  .brand svg { height: 36px; }
  .nav { display: flex; align-items: center; gap: 36px; }
  .menu { display: none; }

  .root-line.sm { display: none; }
  .root-line.lg { display: block; inset-inline-start: 40px; top: 44px; }
  .hero-inner { padding-top: 132px; padding-bottom: 120px; padding-inline-start: 190px; }
  .page-hero .hero-inner { padding-top: 124px; padding-bottom: 88px; }

  .section { padding-block: 112px; }
  .section-head { margin-bottom: 52px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .card { padding: 36px; }

  .mark-story { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; }
  .mark-tile { padding: 72px; }
  .mark-tile svg { width: 300px; }

  .cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 48px 56px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .do-dont { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .site-footer { padding-block: 80px 40px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
  .footer-legal { flex-direction: row; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
