/* ==========================================================================
   Mawarith Pro — Design System  (v3 · dark editorial)
   Charcoal + muted gold, heavy grotesque display type, RTL-ready.
   Dark by default (the brand look); an optional light variant via
   [data-theme="light"]. One stylesheet drives all 120 pages.
   ========================================================================== */
:root {
  /* Accent — aurora (blue → violet → magenta → teal). Token names kept; values now violet. */
  --gold-600: #6d5ae0;
  --gold-500: #8b7cf6;
  --gold-400: #a99bff;
  --gold-300: #c9c0ff;
  --teal: #1fc8d6;
  --aurora: linear-gradient(120deg, #3b6dff 0%, #8b5cf6 38%, #c44fe0 68%, #1fc8d6 100%);
  --aurora-soft: linear-gradient(120deg, #4a78ff, #8b5cf6 50%, #c44fe0);

  /* Legacy emerald tokens kept defined for safety (unused by components) */
  --emerald-900: #082b20; --emerald-800: #0b3d2e; --emerald-700: #0f5740;
  --emerald-600: #157a59; --emerald-500: #1f9e74;

  /* Dark neutrals (default theme) — cool blue-black; elevation: paper < paper-2 < card */
  --paper: #0c0d14;     /* page background — near-black, slightly blue */
  --paper-2: #15161f;   /* muted surface (table stripes, callouts, hovers) */
  --card: #1c1e2a;      /* cards & panels — clearly raised above sections */
  --ink: #f4f5f9;       /* primary text — near-white */
  --ink-soft: #b9bdca;  /* body text grey */
  --ink-faint: #9498a8; /* faint / meta (AA on all dark surfaces) */
  --line: #2a2d3b;      /* borders */
  --line-soft: #20222e;

  --accent: var(--gold-500);
  --accent-strong: var(--gold-600);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 40px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.6);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;

  --sans: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", "Inter", system-ui, sans-serif;
  --serif: "Manrope", "Inter", system-ui, sans-serif;
  --arabic: "Amiri", "Scheherazade New", "Traditional Arabic", serif;
}

/* Optional light variant */
[data-theme="light"] {
  --paper: #f6f5f1;
  --paper-2: #ecebe4;
  --card: #ffffff;
  --ink: #191b1f;
  --ink-soft: #4c515a;
  --ink-faint: #5f6571;   /* AA on light surfaces */
  --line: #e3e0d8;
  --line-soft: #efece4;
  --shadow: 0 1px 2px rgba(20,20,20,.04), 0 10px 30px rgba(20,20,20,.07);
  --shadow-lg: 0 16px 44px rgba(20,20,20,.12);
}
/* Violet links need a darker tone to stay legible on light surfaces */
[data-theme="light"] a { color: #5b46c9; }
[data-theme="light"] a:hover,
[data-theme="light"] .breadcrumb a:hover,
[data-theme="light"] .toc a:hover { color: #4836a6; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body[dir="rtl"] { font-family: var(--arabic), var(--sans); }

/* Faint ambient aurora in the corners of every page (sits behind content) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(36% 30% at 100% 0%, rgba(123,92,240,.13), transparent 60%),
    radial-gradient(32% 28% at 0% 100%, rgba(31,200,214,.08), transparent 60%);
}

img { max-width: 100%; display: block; }

a { color: var(--gold-500); text-decoration: none; }
a:hover { color: var(--gold-400); text-decoration: underline; }

/* Heavy grotesque display */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.05;
  color: var(--ink); letter-spacing: -.03em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin-top: 2.2em; }
h3 { font-size: 1.4rem; margin-top: 1.8em; font-weight: 700; letter-spacing: -.02em; }
.eyebrow-num { font-family: var(--sans); font-weight: 700; font-size: .8rem; letter-spacing: .2em;
  color: var(--gold-500); text-transform: uppercase; }

p { margin: 0 0 1.1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.arabic { font-family: var(--arabic); font-size: 1.35em; line-height: 2; direction: rtl; }

/* --- Skip link & a11y --- */
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--gold-500); color: #0c0d14;
  padding: 10px 16px; border-end-end-radius: 8px; z-index: 200; font-weight: 700; }
.skip:focus { inset-inline-start: 0; }

/* Visible keyboard focus across interactive elements (WCAG 2.4.7) */
a:focus-visible, .btn:focus-visible, .nav-links a:focus-visible, .hero-bar a:focus-visible,
.card:focus-visible, .article-card:focus-visible, .faq-item summary:focus-visible,
.icon-btn:focus-visible, .lang-btn:focus-visible, .lang-menu a:focus-visible,
.stepper button:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--gold-500); outline-offset: 2px; border-radius: 6px;
}

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 12px; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display);
  font-weight: 800; font-size: 1.24rem; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: 0 0 auto; }
