/* Tokens from the approved Claude Design handoff (light theme) */
:root {
  --paper: #f4efe6;
  --paper-alt: #ebe4d8;
  --ink: #1a1814;
  --ink-80: rgba(26,24,20,.8);
  --ink-55: rgba(26,24,20,.55);
  --hair: rgba(26,24,20,.1);
  --hair-2: rgba(26,24,20,.25);
  --gold: #9a6e22;
  --gold-hover: #b8862c;
  --gold-60: rgba(154,110,34,.6);
  --gold-text: #855f1c;   /* gold for small text: same hue, meets 4.5:1 on paper */
  --dark: #1a1814;
  --dark-ink: #efe9dd;
  --dark-gold: #c9973a;
  --dark-hair: rgba(239,233,221,.14);

  --font-ar: "Amiri", "Cormorant Garamond", serif;
  --font-en: "Cormorant Garamond", "Amiri", serif;

  --pad-y: clamp(80px, 12vh, 140px);
  --pad-x: clamp(20px, 6vw, 80px);
  --gap: clamp(40px, 6vw, 96px);
  --ease: cubic-bezier(.2,.8,.2,1);
  --cover-shadow: 0 50px 90px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06);
  --hero-cover-shadow: 0 30px 60px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(26,24,20,.08);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ar); -webkit-font-smoothing: antialiased; overflow-x: hidden; letter-spacing: 0; }
h1, h2, h3, p, figure, ul, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.skip { position: absolute; top: -4rem; inset-inline-start: 1rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 60; border-radius: 999px; }
.skip:focus { top: 1rem; }

.lockup-en, .kicker, .lang, .scroll-cue, .menu-label, .num, .kind, .title-en, .foot-rights, .fig-en, .buy-en, .contact-line span { font-family: var(--font-en); letter-spacing: 0; }
.kicker { font-size: 13px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 10px; }
.kicker-gold { color: var(--dark-gold); }
html[lang="ar"] .kicker { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 17px; }
.h2 { font-family: var(--font-ar); font-weight: 400; font-size: clamp(40px, 6vw, 84px); line-height: 1.1; }
.h2-small { font-size: clamp(36px, 4.5vw, 64px); margin-bottom: 20px; }
.body { font-size: clamp(19px, 1.6vw, 24px); line-height: 1.8; opacity: .9; max-width: 54ch; text-wrap: pretty; }
.body-small { font-size: 19px; line-height: 1.7; opacity: .8; max-width: 46ch; margin-bottom: 28px; }
.wrap { max-width: 1400px; margin: 0 auto; }
.two-col { max-width: 1300px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--gap); align-items: center; }
.placeholder-box { margin-top: 24px; padding: 16px 20px; border: 1px dashed rgba(26,24,20,.3); border-radius: 4px; font-size: 18px; line-height: 1.7; color: rgba(26,24,20,.7); font-style: italic; max-width: 54ch; }

