@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;500;600;700;800&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

:root {
  --ink: #07131e;
  --ink-deep: #030b12;
  --panel: rgba(11, 30, 43, .78);
  --panel-soft: rgba(15, 40, 54, .58);
  --gold: #f7c978;
  --gold-bright: #ffe3a6;
  --gold-dim: #bf8a40;
  --red: #d84f47;
  --red-soft: #f28b7d;
  --cream: #fff6e6;
  --muted: #bbcad0;
  --line: rgba(247, 201, 120, .24);
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--cream);
  background: var(--ink);
  font-family: "Noto Naskh Arabic", Georgia, serif;
  overflow-x: hidden;
}
body::selection { background: var(--gold); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.ambient { position: fixed; z-index: -2; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: .32; }
.ambient-one { width: 35vw; height: 35vw; top: -15vw; right: -8vw; background: #633826; }
.ambient-two { width: 30vw; height: 30vw; bottom: -12vw; left: -8vw; background: #0a5362; }
.grain { position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }

.site-header {
  width: min(1420px, calc(100% - 72px));
  margin: 0 auto;
  padding: 28px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 220px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; color: var(--ink); background: linear-gradient(145deg, var(--gold-bright), var(--gold-dim)); border-radius: 50%; font: 800 1.3rem "Noto Kufi Arabic", sans-serif; box-shadow: 0 0 0 7px rgba(247,201,120,.08); }
.brand strong { display: block; color: var(--gold-bright); font: 700 .9rem "Noto Kufi Arabic", sans-serif; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; }
.main-nav { display: flex; gap: 8px; align-items: center; justify-content: center; }
.main-nav a { position: relative; padding: 8px 14px; color: var(--muted); font-size: .95rem; transition: color .3s ease, transform .3s ease; }
.main-nav a::after { content: ""; position: absolute; right: 14px; left: 14px; bottom: 0; height: 2px; transform: scaleX(0); transform-origin: center; background: var(--gold); transition: transform .3s ease; }
.main-nav a:hover, .main-nav a.active { color: var(--gold-bright); transform: translateY(-2px); }
.main-nav a.active::after { transform: scaleX(1); }
.main-nav span { color: var(--gold-dim); font: .66rem "Noto Kufi Arabic", sans-serif; margin-left: 6px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; min-width: 140px; justify-content: flex-end; }
.progress-label { color: var(--muted); font-size: .83rem; }
.progress-dots { display: flex; gap: 5px; direction: ltr; }
.progress-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #3d4d54; transition: all .4s ease; }
.progress-dots i.active { width: 24px; border-radius: 8px; background: var(--gold); box-shadow: 0 0 15px rgba(247,201,120,.5); }

#app { width: min(1420px, calc(100% - 72px)); margin: 0 auto; min-height: calc(100vh - 145px); }
.page { animation: pageIn .8s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); font: 600 .78rem "Noto Kufi Arabic", sans-serif; letter-spacing: .03em; }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--gold); }
.title-xl, h1, h2, h3 { margin: 0; font-family: "Noto Kufi Arabic", sans-serif; letter-spacing: -.06em; line-height: 1.35; }
.title-xl { font-size: clamp(2.6rem, 6vw, 6.8rem); color: var(--cream); }
.title-xl em { color: var(--gold); font-style: normal; }
.lead { color: var(--muted); font-size: clamp(1.12rem, 1.8vw, 1.45rem); line-height: 2; max-width: 640px; }

