/* Design A: The Reading Room. Base, book, reader and study styles from the approved mockups. */
/* The Reading Room: shared styles for learn.alameh.com page mockups */
:root {
  --night: #0e1524; --night-2: #151e31; --night-3: #1d2840; --night-4: #26334f;
  --lamp: #e3b65e; --lamp-dim: #b98f3e; --lamp-soft: rgba(227,182,94,.14);
  --paper: #f3ead8; --paper-hi: #fbf5e8; --paper-2: #e9dec6; --ink: #1c2433; --ink-2: #2d3444; --ink-soft: #5b6170; --rule: #d8cbb0;
  --moon: #c9cfdc; --dim: #8a93a8; --line: rgba(201,207,220,.16);
  --teal: #4aa7a2; --ok: #7cc4a2;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
}
html[lang="ar"] { --display: "Aref Ruqaa", "Amiri", serif; --body: "Amiri", serif; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--night); color: var(--moon); font: 19px/1.6 var(--body); -webkit-font-smoothing: antialiased; min-height: 100vh; }
html[lang="ar"] body { font-size: 21px; line-height: 1.85; }
html[lang="ar"] [data-l="en"], html[lang="en"] [data-l="ar"] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }

body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }

/* Header */
.site-head { position: sticky; top: 0; z-index: 30; background: rgba(14,21,36,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 26px; height: 66px; }
.mark { display: flex; align-items: baseline; gap: 12px; margin-inline-end: auto; }
.mark .ar { font-family: "Aref Ruqaa", serif; font-size: 29px; color: var(--lamp); line-height: 1; }
.mark .en { white-space: nowrap; font-family: "Cormorant Garamond", serif; font-size: 24px; letter-spacing: .06em; color: var(--paper); }
.nav { display: flex; gap: 24px; font-size: 17px; color: var(--dim); }
.nav a:hover, .nav a[aria-current] { color: var(--paper); }
.lang { font: 16px "Amiri", serif; border: 1px solid var(--line); color: var(--paper); background: none; padding: 5px 14px; border-radius: 30px; cursor: pointer; }
html[lang="ar"] .lang { font-family: "Newsreader", serif; }
.lang:hover { border-color: var(--lamp); color: var(--lamp); }
.pill { font-size: 16px; color: var(--night); background: var(--lamp); padding: 7px 18px; border-radius: 30px; }
.who { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--night-4); color: var(--lamp); font: 600 15px var(--body); border: 1px solid rgba(227,182,94,.4); }

/* Shared type */
.kicker { font-size: 14px; letter-spacing: .3em; text-transform: uppercase; color: var(--lamp); }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: 18px; }
.h-display { font-family: var(--display); font-weight: 500; color: var(--paper); line-height: 1.05; }
html[lang="ar"] .h-display { font-weight: 400; line-height: 1.45; }
.muted { color: var(--dim); }
.gold { color: var(--lamp); }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: 40px; font-size: 17px; transition: background .2s, border-color .2s, color .2s; cursor: pointer; border: 0; }
.btn.primary { background: var(--paper); color: var(--ink); }
.btn.primary:hover { background: #fff7e6; }
.btn.lamp { background: var(--lamp); color: var(--night); }
.btn.ghost { border: 1px solid var(--line); color: var(--paper); background: none; }
.btn.ghost:hover { border-color: var(--lamp); color: var(--lamp); }
.arrow { display: inline-block; }
html[lang="ar"] .arrow { transform: scaleX(-1); }

/* Paper surface: all long reading sits on this */
.paper { background: radial-gradient(ellipse at 30% 0%, var(--paper-hi), transparent 60%), var(--paper); color: var(--ink); box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.05); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 46px 0 64px; color: var(--dim); font-size: 16px; margin-top: 90px; }
.foot { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: baseline; }
.foot .m { font-family: var(--display); font-size: 24px; color: var(--paper); }
.foot nav { display: flex; gap: 22px; }