.brand b { color: var(--gold-500); font-weight: 800; }
.brand .pro { color: var(--gold-500); font-style: normal; }

.nav-links { display: flex; gap: 2px; margin-inline-start: auto; align-items: center; }
.nav-links a {
  color: var(--ink-soft); font-weight: 600; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 13px; border-radius: 8px; font-family: var(--sans); position: relative;
}
.nav-links a.btn { text-transform: none; letter-spacing: .01em; font-size: .9rem; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--gold-400); }
.nav-links a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--gold-500); border-radius: 2px; }
.nav-links .btn { white-space: nowrap; }
.nav-links .btn.active::after { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  cursor: pointer; color: var(--ink-soft); font-size: 1.05rem;
}
.icon-btn:hover { color: var(--ink); border-color: var(--accent); }
.nav-toggle { display: none; }

/* --- Language switcher --- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; cursor: pointer;
  color: var(--ink-soft); font: inherit; font-size: .9rem; font-weight: 600; }
.lang-btn:hover { color: var(--ink); border-color: var(--accent); }
.lang-btn .globe { font-size: 1rem; }
.lang-btn .chev { font-size: .7rem; opacity: .7; }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: 48px; min-width: 188px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
  display: none; z-index: 130; max-height: 70vh; overflow: auto; }
.lang-menu.open { display: block; }
.lang-menu a, .lang-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; padding: 9px 11px;
  border: none; background: transparent; cursor: pointer; border-radius: 8px; font: inherit;
  font-size: .92rem; color: var(--ink-soft); text-decoration: none; }
.lang-menu a:hover, .lang-menu button:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.lang-menu a.on, .lang-menu button.on { color: var(--gold-400); font-weight: 700; }
.lang-menu .flag { font-size: 1.05rem; }
.lang-menu .native { color: var(--ink-faint); font-size: .8rem; margin-inline-start: auto; }

/* RTL refinements */
[dir="rtl"] .hero h1, [dir="rtl"] .hero .lede, [dir="rtl"] .prose { text-align: right; }
[dir="rtl"] .side-rail { left: auto; right: 0; }
[dir="rtl"] body { font-family: var(--arabic), var(--sans); }
/* Arabic is cursive — letter-spacing/uppercase break the joins, so disable them in RTL */
[dir="rtl"] .nav-links a, [dir="rtl"] .eyebrow, [dir="rtl"] .kicker,
[dir="rtl"] .hero-stats .s span, [dir="rtl"] .article-card .meta,
[dir="rtl"] .hero-bar .lbl, [dir="rtl"] .breadcrumb { letter-spacing: normal; text-transform: none; }
/* Mirror the hero aurora to the left in RTL so the right-aligned headline stays on the dark side */
[dir="rtl"] .hero {
  background:
    radial-gradient(56% 78% at 12% 46%, rgba(123,92,240,.52), transparent 62%),
    radial-gradient(46% 62% at 1% 82%, rgba(196,79,224,.44), transparent 60%),
    radial-gradient(48% 64% at -1% 12%, rgba(59,109,255,.44), transparent 60%),
    radial-gradient(40% 50% at 36% 98%, rgba(31,200,214,.30), transparent 60%),
    linear-gradient(200deg, #0c0d14, #0a0b11);
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  font-family: var(--sans); font-weight: 700; font-size: .96rem; letter-spacing: .01em;
  padding: 13px 24px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s, color .2s; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--gold-400); color: #0c0d14; }
.btn-gold { background: linear-gradient(120deg, #4a3bd0, #7b4fd8 55%, #9a3fc0); color: #fff; box-shadow: 0 8px 30px rgba(123,92,240,.30); }
.btn-gold:hover { color: #fff; box-shadow: 0 12px 42px rgba(123,92,240,.48); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-lg { padding: 16px 30px; font-size: 1.04rem; }

/* --- Hero (dark editorial) --- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(56% 78% at 88% 46%, rgba(123,92,240,.52), transparent 62%),
    radial-gradient(46% 62% at 99% 82%, rgba(196,79,224,.44), transparent 60%),
    radial-gradient(48% 64% at 101% 12%, rgba(59,109,255,.44), transparent 60%),
    radial-gradient(40% 50% at 64% 98%, rgba(31,200,214,.30), transparent 60%),
    linear-gradient(160deg, #0c0d14, #0a0b11);
  color: #eef1f6;
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .06; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90' viewBox='0 0 90 90'%3E%3Cg fill='none' stroke='%238b7cf6' stroke-width='1'%3E%3Cpath d='M45 0l45 45-45 45L0 45z'/%3E%3Cpath d='M45 22l23 23-23 23-23-23z'/%3E%3Ccircle cx='45' cy='45' r='6'/%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { position: relative; z-index: 1; padding: 100px 0 0; }
.hero .eyebrow-line { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.hero .eyebrow-line .num { font-family: var(--display); font-size: 1.05rem; color: var(--gold-400); font-weight: 800; letter-spacing: .04em; }
.hero .eyebrow-line .rule { height: 1px; width: 70px; background: linear-gradient(90deg, var(--gold-500), transparent); }
.hero h1 { color: #fff; max-width: 18ch; font-weight: 800; letter-spacing: -.035em; line-height: .98; }
.hero h1 em { font-style: normal; color: var(--gold-400); }
.hero .lede { font-size: 1.2rem; color: #aab0ba; max-width: 56ch; margin: 26px 0 32px; line-height: 1.6; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans);
  font-weight: 700; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-400);
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 44px; margin: 48px 0 60px; flex-wrap: wrap; }
.hero-stats .s b { font-family: var(--display); font-size: 2rem; color: #fff; display: block; font-weight: 800; letter-spacing: -.02em; }
.hero-stats .s span { color: #8e949e; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }

/* hero bottom feature bar (editorial strip) */
.hero-bar { position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.1);
  display: grid; grid-template-columns: repeat(3, 1fr); }
.hero-bar a { padding-block: 28px; padding-inline: 0 24px; color: #aab0ba; display: block; border-inline-end: 1px solid rgba(255,255,255,.08); }
.hero-bar a:last-child { border-inline-end: none; }
.hero-bar a:hover { text-decoration: none; }
.hero-bar .lbl { font-family: var(--sans); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-500); font-weight: 700; }
.hero-bar .ttl { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: #fff; margin-top: 7px; display: block; letter-spacing: -.01em; }
.hero-bar .ttl::after { content: " →"; color: var(--gold-400); opacity: 0; transition: opacity .2s, margin .2s; }
.hero-bar a:hover .ttl::after { opacity: 1; margin-inline-start: 4px; }

/* slim vertical side rail */
.side-rail { position: fixed; left: 0; top: 0; bottom: 0; width: 48px; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 84px 0 28px; pointer-events: none; border-inline-end: 1px solid rgba(255,255,255,.05); }
.side-rail .vtxt { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--sans);
  font-size: .66rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-faint); pointer-events: auto; }
.side-rail .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500); margin: 14px 0; }
@media (max-width: 1280px) { .side-rail { display: none; } }

