/* ==========================================================================
   Mumin Business Mindset: main stylesheet
   Shared by every page. Look and feel taken from the home page (hard 2px
   outlines, offset block shadows, pill buttons), colour from the blue + gold
   palette, in light and dark. Home-only styles live in home.css.
   ========================================================================== */


@font-face { font-family: "Hind Siliguri"; src: url("/assets/fonts/hind-siliguri-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("/assets/fonts/hind-siliguri-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("/assets/fonts/hind-siliguri-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("/assets/fonts/hind-siliguri-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "MBM Arabic"; src: url("/assets/fonts/amiri-arabic.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

/* Hind Siliguri has a documented malformed glyph for Bengali digit ১ (U+09E7) in its
   regular/medium/semibold/bold weights. Rather than swap the whole font (everything
   else in Hind Siliguri renders correctly), main.js detects contiguous Bengali-numeral
   runs that contain ১ (e.g. "১০", "১২") and reroutes just that run to Noto Sans Bengali,
   so a run like ৳১০ doesn't mix two different digit styles mid-number. See bn-digit-fix. */
@font-face { font-family: "Noto Sans Bengali"; src: url("/assets/fonts/noto-sans-bengali-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0980-09FF; }
@font-face { font-family: "Noto Sans Bengali"; src: url("/assets/fonts/noto-sans-bengali-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0980-09FF; }
.bn-digit-fix { font-family: "Noto Sans Bengali", "Hind Siliguri", sans-serif; display: contents; }

/* ==========================================================================
   Tokens. One palette for the whole site: cobalt blue + gold, light and dark.
   Purple (--violet) only shows up in dark mode; in light mode it falls back to blue.
   The "edge" + "drop" pair is the hard outline and offset shadow from the home page.
   ========================================================================== */
:root {
  --cobalt: #1D3BB3;
  --cobalt-deep: #142A86;
  --plum: #4A1C55;
  --gold: #D9A12B;
  --gold-hover: #E8B13E;
  --gold-glow: #F2C14E;
  --gold-ink: #1A1306;
  --green: #1E5B3E;

  --paper: #F3F4F9;
  --surface: #FFFFFF;
  --surface-2: #E8EAF3;
  --ink: #16142E;
  --ink-2: #4C4A68;
  --ink-3: #6E6C88;
  --line: #D6D9E7;
  --edge: #16142E;           /* hard 2px outlines */
  --drop: #16142E;           /* offset block shadows */
  --hi: #1D3BB3;             /* cool accent text: tags, numbers */
  --warm: #9A6608;           /* warm accent text, readable on light paper */
  --violet: #1D3BB3;         /* purple slot (blue in light mode) */
  --violet-soft: #4F67D6;
  --word: var(--plum);
  --link: var(--cobalt);
  --on-cobalt: #F3F4F9;
  --on-cobalt-2: rgba(243, 244, 249, .74);
  --no: #8C2F4B;
  --header-bg: rgba(243, 244, 249, .82);
  --shadow: 0 1px 0 rgba(22, 20, 46, .04), 0 18px 40px -24px rgba(29, 59, 179, .35);
  --grain: .035;

  /* Type */
  --font: "Hind Siliguri", "Noto Sans Bengali", "Kalpurush", "Nirmala UI", system-ui, sans-serif;
  --font-ar: "MBM Arabic", "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --fs-body: 1.0625rem;
  --lh-body: 1.8;
  --fs-small: .9375rem;
  --fs-h3: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --fs-h2: clamp(1.8rem, 1.3rem + 1.9vw, 2.6rem);
  --fs-h1: clamp(2.3rem, 1.6rem + 3.2vw, 4rem);
  --fs-hero: clamp(2.4rem, 1.5rem + 4.2vw, 4.4rem);
  --lh-tight: 1.25;

  /* Layout */
  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --radius: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
  --pill: 999px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

:root[data-lang="en"] {
  --lh-body: 1.65;
  --lh-tight: 1.12;
}

:root[data-theme="dark"] {
  --cobalt: #2747C9;
  --cobalt-deep: #1B338F;
  --plum: #5B2A86;
  --paper: #0E0D1F;
  --surface: #17162C;
  --surface-2: #1F1D38;
  --ink: #F2F1FA;
  --ink-2: #B4B1CE;
  --ink-3: #8E8BAB;
  --line: #2E2B4C;
  --edge: #05040B;
  --drop: #05040B;
  --hi: #9DB1FF;
  --warm: #F2C14E;
  --violet: #5B2A86;
  --violet-soft: #C49EE8;
  --word: #C49EE8;
  --link: #9DB1FF;
  --no: #E58AA6;
  --header-bg: rgba(14, 13, 31, .72);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -24px rgba(0, 0, 0, .7);
  --grain: .06;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: var(--lh-tight); font-weight: 700; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
main:focus { outline: none; }
::selection { background: var(--gold); color: var(--gold-ink); }

.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: .6rem 1rem; border: 2px solid var(--edge); font-weight: 600; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + .75rem); }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--text { max-width: calc(760px + var(--gutter) * 2); }
.wrap--mid { max-width: calc(880px + var(--gutter) * 2); }

.h1 { font-size: var(--fs-h1); letter-spacing: -.01em; }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
:root[data-lang="en"] .h1, :root[data-lang="en"] .h2 { letter-spacing: -.02em; }
.lede { font-size: clamp(1.1rem, 1rem + .4vw, 1.25rem); color: var(--ink-2); max-width: 60ch; }
.meta, .fine { color: var(--ink-3); font-size: var(--fs-small); }
.hint { color: var(--ink-2); font-size: var(--fs-small); }
.hint--center { text-align: center; max-width: 54ch; margin-inline: auto; }
.text-link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; color: var(--ink); }
.text-link:hover { color: var(--link); }
.empty { color: var(--ink-3); }
.sep { margin-inline: .5em; color: var(--ink-3); }
.kicker { font-weight: 700; color: var(--hi); margin-bottom: .25rem; }

/* ---------- Buttons (pill, hard outline, offset shadow) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.6em; border-radius: var(--pill);
  font-weight: 700; font-size: .95rem; line-height: 1.3; text-decoration: none; text-align: center;
  border: 2px solid var(--edge); cursor: pointer; position: relative;
  transition: transform .15s ease, box-shadow .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: translate(1px, 1px) !important; box-shadow: 2px 2px 0 0 var(--drop) !important; }
.btn--gold { background: var(--gold); color: var(--gold-ink); box-shadow: 5px 5px 0 0 var(--drop); }
.btn--gold:hover { box-shadow: 7px 7px 0 0 var(--drop); background: var(--gold-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--grad { background: linear-gradient(120deg, var(--cobalt), var(--violet)); color: #fff; box-shadow: 5px 5px 0 0 var(--drop); }
.btn--grad:hover { box-shadow: 7px 7px 0 0 var(--drop); }
.btn--glow { background: linear-gradient(135deg, var(--gold-glow), var(--gold)); color: var(--gold-ink); animation: glowPulse 2.4s ease-in-out infinite; }
.btn--glow:hover { animation-play-state: paused; }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 161, 43, .45), 5px 5px 0 0 var(--drop); }
  50% { box-shadow: 0 0 30px 6px rgba(242, 193, 78, .55), 5px 5px 0 0 var(--drop); }
}
.btn--quiet { background: transparent; color: inherit; text-decoration: underline; text-underline-offset: .25em; padding-inline: .5em; border-color: transparent; }
.btn--sm { min-height: 40px; padding: .45em 1.1em; font-size: .875rem; }
.btn--lg { min-height: 54px; padding: .8em 1.8em; font-size: 1rem; }
.btn__aside { font-weight: 400; opacity: .75; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 2px solid var(--edge);
}
/* Blur lives on a pseudo-element so the fixed mobile menu isn't trapped inside the header */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 51; background: var(--header-bg); }
body.nav-open .site-header::before { background: var(--paper); }
.site-header__inner { display: flex; align-items: center; gap: 1.25rem; min-height: var(--header-h); }

.logo { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.logo .mark { width: 36px; height: 36px; flex: none; }
.logo__word { display: flex; flex-direction: column; line-height: 1.1; }
.logo__top { font-weight: 700; font-size: 1rem; }
.logo__bottom { font-weight: 500; font-size: .72rem; color: var(--ink-3); letter-spacing: .02em; }

.nav { margin-inline: auto; display: flex; align-items: center; }
.nav__list { list-style: none; display: flex; align-items: center; gap: .15rem; }
.nav__link { display: block; padding: .45rem .7rem; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; transition: color .2s ease; }
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.nav__mobile-ctas { display: none; }

.nav__tools { position: relative; }
.nav-drop {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
  display: grid; grid-template-columns: repeat(4, 178px); gap: 1.25rem 1.5rem;
  background: var(--surface); border: 2px solid var(--edge); box-shadow: 6px 6px 0 0 var(--drop);
  padding: 1.4rem; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 60;
}
.nav__tools:hover .nav-drop, .nav__tools:focus-within .nav-drop { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-drop__col { display: flex; flex-direction: column; gap: .5rem; }
.nav-drop__head { font-size: .72rem; font-weight: 700; letter-spacing: .03em; color: var(--warm); margin-bottom: .1rem; }
.nav-drop a { font-size: .82rem; color: var(--ink-2); line-height: 1.4; text-decoration: none; }
.nav-drop a:hover { color: var(--ink); }
.nav-drop .nav-drop__all { grid-column: 1 / -1; justify-self: start; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--gold); padding-bottom: 2px; font-size: .85rem; }

.header-tools { display: flex; align-items: center; gap: .5rem; }
.lang-switch { font-weight: 600; font-size: .85rem; color: var(--ink); text-decoration: none; padding: .35rem .75rem; border: 2px solid var(--line); border-radius: var(--pill); }
.lang-switch:hover { border-color: var(--ink); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; border-radius: 0; }
.burger { display: grid; gap: 6px; width: 20px; }
.burger span { display: block; height: 2px; background: currentColor; transition: transform .25s var(--ease); }
.menu-toggle[aria-expanded="true"] .burger span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:last-child { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 1240px) { .header-community { display: none; } }
@media (max-width: 1120px) {
  .menu-toggle { display: inline-grid; }
  .header-tools { margin-left: auto; }
  .nav-drop { display: none; }
  .nav {
    position: fixed; inset: calc(var(--header-h) + 2px + env(safe-area-inset-top, 0px)) 0 0 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 1.5rem; margin: 0;
    padding: 1rem var(--gutter) calc(2rem + env(safe-area-inset-bottom, 0px));
    background: var(--paper); overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link { font-size: 1.35rem; font-weight: 600; color: var(--ink); padding: .8rem 0; border-bottom: 2px solid var(--line); }
  .nav__link[aria-current="page"] { box-shadow: none; color: var(--hi); }
  .nav__mobile-ctas { display: grid; gap: .9rem; }
  .nav__mobile-ctas .btn { min-height: 54px; font-size: 1rem; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 560px) {
  .header-cta { display: none; }
  .logo__bottom { display: none; }
  .logo .mark { width: 32px; height: 32px; }
  .header-tools { gap: .4rem; }
}

/* ---------- Shared section pieces (home, Volume 1 and beyond) ---------- */
.sec { position: relative; padding-block: clamp(4.5rem, 10vw, 8rem); }
.sec--tight { padding-block: clamp(3rem, 7vw, 5rem); }
.sec-head { max-width: 680px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.sec-head--center { text-align: center; margin-inline: auto; }
.sec-head__tag { display: block; font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--hi); margin-bottom: .8rem; }
.sec-head__title { font-size: var(--fs-h2); line-height: 1.3; margin: 0; }
.sec-head__body { margin: 1rem 0 0; font-size: 1.02rem; color: var(--ink-2); line-height: 1.75; }

.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600; letter-spacing: .05em; color: var(--warm);
  border: 2px solid var(--gold); padding: .3rem .9rem; margin-bottom: 1.4rem;
}

/* square line pattern, echoing the cover's floor grid */
.grid-zone { position: relative; }
.grid-zone::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(color-mix(in srgb, var(--gold) 14%, transparent) 1px, transparent 1px),
                    linear-gradient(90deg, color-mix(in srgb, var(--gold) 14%, transparent) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
}
.grid-zone > * { position: relative; z-index: 1; }

/* Table of contents tabs (Volume 1 curriculum) and the home tools tabs */
.tabs { display: grid; grid-template-columns: 280px minmax(0, 1fr); border: 2px solid var(--edge); box-shadow: 6px 6px 0 0 var(--drop); background: var(--surface); }
.tabs__list { display: flex; flex-direction: column; border-right: 2px solid var(--edge); background: var(--paper); }
.tabs__tab {
  background: none; border: 0; border-bottom: 2px solid var(--line); color: var(--ink-2); text-align: left;
  padding: 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .2rem; transition: background .3s ease;
}
.tabs__tab:last-child { border-bottom: 0; }
.tabs__code { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); }
.tabs__name { font-size: .98rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.tabs__count { font-size: .75rem; color: var(--ink-3); }
.tabs__tab:hover { background: var(--surface-2); }
.tabs__tab[aria-selected="true"] { background: var(--gold); }
.tabs__tab[aria-selected="true"] .tabs__code, .tabs__tab[aria-selected="true"] .tabs__name, .tabs__tab[aria-selected="true"] .tabs__count { color: var(--gold-ink); }
.tabs__panel { padding: clamp(1.5rem, 3.5vw, 2.6rem) clamp(1.25rem, 3.5vw, 2.9rem); min-width: 0; }
.tabs__panel[hidden] { display: none; }
.tabs__head { font-size: .85rem; color: var(--warm); font-weight: 700; margin-bottom: 1rem; }
.ch-list { list-style: none; display: flex; flex-direction: column; }
.ch-list li { display: flex; gap: .9rem; padding: .8rem .4rem; font-size: .98rem; color: var(--ink-2); line-height: 1.55; border-bottom: 1px solid var(--line); }
.ch-list li:last-child { border-bottom: 0; }
.ch-list .cn { flex: none; min-width: 1.8rem; color: var(--hi); font-weight: 700; font-size: .92rem; }
.tabs__panel:not([hidden]) .ch-list li { animation: rowIn .4s ease both; }
.tabs__panel .ch-list li:nth-child(2) { animation-delay: .04s; } .tabs__panel .ch-list li:nth-child(3) { animation-delay: .08s; }
.tabs__panel .ch-list li:nth-child(4) { animation-delay: .12s; } .tabs__panel .ch-list li:nth-child(5) { animation-delay: .16s; }
.tabs__panel .ch-list li:nth-child(6) { animation-delay: .2s; } .tabs__panel .ch-list li:nth-child(7) { animation-delay: .24s; }
.tabs__panel .ch-list li:nth-child(8) { animation-delay: .28s; } .tabs__panel .ch-list li:nth-child(9) { animation-delay: .32s; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .tabs { grid-template-columns: 1fr; }
  /* Tabs become a swipeable row; each tab keeps its own width so labels never overlap */
  .tabs__list {
    flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 2px solid var(--edge);
    scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tabs__list::-webkit-scrollbar { display: none; }
  .tabs__tab { flex: 0 0 auto; width: 176px; border-bottom: 0; border-right: 2px solid var(--line); scroll-snap-align: start; padding: 1rem 1.1rem; }
  .tabs__tab:last-child { border-right: 0; }
  .tabs__name { font-size: .92rem; }
}

/* FAQ, home style */
.faq-list { max-width: 780px; display: flex; flex-direction: column; gap: .9rem; }
.faq-list details { background: var(--surface); border: 2px solid var(--edge); padding: 1.25rem 1.5rem; transition: border-color .2s ease, box-shadow .2s ease; }
.faq-list details[open] { border-color: var(--gold); box-shadow: 5px 5px 0 0 var(--drop); }
.faq-list summary { cursor: pointer; font-size: 1.02rem; font-weight: 700; list-style: none; display: flex; gap: .9rem; align-items: center; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .2s ease, box-shadow .2s ease; }
.faq-list details[open] summary::before { background: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); }
.faq-list summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; line-height: 1; color: var(--warm); font-weight: 700; }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list .faq-list__a { margin: .8rem 0 0 1.4rem; font-size: .98rem; line-height: 1.75; color: var(--ink-2); max-width: 62ch; }

/* Toast (payment-link placeholders, newsletter-not-ready) */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 160%);
  background: var(--gold); border: 2px solid var(--edge); color: var(--gold-ink); max-width: calc(100vw - 2rem);
  padding: .75rem 1.4rem; border-radius: var(--pill); font-size: .9rem; font-weight: 700; z-index: 100; text-align: center;
  transition: transform .35s ease, visibility .35s; box-shadow: 5px 5px 0 0 var(--drop); visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Bands (cobalt colour blocks with the star texture) ---------- */
.band { padding-block: clamp(3rem, 8vw, 6rem); }
.band--cobalt {
  background-color: var(--cobalt); color: var(--on-cobalt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23F3F4F9' stroke-opacity='.07' stroke-width='1.2'%3E%3Crect x='35' y='35' width='50' height='50'/%3E%3Crect x='35' y='35' width='50' height='50' transform='rotate(45 60 60)'/%3E%3Cpath d='M0 0L35 35M120 0L85 35M0 120L35 85M120 120L85 85'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.band--cobalt .h2, .band--cobalt h2 { color: var(--on-cobalt); }
.band--cobalt p, .band--cobalt dd { color: var(--on-cobalt-2); }
.band__inner--split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; }
.band__inner--split > div { max-width: 46rem; }

.ayah { margin: 0; text-align: center; }
.ayah blockquote { margin: 0; }
.ayah__ar { font-family: var(--font-ar); font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.9; color: var(--gold); margin-bottom: .4em; }
.ayah__tr { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); max-width: 44ch; margin-inline: auto; }
.ayah__ref { font-size: var(--fs-small); opacity: .8; }
.band--cobalt .ayah__tr { color: var(--on-cobalt); }
.band--cobalt .ayah__ar { color: var(--gold); }
.band--cobalt .ayah__ref { color: var(--on-cobalt-2); }
.wrap--mid > .ayah, .notes-block .ayah, .founder + div .ayah, .split .ayah { margin-block: 2rem; padding: 2rem 1.5rem; border-radius: var(--radius-lg); background: var(--surface); }
:root:not([data-theme="dark"]) .wrap--mid > .ayah .ayah__ar, :root:not([data-theme="dark"]) .split .ayah .ayah__ar, :root:not([data-theme="dark"]) .notes-block .ayah .ayah__ar { color: var(--cobalt); }


/* ---------- Post lists ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; }
.post-list { list-style: none; border-top: 1px solid var(--line); margin-top: 1rem; }
.post-list__item a { display: grid; gap: .2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.post-list__item time, .post-list__meta { font-size: var(--fs-small); color: var(--ink-3); }
.post-list__title { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); font-weight: 700; line-height: 1.35; }
.post-list__desc { color: var(--ink-2); }
.post-list__item a:hover .post-list__title { color: var(--link); }

/* ---------- Generic page head ---------- */
.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.page-head .h1 { max-width: 20ch; }
.page-head--wide .h1 { max-width: 24ch; }
.page-head__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; font-size: var(--fs-small); color: var(--ink-3); margin-bottom: 1.25rem; }
.crumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--line); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.split--narrow { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 820px) { .split, .split--narrow { grid-template-columns: 1fr; } }
.big-p { font-size: clamp(1.2rem, 1rem + .7vw, 1.5rem); line-height: 1.6; }

/* ---------- Books ---------- */
.shelf { display: grid; gap: 1.25rem; padding-bottom: clamp(3rem, 7vw, 5rem); }
.shelf__item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; padding: clamp(1.25rem, 2.5vw, 2rem); background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--line); }
.shelf__text p:not(.status) { color: var(--ink-2); }
.shelf__text .meta { margin-bottom: 1rem; }
.shelf__no { color: var(--ink-3); font-weight: 500; }
.shelf__cover { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow); }
.spine { aspect-ratio: 2 / 3; border-radius: 10px; padding: .9rem; display: flex; flex-direction: column; justify-content: space-between; color: #F3F4F9; box-shadow: var(--shadow); }
.spine__no { font-size: .8rem; font-weight: 600; opacity: .85; }
.spine__name { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.spine--1 { background: var(--cobalt); }
.spine--2 { background: var(--plum); }
.spine--3 { background: var(--green); }
.spine--pb { background: var(--gold); color: var(--gold-ink); }
.status { display: inline-block; font-size: .875rem; font-weight: 600; padding: .1em .75em; border-radius: 999px; margin-bottom: .6rem; }
.status--free { background: var(--gold); color: var(--gold-ink); }
.status--writing { background: color-mix(in srgb, var(--plum) 16%, transparent); color: var(--plum); }
.status--planned, .status--soon { background: var(--surface-2); color: var(--ink-2); }
:root[data-theme="dark"] .status--writing { color: var(--word); }
@media (max-width: 600px) { .shelf__item { grid-template-columns: 96px minmax(0, 1fr); align-items: start; } .spine__name { font-size: .85rem; } .spine { padding: .55rem; } }

/* ---------- Volume 1 ---------- */
.vol-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: clamp(2rem, 5vw, 4rem); }
.vol-hero .h1 { font-size: var(--fs-hero); margin-bottom: .3em; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0; border-block: 1px solid var(--line); padding-block: 1.1rem; }
.facts dt { font-size: var(--fs-small); color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 700; font-size: 1.25rem; }
.vol-hero__cta .fine { margin-top: .75rem; }
.release-note { font-weight: 600; margin-bottom: .9rem; }
.cover {
  aspect-ratio: 2 / 3; max-width: 380px; margin-inline: auto; border-radius: 8px 16px 16px 8px; padding: 2rem 1.75rem;
  display: flex; flex-direction: column; background: var(--cobalt); color: #F3F4F9;
  box-shadow: inset 10px 0 0 rgba(0, 0, 0, .14), 0 30px 60px -30px rgba(29, 59, 179, .65), 0 2px 0 rgba(0, 0, 0, .05);
  transform: rotate(-2.5deg); transition: transform .5s var(--ease);
}
.cover:hover { transform: rotate(0); }
.cover-photo {
  display: block; aspect-ratio: 2 / 3; max-width: 380px; width: 100%; margin-inline: auto;
  border-radius: 8px 16px 16px 8px; object-fit: cover;
  box-shadow: 0 30px 60px -30px rgba(29, 59, 179, .65), 0 2px 0 rgba(0, 0, 0, .05);
  transform: rotate(-2.5deg); transition: transform .5s var(--ease);
}
.cover-photo:hover { transform: rotate(0); }
.cover__series { font-size: .9rem; font-weight: 600; opacity: .85; }
.cover__title { margin-top: auto; font-size: clamp(2.6rem, 2rem + 2.5vw, 3.7rem); font-weight: 700; line-height: 1.1; }
.cover__line { margin-top: .75rem; color: var(--gold); font-weight: 600; }
.cover__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(243, 244, 249, .25); font-size: .9rem; font-weight: 600; }
.cover .mark { width: 34px; height: 34px; color: #F3F4F9; }
@media (max-width: 860px) {
  .vol-hero { grid-template-columns: 1fr; }
  .vol-hero__cover { order: -1; }
  .cover { max-width: 240px; padding: 1.4rem 1.2rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.steps { list-style: none; counter-reset: s; display: grid; gap: .9rem; margin-top: 1.25rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--gold); color: var(--gold-ink); font-weight: 700; }
:root[data-lang="bn"] .steps li::before { content: counter(s, bengali); }
.topics { list-style: none; display: grid; gap: .75rem; margin-top: 1.25rem; }
.topics li { position: relative; padding-left: 1.6rem; }
.topics li::before { content: ""; position: absolute; left: .15rem; top: .7em; width: .55rem; height: .55rem; background: var(--cobalt); transform: rotate(45deg); border-radius: 2px; }
.parts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.parts li { border-top: 2px solid rgba(243, 244, 249, .3); padding-top: 1rem; }
.parts__name { display: block; font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem); font-weight: 700; color: var(--gold); }
.parts__body { color: var(--on-cobalt-2); }
@media (max-width: 760px) { .parts { grid-template-columns: 1fr; } }

.faq { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.split .faq { padding-block: 0; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; font-weight: 600; font-size: 1.1rem; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: ""; position: absolute; right: .4rem; top: 50%; width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); transition: transform .2s var(--ease); }
.faq__item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq__item p { color: var(--ink-2); padding-bottom: 1rem; margin: 0; }

/* ---------- Tools hub ---------- */
.tool-cards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.tool-card a { display: flex; flex-direction: column; height: 100%; gap: .6rem; padding: 1.75rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .2s, transform .25s var(--ease); }
.tool-card a:hover { border-color: var(--cobalt); transform: translateY(-3px); }
.tool-card__glyph { width: 52px; height: 52px; color: var(--cobalt); margin-bottom: .5rem; }
:root[data-theme="dark"] .tool-card__glyph { color: var(--link); }
.tool-card__title { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
.tool-card__body { color: var(--ink-2); flex: 1; }
.tool-card__foot { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-small); color: var(--ink-3); padding-top: 1rem; border-top: 1px solid var(--line); }
.tool-card__open { font-weight: 700; color: var(--ink); background: var(--gold); color: var(--gold-ink); padding: .2em .9em; border-radius: 10px; }
.more-tools { margin-top: 2.5rem; padding: 1.75rem; border-radius: var(--radius-lg); border: 1.5px dashed var(--line); }
.more-tools p { margin: 0; color: var(--ink-2); }
.disclaimer { margin-top: 2rem; padding: 1rem 1.25rem; border-left: 4px solid var(--gold); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--ink-2); font-size: var(--fs-small); }
@media (max-width: 900px) { .tool-cards { grid-template-columns: 1fr; } }

/* ---------- Tool layout + forms ---------- */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; padding-bottom: 2rem; }
.tool-layout--wide { grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); }
@media (max-width: 920px) { .tool-layout, .tool-layout--wide { grid-template-columns: 1fr; } }

