/* HMAASAH v1.1 — all visual values use semantic tokens. */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #000000;
  --panel-hover: #101010;
  --text: #ffffff;
  --text-muted: #bec4c9;
  --text-faint: #969da4;
  --accent: #d8bc83;
  --accent-contrast: #000000;
  --border: #373737;
  --border-strong: #595959;
  --line: #272727;
  --focus: #f0d9a4;
  --hover-wash: rgba(216,188,131,.08);
  --shadow: 0 16px 40px rgba(0,0,0,.18);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f6f5f2;
  --text: #161616;
  --text-muted: #555b63;
  --text-faint: #646a70;
  --accent: #79591f;
  --accent-contrast: #ffffff;
  --border: #d9d9d9;
  --border-strong: #a1a1a1;
  --line: #e9e8e5;
  --focus: #79591f;
  --hover-wash: rgba(121,89,31,.08);
  --shadow: 0 16px 40px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.6; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-contrast); }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--accent); color: var(--accent-contrast); border-radius: 8px; padding: 10px 18px; font-weight: 700; }
.skip-link:focus { top: 12px; }
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.sidebar { min-height: 100dvh; position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 34px 20px 26px; }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; font-size: 20px; color: var(--accent); font-weight: 750; letter-spacing: .135em; line-height: 1; }
.brand-symbol { font-size: 22px; font-weight: 400; }
.sidebar-caption { color: var(--text-faint); font-size: 10px; letter-spacing: .22em; margin: 16px 0 42px 34px; }
.desktop-nav { display: grid; gap: 5px; }
.desktop-nav a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 12px; color: var(--text-muted); font-weight: 570; transition: color .15s, background .15s; }
.desktop-nav a:hover { color: var(--text); background: var(--panel-hover); }
.desktop-nav a[aria-current="page"] { color: var(--accent); background: var(--hover-wash); }
.nav-icon { display: inline-flex; flex: none; width: 21px; height: 21px; align-items: center; justify-content: center; }
.nav-icon svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 12px 0; }
.sidebar-foot p { color: var(--accent); font-size: 13px; margin: 0 0 16px; }
.small-label { color: var(--text-faint); font-size: 11px; }
.app-content { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.topbar { height: 74px; min-height: 74px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 clamp(20px,4vw,54px); }
.header-context { color: var(--text-faint); font-size: 11px; letter-spacing: .16em; font-weight: 680; }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.theme-switch, .shop-shortcut { min-height: 41px; border-radius: 11px; padding: 8px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 650; font-size: 13px; }
.theme-switch { background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); }
.theme-switch:hover { background: var(--panel-hover); }
.theme-symbol { color: var(--accent); font-size: 21px; line-height: 1; }
.shop-shortcut { background: var(--accent); color: var(--accent-contrast); border: 1px solid var(--accent); }
.shop-shortcut:hover, .primary-button:hover { filter: brightness(.92); }
.mobile-brand { display: none; }
#main { flex: 1; width: 100%; outline: none; }
.page { width: min(1120px,100%); margin: auto; padding: 42px clamp(20px,4vw,54px) 80px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 12px; }
.page-title { font-size: clamp(30px,3.2vw,45px); line-height: 1.19; margin: 0; letter-spacing: -.038em; font-weight: 720; }
.page-description { max-width: 650px; color: var(--text-muted); margin: 15px 0 0; line-height: 1.8; }
.hero { padding: clamp(26px,5vw,58px); border: 1px solid var(--border); border-radius: 23px; position: relative; overflow: hidden; margin-bottom: 36px; background: var(--panel); }
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 340px; height: 340px; border: 1px solid var(--border); border-radius: 50%; pointer-events: none; }
.hero::before { content: ""; position: absolute; right: -70px; top: -100px; width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 50%; pointer-events: none; }
.hero .page-title { max-width: 620px; position: relative; z-index: 1; }
.hero .page-description { position: relative; z-index: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; position: relative; z-index: 1; }
.primary-button, .secondary-button { min-height: 45px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; font-size: 13px; font-weight: 700; transition: filter .15s, background .15s; }
.primary-button { color: var(--accent-contrast); background: var(--accent); border: 1px solid var(--accent); }
.secondary-button { color: var(--text); background: transparent; border: 1px solid var(--border-strong); }
.secondary-button:hover { background: var(--panel-hover); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.section-heading { font-size: 21px; line-height: 1.4; letter-spacing: -.025em; margin: 0; }
.section-note { color: var(--text-faint); font-size: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 38px; }
.feature-card { border: 1px solid var(--border); background: var(--panel); padding: 24px; border-radius: 17px; min-height: 190px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s; }
a.feature-card:hover { border-color: var(--accent); background: var(--panel-hover); }
.feature-card .card-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); color: var(--accent); border-radius: 11px; margin-bottom: 7px; }
.feature-card .card-icon svg { width: 23px; height: 23px; }
.feature-card h3 { margin: 0; font-size: 17px; letter-spacing: -.018em; font-weight: 690; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.feature-card .card-footer { margin-top: auto; padding-top: 15px; font-size: 11px; font-weight: 650; color: var(--accent); }
.status-tag { display: inline-flex; border: 1px solid var(--border); border-radius: 99px; font-size: 11px; padding: 3px 9px; color: var(--text-muted); width: fit-content; margin-top: 6px; }
.intro-strip { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; border: 1px solid var(--border); border-radius: 15px; color: var(--text-muted); font-size: 13px; margin-bottom: 36px; }
.intro-strip strong { color: var(--text); }
.intro-strip .star { color: var(--accent); font-size: 19px; }
.group-label { color: var(--accent); font-size: 12px; font-weight: 700; margin: 5px 0 17px; }
.content-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin: 0 0 38px; }
.content-item { border: 1px solid var(--border); border-radius: 14px; padding: 19px 20px; min-height: 115px; display: flex; flex-direction: column; gap: 6px; }
.content-item strong { font-size: 15px; line-height: 1.4; }
.content-item span { color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.content-item small { color: var(--accent); margin-top: auto; font-size: 11px; padding-top: 5px; }
.arabic-preview { font-family: "HMAASAH Quran","Noto Naskh Arabic","Amiri","Traditional Arabic",serif; direction: rtl; unicode-bidi: isolate; font-size: clamp(28px,4vw,42px); line-height: 2; text-align: center; color: var(--text); }
.quran-sample { border: 1px solid var(--border); border-radius: 17px; padding: 22px 28px; margin: 0 0 35px; }
.quran-sample p { margin: 0; }
.quran-sample .sample-note { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color: var(--text-faint); text-align: center; font-size: 12px; margin-top: 10px; }
.main-footer { padding: 20px clamp(20px,4vw,54px); border-top: 1px solid var(--line); color: var(--text-faint); font-size: 11px; display: flex; justify-content: space-between; gap: 10px; }
.mobile-nav { display: none; }
.loading-state, .noscript-note { padding: 50px 20px; text-align: center; color: var(--text-muted); }
@font-face { font-family: "HMAASAH Quran"; src: url("./fonts/lpmq-isep-misbah.ttf") format("truetype"); font-style: normal; font-weight: normal; font-display: swap; }
@media (max-width: 1080px) { .app-shell { grid-template-columns: 214px minmax(0,1fr); } .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .sidebar { padding-inline: 13px; } }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 66px; min-height: 66px; padding-inline: 20px; }
  .mobile-brand { display: inline-flex; font-size: 17px; letter-spacing: .12em; }
  .mobile-brand .brand-symbol { font-size: 19px; }
  .header-context { display: none; }
  .header-actions { gap: 8px; }
  .theme-switch { min-height: 37px; padding: 6px 10px; }
  .shop-shortcut { min-height: 37px; padding: 7px 12px; }
  .page { padding: 27px 18px calc(110px + env(safe-area-inset-bottom)); }
  .hero { padding: 29px 24px; border-radius: 19px; }
  .hero::before,.hero::after { opacity: .42; }
  .hero-actions { gap: 9px; }
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
  .feature-card { padding: 17px; min-height: 185px; border-radius: 15px; }
  .content-list { grid-template-columns: 1fr; gap: 10px; }
  .main-footer { display: none; }
  .mobile-nav { display: block; position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav-links { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); min-height: 68px; }
  .mobile-nav a { min-width: 0; padding: 9px 1px 7px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: 10px; color: var(--text-muted); font-weight: 570; }
  .mobile-nav a .nav-icon { height: 23px; }
  .mobile-nav a[aria-current="page"] { color: var(--accent); }
}
@media (max-width: 390px) { .card-grid { grid-template-columns: 1fr; } .feature-card { min-height: 145px; } .mobile-nav a { font-size: 9px; } .page-title { font-size: 31px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

