/* ============================================================================
   DEENUNADAILY.COM — styles.css
   Family theme: THE HIFZ EUTOPIA visual system by Deenuna.
   Matte night ink · royal purple · royal gold · Amiri calligraphy.
   Alhamdulillah.
   ========================================================================== */

/* ---------- 1. TOKENS (mirrors C02_BASE + madrasa night system) ---------- */
:root {
  /* primary — royal purple */
  --p: #7C3AED;
  --p-dark: #6D28D9;
  --p-deep: #4C1D95;
  --p-light: #A78BFA;
  --p-lighter: #C4B5FD;
  --p-pale: #241E34;
  --p-glow: rgba(124, 58, 237, 0.14);

  /* accent — royal gold */
  --gold: #D4A843;
  --gold-l: #F0D78A;
  --gold-soft: #E9D6A8;
  --gold-d: #A57F3E;
  --gold-glow: rgba(212, 168, 67, 0.14);

  /* madrasa night surfaces */
  --night: #0D1416;
  --ink: #10191B;
  --slate: #182225;
  --slate-2: #141E20;
  --line: #2A3938;
  --line-soft: #223231;

  /* text */
  --t: #F3F0E7;
  --t2: #D4D1C6;
  --t3: #9DA79F;
  --t4: #6E7A75;
  --ivory: #F7F4EC;

  /* status */
  --grn: #54C19A;
  --red: #E78787;

  /* radii / shadows — layered, matte */
  --r: 16px;
  --r2: 24px;
  --sh: 0 4px 16px rgba(0, 0, 0, 0.22), 0 2px 4px rgba(0, 0, 0, 0.16);
  --sh-md: 0 8px 24px rgba(0, 0, 0, 0.28), 0 4px 8px rgba(0, 0, 0, 0.18);
  --sh-lg: 0 16px 48px rgba(0, 0, 0, 0.34), 0 8px 16px rgba(0, 0, 0, 0.2);
  --sh-purple: 0 8px 32px rgba(124, 58, 237, 0.22), 0 4px 8px rgba(124, 58, 237, 0.12);
  --sh-gold: 0 8px 32px rgba(212, 168, 67, 0.18), 0 4px 8px rgba(212, 168, 67, 0.1);

  /* fonts */
  --f: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f2: 'Outfit', -apple-system, sans-serif;
  --fa: 'Amiri', Georgia, serif;
  --fq: 'Amiri Quran', 'Amiri', Georgia, serif;

  --nav: 72px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f);
  background: var(--night);
  color: var(--t);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}
/* subtle geometric night overlay — family signature */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 12% 9%, rgba(124, 58, 237, 0.05), transparent 31%),
    radial-gradient(circle at 88% 93%, rgba(201, 162, 93, 0.04), transparent 34%),
    linear-gradient(45deg, transparent 48%, rgba(124, 58, 237, 0.02) 49%, rgba(124, 58, 237, 0.02) 51%, transparent 52%);
  background-size: auto, auto, 36px 36px;
}
img { max-width: 100%; display: block; }
a { color: var(--p-light); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--gold-l); }
.container { width: min(1120px, 92%); margin-inline: auto; }
.arabic { font-family: var(--fa); direction: rtl; }
.quranic { font-family: var(--fq); direction: rtl; }
::selection { background: var(--p); color: var(--ivory); }