.calc { display: grid; gap: 1.25rem; }
.calc__group { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(1.25rem, 3vw, 2rem); min-width: 0; display: grid; gap: 1.1rem; }
.calc__legend { float: left; width: 100%; display: flex; align-items: center; gap: .7rem; font-weight: 700; font-size: 1.25rem; padding: 0; margin-bottom: .1rem; }
.calc__legend + * { clear: both; }
.calc__step { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: var(--cobalt); color: var(--on-cobalt); font-size: 1rem; }
.field { display: grid; gap: .35rem; min-width: 0; }
.field label { font-weight: 500; font-size: .98rem; color: var(--ink); line-height: 1.45; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: .65rem .95rem; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1.05rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 55%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--no); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.unit-tag { font-size: .85em; color: var(--ink-3); font-weight: 500; }

.seg { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.seg__label { width: 100%; font-weight: 500; font-size: .98rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label > span { display: inline-block; padding: .55rem 1rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 500; cursor: pointer; }
.seg input:checked + span { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.result { position: sticky; top: calc(var(--header-h) + 1.25rem); }
@media (max-width: 920px) { .result { position: static; } }
.result__card { background: var(--cobalt); color: var(--on-cobalt); border-radius: var(--radius-lg); padding: clamp(1.4rem, 3vw, 2rem); }
.result__title { font-size: 1.3rem; color: var(--on-cobalt); }
.result__rows { margin: 0 0 1rem; display: grid; }
.result__rows div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid rgba(243, 244, 249, .18); }
.result__rows dt { color: var(--on-cobalt-2); }
.result__rows dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.result__strong dt, .result__strong dd { color: var(--on-cobalt); font-weight: 700; }
.result__due { display: grid; gap: .1rem; margin: 1rem 0; padding: 1rem 1.1rem; border-radius: 14px; background: rgba(0, 0, 0, .16); }
.result__due span { color: var(--on-cobalt-2); font-size: var(--fs-small); }
.result__due strong { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.6rem); color: var(--gold); line-height: 1.2; font-variant-numeric: tabular-nums; }
.result__verdict { color: var(--on-cobalt); font-weight: 500; }
.result__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.result .btn--ghost { border-color: var(--on-cobalt); color: var(--on-cobalt); }
.result .btn--ghost:hover { background: var(--on-cobalt); color: var(--cobalt); }
.result .btn--quiet { color: var(--on-cobalt); }
.result__sub { font-size: 1.05rem; color: var(--on-cobalt); margin-top: 1.25rem; }

.notes-block { padding-block: 1rem 2rem; }
.notes { list-style: none; display: grid; gap: .7rem; max-width: 72ch; }
.notes li { position: relative; padding-left: 1.5rem; color: var(--ink-2); }
.notes li::before { content: ""; position: absolute; left: .1rem; top: .72em; width: .5rem; height: .5rem; background: var(--gold); transform: rotate(45deg); }

/* Niyyah quiz */
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.result__card .progress { background: rgba(243, 244, 249, .18); }
.progress__bar { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; transition: width .35s var(--ease); }
.progress__text { font-size: var(--fs-small); color: var(--ink-3); margin: .5rem 0 1.5rem; }
.result__card .progress__text { color: var(--on-cobalt-2); }
.quiz { position: relative; }
.quiz > .progress { position: sticky; top: calc(var(--header-h) + .5rem); z-index: 2; }
.quiz__list { list-style: none; display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.quiz__q fieldset { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 1.25rem 1.4rem 1.4rem; min-width: 0; transition: border-color .2s; }
.quiz__q fieldset.is-answered { border-color: color-mix(in srgb, var(--cobalt) 45%, var(--line)); }
.quiz__q legend { float: left; width: 100%; display: flex; gap: .8rem; font-weight: 600; font-size: 1.12rem; line-height: 1.55; margin-bottom: 1rem; padding: 0; }
.quiz__q legend + * { clear: both; }
.quiz__n { flex-shrink: 0; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--surface-2); font-size: .95rem; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.scale__opt { position: relative; }
.scale__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.scale__opt span { display: grid; place-items: center; text-align: center; min-height: 56px; height: 100%; padding: .5rem .4rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-size: .9rem; line-height: 1.3; cursor: pointer; transition: background-color .15s, border-color .15s; }
.scale__opt span:hover { border-color: var(--cobalt); }
.scale__opt input:checked + span { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); font-weight: 600; }
.scale__opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 600px) { .scale { grid-template-columns: 1fr; } .scale__opt span { min-height: 46px; justify-items: start; text-align: left; padding-inline: 1rem; } }
.form-error { color: var(--no); font-weight: 600; }

