/* الخطوط مستضافة محليًا: المسيري للعناوين، ريدكس للواجهة، أميري للقراءة، عارف رقعة للمسة الخط */
@font-face { font-family: "El Messiri"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/el-messiri-arabic-wght-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "El Messiri"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/el-messiri-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap; src: url("fonts/readex-pro-arabic-wght-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-weight: 160 700; font-display: swap; src: url("fonts/readex-pro-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/amiri-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/amiri-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/amiri-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/amiri-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Aref Ruqaa"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/aref-ruqaa-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

/* ═══════════════════════════════════════════════════════════════
   يحيى أحمد — «مكتبة يحيى»
   كل نص كتاب، ولكل كتاب غلاف هندسي مولَّد وألوانه الخاصة.
   ورق كريمي، حبر دافئ، ولوحة ألوان: قرميدي، كوبالت، بترولي، برقوقي، زيتي، وردي ترابي.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper: #f4ede1;
  --paper-2: #ebe2cf;
  --paper-3: #e0d5bd;
  --ink: #1c1b18;
  --ink-2: #47433b;
  --mute: #847c6e;
  --line: rgba(28, 27, 24, .13);
  --line-2: rgba(28, 27, 24, .3);
  --accent: #d4532b;
  --cobalt: #2a45c2;
  --display: "El Messiri", "Readex Pro", Tahoma, sans-serif;
  --ui: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --read: "Amiri", "Traditional Arabic", Georgia, serif;
  --hand: "Aref Ruqaa", "Amiri", serif;
  --gut: clamp(18px, 4.6vw, 72px);
  --max: 1400px;
  --r: 18px;
  --ease: cubic-bezier(.22, .8, .16, 1);
  --shadow: 0 1px 1px rgba(40, 30, 10, .06), 0 10px 22px -8px rgba(40, 30, 10, .22), 0 34px 60px -30px rgba(40, 30, 10, .4);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #161512;
  --paper-2: #211f1b;
  --paper-3: #2c2923;
  --ink: #f1e9da;
  --ink-2: #cbc3b3;
  --mute: #978f80;
  --line: rgba(241, 233, 218, .12);
  --line-2: rgba(241, 233, 218, .3);
  --accent: #e8683f;
  --shadow: 0 1px 1px rgba(0,0,0,.3), 0 12px 26px -8px rgba(0,0,0,.6), 0 40px 70px -30px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background: var(--paper); color: var(--ink);
  font: 350 16px/1.75 var(--ui);
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.is-hidden { display: none !important; }

/* حركة التكوينات */
.art { width: 100%; height: 100%; }
.art .float { animation: bob 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.art .drift { animation: drift 11s ease-in-out infinite; transform-box: fill-box; }
.art .spin { animation: spin 22s linear infinite; }
@keyframes bob { 50% { transform: translateY(-14px); } }
@keyframes drift { 50% { transform: translate(-16px, 10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── أزرار ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 26px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 15px var(--ui); white-space: nowrap; transition: transform .35s var(--ease), background .3s, box-shadow .35s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(0,0,0,.5); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { transition: transform .4s var(--ease); }
.btn:hover svg { transform: translateX(-4px); }
.btn-light { background: var(--c-t); color: var(--c-bg); }

.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; font: 500 13px var(--ui); color: var(--mute); letter-spacing: .02em; }
.eb-line { width: 34px; height: 2px; background: var(--accent); border-radius: 2px; }

/* ───────── الإعلان ───────── */
.announce { position: relative; z-index: 60; display: flex; align-items: center; height: 44px; overflow: hidden; background: var(--ink); color: var(--paper); font: 500 14px var(--ui); }
.announce-link { position: absolute; inset: 0; z-index: 1; }
.announce-track { display: flex; width: max-content; animation: slide-rtl 40s linear infinite; }
.announce-track > div { display: flex; align-items: center; }
.announce-track span { padding: 0 26px; white-space: nowrap; }
.announce-track i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.announce:hover .announce-track { animation-play-state: paused; }
.announce-x { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; width: 50px; display: grid; place-items: center; background: var(--ink); box-shadow: 18px 0 18px -6px var(--ink); }
@keyframes slide-rtl { to { transform: translateX(50%); } }

/* ───────── الرأس ───────── */
.site-head { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px var(--gut); background: color-mix(in srgb, var(--paper) 82%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid transparent; transition: border-color .3s, background .5s; }
.scrolled .site-head { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-tile { width: 36px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; box-shadow: 0 4px 10px -4px rgba(0,0,0,.35); transition: transform .5s var(--ease); }
.brand:hover .brand-tile { transform: rotate(-6deg) scale(1.06); }
.mark { font: 700 22px/1 var(--display); }
.head-nav { display: flex; align-items: center; gap: 4px; }
.hn { min-height: 44px; padding: 8px 16px; border-radius: 999px; font: 450 14.5px var(--ui); display: inline-flex; align-items: center; transition: background .25s; }
.hn:hover { background: var(--paper-2); }
.hn.icon { width: 44px; padding: 0; justify-content: center; }
.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }

/* ═════════ الافتتاح ═════════ */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(30px, 6vh, 70px) var(--gut) clamp(60px, 10vh, 110px); display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(30px, 6vw, 110px); align-items: center; min-height: calc(100svh - 72px); }
.hero-name { font: 700 clamp(68px, 9.6vw, 164px)/1.02 var(--display); margin: 0; letter-spacing: -.01em; }
.hero-name span { color: var(--accent); }
.hero-tag { font: 700 clamp(26px, 2.8vw, 44px)/1.6 var(--hand); color: var(--cobalt); margin: 10px 0 26px; }
[data-theme="dark"] .hero-tag { color: #8fa2ff; }
.hero-intro { font: 300 clamp(18px, 1.6vw, 23px)/1.8 var(--ui); color: var(--ink-2); max-width: 26em; margin: 0 0 36px; }
.hero-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 28px; }
.hero-count { color: var(--mute); font-size: 14px; }
.hero-count b { color: var(--ink); font: 700 26px var(--display); margin-inline-end: 4px; }
.hero-art { position: relative; margin: 0; aspect-ratio: 4 / 5; max-height: 78vh; width: 100%; justify-self: center; cursor: pointer; }
.ha-frame { position: absolute; inset: 0 0 38px; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); opacity: 0; transform: scale(.94) rotate(-2deg); transition: opacity .8s var(--ease), transform 1s var(--ease); }
.ha-frame.on { opacity: 1; transform: none; z-index: 1; }
.ha-frame.out { opacity: 0; transform: scale(1.04) rotate(2deg); }
.hero-art figcaption { position: absolute; bottom: 0; right: 0; left: 0; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mute); }
.hero-art:hover .ha-frame.on { transform: rotate(1.2deg) scale(1.01); }

/* ═════════ شريط الموضوعات ═════════ */
.marquee { overflow: hidden; padding: 22px 0; border-block: 1px solid var(--line); }
.mq-track { display: flex; width: max-content; animation: slide-rtl 70s linear infinite; }
.mq-set { display: flex; align-items: center; }
.mq-w { font: 700 clamp(40px, 6vw, 96px)/1.3 var(--display); color: var(--mc); padding: 0 .4em; white-space: nowrap; }
[data-theme="dark"] .mq-w[style*="1c1b18"] { color: var(--ink) !important; }
.mq-sh { width: clamp(22px, 2.6vw, 40px); height: clamp(22px, 2.6vw, 40px); background: var(--ink); flex: none; }
.mq-sh.s0 { border-radius: 50%; }
.mq-sh.s1 { border-radius: 999px 999px 0 0; height: clamp(11px, 1.3vw, 20px); }
.mq-sh.s2 { transform: rotate(45deg) scale(.8); }
.mq-sh.s3 { border-radius: 999px 999px 3px 3px; width: clamp(16px, 1.8vw, 28px); }
.marquee:hover .mq-track { animation-play-state: paused; }

/* ═════════ الكتاب ═════════ */
.book { position: relative; aspect-ratio: 5 / 7; border-radius: 5px 12px 12px 5px; overflow: hidden; background: var(--c-bg); box-shadow: var(--shadow); transform-origin: right center; transition: transform .7s var(--ease), box-shadow .7s var(--ease); }
.book::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(to left, rgba(0,0,0,.28), rgba(0,0,0,0) 3.5%, rgba(255,255,255,.18) 4.5%, rgba(255,255,255,0) 7%), linear-gradient(to bottom, rgba(255,255,255,.08), transparent 40%); }
.book .art { position: absolute; inset: 0 0 30%; height: 70%; }
.book-cover-text { position: absolute; right: 0; left: 0; bottom: 0; height: 30%; z-index: 2; background: var(--c-bg); color: var(--c-t); padding: 12px 18px 16px 14px; padding-right: 9%; display: flex; flex-direction: column; justify-content: space-between; border-top: 2px solid var(--c-a); }
.bk-author { font: 500 10.5px var(--ui); letter-spacing: .06em; opacity: .75; }
.bk-title { font: 700 clamp(15px, 1.25vw, 19px)/1.4 var(--display); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
a:hover .book { transform: perspective(1400px) rotateY(16deg) translateX(-4px); box-shadow: -20px 30px 50px -24px rgba(40,30,10,.55); }

/* ═════════ النص المختار ═════════ */
.featured { background: var(--c-bg); color: var(--c-t); padding: clamp(70px, 12vh, 140px) var(--gut); position: relative; overflow: hidden; }
.ft { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(40px, 7vw, 120px); align-items: center; }
.ft-book { max-width: 380px; width: 100%; justify-self: center; }
.ft-book .book { box-shadow: 0 40px 80px -30px rgba(0,0,0,.55), 0 10px 20px -10px rgba(0,0,0,.3); }
.ft-book .book-cover-text { border-top-color: var(--c-t); }
.label { display: inline-flex; margin: 0 0 22px; padding: 6px 16px; border-radius: 999px; border: 1.5px solid currentColor; font: 500 13px var(--ui); }
.ft-title { font: 700 clamp(36px, 4.4vw, 72px)/1.25 var(--display); margin: 0 0 26px; text-wrap: balance; }
.ft-quote { margin: 0 0 26px; font: 400 clamp(20px, 1.8vw, 27px)/1.85 var(--read); opacity: .92; max-width: 32em; }
.ft-meta { font-size: 14px; opacity: .75; margin: 0 0 34px; }

/* ═════════ المكتبة ═════════ */
.writings { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 13vh, 150px) var(--gut) 120px; }
.w-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: clamp(44px, 7vh, 80px); }
.w-title { font: 700 clamp(44px, 6vw, 96px)/1.1 var(--display); margin: 0; }
.w-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.seg-views { display: inline-flex; padding: 5px; border-radius: 999px; background: var(--paper-2); gap: 2px; }
.seg-views button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; font: 500 14px var(--ui); color: var(--ink-2); transition: all .35s var(--ease); }
.seg-views button:hover { color: var(--ink); }
.seg-views button.on { background: var(--ink); color: var(--paper); box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.chip { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); font: 450 14px var(--ui); transition: all .3s var(--ease); }
.chip sup { font-size: 10.5px; opacity: .65; margin-inline-start: 2px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.stage > div { display: none; }
.stage[data-view="gallery"] .v-gallery { display: grid; animation: rise .7s var(--ease) both; }
.stage[data-view="index"] .v-index, .stage[data-view="cinema"] .v-cinema { display: block; animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.no-match { text-align: center; color: var(--mute); padding: 80px 0; }

/* أغلفة */
.v-gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: clamp(46px, 7vh, 72px) clamp(22px, 2.8vw, 42px); }
.g-item a { display: block; }
.g-cap { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 12.5px; color: var(--mute); }
.g-quote { grid-column: 1 / -1; }
.g-quote a { display: block; background: var(--c-bg); color: var(--c-t); border-radius: 28px; padding: clamp(40px, 8vh, 90px) clamp(24px, 8vw, 140px); text-align: center; transition: transform .6s var(--ease); position: relative; overflow: hidden; }
.g-quote a::before, .g-quote a::after { content: ""; position: absolute; border-radius: 50%; background: var(--c-a); opacity: .9; }
.g-quote a::before { width: 140px; height: 140px; top: -50px; right: -40px; }
.g-quote a::after { width: 60px; height: 60px; bottom: 30px; left: 40px; background: var(--c-b); }
.g-quote p { position: relative; z-index: 1; font: 400 clamp(26px, 3.2vw, 48px)/1.7 var(--read); margin: 0 auto 18px; max-width: 24em; text-wrap: balance; }
.g-quote span { position: relative; z-index: 1; font-size: 14px; opacity: .8; }
.g-quote a:hover { transform: scale(1.01); }

/* رفّ */
.shelf-wrap { display: grid; grid-template-columns: 250px 1fr; gap: clamp(24px, 4vw, 60px); align-items: end; }
.stand { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; min-height: 440px; }
.stand-book { width: 100%; max-width: 230px; margin-bottom: 18px; transition: opacity .3s; }
.stand-book:empty { aspect-ratio: 5 / 7; border: 2px dashed var(--line-2); border-radius: 12px; }
.stand-t { font: 700 20px/1.45 var(--display); margin: 0 0 6px; min-height: 1.45em; }
.stand-x { font: 400 16px/1.8 var(--read); color: var(--ink-2); margin: 0; min-height: 5.4em; }
.shelf { position: relative; display: flex; align-items: flex-end; gap: 5px; height: 470px; padding: 40px 10px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; border-bottom: 14px solid var(--paper-3); box-shadow: 0 16px 20px -14px rgba(0,0,0,.35); }
.spine { position: relative; flex: 0 0 var(--w); height: calc(var(--h) * 4.1px); display: flex; flex-direction: column; align-items: center; background: var(--c-bg); color: var(--c-t); border-radius: 4px 4px 1px 1px; overflow: hidden; box-shadow: inset -3px 0 0 rgba(0,0,0,.12), inset 3px 0 0 rgba(255,255,255,.12), 0 2px 4px rgba(0,0,0,.15); transition: transform .5s var(--ease), box-shadow .5s; }
.spine::before, .spine::after { content: ""; position: absolute; right: 0; left: 0; height: 2px; background: var(--c-a); opacity: .9; }
.spine::before { top: calc(var(--w) + 10px); }
.spine::after { bottom: 44px; }
.sp-top { width: 100%; height: var(--w); flex: none; overflow: hidden; }
.sp-top .art { height: 100%; }
.sp-title { flex: 1; writing-mode: vertical-rl; font: 700 15px/1.3 var(--display); padding: 18px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-height: 100%; }
.sp-year { flex: none; height: 44px; display: grid; place-items: center; font: 500 11px var(--ui); opacity: .8; }
.spine:hover, .spine.lift { transform: translateY(-30px); box-shadow: 0 20px 30px -12px rgba(0,0,0,.4); }
.shelf-hint { color: var(--mute); font-size: 13px; margin: 18px 0 0; text-align: center; }

/* فهرس */
.i-year { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding-top: 30px; border-top: 1px solid var(--line-2); margin-top: 20px; }
.i-year-no { position: sticky; top: 100px; align-self: start; font: 700 clamp(40px, 4.6vw, 72px)/1 var(--display); color: var(--accent); }
.i-list { list-style: none; margin: 0; padding: 0; }
.i-row a { display: grid; grid-template-columns: 56px 1fr auto 50px; gap: 20px; align-items: center; padding: 12px 14px 12px 18px; border-radius: 16px; transition: background .35s var(--ease), color .35s; }
.i-art { width: 56px; height: 72px; border-radius: 4px 8px 8px 4px; overflow: hidden; box-shadow: 0 6px 12px -6px rgba(0,0,0,.4); transition: transform .5s var(--ease); }
.i-title { font: 700 clamp(18px, 1.8vw, 26px)/1.45 var(--display); }
.i-meta, .i-time { font-size: 13px; color: var(--mute); white-space: nowrap; transition: color .3s; }
.i-time { text-align: left; }
.i-row a:hover { background: var(--c-bg); color: var(--c-t); }
.i-row a:hover .i-meta, .i-row a:hover .i-time { color: var(--c-t); opacity: .8; }
.i-row a:hover .i-art { transform: rotate(-6deg) scale(1.08); }

/* ═════════ التذييل ═════════ */
.site-foot { max-width: var(--max); margin: 0 auto; padding: 80px var(--gut) 36px; border-top: 1px solid var(--line); }
.foot-mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; margin-bottom: 70px; }
.foot-mosaic a { aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; transition: transform .4s var(--ease); }
.foot-mosaic a:hover { transform: translateY(-6px) rotate(-4deg) scale(1.12); z-index: 1; }
.foot-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 30px; margin-bottom: 40px; }
.foot-name { font: 700 clamp(48px, 8vw, 128px)/1.1 var(--display); margin: 0; }
.foot-tag { font: 700 clamp(22px, 2.6vw, 38px) var(--hand); color: var(--accent); margin: 0; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 30px; font-size: 13.5px; color: var(--mute); border-top: 1px solid var(--line); padding-top: 20px; }
.foot-row a:hover { color: var(--ink); }

