/* ── kitab.tanazur.org — the Tanāẓuric Mushaf library ── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Amiri:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg-deep: #08091a;
  --bg-dark: #0d1024;
  --bg-mid: #131830;
  --bg-card: #1a1e3a;
  --bg-card-hover: #232850;
  --border: #2a3060;
  --border-bright: #4a5390;
  --text-dim: #6b7396;
  --text-mid: #a8aec6;
  --text-bright: #d4d7e3;
  --text-white: #eef0f6;
  --gold: #d4a84b;
  --gold-dim: #a8863c;
  --gold-glow: #f5c842;
  --indigo: #16213e;
  --cream: #faf6f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-mid);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-glow); }

/* ── Top nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.2rem 2.2rem;
  background: linear-gradient(to bottom, rgba(8,9,26,0.85), rgba(8,9,26,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--text-white);
}
.nav-brand-ar {
  font-family: 'Amiri', serif;
  margin-left: 0.6rem;
  color: var(--gold);
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-mid);
}
.nav-links a:hover { color: var(--gold); }

/* ── Hero ── */
.hero {
  position: relative; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
  text-align: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(212,168,75,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(212,168,75,0.04) 0%, transparent 50%),
    linear-gradient(to bottom, var(--bg-dark) 0%, var(--bg-deep) 100%);
}
.stars {
  position: absolute; inset: 0; opacity: 0.6;
  background-image:
    radial-gradient(1px 1px at 20% 30%, var(--cream), transparent),
    radial-gradient(1px 1px at 60% 50%, var(--cream), transparent),
    radial-gradient(1px 1px at 40% 70%, var(--cream), transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, var(--cream), transparent),
    radial-gradient(1px 1px at 30% 80%, var(--cream), transparent),
    radial-gradient(1px 1px at 70% 60%, var(--cream), transparent),
    radial-gradient(1px 1px at 90% 40%, var(--cream), transparent),
    radial-gradient(1.2px 1.2px at 15% 60%, var(--cream), transparent),
    radial-gradient(1px 1px at 50% 25%, var(--cream), transparent),
    radial-gradient(1px 1px at 85% 75%, var(--cream), transparent);
  background-size: 100% 100%;
}
.hero-content { position: relative; z-index: 2; max-width: 780px; }

.hero-eyebrow {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 2.2rem;
}

.hero-title-ar {
  font-family: 'Amiri', serif;
  font-size: clamp(3.5rem, 9vw, 6rem);
  color: var(--gold-glow);
  line-height: 1.05; margin-bottom: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-title-en {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--text-white);
  font-weight: 400;
  margin-bottom: 2.5rem;
  letter-spacing: 0.01em;
}

.hero-rule {
  width: 60px; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin: 0 auto 2rem;
}

.hero-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: var(--text-bright);
  line-height: 1.6;
  max-width: 600px; margin: 0 auto;
  font-weight: 400;
}

.hero-tagline em {
  color: var(--gold);
  font-style: italic;
}

.scroll-cue {
  position: absolute; bottom: 2.5rem; left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-dim); opacity: 0.7;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, 0); }
  50% { opacity: 0.8; transform: translate(-50%, 6px); }
}

/* ── Sections ── */
section { padding: 5rem 2rem; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-eyebrow {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.8rem;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--text-white); font-weight: 600;
  line-height: 1.2; margin-bottom: 1rem;
}
.section-title em { color: var(--gold); font-style: italic; }
.section-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; line-height: 1.7;
  color: var(--text-mid); max-width: 620px; margin: 0 auto;
  font-style: italic;
}

/* ── Books grid ── */
.books-section { background: var(--bg-dark); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1100px; margin: 0 auto;
}
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
}
.book-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-dim);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(212,168,75,0.1);
}
.book-cover {
  aspect-ratio: 595/842;
  background: var(--indigo);
  background-size: cover; background-position: center;
  position: relative;
}
.book-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 65%, rgba(8,9,26,0.4));
}
.book-info { padding: 1.6rem 1.5rem 1.8rem; }
.book-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; font-weight: 600;
  color: var(--text-white); margin-bottom: 0.2rem;
  letter-spacing: 0.005em;
}
.book-info-ar {
  font-family: 'Amiri', serif;
  font-size: 1.4rem; color: var(--gold);
  margin-bottom: 0.8rem; line-height: 1.2;
}
.book-info p {
  font-size: 0.9rem; color: var(--text-mid);
  line-height: 1.6; margin-bottom: 1.2rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
}
.book-actions {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.book-actions a {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  color: var(--text-bright);
}
.book-actions a:hover {
  background: rgba(212,168,75,0.08);
  border-color: var(--gold-dim);
  color: var(--gold-glow);
}
.book-actions a.muted {
  color: var(--text-dim); border-color: var(--border);
  cursor: default; pointer-events: none;
}

.status-pill {
  display: inline-block; font-size: 0.65rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); padding: 0.18em 0.6em;
  border: 1px solid var(--gold-dim); border-radius: 2px;
  margin-left: 0.5rem; vertical-align: middle;
  font-weight: 600;
}
.status-pill.muted {
  color: var(--text-dim); border-color: var(--border);
}

