/* ==========================================================
   موري — رواية محمد طايع
   ========================================================== */

:root {
    --navy: #162638;
    --navy-deep: #0d1826;
    --navy-ink: #101d2c;
    --ink: #f6efe0;
    --ink-dim: #cfc4ad;
    --gold: #af915f;
    --gold-bright: #d4af6a;
    --amber: #d69900;
    --cream: #fce1b6;
    --green: #2e9e6b;
    --ease-cine: cubic-bezier(.2, .6, 0, 1);
    --font-display: 'Aref Ruqaa', 'Amiri', serif;
    --font-head: 'Amiri', serif;
    --font-body: 'Noto Naskh Arabic', 'Amiri', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
}

body {
    font-family: var(--font-body);
    background: var(--navy-deep);
    color: var(--ink);
    line-height: 2;
    font-size: 1.1rem;
    overflow-x: hidden;
}

::selection {
    background: var(--amber);
    color: #1a1206;
}

/* طبقة الحبيبات الورقية */
.grain {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 22px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ============ الفاصل الورقي الممزق ============ */
.tear {
    display: block;
    width: 100%;
    height: 60px;
    margin-bottom: -1px;
}

.tear.flip {
    transform: scaleY(-1);
}

/* ============ الواجهة ============ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--navy-deep);
}

.hero-bg {
    position: absolute;
    inset: -12% 0;
    z-index: 0;
    will-change: transform;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.15);
}

.hero-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top, rgba(10, 16, 24, .96) 0%, rgba(10, 16, 24, .45) 45%, rgba(10, 16, 24, .55) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 90px 20px 120px;
}

.kicker {
    color: var(--cream);
    font-size: 1rem;
    letter-spacing: .12em;
    margin-bottom: 8px;
}

.title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5.5rem, 20vw, 13rem);
    line-height: 1.25;
    color: var(--amber);
    text-shadow: 0 6px 40px rgba(0, 0, 0, .65);
    margin-bottom: 4px;
}

.author {
    font-family: var(--font-head);
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    color: var(--ink);
    margin-bottom: 10px;
}

.tagline {
    font-family: var(--font-head);
    color: var(--gold-bright);
    font-size: clamp(1.05rem, 3vw, 1.3rem);
    margin-bottom: 38px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* أزرار */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px 38px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .35s var(--ease-cine), box-shadow .35s var(--ease-cine), background .35s;
}