/* ═════════ النوافذ ═════════ */
.overlay { position: fixed; inset: 0; z-index: 100; background: var(--paper); overflow-y: auto; animation: ov .45s var(--ease) both; }
@keyframes ov { from { opacity: 0; transform: translateY(20px); } }
.ov-close { position: fixed; top: 16px; left: var(--gut); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); z-index: 2; transition: transform .3s; }
.ov-close:hover { transform: rotate(90deg); }
.ov-inner { max-width: 860px; margin: 0 auto; padding: 14vh var(--gut) 80px; }
.ov-about .ov-inner { text-align: center; }
.about-art { width: 180px; aspect-ratio: 4 / 5; margin: 0 auto 30px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.about-name { font: 700 clamp(44px, 7vw, 90px)/1.2 var(--display); margin: 0 0 20px; }
.about-text { font: 400 clamp(19px, 1.7vw, 24px)/2 var(--read); }
#q { width: 100%; background: var(--paper-2); border: 0; border-radius: 22px; color: var(--ink); font: 700 clamp(26px, 4vw, 48px)/1.4 var(--display); padding: 18px 26px; outline: none; }
#q:focus { box-shadow: 0 0 0 3px var(--accent); }
#q::placeholder { color: var(--mute); opacity: .6; }
.search-results { list-style: none; margin: 26px 0 0; padding: 0; }
.search-results a { display: block; padding: 20px 22px; border-radius: 16px; transition: background .25s; }
.search-results a:hover { background: var(--paper-2); }
.search-results .sr-t { font: 700 21px var(--display); }
.search-results .sr-x { display: block; font: 400 17px/1.8 var(--read); color: var(--mute); margin-top: 4px; }
.search-results mark { background: var(--accent); color: #fff; padding: 0 4px; border-radius: 4px; }
.search-results .sr-none { color: var(--mute); padding: 20px; }

/* ═════════ صفحة القراءة ═════════ */
.progress { position: fixed; top: 0; right: 0; left: 0; height: 4px; z-index: 70; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--c-acc); border-radius: 0 0 0 4px; }
.a-hero { background: var(--c-bg); color: var(--c-t); padding: clamp(40px, 8vh, 90px) var(--gut) 0; overflow: hidden; }
.a-hero-in { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(30px, 6vw, 100px); align-items: end; }
.a-head { padding-bottom: clamp(50px, 10vh, 110px); }
.a-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.a-meta > * { padding: 5px 14px; border-radius: 999px; border: 1.5px solid currentColor; font: 450 13px var(--ui); opacity: .9; }
.a-cat { background: var(--c-t); color: var(--c-bg); border-color: var(--c-t) !important; opacity: 1 !important; }
.draft-tag { background: #fff; color: #000; }
.a-title { font: 700 clamp(38px, 5.4vw, 90px)/1.25 var(--display); margin: 0; text-wrap: balance; }
.a-by { margin: 24px 0 0; font: 700 22px var(--hand); opacity: .9; }
.a-art { position: relative; aspect-ratio: 4 / 5; border-radius: 22px 22px 0 0; overflow: hidden; box-shadow: 0 -10px 40px -20px rgba(0,0,0,.5); }
.a-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }

.a-body { max-width: 720px; margin: clamp(60px, 10vh, 110px) auto 0; padding: 0 var(--gut); font: 400 clamp(19px, 1.4vw, 22px)/2.05 var(--read); box-sizing: content-box; }
.a-body > p:first-child { font-size: 1.22em; line-height: 1.9; }
.a-body p { margin: 0 0 1.3em; }
.a-body h2, .a-body h3, .a-body h4 { font-family: var(--display); font-weight: 700; line-height: 1.45; margin: 2.1em 0 .8em; }
.a-body h2 { font-size: 1.5em; } .a-body h3 { font-size: 1.25em; } .a-body h4 { font-size: 1.05em; }
.a-body a { text-decoration: underline; text-decoration-color: var(--c-acc); text-decoration-thickness: 2px; text-underline-offset: 6px; transition: color .25s; word-break: break-word; }
.a-body a:hover { color: var(--c-acc); }
.a-body strong { font-weight: 700; }
.a-body blockquote { margin: 2.2em 0; padding: .4em 1.4em .4em 0; border-right: 4px solid var(--c-acc); font-size: 1.08em; color: var(--ink); }
.a-body blockquote p:last-child { margin-bottom: 0; }
.a-body ul, .a-body ol { padding-inline-start: 1.3em; margin: 0 0 1.3em; }
.a-body li { margin-bottom: .4em; }
.a-body li::marker { color: var(--c-acc); }
.a-body hr { border: 0; height: 14px; margin: 3.2em auto; width: 90px; background: radial-gradient(circle, var(--c-acc) 5px, transparent 5.5px) 0 50% / 30px 14px repeat-x; }
.a-body figure { margin: 2.6em -8%; }
.a-body figure img { width: 100%; border-radius: 14px; }
.a-body figcaption { font: 400 13px var(--ui); color: var(--mute); margin-top: 10px; text-align: center; }
.a-body img { margin: 0 auto; border-radius: 10px; }
.a-body code { font-size: .85em; background: var(--paper-2); padding: 1px 6px; border-radius: 4px; }
.a-body.is-ltr { font-family: "Amiri", Georgia, serif; }
.a-body.is-ltr blockquote { border-right: 0; border-left: 4px solid var(--c-acc); padding: .4em 0 .4em 1.4em; }

.a-end { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 80px auto 0; text-align: center; }
.end-mark { width: 64px; height: 80px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.a-end p { margin: 0; font: 700 clamp(24px, 2.4vw, 34px) var(--hand); color: var(--c-acc); }
.a-foot { max-width: 720px; margin: 60px auto 0; padding: 20px var(--gut) 0; box-sizing: content-box; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; border-top: 1px solid var(--line); }
.share { min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--paper-2); font: 500 14px var(--ui); transition: background .25s; }
.share:hover { background: var(--paper-3); }
.source { display: inline-flex; align-items: center; min-height: 44px; font-size: 13.5px; color: var(--mute); }
.source:hover { color: var(--ink); }

/* التعليقات */
.comments { max-width: 720px; margin: clamp(80px, 13vh, 140px) auto 0; padding: 0 var(--gut); box-sizing: content-box; }
.cm-head { font: 700 clamp(34px, 4.6vw, 60px)/1.25 var(--display); margin: 0 0 30px; }
.cm-head sup { display: inline-grid; place-items: center; min-width: 1.9em; height: 1.9em; border-radius: 999px; background: var(--c-acc); color: #fff; font: 600 .3em var(--ui); vertical-align: super; padding: 0 .5em; }
.c-list { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 14px; }
.c-item { background: var(--paper-2); border-radius: 20px; padding: 22px 26px; }
.c-who { margin: 0 0 6px; font-size: 14px; }
.c-who strong { font-weight: 600; }
.c-who span { color: var(--mute); font-size: 12.5px; margin-inline-start: 8px; }
.c-text { font: 400 19px/1.95 var(--read); }
.c-form textarea, .c-form input[type=text] { width: 100%; background: var(--paper); color: var(--ink); border: 1.5px solid var(--line-2); border-radius: 18px; outline: none; transition: border-color .25s, box-shadow .25s; }
.c-form textarea { font: 400 20px/1.8 var(--read); padding: 16px 20px; resize: vertical; min-height: 140px; }
.c-form input[type=text] { font: 400 15px var(--ui); padding: 0 20px; min-height: 50px; border-radius: 999px; }
.c-form textarea:focus, .c-form input:focus { border-color: var(--c-acc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-acc) 20%, transparent); }
.c-form ::placeholder { color: var(--mute); }
.c-row { display: flex; gap: 12px; margin-top: 12px; }
.c-row input { flex: 1; }
.c-note { color: var(--mute); font-size: 13px; margin: 12px 0 0; }
.c-error { margin: 0 0 12px; padding: 12px 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); font-weight: 500; }
.c-sent { padding: 22px 26px; border-radius: 20px; background: var(--c-bg); color: var(--c-t); font-size: 16px; animation: rise .6s var(--ease) both; }
.hp { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: var(--max); margin: clamp(90px, 14vh, 150px) auto 0; padding: 0 var(--gut); }
.pn-item { display: block; padding: 30px 32px; border-radius: 24px; background: var(--paper-2); transition: background .3s, transform .4s var(--ease); }
.pn-item.empty { background: none; }
a.pn-item:hover { background: var(--paper-3); transform: translateY(-3px); }
.pn-item.prev { text-align: left; }
.pn-label { display: block; font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.pn-title { font: 700 clamp(19px, 1.9vw, 27px)/1.45 var(--display); }

.admin-fab { position: fixed; left: 20px; bottom: 20px; z-index: 60; background: var(--ink); color: var(--paper); font: 500 14px var(--ui); padding: 12px 22px; border-radius: 999px; box-shadow: var(--shadow); }

/* فراغ / غير موجود */
.empty, .notfound { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 40px var(--gut); }
.empty-art, .nf-art { width: 180px; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.notfound h1 { font: 700 clamp(30px, 4vw, 52px) var(--display); margin: 0; }
.notfound p, .empty p { color: var(--mute); margin: 0 0 12px; }

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ═════════ الشاشات الصغيرة ═════════ */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { max-width: 460px; max-height: none; }
  .ft { grid-template-columns: 1fr; }
  .ft-book { max-width: 280px; }
  .shelf-wrap { grid-template-columns: 1fr; }
  .stand { display: none; }
  .i-year { grid-template-columns: 1fr; }
  .i-year-no { position: static; }
  .a-hero-in { grid-template-columns: 1fr; }
  .a-art { aspect-ratio: 16 / 10; }
  .a-head { padding-bottom: 20px; }
  .a-body figure { margin: 2.2em 0; }
}
@media (max-width: 640px) {
  .site-head { padding: 10px var(--gut); }
  .hn:not(.icon) { display: none; }
  .mark { font-size: 19px; }
  .hero { padding-top: 26px; }
  .hero-name { font-size: 19vw; }
  .w-head, .w-controls { align-items: flex-start; }
  .chips { justify-content: flex-start; }
  .seg-views { width: 100%; }
  .seg-views button { flex: 1; justify-content: center; padding: 0 8px; }
  .v-gallery { grid-template-columns: repeat(2, 1fr); gap: 36px 16px; }
  .bk-title { font-size: 14px; }
  .book-cover-text { padding: 8px 12px 10px 10px; }
  .i-row a { grid-template-columns: 48px 1fr; gap: 4px 14px; padding: 12px 8px; }
  .i-art { width: 48px; height: 62px; grid-row: span 2; }
  .i-meta { grid-column: 2; }
  .i-time { display: none; }
  .shelf { height: 400px; }
  .spine { height: calc(var(--h) * 3.5px); }
  .c-row { flex-direction: column; }
  .pn { grid-template-columns: 1fr; }
  .pn-item.prev { text-align: right; }
  .announce { height: 40px; font-size: 13px; }
  .foot-mosaic { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* الوضع الداكن: حدّ رفيع يفصل الكتب الداكنة عن الخلفية */
[data-theme="dark"] .book, [data-theme="dark"] .g-quote a, [data-theme="dark"] .spine, [data-theme="dark"] .i-art, [data-theme="dark"] .foot-mosaic a { box-shadow: 0 0 0 1px rgba(241, 233, 218, .12), var(--shadow); }
