/* =========================================================
   Divine Karma — shared stylesheet
   ========================================================= */

:root {
  --ink:  #f5efff;
  --dim:  #b89cff;
  --dimmer: #7c6db0;
  --gold: #e8d58b;
  --gold-soft: rgba(232, 213, 139, 0.35);
  --bg:   #05040d;
  --bg-2: #0b0818;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(184, 156, 255, 0.18);
  --brand-blue: #0b2a86;
  --brand-teal: #16a0a8;
  --brand-green:#22b27a;
  --radius-lg: 14px;
  --radius-md: 8px;
  --serif: "Cormorant Garamond", "Garamond", "Times New Roman", Times, serif;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --track-wide: 0.18em;
  --max: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(124, 88, 220, 0.25), transparent 60%),
    radial-gradient(1000px 650px at 110% 10%, rgba(22, 160, 168, 0.18), transparent 55%),
    radial-gradient(900px 900px at 50% 110%, rgba(232, 213, 139, 0.08), transparent 60%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* subtle starfield */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 15%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 80% 22%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 35% 55%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 65% 70%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 50% 90%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1px 1px at 10% 75%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 95% 55%, rgba(255,255,255,0.5), transparent 60%);
  background-size: 1200px 800px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

main, nav, footer, header, section { position: relative; z-index: 1; }

a { color: var(--dim); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.3rem; line-height: 1.25; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- Layout ---------- */

.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.container--narrow { max-width: 820px; }

section { padding: 72px 0; }
section.tight { padding: 40px 0; }

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(5, 4, 13, 0.72);
  border-bottom: 1px solid var(--panel-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand img { height: 36px; width: auto; }
.brand-text {
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
}
.nav a.active, .nav a:hover { color: var(--gold); border-bottom-color: var(--gold-soft); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav { display: none; flex-direction: column; position: absolute; right: 20px; top: 64px;
         background: rgba(5,4,13,0.96); border: 1px solid var(--panel-border); padding: 14px 18px; border-radius: 12px; }
  .nav.open { display: flex; }
  .nav-toggle { display: inline-block; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 28px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--bg);
  background: var(--gold);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { background: #f2e3a0; color: var(--bg); transform: translateY(-1px); box-shadow: 0 10px 30px rgba(232, 213, 139, 0.22); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--panel-border);
}
.btn.ghost:hover { color: var(--gold); border-color: var(--gold-soft); background: rgba(232, 213, 139, 0.06); }

/* ---------- Hero ---------- */

.hero {
  padding-top: 90px;
  padding-bottom: 60px;
  text-align: center;
}
.hero .eyebrow { margin-bottom: 18px; display: inline-block; }
.hero h1 { margin: 0 0 14px; }
.hero .lede {
  max-width: 680px;
  margin: 0 auto 28px;
  color: var(--dim);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5;
}
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Daily Quote Card ---------- */

.quote-card {
  max-width: 840px;
  margin: 60px auto 0;
  padding: 44px 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(184,156,255,0.10), rgba(232,213,139,0.04));
  border: 1px solid var(--panel-border);
  position: relative;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.quote-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(232,213,139,0.5), rgba(184,156,255,0.25), transparent);
  -webkit-mask:
     linear-gradient(#000 0 0) content-box,
     linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.quote-card .mark {
  font-family: var(--display);
  font-size: 4rem;
  color: var(--gold);
  line-height: 0.5;
  display: block;
  margin-bottom: 8px;
}
.quote-card blockquote {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.35;
  color: var(--ink);
  font-style: italic;
}
.quote-card .attrib {
  margin-top: 22px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 0.82rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
}
.quote-card .attrib .rule {
  display: inline-block; width: 44px; height: 1px; background: var(--gold-soft);
}

/* ---------- Book grid ---------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: 40px;
}
@media (max-width: 900px) { .book-grid { grid-template-columns: 1fr; gap: 56px; } }

.book-card {
  text-align: center;
}
.book-card img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto 18px;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.5));
  transition: transform .4s ease;
}
.book-card:hover img { transform: translateY(-6px); }
.book-card .roman {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.book-card h3 {
  font-family: var(--display);
  font-weight: 500;
  margin: 4px 0 10px;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}
.book-card p {
  color: var(--dim);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 auto 14px;
  max-width: 32ch;
}

/* ---------- About ---------- */

.author-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 820px) { .author-row { grid-template-columns: 1fr; gap: 32px; } }

.portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, rgba(184,156,255,0.18), rgba(22,160,168,0.15));
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-family: var(--serif);
  font-style: italic;
  position: relative;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.bio p {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.72;
  color: rgba(245, 239, 255, 0.88);
  margin: 0 0 18px;
}
.bio p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 3.6rem;
  line-height: 1;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--gold);
}

.pullquote {
  margin: 34px 0;
  padding: 22px 28px;
  border-left: 2px solid var(--gold);
  font-family: var(--display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
}

/* ---------- Contact form ---------- */

.form-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 36px 30px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 7px;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  transition: border-color .2s ease, background .2s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(232, 213, 139, 0.05);
}
.form-row textarea { min-height: 120px; resize: vertical; }

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 22px;
  font-size: 0.92rem;
  color: var(--dim);
}
.check-row input { margin-top: 4px; }

.form-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--dimmer);
  text-align: center;
}
.form-status { margin-top: 14px; text-align: center; font-size: 0.95rem; }
.form-status.success { color: var(--brand-green); }
.form-status.error { color: #ff8a8a; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 0 36px;
  border-top: 1px solid var(--panel-border);
  background: rgba(5,4,13,0.7);
  color: var(--dimmer);
  font-size: 0.88rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer .brand img { height: 28px; }
.site-footer .social { display: flex; gap: 18px; }
.site-footer .social a { color: var(--dim); }
.site-footer .social a:hover { color: var(--gold); }
.site-footer .tiny { color: var(--dimmer); font-size: 0.78rem; }

/* ---------- Divider rule ---------- */

.rule-gold {
  display: block;
  width: 90px; height: 1px; margin: 20px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- Section titles ---------- */

.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title .eyebrow { display: block; margin-bottom: 10px; }
.section-title h2 { margin: 0; }

/* ---------- Quote shelf (books page) ---------- */

.shelf {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 80px;
}
.shelf.reverse { grid-template-columns: 1fr 260px; }
.shelf.reverse .shelf-img { order: 2; }
@media (max-width: 820px) {
  .shelf, .shelf.reverse { grid-template-columns: 1fr; gap: 24px; }
  .shelf.reverse .shelf-img { order: 0; }
}
.shelf-img img { width: 100%; border-radius: 6px; box-shadow: 0 30px 60px rgba(0,0,0,0.6); }
.shelf h3 { margin-top: 0; font-size: 1.9rem; }
.shelf .roman { color: var(--gold); font-size: 0.75rem; letter-spacing: var(--track-wide); text-transform: uppercase; margin-bottom: 8px; }
.shelf p { color: rgba(245,239,255,0.85); font-family: var(--serif); font-size: 1.1rem; line-height: 1.6; }
.shelf .buy-row { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Fade in on load ---------- */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp .9s ease-out forwards;
}
.fade-in.delay-1 { animation-delay: 0.15s; }
.fade-in.delay-2 { animation-delay: 0.3s; }
.fade-in.delay-3 { animation-delay: 0.45s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