/* ---------- keyframes ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes glow { 0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(1); } 50% { opacity: .9; transform: translate(-50%, -50%) scale(1.15); } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(20px, 5vw, 64px); background: linear-gradient(rgba(244,239,230,.85), rgba(244,239,230,0)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lockup { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.lockup-ar { font-family: var(--font-ar); font-size: 26px; font-weight: 700; line-height: 1; }
.lockup-en { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); }
.nav-right { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 32px); font-size: 15px; }
.nav-links { display: flex; gap: clamp(14px, 2.5vw, 32px); }
.nav-links a { color: var(--ink); opacity: .8; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; transition: color .2s, opacity .2s; font-size: 17px; }
.nav-links a:hover { opacity: 1; color: var(--gold); }
.lang { font-family: var(--font-en); font-size: 14px; letter-spacing: .14em; padding: 7px 14px; border: 1px solid var(--gold-60); border-radius: 999px; background: transparent; color: var(--gold-text); min-height: 40px; min-width: 44px; transition: background .2s, color .2s; }
.lang:hover { background: var(--gold); color: var(--paper); }
html[lang="en"] .lang { font-family: var(--font-ar); letter-spacing: 0; font-size: 16px; }
.burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; border: 1px solid rgba(26,24,20,.2); border-radius: 999px; background: transparent; }
.burger span { display: block; height: 1.5px; background: var(--ink); }
.menu { position: fixed; inset: 0; z-index: 49; background: rgba(244,239,230,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 100px clamp(24px, 8vw, 48px) 40px; animation: rise .4s ease-out both; }
.menu[hidden] { display: none; }
.menu a { color: var(--ink); font-family: var(--font-ar); font-size: 44px; line-height: 1.3; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.menu a:last-of-type { border-bottom: 0; }
.menu-label { margin-top: 32px; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-text); }
body.menu-open { overflow: hidden; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; display: grid; align-content: center; justify-items: center; text-align: center; padding: clamp(110px, 16vh, 150px) var(--pad-x) clamp(48px, 8vh, 80px); overflow: hidden; background: var(--paper); }
.hero-light { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.7), rgba(255,255,255,0) 60%), radial-gradient(ellipse at 50% 100%, rgba(26,24,20,.08), rgba(26,24,20,0) 55%); }
.hero-glow { position: absolute; left: 50%; top: 60%; width: min(80vw, 900px); height: min(80vw, 900px); border-radius: 50%; background: radial-gradient(circle, rgba(154,110,34,.22), rgba(154,110,34,0) 62%); animation: glow 9s ease-in-out infinite; pointer-events: none; transform: translate(-50%, -50%); }
.hero-kicker { position: relative; font-size: 14px; margin-bottom: 18px; animation: rise 1s ease-out both; }
.hero-name { position: relative; font-family: var(--font-ar); font-weight: 700; font-size: clamp(56px, 13vw, 180px); line-height: 1.05; letter-spacing: -.01em; overflow-wrap: anywhere; color: var(--ink); animation: rise 1.1s .15s ease-out both; }
html[lang="en"] .hero-name { font-family: var(--font-en); font-weight: 500; letter-spacing: 0; }
.hero-tagline { position: relative; margin-top: 14px; font-family: var(--font-en); font-weight: 300; font-style: italic; font-size: clamp(22px, 3vw, 36px); color: rgba(26,24,20,.75); animation: rise 1.1s .3s ease-out both; }
html[lang="ar"] .hero-tagline { font-family: var(--font-ar); font-style: normal; font-weight: 400; }
.cluster { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: clamp(4px, 1.2vw, 18px); margin-top: clamp(40px, 7vh, 80px); width: 100%; max-width: 1100px; animation: rise 1.4s .5s ease-out both; }
.cluster a { display: block; flex: 1 1 0; max-width: 230px; min-width: 0; transform: rotate(var(--rot)) translateY(var(--lift)); transition: transform .5s var(--ease); }
.cluster a:hover, .cluster a:focus-visible { transform: translateY(-30px) scale(1.06); z-index: 2; }
.cluster .floater { will-change: transform; }
.cluster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; box-shadow: var(--hero-cover-shadow); }
.scroll-cue { position: relative; margin-top: 48px; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: rgba(26,24,20,.7); display: flex; align-items: center; gap: 10px; min-height: 44px; }
html[lang="ar"] .scroll-cue { font-family: var(--font-ar); letter-spacing: 0; font-size: 17px; text-transform: none; }
.scroll-cue:hover { color: var(--gold-text); }
.scroll-cue .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: pulse 2s ease-in-out infinite; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding: 18px 0; background: var(--paper); }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track span { display: inline-flex; align-items: center; gap: 28px; padding: 0 28px; font-family: var(--font-ar); font-size: clamp(22px, 2.6vw, 34px); color: rgba(26,24,20,.75); white-space: nowrap; }
.marquee-track i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }

/* ---------- books ---------- */
.section-head { padding: 120px var(--pad-x) 20px; max-width: 1400px; margin: 0 auto; }
.chapter { position: relative; overflow: hidden; background: var(--bg); color: var(--ink-c); padding: var(--pad-y) var(--pad-x); }
.watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-ar); font-weight: 700; font-size: clamp(180px, 34vw, 560px); line-height: 1; white-space: nowrap; color: var(--accent); opacity: .06; pointer-events: none; user-select: none; }
.chapter-grid { position: relative; max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--gap); align-items: center; }
.chapter-cover { display: flex; justify-content: center; perspective: 1200px; }
.chapter-cover.alt { order: 2; }
.tilt { width: min(100%, 400px); transition: transform .3s ease-out; transform-style: preserve-3d; will-change: transform; }
.tilt img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: var(--cover-shadow); }
.chapter-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.num { font-size: 14px; letter-spacing: .3em; color: var(--accent); }
.rule { height: 1px; width: 48px; background: var(--accent); opacity: .6; }
.kind { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; opacity: .85; }
html[lang="ar"] .kind { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 17px; }
.title-ar { font-family: var(--font-ar); font-weight: 700; font-size: clamp(52px, 7vw, 110px); line-height: 1; color: var(--accent); }
.title-en { margin-top: 10px; font-style: italic; font-weight: 300; font-size: clamp(24px, 2.6vw, 36px); opacity: .88; }
.blurb { margin-top: 36px; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.75; max-width: 54ch; opacity: .9; text-wrap: pretty; }
.chapter-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.pill { display: inline-flex; align-items: center; min-height: 46px; padding: 0 26px; border-radius: 999px; font-size: 17px; transition: transform .25s, opacity .25s, background .25s; }
.pill-fill { background: var(--accent); color: var(--bg); font-weight: 700; }
.pill-fill:hover { transform: translateY(-2px); opacity: .9; color: var(--bg); }
.pill-line { border: 1px solid var(--accent); color: var(--accent); }
.pill-line:hover { background: rgba(255,255,255,.06); color: var(--accent); }