.niyyah-result { margin-top: 2.5rem; padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); }
.niyyah-result:focus { outline: none; }
.score { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.score__num { display: grid; place-items: center; width: clamp(110px, 20vw, 150px); aspect-ratio: 1; border-radius: 28px; background: var(--cobalt); color: var(--gold); font-size: clamp(2.4rem, 1.8rem + 2.5vw, 3.4rem); font-weight: 700; transform: rotate(0); }
.score__band { font-size: var(--fs-h3); font-weight: 700; margin-bottom: .3rem; }
@media (max-width: 560px) { .score { grid-template-columns: 1fr; } }
.areas { list-style: none; display: grid; gap: 1rem; margin: 1rem 0 2rem; }
.area__top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .35rem; }
.area__bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.area__bar span { display: block; height: 100%; border-radius: inherit; background: var(--cobalt); transition: width .8s var(--ease); }
.area--weak .area__bar span { background: var(--gold); }
.weak { padding: 1.25rem 1.4rem; border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 18%, var(--surface)); margin-bottom: 1.5rem; }
.weak__label { margin-bottom: .4rem; }
.weak p:last-child { margin: 0; }

/* Shariah checklist */
.check { display: grid; gap: 1.5rem; }
.check__sec { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(1.25rem, 3vw, 1.75rem); }
.check__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; margin-bottom: .5rem; }
.check__head .h3 { margin: 0; }
.check__ref { font-size: .85rem; color: var(--ink-3); margin: 0; }
.check__item { margin: 0; padding: 1rem 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.check__item legend { float: left; width: 100%; padding: 0; margin-bottom: .75rem; font-weight: 500; line-height: 1.55; }
.check__item legend + * { clear: both; }
.tri { display: flex; flex-wrap: wrap; gap: .5rem; }
.tri__opt { position: relative; }
.tri__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tri__opt span { display: inline-block; padding: .45rem 1.05rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 500; cursor: pointer; }
.tri__opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.tri__opt--yes input:checked + span { background: var(--green); border-color: var(--green); color: #EEF7F1; }
.tri__opt--no input:checked + span { background: var(--plum); border-color: var(--plum); color: #F6EEF8; }
.tri__opt--unsure input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.tally__n { display: grid; text-align: center; padding: .6rem .3rem; border-radius: 12px; background: rgba(0, 0, 0, .16); font-size: .85rem; color: var(--on-cobalt-2); }
.tally__n strong { font-size: 1.6rem; color: var(--on-cobalt); line-height: 1.2; }
.tally__n--unsure strong { color: var(--gold); }
.flag-list { list-style: none; display: grid; gap: .5rem; margin-bottom: 1rem; }
.flag-list li { padding: .6rem .8rem; border-radius: 10px; background: rgba(0, 0, 0, .16); font-size: .95rem; line-height: 1.5; }
.flag-list--no li { border-left: 3px solid #F2B8C9; }
.flag-list--unsure li { border-left: 3px solid var(--gold); }

/* Email capture */
.updates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(1.25rem, 4vw, 3rem); margin-block: clamp(2rem, 5vw, 3.5rem); padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--radius-xl); background: var(--surface-2); }
.updates__title { font-size: var(--fs-h3); }
.updates__text p { color: var(--ink-2); margin: 0; }
.updates__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; align-items: end; }
.updates__form .btn { grid-column: 1 / -1; justify-self: start; }
.updates__status { grid-column: 1 / -1; margin: 0; font-weight: 600; min-height: 1.5em; }
.updates__status.is-ok { color: var(--green); }
:root[data-theme="dark"] .updates__status.is-ok { color: #8FD3AE; }
.updates__status.is-err { color: var(--no); }
.updates__fine { grid-column: 1 / -1; margin: 0; font-size: .85rem; color: var(--ink-3); }
@media (max-width: 760px) { .updates, .updates__form { grid-template-columns: 1fr; } }

/* ---------- Support / pricing ---------- */
.tiers { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: stretch; }
.tier { display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 2rem); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.tier--featured { background: var(--cobalt); color: var(--on-cobalt); border-color: var(--cobalt); }
.tier__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.tier__name { font-size: 1.35rem; margin: 0; }
.tier__badge { font-size: .8rem; font-weight: 600; padding: .15em .7em; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tier__price { margin: 1.1rem 0 .1rem; display: flex; align-items: baseline; gap: .25rem; }
.tier__price strong { font-size: clamp(2.2rem, 1.8rem + 1.4vw, 2.9rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tier__price span { color: var(--ink-3); }
.tier--featured .tier__price strong { color: var(--gold); }
.tier--featured .tier__price span, .tier--featured .tier__note, .tier--featured .tier__body { color: var(--on-cobalt-2); }
.tier__note { font-size: var(--fs-small); color: var(--ink-3); }
.tier__body { color: var(--ink-2); }
.tier__features { list-style: none; display: grid; align-content: start; gap: .55rem; margin: .5rem 0 1.75rem; flex: 1; }
.tier__features li { position: relative; padding-left: 1.5rem; line-height: 1.5; }
.tier__features li::before { content: ""; position: absolute; left: .1rem; top: .5em; width: .5rem; height: .5rem; transform: rotate(45deg); background: var(--cobalt); }
.tier--featured .tier__features li::before { background: var(--gold); }
.tier__cta { width: 100%; }
.tier--featured .btn--ghost { border-color: var(--on-cobalt); color: var(--on-cobalt); }
@media (max-width: 960px) { .tiers { grid-template-columns: 1fr; max-width: 560px; } }
.where { list-style: none; display: grid; gap: .75rem; margin-top: 1rem; }
.where li { padding: .9rem 1.1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- Community / about ---------- */
.rules { padding-block: clamp(2.5rem, 6vw, 4rem); }
.rules__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(1.5rem, 4vw, 3rem); margin: 1.5rem 0 0; }
.rules__item { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.rules__item dt { font-weight: 700; font-size: 1.15rem; margin-bottom: .25rem; }
.rules__item dd { margin: 0; color: var(--ink-2); }
@media (max-width: 700px) { .rules__list { grid-template-columns: 1fr; } }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem 2rem; margin: 1.5rem 0 0; }
.values__item { border-top: 2px solid rgba(243, 244, 249, .3); padding-top: 1rem; }
.values__item dt { font-weight: 700; font-size: 1.2rem; color: var(--gold); margin-bottom: .3rem; }
.values__item dd { margin: 0; }
.founder__name { font-size: 1.4rem; font-weight: 700; margin-bottom: .4rem; }
.founder p { color: var(--ink-2); }

/* ---------- Posts / prose ---------- */
.post__head { padding-top: clamp(2rem, 5vw, 3.5rem); }
.post__title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
.post__dek { font-size: 1.25rem; color: var(--ink-2); }
.post__meta { color: var(--ink-3); font-size: var(--fs-small); padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.post__cover { margin-block: 2rem; }
.post__cover img { width: 100%; border-radius: var(--radius-lg); }
.prose { padding-block: 1.5rem 2rem; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-top: 2em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-inline: 0; padding: .4rem 0 .4rem 1.25rem; border-left: 4px solid var(--gold); color: var(--ink); font-weight: 500; }
.prose blockquote p { margin: 0; }
.prose img { border-radius: var(--radius); margin-block: 1.5em; }
.prose a { color: var(--link); }
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 2.5em; }
.prose code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
.prose [lang="ar"], .prose .ar { font-family: var(--font-ar); font-size: 1.5em; line-height: 1.9; direction: rtl; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.post__foot { padding-bottom: clamp(3rem, 6vw, 5rem); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-block: 1.5rem; border-block: 1px solid var(--line); }
.share__label { font-weight: 600; margin-right: .5rem; }
.share__btn { font-size: .9375rem; font-weight: 500; padding: .4rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; }
.share__btn:hover { border-color: var(--ink); }
.post__cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-block: 2rem; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface); }
.post__cta p { margin: 0; font-weight: 600; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.pager__link { display: grid; gap: .2rem; padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.4; }
.pager__link span { font-size: .85rem; font-weight: 500; color: var(--ink-3); }
.pager__link--next { grid-column: 2; text-align: right; }
.pager__link:hover { border-color: var(--cobalt); }
.other-lang { margin-top: 2rem; padding-bottom: 3rem; }

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(3rem, 10vw, 7rem); max-width: 860px; }
.notfound__mark { width: 72px; color: var(--cobalt); margin-bottom: 1.5rem; }
.notfound__links { list-style: none; display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }


/* ---------- Footer (home-page footer, on every page) ---------- */
.site-footer { position: relative; margin-top: clamp(3rem, 6vw, 5rem); border-top: 2px solid var(--edge); padding: clamp(3rem, 6vw, 4.25rem) 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 5%, transparent), transparent 40%); }
.site-footer::before { content: ""; position: absolute; top: -2px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--violet-soft), var(--hi)); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.15fr); gap: 2rem 2.25rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.foot-brand p { margin: 1rem 0 0; font-size: .88rem; color: var(--ink-3); line-height: 1.7; max-width: 32ch; }
.foot-brand .foot-brand__promise { color: var(--ink); font-weight: 600; margin-top: .6rem; }
.foot-col__head { font-size: .8rem; letter-spacing: .04em; color: var(--warm); margin-bottom: 1rem; font-weight: 700; }
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.foot-col a { font-size: .9rem; color: var(--ink-2); text-decoration: none; position: relative; transition: padding-left .2s ease, color .2s ease; word-break: break-word; }
.foot-col a::before { content: "\2192"; position: absolute; left: -16px; opacity: 0; color: var(--warm); transition: opacity .2s ease, left .2s ease; }
.foot-col a:hover { color: var(--ink); padding-left: 16px; }
.foot-col a:hover::before { opacity: 1; left: 0; }
.foot-bottom { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding: 1.25rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px)); border-top: 2px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem 1.5rem; }
.foot-bottom p { margin: 0; font-size: .8rem; color: var(--ink-3); }
.foot-bottom p a { color: var(--ink-2); }
.foot-social { display: flex; gap: .6rem; }
.foot-social a { width: 36px; height: 36px; border: 2px solid var(--edge); display: flex; align-items: center; justify-content: center; color: var(--ink-2); background: var(--surface); transition: background .2s ease, transform .2s ease, color .2s ease; }
.foot-social a:hover { background: var(--gold); color: var(--gold-ink); transform: translateY(-2px); }
.foot-social svg { width: 16px; height: 16px; }
@media (max-width: 1040px) { .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 640px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-col--contact { grid-column: 1 / -1; } }