@media (max-width: 900px) { .nav { display: none; } }
@media (max-width: 520px) { .site-head .pill { display: none; } .mark .en { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Book page */
.book-hero { position: relative; overflow: hidden; padding: 80px 0 90px; }
.book-hero::before { content: ""; position: absolute; width: 760px; height: 760px; inset-inline-start: -120px; top: -160px; border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(227,182,94,.24), rgba(227,182,94,.06) 55%, transparent); pointer-events: none; }
.bh { display: grid; grid-template-columns: 340px 1fr; gap: 70px; align-items: center; position: relative; }
.bh img { width: 100%; box-shadow: 0 30px 60px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.05); }
.bh h1 { font-size: clamp(46px, 6vw, 78px); margin: 14px 0 8px; }
html[lang="ar"] .bh h1 { font-size: clamp(36px, 4.2vw, 56px); }
.bh .sub { font-family: var(--display); font-style: italic; font-size: 28px; color: var(--moon); }
html[lang="ar"] .bh .sub { font-style: normal; font-size: 30px; }
.bh .by { margin-top: 14px; color: var(--dim); font-size: 18px; }
.bh .about { margin-top: 26px; max-width: 600px; font-size: 20px; }
.bh .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.facts { display: flex; gap: 0; margin-top: 38px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.facts div { padding: 16px 26px 16px 0; margin-inline-end: 26px; border-inline-end: 1px solid var(--line); }
.facts div:last-child { border: 0; }
.facts b { display: block; font-family: var(--display); font-size: 30px; color: var(--paper); font-weight: 500; line-height: 1.1; }
html[lang="ar"] .facts b { font-family: "Amiri", serif; }
.facts div > span { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
html[lang="ar"] .facts div > span { letter-spacing: 0; font-size: 16px; }

.contents { padding: 76px 0 30px; }
.contents .top { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.contents h2 { font-size: clamp(36px, 4.4vw, 52px); }
.toc-paper { padding: 54px 64px 60px; columns: 2; column-gap: 64px; column-rule: 1px solid var(--rule); }
.part { break-inside: avoid; margin-bottom: 34px; }
.part .pn { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: #9a7a3c; }
html[lang="ar"] .part .pn { letter-spacing: 0; font-size: 16px; }
.part h3 { font-family: var(--display); font-size: 27px; font-weight: 600; line-height: 1.15; margin: 4px 0 10px; color: var(--ink); }
html[lang="ar"] .part h3 { font-weight: 400; line-height: 1.6; font-size: 26px; }
.part ol { list-style: none; }
.part li a { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 17px; line-height: 1.35; color: var(--ink-2); }
html[lang="ar"] .part li a { font-size: 19px; line-height: 1.6; }
.part li a:hover { color: #000; }
.part li a:hover .t { text-decoration: underline; text-decoration-color: var(--lamp); text-underline-offset: 4px; }
.part li .n { color: #9a7a3c; font-variant-numeric: tabular-nums; }
.part li.here a { color: var(--ink); font-weight: 500; }
.part li.here .t::after { content: "  \2022"; color: var(--lamp-dim); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 70px; }
.how > div { background: var(--night); padding: 32px 30px 34px; }
.how h4 { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--paper); margin-bottom: 6px; }
html[lang="ar"] .how h4 { font-weight: 400; }
.how p { font-size: 16px; color: var(--dim); }
html[lang="ar"] .how p { font-size: 18px; }

@media (max-width: 900px) {
  .bh { grid-template-columns: 1fr; gap: 36px; }
  .bh img { width: 220px; }
  .toc-paper { columns: 1; padding: 36px 24px; }
  .how { grid-template-columns: 1fr; }
}

/* Reader */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; }
.progress i { display: block; height: 100%; width: 0; background: var(--lamp); box-shadow: 0 0 10px var(--lamp); }
html[dir="rtl"] .progress i { margin-inline-start: auto; }
.crumbs { padding: 34px 0 22px; font-size: 15px; color: var(--dim); display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--paper); }
.crumbs .sep { opacity: .5; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 44px; align-items: start; }
.chapter { padding: 64px 76px 70px; font-size: var(--fs, 20px); }
html[lang="ar"] .chapter { font-size: var(--fs, 22px); }
.chapter .num { font-size: 14px; letter-spacing: .24em; text-transform: uppercase; color: #9a7a3c; }
html[lang="ar"] .chapter .num { letter-spacing: 0; font-size: 18px; }
.chapter h1 { font-family: var(--display); font-weight: 600; font-size: 2.3em; line-height: 1.1; margin: 10px 0 24px; color: var(--ink); }
html[lang="ar"] .chapter h1 { font-weight: 400; line-height: 1.55; font-size: 2.1em; }
.chapter p, .chapter li { color: var(--ink-2); max-width: 66ch; margin-bottom: .85em; line-height: 1.65; }
html[lang="ar"] .chapter p, html[lang="ar"] .chapter li { line-height: 2; }
.chapter p.li { padding-inline-start: 1.2em; position: relative; }
.chapter p.li::before { content: "\2022"; position: absolute; inset-inline-start: 0; color: var(--lamp-dim); }
.chapter ol { padding-inline-start: 1.4em; margin-bottom: 1em; }
.chapter h3 { font-family: var(--display); font-size: 1.45em; font-weight: 600; color: var(--ink); margin: 1.6em 0 .5em; position: relative; scroll-margin-top: 90px; }
html[lang="ar"] .chapter h3 { font-weight: 400; }
.chapter h3 .anchor { position: absolute; inset-inline-start: -1.1em; font-size: .7em; top: .35em; color: var(--lamp-dim); opacity: 0; transition: opacity .2s; }
.chapter h3:hover .anchor { opacity: 1; }
.chapter blockquote { border-inline-start: 3px solid var(--lamp); padding: 4px 22px; margin: 12px 0 18px; font-style: italic; color: #3b4252; max-width: 62ch; }
html[lang="ar"] .chapter blockquote { font-style: normal; }
.chapter em { font-style: italic; }
.chapter strong { font-weight: 600; color: var(--ink); }

.answer { margin: 6px 0 26px; background: #efe4cc; border: 1px solid var(--rule); border-radius: 6px; padding: 16px 18px 14px; max-width: 66ch; font-family: var(--body); }
.answer .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #8a6a2c; margin-bottom: 8px; }
html[lang="ar"] .answer .lbl { letter-spacing: 0; font-size: 15px; }
.answer .lbl em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--ink-soft); }
.answer textarea { width: 100%; min-height: 84px; border: 1px solid var(--rule); background: var(--paper-hi); border-radius: 4px; padding: 10px 12px; font: 17px/1.5 var(--body); color: var(--ink); resize: vertical; }
html[lang="ar"] .answer textarea { font-size: 19px; }
.answer textarea:focus { outline: none; border-color: var(--lamp-dim); }
.answer .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.answer .row button { border: 0; border-radius: 30px; padding: 8px 16px; font-size: 15px; cursor: pointer; }
.answer .save { background: var(--ink); color: var(--paper); }
.answer .speak { background: none; border: 1px solid var(--rule) !important; color: var(--ink); }
.answer .fb { margin-inline-start: auto; background: none; color: #8a6a2c; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0 !important; }
.answer .saved { font-size: 14px; color: #3f7a5a; }

.rail { position: sticky; top: 90px; }
.rail .box { border: 1px solid var(--line); border-radius: 6px; padding: 20px 20px 18px; margin-bottom: 18px; background: var(--night-2); }
.rail h4 { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--lamp); margin-bottom: 10px; font-weight: 500; }
html[lang="ar"] .rail h4 { letter-spacing: 0; font-size: 16px; }
.rail ol { list-style: none; counter-reset: s; }
.rail li a { display: block; font-size: 15px; padding: 5px 0 5px 0; color: var(--dim); border-inline-start: 2px solid transparent; padding-inline-start: 10px; line-height: 1.35; }
html[lang="ar"] .rail li a { font-size: 17px; line-height: 1.6; }
.rail li a.on { color: var(--paper); border-color: var(--lamp); }
.rail li a.ex::after { content: "  \270E"; color: var(--lamp-dim); font-size: 12px; }
.size { display: flex; gap: 8px; }
.size button { flex: 1; background: none; border: 1px solid var(--line); color: var(--paper); border-radius: 6px; padding: 6px; cursor: pointer; }
.size button:hover { border-color: var(--lamp); }
.rail p { font-size: 14px; color: var(--dim); }
html[lang="ar"] .rail p { font-size: 16px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.pager a { border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; display: block; }
.pager a:hover { border-color: var(--lamp); }
.pager small { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
html[lang="ar"] .pager small { letter-spacing: 0; font-size: 15px; }
.pager b { display: block; font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--paper); line-height: 1.25; margin-top: 4px; }
html[lang="ar"] .pager b { font-family: "Amiri", serif; font-size: 20px; line-height: 1.6; font-weight: 400; }
.pager .next { text-align: end; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; order: -1; }
  .rail .toc-box, .rail .note-box { display: none; }
  .chapter { padding: 36px 22px 40px; }
  .pager { grid-template-columns: 1fr; }
}

/* Study */
.hello { padding: 64px 0 40px; position: relative; }
.hello h1 { font-size: clamp(40px, 5vw, 62px); }
.hello p { color: var(--dim); margin-top: 8px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--night-2); padding: 26px 28px 28px; margin-bottom: 28px; }
.panel h2 { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--lamp); font-weight: 500; margin-bottom: 16px; }
html[lang="ar"] .panel h2 { letter-spacing: 0; font-size: 17px; }

.resume { display: grid; grid-template-columns: 120px 1fr; gap: 26px; align-items: center; padding: 26px; position: relative; overflow: hidden; }
.resume::before { content: ""; position: absolute; width: 420px; height: 420px; inset-inline-end: -140px; top: -180px; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(227,182,94,.18), transparent); }
.resume img { width: 120px; box-shadow: 0 16px 30px rgba(0,0,0,.55); }
.resume .t { font-family: var(--display); font-size: 30px; color: var(--paper); line-height: 1.15; margin: 4px 0 6px; font-weight: 500; }
html[lang="ar"] .resume .t { font-family: "Amiri", serif; font-size: 26px; line-height: 1.6; }
.meter { height: 6px; background: var(--night-4); border-radius: 6px; overflow: hidden; margin: 14px 0 8px; max-width: 420px; }
.meter i { display: block; height: 100%; background: var(--lamp); border-radius: 6px; }
html[dir="rtl"] .meter i { margin-inline-start: 0; }
.resume small { color: var(--dim); font-size: 15px; }
.resume .btn { margin-top: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 28px; }
.stats div { background: var(--night); padding: 18px 20px; }
.stats b { display: block; font-family: var(--display); font-size: 40px; color: var(--paper); line-height: 1; font-weight: 500; }
html[lang="ar"] .stats b { font-family: "Amiri", serif; font-size: 36px; }
.stats div > span { font-size: 14px; color: var(--dim); }

.list { list-style: none; }
.list li { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .what { font-size: 17px; color: var(--paper); line-height: 1.35; }
html[lang="ar"] .list .what { font-size: 19px; line-height: 1.6; }
.list .where { font-size: 14px; color: var(--dim); margin-top: 2px; }
html[lang="ar"] .list .where { font-size: 16px; }
.st { font-size: 13px; padding: 4px 11px; border-radius: 20px; white-space: nowrap; border: 1px solid var(--line); color: var(--dim); }
.st.fb { border-color: rgba(227,182,94,.5); color: var(--lamp); }
.st.tr { border-color: rgba(124,196,162,.5); color: var(--ok); }

.feedback { padding: 26px 30px 26px; }
.feedback .q { font-size: 15px; color: var(--ink-soft); font-style: italic; }
html[lang="ar"] .feedback .q { font-style: normal; font-size: 17px; }
.feedback .mine { margin: 10px 0 16px; padding: 12px 16px; background: #ebe0c8; border-radius: 4px; font-size: 17px; color: var(--ink-2); }
.feedback h3 { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
html[lang="ar"] .feedback h3 { font-weight: 400; }
.feedback ul { list-style: none; margin-bottom: 12px; }
.feedback li { font-size: 16px; color: var(--ink-2); padding: 6px 0 6px 0; padding-inline-start: 22px; position: relative; }
html[lang="ar"] .feedback li { font-size: 18px; }
.feedback li::before { position: absolute; inset-inline-start: 0; font-weight: 600; }
.feedback li.y::before { content: "\2713"; color: #3f7a5a; }
.feedback li.n::before { content: "\2192"; color: #9a7a3c; }
html[dir="rtl"] .feedback li.n::before { content: "\2190"; }
.feedback .warn { font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--rule); padding-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feedback .warn a { color: #8a6a2c; text-decoration: underline; text-underline-offset: 3px; }

.pass { border-color: rgba(227,182,94,.45); background: linear-gradient(160deg, #22304d, var(--night-2) 70%); }
.pass .big { font-family: var(--display); font-size: 28px; color: var(--paper); font-weight: 500; }
html[lang="ar"] .pass .big { font-family: "Amiri", serif; font-size: 24px; }
.pass p { font-size: 15px; color: var(--dim); margin-top: 6px; }
html[lang="ar"] .pass p { font-size: 17px; }
.pass .use { margin-top: 14px; font-size: 14px; color: var(--moon); }
.side .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; align-items: center; }
.side .row:first-of-type { border-top: 0; }
.side .row a { color: var(--lamp); font-size: 15px; }
.privacy { font-size: 14px; color: var(--dim); line-height: 1.55; }
html[lang="ar"] .privacy { font-size: 16px; }

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .resume { grid-template-columns: 80px 1fr; gap: 18px; }
  .resume img { width: 80px; }
}

/* Home */
/* Hero: the lamp */
.hero { position: relative; overflow: hidden; padding: 120px 0 130px; text-align: center; }
.glow { position: absolute; left: 50%; top: 40px; width: 900px; height: 900px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(227,182,94,.30) 0%, rgba(227,182,94,.10) 45%, transparent 100%); animation: breathe 7s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 50% { opacity: .72; transform: translateX(-50%) scale(.96); } }
.flame { width: 16px; height: 26px; margin: 0 auto 34px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(circle at 50% 70%, #fff6dc, var(--lamp) 55%, #b77b22); box-shadow: 0 0 28px 8px rgba(227,182,94,.55); animation: flick 3.2s ease-in-out infinite; }
@keyframes flick { 30% { transform: scale(.94, 1.04) rotate(-2deg); } 60% { transform: scale(1.03, .97) rotate(2deg); } }
.kicker { font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: var(--lamp); }
html[lang="ar"] .kicker { letter-spacing: 0; font-size: 20px; }
.motto { font-family: var(--display); font-weight: 500; font-size: clamp(46px, 7.4vw, 96px); line-height: 1.02; color: var(--paper); margin: 22px auto 26px; max-width: 980px; }
.motto b { color: var(--lamp); font-weight: 600; }
html[lang="ar"] .motto { line-height: 1.5; font-size: clamp(44px, 6.6vw, 84px); }
.lede { max-width: 640px; margin: 0 auto 40px; color: var(--moon); font-size: 21px; }
.ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }


/* Section heads */
.sec { padding: 100px 0; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 46px; flex-wrap: wrap; }
.head h2 { font-family: var(--display); font-weight: 500; font-size: clamp(36px, 4.6vw, 56px); color: var(--paper); line-height: 1.1; }
html[lang="ar"] .head h2 { line-height: 1.5; }
.head p { color: var(--dim); font-size: 18px; max-width: 460px; }

/* Shelf */
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 34px; align-items: end; position: relative; padding-bottom: 26px; }
html[lang="ar"] .shelf { grid-template-columns: repeat(3, minmax(0, 220px)); justify-content: start; gap: 60px; }
.shelf::after { content: ""; position: absolute; left: -24px; right: -24px; bottom: 0; height: 14px; background: linear-gradient(#3a2c1c, #241a10); box-shadow: 0 18px 30px rgba(0,0,0,.55); border-radius: 2px; }
.book { position: relative; transition: transform .35s ease; }
.book:hover { transform: translateY(-10px); }
.book .cover { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; display: block; box-shadow: 0 22px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04); }
.book.dim .cover { filter: saturate(.55) brightness(.62); }
.book .tag { position: absolute; top: 10px; inset-inline-start: 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; background: rgba(14,21,36,.85); color: var(--dim); }
html[lang="ar"] .book .tag { letter-spacing: 0; font-size: 15px; }
.book.live .tag { background: var(--lamp); color: var(--night); }
.meta { margin-top: 44px; }
.books-meta { display: grid; grid-template-columns: repeat(5, 1fr); gap: 34px; }
html[lang="ar"] .books-meta { grid-template-columns: repeat(3, minmax(0, 220px)); gap: 60px; }
.books-meta h3 { font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.15; color: var(--paper); }
html[lang="ar"] .books-meta h3 { font-size: 27px; line-height: 1.5; font-weight: 400; }
.books-meta p { font-size: 16px; color: var(--dim); margin-top: 6px; line-height: 1.45; }
html[lang="ar"] .books-meta p { font-size: 18px; line-height: 1.7; }
/* typographic covers for titles without art */
.tcover { aspect-ratio: 2 / 3; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 35%, #23324f, #121a2c 70%); border: 1px solid rgba(227,182,94,.35); box-shadow: 0 22px 40px rgba(0,0,0,.6); position: relative; }
.tcover::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(227,182,94,.25); }
.tcover .t { font-family: "Aref Ruqaa", serif; font-size: 34px; line-height: 1.35; color: var(--lamp); }
.tcover .s { font-family: "Amiri", serif; font-size: 15px; color: var(--moon); margin-top: 14px; line-height: 1.6; }
.tcover .a { font-family: "Amiri", serif; font-size: 14px; color: var(--dim); position: absolute; bottom: 24px; }
.book.dim .tcover { filter: brightness(.7); }

/* Chapter preview: a lit page on a dark desk */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; align-items: start; }
.page { background: radial-gradient(ellipse at 30% 0%, #fbf5e8, transparent 60%), var(--paper); color: var(--ink); padding: 64px 72px 70px; box-shadow: 0 40px 90px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.05); position: relative; }
.crumb { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: #9a7a3c; }
html[lang="ar"] .crumb { letter-spacing: 0; font-size: 18px; }
.page h3 { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1.12; margin: 14px 0 22px; }
html[lang="ar"] .page h3 { font-weight: 400; line-height: 1.55; font-size: 42px; }
.page p { font-size: 20px; color: #2d3444; margin-bottom: 18px; max-width: 62ch; }
html[lang="ar"] .page p { font-size: 23px; }
.page h4 { font-family: var(--display); font-size: 26px; font-weight: 600; margin: 30px 0 10px; color: var(--ink); }
html[lang="ar"] .page h4 { font-weight: 400; }
.page blockquote { border-inline-start: 3px solid var(--lamp); padding: 4px 22px; margin: 12px 0 16px; font-style: italic; color: #3b4252; font-size: 20px; }
html[lang="ar"] .page blockquote { font-style: normal; font-size: 23px; }
mark { background: linear-gradient(transparent 55%, rgba(227,182,94,.45) 55%); color: inherit; }
.margin { padding: 64px 0 0; padding-inline-start: 34px; }
.note { border-inline-start: 1px solid var(--lamp); padding-inline-start: 22px; margin-bottom: 34px; }
.note .k { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--lamp); }
html[lang="ar"] .note .k { letter-spacing: 0; font-size: 17px; }
.note p { color: var(--moon); font-size: 17px; margin-top: 6px; }
html[lang="ar"] .note p { font-size: 19px; }
.study { background: var(--night-3); border: 1px solid rgba(227,182,94,.3); border-radius: 6px; padding: 24px 24px 26px; }
.study h5 { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--paper); }
html[lang="ar"] .study h5 { font-weight: 400; }
.study p { font-size: 16px; color: var(--dim); margin: 6px 0 14px; }
html[lang="ar"] .study p { font-size: 18px; }
.study textarea { width: 100%; height: 96px; background: var(--night); color: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font: 16px var(--body); resize: vertical; }
.study textarea:focus { outline: none; border-color: var(--lamp); }
.study button { margin-top: 12px; width: 100%; padding: 11px; border: 0; border-radius: 30px; background: var(--lamp); color: var(--night); font: 600 16px var(--body); cursor: pointer; }
.study .fine { font-size: 14px; color: var(--dim); margin-top: 10px; }

/* How study works */
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.way { background: var(--night); padding: 40px 36px 44px; }
.way .n { font-family: var(--display); font-size: 64px; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--lamp); }
html[lang="ar"] .way .n { font-family: "Amiri", serif; }
.way h3 { font-family: var(--display); font-weight: 600; font-size: 30px; color: var(--paper); margin: 16px 0 8px; }
html[lang="ar"] .way h3 { font-weight: 400; }
.way p { color: var(--dim); font-size: 17px; }
html[lang="ar"] .way p { font-size: 19px; }
.way .price { margin-top: 18px; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--lamp); }
html[lang="ar"] .way .price { letter-spacing: 0; font-size: 17px; }
.way.pass { background: linear-gradient(160deg, #22304d, var(--night) 70%); }

@media (max-width: 960px) {
  .shelf, .books-meta { grid-template-columns: repeat(3, 1fr); }
  .shelf .book:nth-child(n+4), .books-meta > div:nth-child(n+4) { display: none; }
  .ways { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  html[lang="ar"] .shelf, html[lang="ar"] .books-meta { gap: 20px; grid-template-columns: repeat(3, 1fr); }
  .shelf, .books-meta { gap: 16px; }
  .books-meta h3 { font-size: 18px; } .books-meta p { display: none; }
  .tcover .t { font-size: 20px; } .tcover .s, .tcover .a { display: none; }
}
@media (prefers-reduced-motion: reduce) { .glow, .flame { animation: none; } .book { transition: none; } }