/* ── Manifesto / longform ── */
.manifesto-section {
  padding: 7rem 2rem;
  background: var(--bg-deep);
}
.manifesto {
  max-width: 680px; margin: 0 auto;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.18rem;
  line-height: 1.85;
  color: var(--text-bright);
}
.manifesto p { margin-bottom: 1.5rem; }
.manifesto p:first-of-type::first-letter {
  font-size: 4.5rem;
  float: left;
  line-height: 0.9;
  padding: 0.3rem 0.6rem 0 0;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}
.manifesto blockquote {
  margin: 2.5rem 0;
  padding: 1.2rem 1.8rem;
  border-left: 2px solid var(--gold);
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold);
  text-align: left;
  background: rgba(212,168,75,0.04);
}
.manifesto blockquote .translit {
  display: block; font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 0.95rem;
  color: var(--text-mid); margin-top: 0.4rem;
  font-weight: 400;
}
.manifesto blockquote .gloss {
  display: block; font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 1.05rem;
  color: var(--text-bright); margin-top: 0.3rem;
  font-weight: 400;
}

/* ── Footer ── */
footer {
  padding: 3.5rem 2rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-dark);
  text-align: center;
}
footer .footer-rule {
  width: 50px; height: 1px;
  background: var(--gold-dim);
  margin: 0 auto 1.5rem;
  opacity: 0.6;
}
footer p {
  font-size: 0.82rem; color: var(--text-dim);
  font-family: 'Cormorant Garamond', serif; font-style: italic;
}
footer .arabic {
  font-family: 'Amiri', serif; font-style: normal;
  color: var(--gold); font-size: 1.1rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Book detail page ── */
.detail-hero {
  padding: 8rem 2rem 4rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(212,168,75,0.05) 0%, transparent 60%),
    var(--bg-deep);
  border-bottom: 1px solid var(--border);
}
.detail-hero .book-cover-large {
  width: 280px; max-width: 80%;
  aspect-ratio: 595/842;
  margin: 0 auto 2.5rem;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,168,75,0.08);
}
.detail-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--text-white); font-weight: 600;
  margin-bottom: 0.3rem;
}
.detail-hero h1 em { color: var(--gold); font-style: italic; }
.detail-hero .ar {
  font-family: 'Amiri', serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--gold); margin-bottom: 1rem;
}
.detail-hero .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem; color: var(--text-bright);
  margin-bottom: 2rem;
}
.detail-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1.5rem;
}
.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-glow);
  transition: all 0.25s;
}
.btn:hover {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}
.btn.primary {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}
.btn.primary:hover { background: var(--gold-glow); border-color: var(--gold-glow); }
.btn.muted {
  border-color: var(--border);
  color: var(--text-dim);
  cursor: default; pointer-events: none;
}

.detail-body {
  max-width: 720px; margin: 0 auto;
  padding: 4rem 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; line-height: 1.85;
  color: var(--text-bright);
}
.detail-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem; color: var(--text-white);
  margin: 2.5rem 0 1rem;
  font-weight: 600;
}
.detail-body p { margin-bottom: 1.3rem; }
.detail-body ul { margin: 1rem 0 1.5rem 1.5rem; }
.detail-body li { margin-bottom: 0.4rem; }

@media (max-width: 700px) {
  .nav { padding: 1rem 1.2rem; }
  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.74rem; }
  .nav-brand { font-size: 1.1rem; }
  section { padding: 4rem 1.2rem; }
  .manifesto-section { padding: 5rem 1.5rem; }
  .manifesto { font-size: 1.08rem; }
  .manifesto blockquote { font-size: 1.2rem; padding: 1rem 1.3rem; }
}