/* ---------- excerpts ---------- */
.excerpts { background: var(--dark); color: var(--dark-ink); padding: var(--pad-y) var(--pad-x); }
.excerpts .h2 { margin-bottom: 56px; }
.excerpt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.excerpt { padding: 36px 32px 32px; border: 1px solid var(--dark-hair); border-radius: 6px; background: rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 24px; min-height: 320px; transition: border-color .3s; }
.excerpt:hover { border-color: var(--dark-gold); }
.excerpt .quote-mark { font-family: var(--font-ar); font-size: 80px; line-height: .6; color: var(--dark-gold); }
.excerpt blockquote { flex: 1; font-size: 21px; line-height: 1.7; font-style: italic; color: rgba(239,233,221,.7); border: 1px dashed rgba(239,233,221,.3); border-radius: 4px; padding: 16px; text-wrap: pretty; }
.excerpt blockquote.real { color: var(--dark-ink); border: 0; padding: 0; font-style: normal; }
.excerpt figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 17px; }
.excerpt figcaption strong { font-family: var(--font-ar); font-size: 22px; font-weight: 700; }
.fig-en { font-style: italic; opacity: .75; }

/* ---------- about ---------- */
.about { background: var(--paper); padding: var(--pad-y) var(--pad-x); }
.portrait { position: relative; width: min(100%, 420px); aspect-ratio: 4 / 5; margin: 0 auto; }
.portrait-outline { position: absolute; inset: 18px -18px -18px 18px; border: 1px solid rgba(154,110,34,.5); border-radius: 4px; pointer-events: none; }
html[dir="rtl"] .portrait-outline { inset: 18px 18px -18px -18px; }
.portrait-slot { position: absolute; inset: 0; border-radius: 4px; background: var(--paper-alt); display: grid; place-items: center; color: rgba(26,24,20,.72); font-style: italic; font-size: 18px; overflow: hidden; }
.portrait-slot img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- buy ---------- */
.buy { background: var(--paper-alt); border-top: 1px solid rgba(26,24,20,.08); padding: var(--pad-y) var(--pad-x); }
.buy .h2 { margin-bottom: 48px; }
.buy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; }
.buy-card { display: flex; gap: 18px; align-items: center; padding: 18px; border: 1px solid rgba(26,24,20,.12); border-radius: 6px; background: rgba(26,24,20,.03); transition: border-color .3s; }
.buy-card:hover { border-color: var(--gold); }
.buy-card img { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; flex: none; box-shadow: 0 10px 20px -8px rgba(0,0,0,.8); }
.buy-card > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.buy-card strong { font-family: var(--font-ar); font-size: 24px; line-height: 1.1; font-weight: 700; }
.buy-en { font-style: italic; font-size: 16px; opacity: .78; }
.buy-card a { font-size: 15px; color: var(--gold-text); border-bottom: 1px solid rgba(154,110,34,.4); align-self: flex-start; min-height: 32px; display: inline-flex; align-items: center; }