.btn-gold {
    background: linear-gradient(135deg, var(--amber), #b57a00);
    color: #1c1204;
    box-shadow: 0 6px 26px rgba(214, 153, 0, .35);
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 34px rgba(214, 153, 0, .5);
}

.btn-ghost {
    border-color: rgba(246, 239, 224, .5);
    color: var(--ink);
    background: rgba(13, 24, 38, .3);
}

.btn-ghost:hover {
    border-color: var(--gold-bright);
    color: var(--cream);
    transform: translateY(-3px);
}

.btn-dark {
    background: var(--navy-ink);
    color: var(--cream);
    box-shadow: 0 6px 20px rgba(16, 29, 44, .4);
}

.btn-dark:hover {
    transform: translateY(-3px);
    background: var(--navy);
}

.btn-green {
    background: linear-gradient(135deg, #35b57c, #1f7a50);
    color: #fff;
    box-shadow: 0 6px 26px rgba(46, 158, 107, .4);
}

.btn-big {
    font-size: 1.25rem;
    padding: 18px 64px;
}

/* الختم الدوّار */
.seal {
    position: absolute;
    z-index: 3;
    top: 34px;
    inset-inline-start: 34px;
    width: 118px;
    height: 118px;
}

.seal svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.seal-text {
    font-family: var(--font-head);
    font-size: 10.5px;
    fill: var(--gold-bright);
    letter-spacing: .18em;
}

.seal-center {
    font-family: var(--font-display);
    font-size: 26px;
    fill: var(--amber);
}

.seal svg {
    animation: spin 22s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* مؤشر النزول */
.scroll-hint {
    position: absolute;
    z-index: 3;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--ink-dim);
    font-size: .85rem;
    text-decoration: none;
    transition: color .3s;
}

.scroll-hint:hover { color: var(--cream); }

.scroll-hint i {
    display: block;
    width: 1px;
    height: 44px;
    background: linear-gradient(to bottom, transparent, var(--gold));
    animation: drip 2.2s var(--ease-cine) infinite;
}

@keyframes drip {
    0% { transform: scaleY(0); transform-origin: top; }
    45% { transform: scaleY(1); transform-origin: top; }
    55% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============ المقتبسات ============ */
.quotes {
    background: var(--navy-deep);
    padding: 70px 0 90px;
    text-align: center;
}

.section-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(1.7rem, 5vw, 2.4rem);
    color: var(--cream);
    margin-bottom: 54px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    display: block;
    width: 70px;
    height: 2px;
    margin: 10px auto 0;
    background: linear-gradient(to left, transparent, var(--gold), transparent);
}

.quotes blockquote {
    margin: 0 auto 44px;
    max-width: 620px;
}

.quotes blockquote:last-child { margin-bottom: 0; }

.quotes blockquote p {
    font-family: var(--font-head);
    font-size: clamp(1.4rem, 4.5vw, 1.9rem);
    color: var(--ink);
}

.quotes blockquote::before {
    content: "❖";
    display: block;
    color: var(--gold);
    font-size: 1rem;
    margin-bottom: 14px;
}

/* ============ الفصل المجاني (ورقة الكتاب) ============ */
.preview {
    background: var(--navy-deep);
    padding: 0 0 80px;
}

.paper {
    position: relative;
    background: var(--ink);
    color: #2a2118;
    max-width: 680px;
    margin: 0 auto;
    padding: 64px 52px 46px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.paper::before,
.paper::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    height: 14px;
    background: inherit;
    clip-path: polygon(0 100%, 3% 20%, 7% 75%, 12% 10%, 18% 80%, 24% 25%, 30% 70%, 37% 15%, 44% 85%, 51% 30%, 58% 75%, 65% 10%, 72% 70%, 79% 20%, 86% 80%, 92% 25%, 97% 70%, 100% 100%);
}

.paper::before { top: -13px; transform: scaleY(-1); }
.paper::after { bottom: -13px; }

.chapter-label {
    text-align: center;
    color: var(--gold);
    font-size: .95rem;
    letter-spacing: .1em;
    margin-bottom: 4px;
}

.chapter-title {
    font-family: var(--font-display);
    font-weight: 700;
    text-align: center;
    font-size: clamp(2rem, 6vw, 2.8rem);
    color: #1c150c;
    margin-bottom: 30px;
}

.chapter-text p {
    margin-bottom: 10px;
    font-size: 1.12rem;
}

.paper-fade {
    height: 90px;
    margin-top: -60px;
    position: relative;
    background: linear-gradient(to bottom, transparent, var(--ink) 85%);
    pointer-events: none;
}

.paper-teaser {
    text-align: center;
    color: #7a6c52;
    font-family: var(--font-head);
    margin: 18px 0 26px;
}

.paper .btn {
    display: table;
    margin: 0 auto;
}

/* ============ الشراء ============ */
.buy {
    background: var(--navy);
    padding: 80px 0 90px;
    text-align: center;
}

.download-banner {
    max-width: 560px;
    margin: 0 auto 60px;
    padding: 40px 30px;
    border: 1px solid rgba(53, 181, 124, .55);
    background: rgba(46, 158, 107, .1);
    animation: rise .6s var(--ease-cine);
}

.download-banner h2 {
    font-family: var(--font-head);
    color: #4bd598;
    margin-bottom: 8px;
}

.download-banner p { color: var(--ink-dim); margin-bottom: 22px; }

.price {
    margin-bottom: 26px;
}

.price .amount {
    font-family: var(--font-display);
    font-size: clamp(4rem, 14vw, 6.5rem);
    color: var(--amber);
    line-height: 1;
}

.price .currency {
    font-family: var(--font-head);
    font-size: 1.6rem;
    color: var(--cream);
}

.included {
    list-style: none;
    max-width: 460px;
    margin: 0 auto 40px;
    text-align: right;
}

.included li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(175, 145, 95, .22);
    color: var(--ink-dim);
}

.included li::before {
    content: "—";
    color: var(--gold);
    margin-inline-end: 12px;
}

.included li:last-child { border-bottom: none; }

.pay-note {
    margin-top: 22px;
    color: var(--ink-dim);
    font-size: .98rem;
}

.pay-note a { color: var(--gold-bright); }

/* الغلاف الخلفي */
.back-cover {
    max-width: 280px;
    margin: 0 auto 50px;
}

.back-cover img {
    width: 100%;
    border: 1px solid rgba(175, 145, 95, .45);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}

.back-cover figcaption {
    margin-top: 12px;
    color: var(--gold-bright);
    font-family: var(--font-head);
    font-size: .98rem;
}

/* ============ الجزء التاني ============ */
.part2 {
    background: var(--navy-ink);
    padding: 90px 0;
    text-align: center;
}

.part2-mark {
    color: var(--gold);
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.part2 h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    color: var(--amber);
    margin-bottom: 10px;
}

.part2-sub {
    color: var(--ink-dim);
    max-width: 480px;
    margin: 0 auto 34px;
}

.notify-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.notify-form input {
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 13px 18px;
    background: rgba(246, 239, 224, .06);
    border: 1px solid rgba(175, 145, 95, .4);
    color: var(--ink);
    min-width: 220px;
    transition: border-color .3s;
}

.notify-form input::placeholder { color: #8d8574; }

.notify-form input:focus {
    outline: none;
    border-color: var(--gold-bright);
}

.notify-msg {
    margin-top: 18px;
    color: #4bd598;
    min-height: 1.8em;
    font-weight: 600;
}

.notify-msg.error { color: #ff8080; }

.notify-foot {
    margin-top: 26px;
    font-size: .82rem;
    color: #776f5e;
}

/* ============ التذييل ============ */
.footer {
    background: var(--navy-deep);
    padding: 56px 0 44px;
    text-align: center;
}

.footer-title {
    font-family: var(--font-head);
    color: var(--cream);
    margin-bottom: 18px;
}

.share-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.share-link {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--gold-bright);
    cursor: pointer;
    padding: 4px 6px;
    border-bottom: 1px solid transparent;
    transition: border-color .3s, color .3s;
}

.share-link:hover {
    color: var(--cream);
    border-bottom-color: var(--gold);
}

.dot { color: #53492f; }

.copyright {
    color: #6f6650;
    font-size: .9rem;
}

/* ============ نافذة الدفع ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[hidden] { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 16, .9);
    animation: fadein .35s var(--ease-cine);
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--navy);
    border: 1px solid rgba(175, 145, 95, .45);
    padding: 44px 36px 36px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
    animation: rise .45s var(--ease-cine);
}

.modal-close {
    position: absolute;
    top: 12px;
    inset-inline-end: 16px;
    background: none;
    border: none;
    color: var(--ink-dim);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color .3s;
}

.modal-close:hover { color: var(--amber); }

.modal-panel h2 {
    font-family: var(--font-head);
    color: var(--cream);
    margin-bottom: 6px;
}

.modal-sub {
    color: var(--ink-dim);
    font-size: .98rem;
    margin-bottom: 26px;
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: .92rem;
    color: var(--cream);
    margin-bottom: 6px;
}

.field label small { color: #8d8574; }

.field input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 12px 14px;
    background: rgba(246, 239, 224, .06);
    border: 1px solid rgba(175, 145, 95, .4);
    color: var(--ink);
    transition: border-color .3s;
}

.field input:focus {
    outline: none;
    border-color: var(--gold-bright);
}

.methods-label {
    margin: 24px 0 12px;
    color: var(--cream);
    font-size: .95rem;
}

.methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: .98rem;
    padding: 13px 14px;
    background: rgba(13, 24, 38, .6);
    border: 1px solid rgba(175, 145, 95, .3);
    color: var(--ink);
    cursor: pointer;
    transition: border-color .3s, background .3s;
    text-align: right;
}

.method:hover {
    border-color: var(--amber);
    background: rgba(214, 153, 0, .08);
}

.method-tag {
    font-size: .72rem;
    color: var(--gold);
    border: 1px solid rgba(175, 145, 95, .4);
    padding: 1px 8px;
    white-space: nowrap;
}

.pay-msg {
    margin-top: 18px;
    color: #ff9d9d;
    min-height: 1.6em;
    font-size: .95rem;
}

.pay-msg.ok { color: #4bd598; }

.fawry-box {
    margin-top: 16px;
    padding: 18px;
    border: 1px dashed var(--gold);
    text-align: center;
}

.fawry-code {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--amber);
    letter-spacing: .15em;
    margin: 8px 0;
    direction: ltr;
}

.fawry-note { font-size: .88rem; color: var(--ink-dim); }

/* ============ حركات الظهور ============ */
.reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 1.1s var(--ease-cine), transform 1.1s var(--ease-cine);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

@keyframes fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: none; }
}

/* ============ موبايل ============ */
@media (max-width: 640px) {
    .seal {
        width: 88px;
        height: 88px;
        top: 20px;
        inset-inline-start: 20px;
    }

    .paper { padding: 54px 26px 36px; }

    .methods { grid-template-columns: 1fr; }

    .hero-cta .btn { width: 100%; max-width: 320px; }

    .notify-form input,
    .notify-form .btn { width: 100%; }
}
