:root {
    --midnight: #0a0e1a;
    --midnight-rgb: 10, 14, 26;
    --surface-rgb: 31, 41, 66;
    --footer-bg: #06080f;
    --indigo: #131a2e;
    --surface: #1f2942;
    --gold: #c9a96e;
    --gold-deep: #a8884a;
    --parchment: #f4ecd8;
    --linen: #e8e4d8;
    --stone: #5f5e5a;
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'Inter', 'Helvetica Neue', sans-serif;
  }
  html[data-theme="light"] {
    --midnight: #f7f2e9;
    --indigo: #efe7d6;
    --surface: #ffffff;
    --parchment: #211f1a;
    --linen: #46433b;
    --gold: #9c7a37;
    --gold-deep: #7c6029;
    --stone: #6f6e68;
    --midnight-rgb: 247, 242, 233;
    --surface-rgb: 255, 255, 255;
    --footer-bg: #ece2cd;
  }
  .theme-toggle {
    background: none; border: none; cursor: pointer; padding: 6px;
    color: var(--gold); display: flex; align-items: center;
    opacity: 0.8; transition: opacity 0.2s;
  }
  .theme-toggle:hover { opacity: 1; }
  .theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }
  .theme-toggle .icon-sun { display: block; }
  .theme-toggle .icon-moon { display: none; }
  html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
  html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--midnight);
    color: var(--linen);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
  }

  /* ========== NAV ========== */
  nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.2rem 3rem;
    background: rgba(var(--midnight-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 0.5px solid rgba(201, 169, 110, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-decoration: none;
  }
  .nav-brand svg { width: 42px; height: 38px; }
  .nav-brand-text {
    font-family: var(--serif);
    font-size: 1.5rem;
    color: var(--parchment);
    letter-spacing: 0.02em;
  }
  .nav-brand-text em {
    color: var(--gold);
    font-style: italic;
  }
  .nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
  }
  .nav-links a {
    color: var(--linen);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 400;
    transition: color 0.3s;
    position: relative;
  }
  .nav-links a:hover, .nav-links a.active { color: var(--gold); }
  .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 0;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.3s;
  }
  .nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

  /* Mobile hamburger button (hidden on desktop) */
  .nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 12px;
    cursor: pointer;
    margin: -12px;
  }
  .nav-toggle-bar {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--gold);
    margin: 5px 0;
    transition: all 0.3s;
  }
  .nav-toggle.open .nav-toggle-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .nav-toggle.open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  /* Mobile drawer (full-screen overlay) */
  .mobile-drawer {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(var(--midnight-rgb), 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 90;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 5rem 2rem 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .mobile-drawer.open {
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-drawer a {
    color: var(--linen);
    text-decoration: none;
    font-family: var(--serif);
    font-size: 1.6rem;
    padding: 0.85rem 1.5rem;
    transition: color 0.2s;
    text-align: center;
  }
  .mobile-drawer a:hover, .mobile-drawer a.active {
    color: var(--gold);
  }
  .mobile-drawer-rule {
    width: 60px;
    height: 0.5px;
    background: rgba(201, 169, 110, 0.3);
    margin: 0.5rem 0;
  }
  .mobile-drawer-tagline {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.65;
    margin-top: 1rem;
  }

  /* ========== PAGE HEADER ========== */
  .page-header {
    padding: 10rem 2rem 5rem;
    text-align: center;
    background: radial-gradient(ellipse at center top, var(--indigo) 0%, var(--midnight) 70%);
    border-bottom: 0.5px solid rgba(201, 169, 110, 0.1);
    position: relative;
  }
  .page-header .stars {
    position: absolute; inset: 0;
    background-image:
      radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.4), transparent),
      radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.4), transparent),
      radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.4), transparent);
    opacity: 0.4;
    pointer-events: none;
  }
  .page-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
    display: block;
    position: relative;
  }
  .page-header h1 {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    color: var(--parchment);
    letter-spacing: 0.01em;
    margin-bottom: 1rem;
    position: relative;
  }
  .page-header h1 em { color: var(--gold); font-style: italic; }
  .page-header p {
    max-width: 650px;
    margin: 0 auto;
    color: var(--linen);
    opacity: 0.75;
    font-size: 1.05rem;
    position: relative;
  }
  .star-divider {
    width: 30px;
    height: 30px;
    margin: 1.5rem auto;
    opacity: 0.5;
    display: block;
    position: relative;
  }

  /* ========== SECTIONS ========== */
  section { padding: 6rem 2rem; }
  .container { max-width: 1100px; margin: 0 auto; }
  .narrow { max-width: 800px; margin: 0 auto; }

  /* ========== BUTTONS ========== */
  .btn {
    display: inline-block;
    padding: 1rem 2.2rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.3s;
    cursor: pointer;
    border: 0.5px solid var(--gold);
    background: transparent;
    color: var(--gold);
  }
  .btn:hover {
    background: rgba(201, 169, 110, 0.1);
    transform: translateY(-2px);
  }
  .btn-primary {
    background: var(--gold);
    color: var(--midnight);
    font-weight: 500;
  }
  .btn-primary:hover {
    background: var(--parchment);
    border-color: var(--parchment);
  }

  /* ========== FOOTER ========== */
  footer {
    background: var(--footer-bg);
    padding: 4rem 3rem 2rem;
    border-top: 0.5px solid rgba(201, 169, 110, 0.15);
    margin-top: 4rem;
  }
  .footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
  }
  .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .footer-brand svg { width: 50px; height: 42px; }
  .footer-brand-text {
    font-family: var(--serif);
    font-size: 1.6rem;
    color: var(--parchment);
  }
  .footer-brand-text em {
    color: var(--gold);
    font-style: italic;
  }
  .footer-tagline {
    color: var(--linen);
    opacity: 0.6;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    max-width: 320px;
  }
  .footer-col h4 {
    font-family: var(--sans);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 500;
  }
  .footer-col ul { list-style: none; }
  .footer-col li { margin-bottom: 0.6rem; }
  .footer-col a {
    color: var(--linen);
    opacity: 0.65;
    text-decoration: none;
    font-size: 0.85rem;
    transition: opacity 0.3s, color 0.3s;
  }
  .footer-col a:hover { opacity: 1; color: var(--gold); }
  .footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 0.5px solid rgba(201, 169, 110, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .footer-bottom p {
    font-size: 0.75rem;
    color: var(--linen);
    opacity: 0.4;
  }
  .acrux-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--linen);
    opacity: 0.5;
    text-decoration: none;
  }
  .acrux-badge:hover { opacity: 0.85; }
  .acrux-badge svg { width: 60px; height: auto; }

  /* Breadcrumb */
  .breadcrumb {
    background: rgba(var(--midnight-rgb), 0.6);
    border-bottom: 0.5px solid rgba(201, 169, 110, 0.12);
    padding: 1rem 2rem;
    margin-top: 5rem;
  }
  /* When a breadcrumb precedes the page-header, reduce the page-header's top padding */
  .breadcrumb + .page-header {
    padding-top: 4rem;
  }
  .breadcrumb-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
  }
  .breadcrumb-inner a {
    color: var(--gold);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
  }
  .breadcrumb-inner a:hover { opacity: 1; }
  .breadcrumb-sep { color: var(--gold); opacity: 0.4; }
  .breadcrumb-current { color: var(--linen); opacity: 0.65; }
  @media (max-width: 800px) {
    .breadcrumb { padding: 0.85rem 1.25rem; }
    .breadcrumb-inner { font-size: 0.62rem; gap: 0.5rem; }
  }

  @media (max-width: 800px) {
    nav { padding: 0.85rem 1.25rem; }
    .nav-brand svg { width: 36px; height: 32px; }
    .nav-brand-text { font-size: 1.25rem; }
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    .mobile-drawer { display: flex; }
    .page-header { padding: 7rem 1.25rem 3.5rem; }
    section { padding: 3.5rem 1.25rem; }
    footer { padding: 3rem 1.5rem 2rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2.5rem; text-align: center; }
    .footer-brand { justify-content: center; }
  }
  @media (max-width: 480px) {
    .nav-brand-text { font-size: 1.1rem; }
  }

  /* Sūrah header */
  .surah-header {
    text-align: center;
    padding: 4rem 2rem 2.5rem;
    background: radial-gradient(ellipse at center, rgba(var(--surface-rgb), 0.6), transparent 70%);
  }
  .surah-header-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.85;
    margin-bottom: 1.25rem;
  }
  .surah-header h1 {
    font-family: var(--serif);
    font-size: 4rem;
    color: var(--parchment);
    line-height: 1;
    margin-bottom: 0.6rem;
    direction: rtl;
  }
  .surah-header h2 {
    font-family: var(--serif);
    font-size: 1.85rem;
    color: var(--gold);
    font-style: italic;
    margin-bottom: 0.5rem;
    font-weight: 400;
  }
  .surah-header .meaning {
    color: var(--linen);
    opacity: 0.78;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
  }
  .surah-header .meta {
    color: var(--linen);
    opacity: 0.55;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  .surah-header .meta span { color: var(--gold); margin: 0 0.6rem; opacity: 0.6; }

  /* Bismillah ornament — only shown on sūrahs that begin with it (i.e. all except At-Tawbah and only Al-Fatiha shows its own bismillah as verse 1) */
  .bismillah {
    text-align: center;
    padding: 1.5rem 2rem 0.5rem;
    color: var(--parchment);
    font-family: var(--serif);
    font-size: 2rem;
    direction: rtl;
    line-height: 1;
  }
  .bismillah-translit {
    color: var(--gold);
    opacity: 0.7;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
    direction: ltr;
  }