/* ---------- newsletter + contact ---------- */
.contact { background: var(--paper); padding: var(--pad-y) var(--pad-x); }
.contact .two-col { align-items: start; }
.news-form { display: flex; flex-wrap: wrap; gap: 12px; max-width: 520px; position: relative; }
.news-form input[type="email"] { flex: 1 1 220px; min-height: 50px; padding: 0 18px; border: 1px solid var(--hair-2); border-radius: 999px; background: transparent; color: var(--ink); font-family: var(--font-ar); font-size: 18px; outline: none; }
.news-form input[type="email"]:focus { border-color: var(--gold); }
.news-form input::placeholder { color: rgba(26,24,20,.6); }
.news-form button { min-height: 50px; padding: 0 28px; border-radius: 999px; border: none; background: var(--gold); color: var(--paper); font-family: var(--font-ar); font-size: 18px; font-weight: 700; transition: background .2s; }
.news-form button:hover { background: var(--gold-hover); }
.news-form button[disabled] { opacity: .7; cursor: default; }
.contact-lines { display: flex; flex-direction: column; gap: 14px; font-size: 20px; }
.contact-line { display: flex; align-items: center; gap: 14px; }
.contact-line::before { content: ""; width: 28px; height: 1px; background: var(--gold); flex: none; }
.contact-line span { font-style: italic; opacity: .72; }
html[lang="ar"] .contact-line span { font-family: var(--font-ar); font-style: normal; }
.contact-line a { font-family: var(--font-en); font-size: 20px; color: var(--gold-text); }

/* ---------- footer ---------- */
.foot { background: var(--paper); border-top: 1px solid rgba(26,24,20,.08); padding: 36px var(--pad-x); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.foot-lockup { font-family: var(--font-ar); font-size: 24px; }
.foot-lockup .lockup-en { font-size: 14px; margin-inline-start: 10px; }
.foot-rights { font-size: 14px; letter-spacing: .1em; opacity: .7; }
html[lang="ar"] .foot-rights { font-family: var(--font-ar); letter-spacing: 0; font-size: 15px; }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 1s ease, transform 1s var(--ease); }
[data-reveal].delay { transition-delay: .15s; }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 759px) {
  .nav-links { display: none; }
  .burger { display: flex; }
  .lockup-en { display: none; }
  .cluster a { max-width: none; }
  .chapter-cover.alt { order: 0; }
  .excerpt { min-height: 0; }
  .portrait { width: min(100%, 340px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-glow, .marquee-track, .scroll-cue .dot { animation-play-state: paused; }
  .cluster .floater { transform: none !important; }
  .hero-kicker, .hero-name, .hero-tagline, .cluster, .menu { animation: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .tilt { transition: none; }
}