/* ---------- 3. HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav);
  background: rgba(13, 20, 22, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header::after {
  content: ""; position: absolute; top: 100%; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.14), rgba(212, 168, 67, 0.12), rgba(167, 139, 250, 0.14), transparent);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand img { width: 44px; height: 44px; border-radius: 12px; filter: drop-shadow(0 4px 10px rgba(124, 58, 237, 0.35)); }
.brand-name { font-family: var(--f2); font-weight: 800; font-size: 1.22rem; letter-spacing: -0.01em; color: var(--p-lighter); }
.brand-name span { color: var(--gold); }
.site-nav { display: flex; align-items: center; gap: 1.7rem; }
.site-nav a {
  color: var(--t2); font-weight: 600; font-size: 0.88rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0; position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--p-light), var(--gold));
  transition: width 0.25s var(--ease-out);
}
.site-nav a:hover { color: var(--gold-soft); }
.site-nav a:hover::after, .site-nav a.active::after { width: 100%; }
.site-nav a.active { color: var(--gold); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 44px; height: 44px; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 24px; height: 2px; background: var(--gold);
  position: absolute; left: 10px; transition: 0.25s var(--ease);
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before { top: -7px; left: 0; }
.nav-toggle span::after { top: 7px; left: 0; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: rotate(45deg); top: 0; }
body.nav-open .nav-toggle span::after { transform: rotate(-45deg); top: 0; }

/* ---------- 4. HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--night);
  padding: clamp(4.5rem, 10vw, 7.5rem) 0 clamp(4rem, 9vw, 6.5rem);
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("pattern.png") center / 560px repeat;
  opacity: 0.5; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 8%, rgba(124, 58, 237, 0.18), transparent 70%),
    radial-gradient(ellipse 45% 30% at 50% 100%, rgba(212, 168, 67, 0.08), transparent 70%);
}
.hero > .container { position: relative; z-index: 1; }
.bismillah {
  font-family: var(--fq);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--gold-soft);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 26px rgba(212, 168, 67, 0.4);
}
.hero h1 {
  font-family: var(--f2);
  font-weight: 900;
  font-size: clamp(2.5rem, 6.4vw, 4.4rem);
  line-height: 1.08; letter-spacing: -0.03em;
  max-width: 20ch; margin-inline: auto;
  background: linear-gradient(115deg, var(--ivory) 15%, var(--p-lighter) 52%, var(--gold-l) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero h1 em { font-style: normal; }
.hero p.lede { max-width: 58ch; margin: 1.5rem auto 2.2rem; color: var(--t2); font-size: clamp(1rem, 2vw, 1.13rem); font-weight: 300; }
.date-chips { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 2.4rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 1.15rem; border-radius: 50px;
  border: 1px solid rgba(201, 162, 93, 0.35);
  background: var(--slate-2);
  color: var(--gold-soft); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.04em;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--p-light); box-shadow: 0 0 10px var(--p-light); }
.hero-cta { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- 5. BUTTONS — matte, family ---------- */
.btn {
  display: inline-block; padding: 0.9rem 2.1rem; border-radius: 50px;
  font-family: var(--f2); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.83rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  border: 1px solid transparent; cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: var(--sh-gold); }
.btn-gold:hover { background: var(--gold-l); color: var(--ink); transform: translateY(-2px); }
.btn-primary { background: var(--p); color: #fff; box-shadow: var(--sh-purple); }
.btn-primary:hover { background: var(--p-dark); color: #fff; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--t2); background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); transform: translateY(-2px); }

/* ---------- 6. SECTIONS ---------- */
section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; position: relative; }
.section-head { text-align: center; max-width: 66ch; margin: 0 auto 3rem; }
.eyebrow {
  display: inline-block; color: var(--gold); font-weight: 800;
  letter-spacing: 0.24em; text-transform: uppercase; font-size: 0.76rem; margin-bottom: 0.9rem;
}
.section-head h2 {
  font-family: var(--f2); font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(1.9rem, 4vw, 2.7rem); color: var(--ivory); line-height: 1.15;
}
.section-head p { color: var(--t3); margin-top: 0.9rem; font-weight: 300; }

/* ---------- 7. TODAY CARDS ---------- */
.today { background: var(--ink); }
.today::before, .tasbih::before, .newsletter::before {
  content: ""; position: absolute; inset: 0;
  background: url("pattern.png") center / 560px repeat; opacity: 0.35; pointer-events: none;
}
.today .container, .tasbih .container, .newsletter .container { position: relative; z-index: 1; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.card {
  background: var(--slate); border-radius: var(--r2);
  border: 1px solid var(--line);
  padding: 2.2rem 1.8rem; box-shadow: var(--sh);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.25s;
  display: flex; flex-direction: column; gap: 1rem; text-align: center;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--p), var(--gold));
  opacity: 0; transition: opacity 0.25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); border-color: var(--line); }