/* Cover */
.cover-page { min-height: calc(100vh - 140px); display: grid; align-items: center; position: relative; padding: 18px 0 48px; }
.cover-frame { min-height: min(720px, calc(100vh - 190px)); position: relative; overflow: hidden; display: flex; align-items: stretch; border: 1px solid rgba(247,201,120,.38); border-radius: 22px; box-shadow: var(--shadow); isolation: isolate; background: linear-gradient(90deg, #07131e 0%, #07131e 49%, #102a35 50%, #07131e 100%); }
.cover-frame::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(3,11,18,.06) 0%, rgba(3,11,18,.02) 48%, rgba(3,11,18,.46) 100%); pointer-events: none; }
.cover-frame::after { content: ""; position: absolute; inset: 14px; z-index: 2; border: 1px solid rgba(247,201,120,.14); border-radius: 15px; pointer-events: none; animation: frameGlow 6s ease-in-out infinite; }
@keyframes frameGlow { 0%,100% { opacity: .45; } 50% { opacity: 1; border-color: rgba(247,201,120,.3); } }
.cover-image { position: relative; z-index: 0; flex: 0 0 51%; width: 51%; height: 100%; min-height: 100%; padding: 18px; object-fit: contain; object-position: center; animation: imageDrift 17s ease-in-out infinite alternate; filter: saturate(.91) contrast(1.06); }
@keyframes imageDrift { from { transform: scale(1); } to { transform: scale(1.025) translate3d(1%, -1%, 0); } }
.cover-copy { position: relative; z-index: 2; width: 49%; align-self: center; padding: clamp(38px, 5vw, 76px) clamp(28px, 5vw, 74px); animation: copyRise 1s .15s both cubic-bezier(.2,.8,.2,1); }
@keyframes copyRise { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
.cover-copy .eyebrow { color: var(--gold-bright); }
.cover-copy .eyebrow::before { background: var(--gold-bright); }
.cover-copy h1 { margin: 18px 0 22px; font-size: clamp(2.5rem, 6vw, 5.8rem); }
.cover-copy p { margin: 0; color: #f8e9ce; font-size: clamp(1.15rem, 2vw, 1.6rem); line-height: 1.9; max-width: 510px; }
.cover-sub { display: flex; gap: 14px; align-items: center; margin-top: 34px; color: var(--gold-bright); font-size: 1rem; }
.cover-sub::before { content: ""; width: 56px; height: 1px; background: var(--gold); }
.cover-names { display: flex; gap: 25px; margin-top: 42px; color: rgba(255,246,230,.72); font-size: .92rem; }
.cover-names span { padding-left: 14px; border-left: 1px solid rgba(247,201,120,.4); }
.cover-names span:last-child { border: 0; padding: 0; }
.cover-stamp { position: absolute; z-index: 3; top: 28px; right: 32px; display: flex; align-items: center; gap: 8px; color: rgba(255,246,230,.68); font: 600 .68rem "Noto Kufi Arabic", sans-serif; letter-spacing: .04em; animation: stampIn 1.2s .55s both; }
.cover-stamp b { color: var(--gold); font-weight: 400; }
@keyframes stampIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.cover-meta { position: absolute; z-index: 3; left: 30px; bottom: 25px; color: rgba(255,246,230,.74); font-size: .8rem; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .14em; }
.cover-scroll { position: absolute; z-index: 3; right: 30px; bottom: 26px; display: flex; align-items: center; gap: 10px; color: rgba(255,246,230,.78); font-size: .83rem; }
.cover-scroll i { width: 36px; height: 1px; background: var(--gold); position: relative; }
.cover-scroll i::after { content: ""; position: absolute; right: 0; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: .35; transform: translateX(0); } 50% { opacity: 1; transform: translateX(-26px); } }
.cover-orbit { position: absolute; z-index: 2; top: 36px; left: 42%; width: 96px; height: 96px; border: 1px solid rgba(247,201,120,.36); border-radius: 50%; animation: orbit 9s linear infinite; }
.cover-orbit::before, .cover-orbit::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.cover-orbit::before { top: 12px; right: 5px; } .cover-orbit::after { bottom: 4px; left: 16px; background: var(--red-soft); }
@keyframes orbit { to { transform: rotate(360deg); } }

/* Shared pages */
.section-page { padding: 52px 0 80px; }
.page-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 46px; }
.page-heading-copy { max-width: 760px; }
.page-heading h1 { margin: 15px 0 14px; font-size: clamp(2.2rem, 4vw, 4.3rem); }
.page-heading .lead { margin: 0; }
.page-number { color: var(--gold-dim); font: 700 clamp(4rem, 10vw, 9rem) "Noto Kufi Arabic", sans-serif; line-height: .8; opacity: .68; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 30px 0 42px; }
.cards { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { position: relative; padding: 26px 26px 25px; overflow: hidden; background: linear-gradient(145deg, rgba(19,49,62,.76), rgba(7,20,30,.7)); border: 1px solid rgba(247,201,120,.16); border-radius: 15px; box-shadow: 0 15px 40px rgba(0,0,0,.16); transition: transform .35s ease, border-color .35s ease, background .35s ease; }
.card::before { content: ""; position: absolute; right: 0; top: 0; width: 52px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold)); transition: width .35s ease; }
.card:hover { transform: translateY(-6px); border-color: rgba(247,201,120,.5); background: linear-gradient(145deg, rgba(31,69,82,.86), rgba(7,20,30,.8)); }
.card:hover::before { width: 100%; }
.card h2, .card h3 { color: var(--gold-bright); font-size: 1.18rem; letter-spacing: -.04em; }
.card p { color: var(--muted); margin: 12px 0 0; line-height: 1.95; font-size: 1.04rem; }
.card strong { color: var(--cream); }
.card .mini-label { color: var(--red-soft); font: 600 .72rem "Noto Kufi Arabic", sans-serif; }
.icon-badge { display: inline-grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; color: var(--ink); background: var(--gold); border-radius: 12px 12px 4px 12px; font: 700 1rem "Noto Kufi Arabic", sans-serif; }