/* Newsletter (Kit) */
.news {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.5rem clamp(1.5rem, 4vw, 3rem); align-items: center;
  padding: clamp(1.5rem, 3.5vw, 2.25rem); background: var(--surface); border: 2px solid var(--edge); box-shadow: 6px 6px 0 0 var(--drop);
}
.news__title { font-size: var(--fs-h3); margin-bottom: .4rem; }
.news__text p { margin: 0; color: var(--ink-2); font-size: .95rem; line-height: 1.7; }
.news__form { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; gap: .75rem; align-items: center; }
.news__input { width: 100%; min-height: 48px; padding: .6rem 1.1rem; border: 2px solid var(--line); border-radius: var(--pill); background: var(--paper); color: var(--ink); font-size: .95rem; }
.news__input:focus { outline: none; border-color: var(--edge); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 50%, transparent); }
.news__input[aria-invalid="true"] { border-color: var(--no); }
.news__status { grid-column: 1 / -1; margin: 0; font-weight: 600; font-size: .9rem; min-height: 0; }
.news__status:empty { display: none; }
.news__status.is-ok { color: var(--green); }
:root[data-theme="dark"] .news__status.is-ok { color: #8FD3AE; }
.news__status.is-err { color: var(--no); }
.news__fine { grid-column: 1 / -1; margin: 0; font-size: .8rem; color: var(--ink-3); }
@media (max-width: 900px) { .news { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .news__form { grid-template-columns: 1fr; } .news__form .btn { width: 100%; } }

/* ---------- Skin: the home page's hard-edged card style, applied to every page ---------- */
.calc__group, .quiz__q fieldset, .check__sec, .tool-card a, .shelf__item, .tier, .niyyah-result,
.post__cta, .where li, .more-tools, .teaser--outline, .notes-block .ayah, .wrap--mid > .ayah, .split .ayah {
  border: 2px solid var(--edge) !important; box-shadow: 6px 6px 0 0 var(--drop);
}
.more-tools { border-style: dashed !important; box-shadow: none; }
.result__card { border: 2px solid var(--edge); box-shadow: 6px 6px 0 0 var(--drop); }
.tool-card a { transition: transform .2s ease, box-shadow .2s ease; }
.tool-card a:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 0 var(--drop); }
.tool-card__glyph { color: var(--hi); }
.tool-card__open { border-radius: var(--pill); border: 2px solid var(--edge); }
.tier--featured { background: var(--cobalt); }
:root[data-theme="dark"] .tier--featured { background: linear-gradient(160deg, var(--cobalt-deep), var(--violet)); }
.status, .tier__badge, .teaser__status { border-radius: var(--pill); }
.status--free { border: 2px solid var(--edge); }
.spine { border: 2px solid var(--edge); }
.shelf__cover { border: 2px solid var(--edge); box-shadow: 6px 6px 0 0 var(--drop); }
.field input, .field select, .field textarea { border-width: 2px; border-radius: 0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--edge); }
.seg label > span, .tri__opt span { border-width: 2px; border-radius: var(--pill); }
.scale__opt span { border-width: 2px; }
.calc__step, .quiz__n { border-radius: 0; }
.steps li::before { border-radius: 0; border: 2px solid var(--edge); }
.disclaimer { border-left-width: 4px; border-radius: 0; }
.pager__link, .share__btn { border-width: 2px; border-radius: 0; }
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.crumbs ol { margin-bottom: 1rem; }
.crumbs a:hover { color: var(--hi); }
.post-list__item a:hover .post-list__title, .tool-row:hover .tool-row__title, .offer__link:hover .offer__title { color: var(--hi); }
.band--cobalt { border-block: 2px solid var(--edge); }
:root[data-theme="dark"] .band--cobalt { background-color: var(--cobalt-deep); }
.score__num { border-radius: 0; border: 2px solid var(--edge); box-shadow: 6px 6px 0 0 var(--drop); }
.weak { border-left: 4px solid var(--gold); }