.card:hover::before { opacity: 1; }
.card .icon {
  width: 58px; height: 58px; margin-inline: auto; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--p-deep), var(--slate-2));
  color: var(--gold-l); font-size: 1.45rem;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.16);
}
.card h3 { font-family: var(--f2); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--p-lighter); }
.card .arabic-quote { font-size: 1.75rem; line-height: 2.2; color: var(--gold-soft); }
.card .translation { color: var(--t2); font-size: 0.96rem; font-weight: 300; }
.card .source { margin-top: auto; color: var(--gold); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- 8. TASBIH ---------- */
.tasbih { background: var(--night); }
.tasbih-box { max-width: 480px; margin-inline: auto; text-align: center; }
.dhikr-tabs { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.dhikr-tab {
  font-family: var(--fa); font-size: 1.2rem;
  padding: 0.4rem 1.25rem; border-radius: 50px; cursor: pointer;
  background: var(--slate-2); color: var(--t2);
  border: 1px solid var(--line);
  transition: 0.2s var(--ease);
}
.dhikr-tab:hover { border-color: var(--p-light); color: var(--p-lighter); }
.dhikr-tab.active { background: var(--p); color: #fff; border-color: var(--p); box-shadow: var(--sh-purple); }
.tasbih-button {
  width: 216px; height: 216px; margin-inline: auto; border-radius: 50%;
  border: 2px solid rgba(201, 162, 93, 0.55); cursor: pointer;
  background:
    radial-gradient(circle at 35% 28%, rgba(124, 58, 237, 0.5), transparent 60%),
    radial-gradient(circle at 50% 60%, var(--slate), var(--night) 78%);
  color: var(--gold-l); display: grid; place-content: center; gap: 0.25rem;
  box-shadow: 0 0 0 12px rgba(124, 58, 237, 0.1), 0 24px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.08s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.tasbih-button:active { transform: scale(0.94); }
.tasbih-button .count { font-size: 3.5rem; font-weight: 900; font-family: var(--f2); line-height: 1; letter-spacing: -0.03em; }
.tasbih-button .goal { font-size: 0.8rem; letter-spacing: 0.24em; color: var(--t3); font-weight: 700; }
.tasbih-meta { margin-top: 1.5rem; display: flex; justify-content: center; gap: 2.2rem; color: var(--t3); font-size: 0.9rem; }
.tasbih-meta strong { color: var(--gold-soft); }
.tasbih-reset {
  margin-top: 1.2rem; background: none; border: 0; cursor: pointer;
  color: var(--p-light); text-decoration: underline; font-size: 0.85rem; letter-spacing: 0.08em;
}
.tasbih-pulse { animation: pulse 0.4s var(--ease); }
@keyframes pulse { 50% { box-shadow: 0 0 0 30px rgba(124, 58, 237, 0.16), 0 24px 60px rgba(0, 0, 0, 0.5); } }

/* ---------- 9. QUOTE STRIP ---------- */
.quote-strip {
  background: linear-gradient(135deg, #211C30, #172223 60%, #1B1710);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  text-align: center; padding: 3.4rem 0; position: relative; overflow: hidden;
}
.quote-strip::after {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.2), rgba(212, 168, 67, 0.18), rgba(167, 139, 250, 0.2), transparent);
}
.quote-strip blockquote {
  font-family: var(--f2); font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(1.3rem, 3vw, 1.9rem); max-width: 46ch; margin-inline: auto; line-height: 1.4;
  background: linear-gradient(110deg, var(--ivory), var(--gold-soft));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.quote-strip cite { display: block; margin-top: 1.1rem; font-style: normal; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.78rem; color: var(--p-light); }

/* ---------- 10. FEATURES ---------- */
.features { background: var(--ink); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.feature {
  background: var(--slate); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.9rem 1.4rem; box-shadow: var(--sh); text-align: center;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--sh-md); border-color: rgba(124, 58, 237, 0.4); }
.feature .glyph { font-size: 2rem; margin-bottom: 0.9rem; }
.feature h3 { font-family: var(--f2); font-weight: 700; color: var(--p-lighter); margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.feature p { font-size: 0.92rem; color: var(--t3); font-weight: 300; }

/* ---------- 11. NEWSLETTER ---------- */
.newsletter { background: var(--night); text-align: center; }
.newsletter-box {
  max-width: 760px; margin-inline: auto; padding: clamp(2.2rem, 6vw, 3.6rem);
  background: linear-gradient(135deg, var(--p-pale), var(--slate) 70%);
  border: 1px solid rgba(124, 58, 237, 0.35); border-radius: var(--r2);
  box-shadow: var(--sh-purple);
}
.newsletter h2 { font-family: var(--f2); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--ivory); }
.newsletter p { color: var(--t2); max-width: 52ch; margin: 0.9rem auto 2rem; font-weight: 300; }
.newsletter form { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.newsletter input[type="email"] {
  min-width: min(360px, 80vw); padding: 0.95rem 1.5rem; border-radius: 50px;
  border: 1px solid var(--line); background: var(--slate-2);
  color: var(--t); font-family: var(--f); font-size: 1rem; outline: none;
  transition: border-color 0.2s;
}
.newsletter input[type="email"]::placeholder { color: var(--t4); }
.newsletter input[type="email"]:focus { border-color: var(--p-light); box-shadow: 0 0 0 4px var(--p-glow); }
.form-note { margin-top: 1.1rem; min-height: 1.4em; color: var(--gold-soft); font-weight: 700; }

/* ---------- 12. FOOTER — family treatment ---------- */
.site-footer {
  background: linear-gradient(180deg, #0D0820, #080515);
  padding: 3.2rem 0 0; position: relative; overflow: hidden;
  border-top: 1px solid rgba(167, 139, 250, 0.06);
}
.site-footer::before {
  content: 'خَيْرُكُمْ مَنْ تَعَلَّمَ ٱلْقُرْآنَ وَعَلَّمَهُ';
  position: absolute; font-family: var(--fq); font-size: 3.2rem;
  color: var(--p-light); opacity: 0.035; direction: rtl;
  left: 50%; top: 38%; transform: translate(-50%, -50%);
  white-space: nowrap; pointer-events: none;
}
.site-footer::after {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.14), rgba(212, 168, 67, 0.12), rgba(167, 139, 250, 0.14), transparent);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; position: relative; z-index: 1; }
.footer-grid h4 { color: var(--gold); font-family: var(--f2); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 1.1rem; }
.footer-grid p { font-size: 0.92rem; max-width: 40ch; color: var(--t3); font-weight: 300; }
.footer-grid ul { list-style: none; display: grid; gap: 0.55rem; }
.footer-grid a { color: var(--t2); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--gold-soft); }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand img { width: 42px; border-radius: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(167, 139, 250, 0.08);
  padding: 1.3rem 0; text-align: center; font-size: 0.84rem; color: var(--t4);
  position: relative; z-index: 1;
}
.footer-bottom .arabic { color: var(--gold); }

/* ---------- 13. INNER PAGES ---------- */
.page-hero { background: var(--night); text-align: center; padding: 4.8rem 0 3.6rem; position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.page-hero::before { content: ""; position: absolute; inset: 0; background: url("pattern.png") center / 560px repeat; opacity: 0.45; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 55% 60% at 50% 0%, rgba(124, 58, 237, 0.16), transparent 70%); }
.page-hero > .container { position: relative; z-index: 1; }
.page-hero h1 {
  font-family: var(--f2); font-weight: 900; letter-spacing: -0.03em;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  background: linear-gradient(115deg, var(--ivory), var(--p-lighter) 60%, var(--gold-l));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.page-hero p { color: var(--t2); margin-top: 0.8rem; font-weight: 300; }
.prose { max-width: 76ch; margin-inline: auto; }
.prose h2 { font-family: var(--f2); font-weight: 700; color: var(--p-lighter); margin: 2.3rem 0 0.8rem; font-size: 1.45rem; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--t2); margin-bottom: 0.95rem; font-weight: 300; }
.prose ul { padding-left: 1.3rem; }
.prose strong { color: var(--gold-soft); }
.prose .panel { background: var(--slate); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem 1.8rem; margin: 1.6rem 0; }

/* ---------- 14. CONTACT ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem; align-items: start; }
.contact-card { background: var(--slate); border: 1px solid var(--line); border-radius: var(--r2); padding: 2rem; box-shadow: var(--sh); display: grid; gap: 1.3rem; }
.contact-card .row { display: flex; gap: 1rem; align-items: center; }
.contact-card .row .icon { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--p-deep), var(--slate-2)); color: var(--gold-l); display: grid; place-items: center; flex-shrink: 0; }
.contact-card .row strong { display: block; color: var(--p-lighter); font-family: var(--f2); }
.contact-card .row span { color: var(--t3); font-size: 0.92rem; }
form.fields { display: grid; gap: 1.1rem; background: var(--slate); border: 1px solid var(--line); border-radius: var(--r2); padding: 2rem; box-shadow: var(--sh); }
form.fields label { font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-family: var(--f2); }
form.fields input, form.fields textarea {
  width: 100%; margin-top: 0.45rem; padding: 0.85rem 1.1rem;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--slate-2); font-family: var(--f); font-size: 1rem; color: var(--t);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
form.fields input:focus, form.fields textarea:focus { border-color: var(--p-light); box-shadow: 0 0 0 4px var(--p-glow); }

/* ---------- 15. ERROR PAGES ---------- */
.error-wrap { min-height: calc(100vh - var(--nav)); display: grid; place-content: center; text-align: center; background: var(--night); padding: 4rem 1rem; position: relative; overflow: hidden; }
.error-wrap::before { content: ""; position: absolute; inset: 0; background: url("pattern.png") center / 560px repeat; opacity: 0.4; }
.error-wrap::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 50% 40% at 50% 35%, rgba(124, 58, 237, 0.16), transparent 70%); }
.error-wrap > * { position: relative; z-index: 1; }
.error-code {
  font-family: var(--f2); font-weight: 900; letter-spacing: -0.04em;
  font-size: clamp(5.5rem, 18vw, 9.5rem); line-height: 1;
  background: linear-gradient(120deg, var(--p-light), var(--gold-l));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.35));
}
.error-wrap h1 { font-family: var(--f2); font-weight: 700; font-size: clamp(1.5rem, 4vw, 2.3rem); margin: 0.7rem 0 1rem; color: var(--ivory); }
.error-wrap p { color: var(--t2); max-width: 48ch; margin: 0 auto 2rem; font-weight: 300; }
.error-arabic { font-family: var(--fq); color: var(--gold-soft); font-size: 1.5rem; margin-bottom: 1.8rem; text-shadow: 0 0 20px rgba(212, 168, 67, 0.35); }

/* ---------- 16. REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 17. RESPONSIVE ---------- */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: var(--nav); left: 0; right: 0;
    background: rgba(8, 5, 21, 0.98); flex-direction: column; gap: 0;
    max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease);
    border-bottom: 1px solid var(--line-soft);
  }
  body.nav-open .site-nav { max-height: 420px; }
  .site-nav a { padding: 1.1rem 0; width: 80%; text-align: center; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