/* --- Sections --- */
section { padding: 70px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 46px; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }
.kicker { font-family: var(--sans); font-weight: 700; font-size: .76rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold-500); margin-bottom: 12px; }

/* --- Cards / grid --- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: inset 0 1px 0 rgba(255,255,255,.045), var(--shadow);
  transition: border-color .2s, transform .15s;
}
[data-theme="light"] .card { box-shadow: var(--shadow); }
.card:hover { border-color: color-mix(in srgb, var(--gold-500) 45%, var(--line)); }
.card h3 { margin-top: 0; }
.card .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--paper-2); color: var(--gold-400); margin-bottom: 16px; font-size: 1.3rem; }
.feature-card p { color: var(--ink-soft); margin-bottom: 0; }

.article-card { display: flex; flex-direction: column; }
.article-card:hover { transform: translateY(-3px); }
.article-card .tag { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-500); }
.article-card h3 { margin: 10px 0 10px; font-size: 1.2rem; }
.article-card p { color: var(--ink-soft); flex: 1; }
.article-card .meta { color: var(--ink-faint); font-size: .82rem; margin-top: 16px; letter-spacing: .04em; text-transform: uppercase; }

/* --- Calculator --- */
.calc-shell { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; }
.panel h2, .panel h3 { margin-top: 0; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 7px; }
.field .hint { color: var(--ink-faint); font-size: .82rem; font-weight: 400; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-500); outline-offset: 1px; border-color: transparent; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.stepper button { width: 42px; height: 44px; border: none; background: transparent; font-size: 1.3rem;
  cursor: pointer; color: var(--gold-400); }