/* ---------- Volume 1: hero CTA row, sample pages, lightbox ---------- */
.vol-hero__cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .5rem; }
.vol-hero .facts { border-block-width: 2px; }
.cover-photo { border: 2px solid var(--edge); border-radius: 0; box-shadow: 10px 10px 0 0 var(--drop); }

.preview { color: var(--on-cobalt); }
.preview .sec-head__tag { color: var(--gold-glow); }
.preview .sec-head__title { color: var(--on-cobalt); }
.preview .sec-head__body { color: var(--on-cobalt-2); }
.pages {
  list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: clamp(210px, 24vw, 270px); gap: 1.4rem;
  overflow-x: auto; padding: .5rem .5rem 1.6rem; margin-inline: -.5rem; scroll-snap-type: x mandatory; scrollbar-color: var(--gold) transparent;
}
.pages li { scroll-snap-align: start; }
.page-thumb {
  display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 2px solid var(--edge); background: #F7F6F1;
  box-shadow: 6px 6px 0 0 var(--drop); overflow: hidden; position: relative; transition: transform .2s ease, box-shadow .2s ease;
}
.page-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
button.page-thumb:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 0 var(--drop); }
.page-thumb__n { position: absolute; left: .6rem; bottom: .6rem; background: var(--gold); color: var(--gold-ink); border: 2px solid var(--edge); font-size: .75rem; font-weight: 700; padding: .1rem .6rem; border-radius: var(--pill); }
.page-thumb--empty { background: color-mix(in srgb, var(--on-cobalt) 8%, transparent); border-style: dashed; border-color: rgba(243, 244, 249, .35); box-shadow: none; display: grid; align-content: start; gap: .55rem; padding: 1.4rem 1.2rem; }
.page-thumb--empty span:not(.page-thumb__n) { display: block; height: 7px; background: rgba(243, 244, 249, .14); }
.page-thumb--empty span:nth-child(1) { width: 55%; height: 12px; background: rgba(242, 193, 78, .45); margin-bottom: .5rem; }
.page-thumb--empty span:nth-child(4), .page-thumb--empty span:nth-child(8) { width: 70%; }
.pages__soon { margin: .5rem 0 0; color: var(--on-cobalt-2); font-size: .92rem; }

.lightbox { border: 2px solid var(--edge); padding: 0; background: var(--surface); color: var(--ink); max-width: min(92vw, 760px); width: 100%; box-shadow: 8px 8px 0 0 var(--drop); }
.lightbox::backdrop { background: rgba(5, 4, 11, .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lightbox__img { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #F7F6F1; }
.lightbox__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; padding: .7rem .9rem; border-top: 2px solid var(--edge); }
.lightbox__count { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.lightbox__bar .btn { min-height: 40px; white-space: nowrap; }

/* ---------- Motion + print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

}

@media print {
  .site-header, .site-footer, .updates, .news, .grain, .toast, .result__actions, .skip, .crumbs { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-layout { display: block; }
  .result__card { background: #fff !important; color: #000 !important; border: 1px solid #000; margin-top: 1rem; }
  .result__card * { color: #000 !important; }
  .calc__group { border-color: #999; break-inside: avoid; }
}