/* Reminder */
.reminder-intro { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: stretch; }
.definition-card { min-height: 100%; }
.definition-card .quote { margin: 20px 0 0; padding: 16px 18px; border-right: 2px solid var(--red); color: var(--cream); background: rgba(216,79,71,.08); line-height: 1.9; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; margin: 25px 0 40px; position: relative; }
.flow::before { content: ""; position: absolute; top: 29px; right: 10%; left: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); }
.flow-step { position: relative; z-index: 1; text-align: center; padding: 0 9px; }
.flow-step .step-no { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; background: var(--ink); color: var(--gold-bright); border: 1px solid var(--gold); border-radius: 50%; font: 700 1.1rem "Noto Kufi Arabic", sans-serif; box-shadow: 0 0 0 7px var(--ink); }
.flow-step h3 { color: var(--cream); font-size: 1rem; }
.flow-step p { margin: 6px 0 0; color: var(--muted); font-size: .93rem; line-height: 1.7; }
.notice { display: flex; gap: 18px; align-items: flex-start; padding: 23px 25px; background: linear-gradient(90deg, rgba(216,79,71,.14), rgba(247,201,120,.08)); border: 1px solid rgba(216,79,71,.3); border-right: 3px solid var(--red); border-radius: 13px; }
.notice-mark { color: var(--red-soft); font: 700 1.8rem "Noto Kufi Arabic", sans-serif; line-height: 1; }
.notice p { margin: 0; color: var(--cream); line-height: 1.9; font-size: 1.06rem; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pill { padding: 8px 16px; color: var(--gold-bright); background: rgba(247,201,120,.08); border: 1px solid rgba(247,201,120,.25); border-radius: 999px; font-size: .98rem; }
.compare { margin-top: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.compare > div { padding: 20px; border-radius: 12px; border-top: 3px solid var(--gold); background: rgba(247,201,120,.06); }
.compare > div:last-child { border-top-color: var(--red); }
.compare h3 { font-size: 1rem; }
.compare p { font-size: .98rem; }
.cta-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 48px; padding: 26px 30px; border: 1px solid var(--line); background: rgba(247,201,120,.04); border-radius: 14px; }
.cta-strip p { margin: 0; color: var(--cream); font-size: 1.15rem; }
.button { display: inline-flex; align-items: center; gap: 12px; padding: 13px 20px; border-radius: 5px 16px 16px 16px; color: var(--ink); background: linear-gradient(135deg, var(--gold-bright), var(--gold)); font: 700 .91rem "Noto Kufi Arabic", sans-serif; transition: transform .3s ease, box-shadow .3s ease; white-space: nowrap; }
.button:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(247,201,120,.2); }
.button .arrow { font-size: 1.2rem; }