.stepper button:hover { background: var(--paper-2); }
.stepper input { width: 58px; text-align: center; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; }

.heir-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.heir-row:last-child { border-bottom: none; }
.heir-row .nm { font-weight: 600; }
.heir-row .ar { font-family: var(--arabic); color: var(--ink-faint); font-size: 1.05rem; margin-inline-start: 7px; }
.heir-group-title { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--gold-400);
  letter-spacing: .02em; margin: 24px 0 4px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }

.toggle-row { display: flex; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { padding: 10px 16px; border: none; background: var(--card); cursor: pointer; color: var(--ink-soft); font: inherit; font-weight: 600; }
.seg button.on { background: var(--gold-500); color: #0c0d14; }

/* Results */
.result-empty { color: var(--ink-faint); text-align: center; padding: 40px 10px; }
.result-total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.result-total b { font-family: var(--display); font-weight: 800; font-size: 1.7rem; color: var(--gold-400); letter-spacing: -.02em; }
.share-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.share-row .who { font-weight: 600; }
.share-row .who small { display: block; font-weight: 400; color: var(--ink-faint); font-size: .8rem; }
.share-row .frac { font-family: var(--display); font-weight: 700; color: var(--gold-400); text-align: right; min-width: 52px; }
.share-row .amt { font-weight: 700; text-align: right; min-width: 92px; }
.bar { height: 7px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin-top: 4px; grid-column: 1 / -1; }
.bar i { display: block; height: 100%; background: var(--aurora); }
.note-awl { background: #271229; border: 1px solid #45234a; color: #eeb4ec; padding: 12px 14px; border-radius: 10px; font-size: .9rem; margin-top: 14px; }
.note-radd { background: #0e2630; border: 1px solid #1c4350; color: #9fdfe8; padding: 12px 14px; border-radius: 10px; font-size: .9rem; margin-top: 10px; }
[data-theme="light"] .note-awl { background: #fbeefb; border-color: #ecc6e8; color: #7a2773; }
[data-theme="light"] .note-radd { background: #e6f7f9; border-color: #b9e2e8; color: #0f4c55; }

.steps-list { list-style: none; padding: 0; margin: 16px 0 0; }
.steps-list li { padding: 10px 0 10px 30px; position: relative; border-bottom: 1px dashed var(--line-soft); color: var(--ink-soft); font-size: .94rem; }
.steps-list li::before { content: ""; position: absolute; left: 6px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); }
[dir="rtl"] .steps-list li { padding: 10px 30px 10px 0; }
[dir="rtl"] .steps-list li::before { left: auto; right: 6px; }

/* --- Prose (articles/guide) --- */
.prose { max-width: 760px; margin: 0 auto; }
.prose { color: var(--ink-soft); }
.prose > p:first-of-type { font-size: 1.16rem; color: var(--ink); }
.prose h2, .prose h3 { color: var(--ink); }
.prose h2 { padding-top: 8px; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose blockquote { margin: 1.7em 0; padding: 6px 24px; border-inline-start: 3px solid var(--gold-500);
  font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ink); letter-spacing: -.01em; }
.prose blockquote .src { display: block; font-weight: 500; font-size: .82rem; color: var(--ink-faint); margin-top: 10px; font-family: var(--sans); letter-spacing: .02em; }
.callout { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin: 1.7em 0; }
.callout.tip { border-inline-start: 4px solid var(--gold-400); }
.callout.warn { border-inline-start: 4px solid var(--gold-600); }
.callout h4 { margin: 0 0 6px; font-family: var(--sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-400); }
.callout p { color: var(--ink-soft); }

table.tbl { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
table.tbl th, table.tbl td { text-align: start; padding: 11px 13px; border: 1px solid var(--line); color: var(--ink-soft); }
table.tbl th { background: var(--paper-2); font-family: var(--sans); font-weight: 700; color: var(--ink); }
table.tbl tr:nth-child(even) td { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }

.page-head { padding: 60px 0 8px; }
.page-head .kicker { color: var(--gold-500); }
.breadcrumb { font-size: .82rem; color: var(--ink-faint); margin-bottom: 16px; letter-spacing: .03em; }
.breadcrumb a { color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--gold-400); }

.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin: 0 0 30px; }
.toc strong { font-family: var(--sans); font-size: .76rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); }
.toc ol { margin: 12px 0 0; padding-inline-start: 1.2em; }
.toc a { color: var(--ink-soft); }
.toc a:hover { color: var(--gold-400); }

/* --- FAQ accordion --- */
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: var(--card); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 18px 22px; font-weight: 700; font-size: 1.04rem; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--gold-500); font-size: 1.4rem; font-weight: 400; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item .a { padding: 0 22px 20px; color: var(--ink-soft); }
.faq-item .a p:last-child { margin-bottom: 0; }

/* --- Ads (blended into the design; label kept for policy compliance) --- */
.ad-slot { margin: 34px auto; text-align: center; min-height: 90px; }
.ad-slot small, .ad-banner small, .ad-infeed small {
  display: block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
.ad-banner {
  margin: 0; padding: 14px 18px; background: var(--paper-2);
  border-block: 1px solid var(--line-soft); text-align: center; }
.ad-banner .wrap-ad { max-width: var(--maxw); margin: 0 auto; }
.ad-banner ins { min-height: 90px; }
.ad-infeed {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 18px; box-shadow: var(--shadow); }
.ad-infeed ins { min-height: 110px; }

/* --- CTA band --- */
.band { position: relative; overflow: hidden; border: 1px solid var(--line);
  background:
    radial-gradient(60% 130% at 86% -25%, rgba(139,92,240,.30), transparent 62%),
    radial-gradient(55% 130% at 8% 125%, rgba(31,200,214,.16), transparent 60%),
    radial-gradient(45% 100% at 50% 130%, rgba(196,79,224,.16), transparent 60%),
    linear-gradient(160deg, #16172200, #0e0f17);
  color: #eef1f6; border-radius: 22px; padding: 54px; text-align: center; }
.band::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath d='M40 0l40 40-40 40L0 40z' fill='none' stroke='%238b7cf6'/%3E%3C/svg%3E"); }
.band h2 { color: #fff; margin-top: 0; position: relative; }
.band p { color: #aab0ba; max-width: 52ch; margin-inline: auto; position: relative; }

/* --- Footer --- */
.site-footer { background: #0c0d10; color: #9298a2; padding: 60px 0 32px; margin-top: 80px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .76rem; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 16px; }
.site-footer a { color: #9298a2; display: block; padding: 5px 0; font-size: .92rem; }
.site-footer a:hover { color: var(--gold-400); text-decoration: none; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer .brand b { color: var(--gold-500); }
.site-footer .about { color: #757b85; font-size: .92rem; max-width: 36ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 38px; padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: #868c96; }

/* --- Misc --- */
.pill { display: inline-block; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 4px 12px; border-radius: 100px; font-size: .82rem; font-weight: 600; }
.disclaimer-box { background: var(--paper-2); border: 1px dashed var(--line); border-radius: 12px; padding: 16px 20px; font-size: .9rem; color: var(--ink-soft); }
.disclaimer-box strong { color: var(--ink); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ===================== PREMIUM FAB SYSTEM ===================== */

/* Donate header nav link */
.donate-link { color: var(--gold-400); font-size: 1.05rem; }
.donate-link:hover { color: var(--gold-300); }

/* Shared circle wrapper — all three FABs */
.fab-circle { position: fixed; bottom: 24px; z-index: 95; }
.fab-circle-left   { inset-inline-start: 24px; }
.fab-circle-center { left: 50%; transform: translateX(-50%); }
.fab-circle-right  { inset-inline-end: 24px; }

/* The circle button */
.fab-btn {
  width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  outline: none; isolation: isolate; color: #fff;
}
.fab-btn::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.0);
  transition: border-color .22s ease, inset .22s ease, opacity .22s;
  pointer-events: none;
}
.fab-circle:hover .fab-btn,
.fab-circle.fab-near .fab-btn { transform: scale(1.13); }
.fab-circle:hover .fab-btn::before,
.fab-circle.fab-near .fab-btn::before { border-color: rgba(255,255,255,.25); inset: -5px; }
.fab-btn svg { flex-shrink: 0; transition: transform .22s cubic-bezier(.34,1.56,.64,1); }
.fab-circle:hover .fab-btn svg,
.fab-circle.fab-near .fab-btn svg { transform: scale(1.12); }

/* Proximity / hover label — floats above button */
.fab-label {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(8px); opacity: 0;
  pointer-events: none; white-space: nowrap;
  transition: opacity .22s ease, transform .22s ease;
  background: rgba(10,11,18,.9); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.1); border-radius: 100px;
  padding: 5px 14px; font-size: .7rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: #fff; font-family: var(--sans);
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.fab-circle.fab-near .fab-label,
.fab-circle:hover .fab-label,
.fab-circle:focus-within .fab-label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Individual gradients + glows */
.fab-btn-services {
  background: linear-gradient(135deg, #1e3a8a 0%, #4338ca 55%, #6d28d9 100%);
  box-shadow: 0 6px 24px rgba(67,56,202,.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.fab-circle:hover .fab-btn-services, .fab-circle.fab-near .fab-btn-services {
  box-shadow: 0 10px 34px rgba(67,56,202,.7), inset 0 1px 0 rgba(255,255,255,.18);
}
.fab-btn-sitenav {
  background: linear-gradient(135deg, #064e3b 0%, #0d9488 55%, #0891b2 100%);
  box-shadow: 0 6px 24px rgba(13,148,136,.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.fab-circle:hover .fab-btn-sitenav, .fab-circle.fab-near .fab-btn-sitenav {
  box-shadow: 0 10px 34px rgba(13,148,136,.7), inset 0 1px 0 rgba(255,255,255,.18);
}
.fab-btn-donate {
  background: linear-gradient(135deg, #4a3bd0 0%, #7b4fd8 55%, #9a3fc0 100%);
  box-shadow: 0 6px 24px rgba(123,79,216,.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.fab-circle:hover .fab-btn-donate, .fab-circle.fab-near .fab-btn-donate {
  box-shadow: 0 10px 34px rgba(123,79,216,.7), inset 0 1px 0 rgba(255,255,255,.18);
}
/* Active (popup open) ring */
.fab-btn[aria-expanded="true"] { transform: scale(1.08); }
.fab-btn[aria-expanded="true"]::before { border-color: rgba(255,255,255,.35); inset: -5px; }

/* Donate popup */
.donate-pop { position: fixed; bottom: 90px; inset-inline-end: 24px; z-index: 96; width: 260px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 16px; display: none; }
.donate-pop.open { display: block; }
.donate-title { font-weight: 700; font-size: .95rem; color: var(--ink); margin: 0 0 12px; }
.donate-pop a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line); margin-bottom: 9px; color: var(--ink); font-weight: 600;
  font-size: .92rem; text-decoration: none; }
.donate-pop a:last-child { margin-bottom: 0; }
.donate-pop a:hover { border-color: var(--accent); background: var(--paper-2); text-decoration: none; }
.donate-pop a.primary { background: linear-gradient(120deg, #4a3bd0, #7b4fd8 55%, #9a3fc0); color: #fff; border: none; }

/* Services popup */
.services-pop { position: fixed; bottom: 90px; inset-inline-start: 24px; z-index: 96; width: 310px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; display: none; max-height: calc(100vh - 130px); overflow-y: auto; }
.services-pop.open { display: block; }
.svc-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.svc-brand { font-family: var(--display); font-weight: 800; font-size: 1rem;
  background: linear-gradient(120deg, #60a5fa, #a78bfa); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text; }
.svc-brand b { -webkit-text-fill-color: inherit; }
.svc-header p { margin: 3px 0 0; font-size: .8rem; color: var(--ink-faint); }
.svc-grid { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.svc-item { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px;
  text-decoration: none; color: var(--ink); transition: background .12s; }
.svc-item:hover { background: var(--paper-2); text-decoration: none; }
.svc-item.svc-active { background: rgba(99,102,241,.12); }
.svc-ico { font-size: 1.3rem; width: 28px; text-align: center; flex-shrink: 0; line-height: 1; }
.svc-info { display: flex; flex-direction: column; }
.svc-info b { font-size: .82rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.svc-info small { font-size: .72rem; color: var(--ink-faint); margin-top: 1px; }
.svc-footer { padding: 10px 16px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--ink-faint); text-align: center; }
.svc-footer a { color: var(--gold-400); text-decoration: none; }
.svc-footer a:hover { text-decoration: underline; }

/* Site-nav popup */
.sitenav-pop { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  width: min(700px, calc(100vw - 24px)); max-height: calc(100vh - 120px);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); z-index: 97; display: none;
  overflow: hidden; flex-direction: column; }
.sitenav-pop.open { display: flex; }
.snav-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.snav-title { font-family: var(--display); font-weight: 800; font-size: .92rem;
  background: linear-gradient(120deg, #34d399, #22d3ee); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text; }
.snav-close { background: none; border: none; cursor: pointer; color: var(--ink-faint);
  font-size: 1rem; padding: 4px 8px; border-radius: 6px; font-family: var(--sans); }
.snav-close:hover { background: var(--paper-2); color: var(--ink); }
.snav-body { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; overflow-y: auto; padding: 12px; }
.snav-cat { padding: 10px; border-radius: 10px; }
.snav-cat:hover { background: var(--paper-2); }
.snav-cat-title { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 8px; }
.snav-cat ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.snav-cat ul li a { display: block; padding: 5px 6px; font-size: .82rem; font-weight: 500;
  color: var(--ink-soft); text-decoration: none; border-radius: 6px; transition: background .1s, color .1s; }
.snav-cat ul li a:hover { background: rgba(99,102,241,.12); color: var(--ink); text-decoration: none; }

/* Responsive */
@media (max-width: 680px) {
  .fab-circle { bottom: 18px; }
  .fab-circle-left  { inset-inline-start: 18px; }
  .fab-circle-right { inset-inline-end: 18px; }
  .fab-btn { width: 48px; height: 48px; }
  .donate-pop { inset-inline-end: 18px; bottom: 80px; }
  .services-pop { inset-inline-start: 8px; bottom: 80px; width: calc(100vw - 16px); max-width: 340px; }
  .sitenav-pop { bottom: 80px; }
  .snav-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) { .snav-body { grid-template-columns: 1fr; } }
@media print { .fab-circle, .donate-pop, .services-pop, .sitenav-pop, .donate-link { display: none !important; } }

/* --- AMAADOR Network footer band --- */
.network-band { background: #06070e; border-bottom: 1px solid var(--line); padding: 28px 0; }
.network-label { font-size: .7rem; font-weight: 800; letter-spacing: .14em; color: var(--ink-faint);
  text-transform: uppercase; margin: 0 0 14px; }
.network-links { display: flex; flex-wrap: wrap; gap: 8px; }
.network-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 100px; font-size: .78rem; font-weight: 600;
  color: var(--ink-soft); text-decoration: none; transition: border-color .15s, color .15s; white-space: nowrap; }
.network-link:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.network-link.network-active { border-color: rgba(99,102,241,.5); color: var(--gold-400); }
@media (max-width: 680px) { .network-links { gap: 6px; } .network-link { font-size: .72rem; padding: 5px 10px; } }

/* --- Responsive --- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  /* minmax(0, 1fr) not just 1fr: the single track's default auto-min-content
     otherwise inherits the widest non-wrapping content inside .panel (e.g. the
     segmented control / stepper row), stretching the grid item past the
     viewport and causing horizontal overflow at 320-375px widths. */
  .calc-shell { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
/* Header/nav drawer breakpoint is wider than the rest of the responsive
   layout above: the brand wordmark + AMAADOR network corner logo + all 6
   nav-links + lang switch don't fit the inline header row until ~1445px
   (measured live), so the inline row overflows horizontally for the whole
   901-1445px range if the drawer only engages at 900px like everything else. */
@media (max-width: 1460px) {
  /* The site's own .brand (mark + wordmark) already carries the identity;
     the redundant AMAADOR-network corner logo was overflowing the header
     row and pushing the theme/hamburger buttons off-screen, so it's hidden
     here (matches the fix already applied on sibling AMAADOR Suite sites). */
  /* !important required: the element carries an inline style="display:inline-flex"
     attribute (repeated on every page), which otherwise outranks this rule. */
  .amaador-brand-logo { display: none !important; }
  /* Nav drawer — engages before the inline row gets cramped */
  .nav-links { position: fixed; inset: 70px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 16px 18px; gap: 2px;
    transform: translateY(-135%); transition: transform .25s ease; box-shadow: var(--shadow-lg); margin: 0;
    max-height: calc(100vh - 70px); overflow-y: auto; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 10px; }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: inline-grid; margin-inline-start: auto; }
  /* Language switcher now lives inside the drawer (.nav-links) so it is
     reachable via the hamburger menu; make it full-width and give the
     dropdown menu room instead of being clipped by the drawer's scroll area. */
  .nav-links .lang-switch { order: -1; margin: 0 0 10px; }
  .nav-links .lang-btn { width: 100%; justify-content: space-between; }
  .nav-links .lang-menu { position: static; margin-top: 6px; box-shadow: none; max-height: none;
    border-color: var(--line); }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-bar { grid-template-columns: 1fr; }
  .hero-bar a { border-inline-end: none; border-bottom: 1px solid rgba(255,255,255,.08); padding: 20px 0; }
  .band { padding: 36px 24px; }
  section { padding: 52px 0; }
  .hero-inner { padding: 64px 0 0; }
  /* Header row: the brand wordmark at full size + theme + hamburger buttons
     no longer fit a 320-375px phone (real overflow measured: brand alone was
     ~274px). Shrink the wordmark and tighten the row so nothing is clipped
     or pushed off-screen. */
  .wrap.nav { padding-inline: 14px; gap: 8px; }
  .brand { font-size: .98rem; gap: 7px; }
  .brand .mark { width: 28px; height: 28px; }
  .pitch-switch,.donate-link,.fab-circle,.sc-float,.amc-float { display:none !important; }
}
@media (max-width: 340px) {
  /* Smallest common phone width (320px) needs a bit more room still.
     Icon buttons stay at 40x40 (accessible touch-target minimum) — trim
     padding/gaps and the wordmark instead of shrinking tap targets. */
  .wrap.nav { padding-inline: 10px; gap: 6px; }
  .brand { font-size: .84rem; gap: 5px; }
  .brand .mark { width: 22px; height: 22px; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .ad-banner, .hero-cta, .nav-toggle, .side-rail { display: none; }
}