/* Arguments */
.arg-intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: stretch; }
.definition-line { display: flex; gap: 15px; align-items: flex-start; }
.definition-line + .definition-line { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(247,201,120,.14); }
.definition-line b { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; background: var(--red); color: var(--cream); border-radius: 50%; font: 700 .8rem "Noto Kufi Arabic", sans-serif; }
.definition-line p { margin: 0; }
.order-card { background: linear-gradient(150deg, rgba(128,81,35,.36), rgba(7,20,30,.8)); }
.order-card h2 { margin-bottom: 17px; }
.order-list { counter-reset: order; list-style: none; padding: 0; margin: 0; }
.order-list li { counter-increment: order; display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--cream); border-bottom: 1px solid rgba(247,201,120,.12); }
.order-list li:last-child { border: 0; }
.order-list li::before { content: counter(order, arabic-indic); color: var(--gold); font: 700 1rem "Noto Kufi Arabic", sans-serif; }
.argument-grid { margin-top: 28px; counter-reset: argument; }
.argument-card { min-height: 230px; display: flex; flex-direction: column; }
.argument-card::after { counter-increment: argument; content: counter(argument, decimal-leading-zero); position: absolute; top: 16px; left: 18px; color: rgba(247,201,120,.14); font: 800 3.5rem "Noto Kufi Arabic", sans-serif; line-height: 1; }
.argument-card h3 { padding-left: 58px; }
.argument-card .example { margin-top: auto; padding: 11px 14px; border-right: 2px solid var(--gold); color: var(--cream); background: rgba(247,201,120,.06); line-height: 1.75; font-size: .98rem; }
.argument-card .example::before { content: "مثال · "; color: var(--gold); font-family: "Noto Kufi Arabic", sans-serif; font-size: .78rem; }
.argument-card:hover::after { color: rgba(247,201,120,.26); transform: translateX(-4px); transition: transform .35s ease, color .35s ease; }
.final-message { margin-top: 38px; padding: 34px; text-align: center; border: 1px solid rgba(247,201,120,.3); border-radius: 18px; background: radial-gradient(circle at center, rgba(247,201,120,.13), rgba(7,20,30,.55) 60%); }
.final-message h2 { color: var(--gold-bright); font-size: clamp(1.3rem, 3vw, 2.1rem); }
.final-message p { max-width: 680px; margin: 12px auto 0; color: var(--muted); font-size: 1.08rem; line-height: 1.9; }

.site-footer { width: min(1420px, calc(100% - 72px)); margin: 0 auto; padding: 25px 0 31px; display: flex; align-items: center; gap: 12px; color: rgba(187,202,208,.7); font-size: .82rem; }
.footer-line { flex: 1; height: 1px; background: rgba(247,201,120,.18); }

.reveal { opacity: 0; transform: translateY(18px); animation: reveal .7s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--delay, 0s); }
@keyframes reveal { to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .site-header, #app, .site-footer { width: min(100% - 36px, 760px); }
  .site-header { flex-wrap: wrap; padding-top: 20px; }
  .main-nav { order: 3; width: 100%; justify-content: flex-start; border-top: 1px solid rgba(247,201,120,.12); padding-top: 9px; }
  .progress-wrap { margin-right: auto; }
  .cover-frame { min-height: 680px; }
  .cover-image { object-position: 62% center; }
  .cover-copy { width: 82%; }
  .reminder-intro, .arg-intro { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .site-header, #app, .site-footer { width: calc(100% - 28px); }
  .brand { min-width: auto; }
  .brand small { display: none; }
  .progress-label { display: none; }
  .main-nav { overflow-x: auto; justify-content: space-between; }
  .main-nav a { padding: 8px 7px; font-size: .82rem; white-space: nowrap; }
  .main-nav a::after { right: 7px; left: 7px; }
  .cover-page { padding-top: 4px; }
  .cover-frame { display: block; min-height: 680px; border-radius: 15px; background: #091521; }
  .cover-frame::before { background: linear-gradient(0deg, rgba(3,11,18,.93) 0%, rgba(3,11,18,.46) 57%, rgba(3,11,18,.15) 100%); }
  .cover-frame::after { inset: 9px; }
  .cover-image { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; object-fit: cover; object-position: 62% center; }
  .cover-copy { width: 100%; padding: 45px 25px 90px; align-self: end; margin-top: 250px; }
  .cover-copy h1 { font-size: 2.5rem; }
  .cover-copy p { font-size: 1.15rem; }
  .cover-names { gap: 12px; font-size: .78rem; }
  .cover-stamp { top: 22px; right: 22px; font-size: .58rem; }
  .cover-meta { display: none; }
  .cover-scroll { right: 22px; bottom: 18px; font-size: .72rem; }
  .cover-orbit { left: 12%; top: 26px; width: 70px; height: 70px; }
  .section-page { padding-top: 26px; }
  .page-heading { display: block; margin-bottom: 30px; }
  .page-number { display: none; }
  .two-col, .three-col, .compare { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, 1fr); row-gap: 28px; }
  .flow::before { display: none; }
  .flow-step .step-no { box-shadow: 0 0 0 7px var(--ink); }
  .cta-strip { display: block; padding: 22px; }
  .cta-strip p { margin-bottom: 18px; font-size: 1rem; }
  .button { width: 100%; justify-content: center; }
  .card { padding: 21px; }
  .site-footer { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
