/* =====================================================================
   Astro Aura — store styles
   Night-indigo ground, manuscript gold, a single kundli motif.
   ===================================================================== */

:root {
  --night: #11143A;      /* page ground */
  --indigo: #1B1F52;     /* raised surfaces */
  --indigo-2: #262B6B;   /* borders on surfaces, hover */
  --gold: #D8B25C;       /* accents, primary action */
  --gold-soft: #F0DCA0;  /* focus, highlights on gold */
  --ivory: #F4EFE3;      /* text */
  --mist: #B9B6D8;       /* secondary text */
  --line: rgba(216, 178, 92, 0.28);
  --ok: #93DDAE;
  --warn: #F6C66B;
  --danger: #FF9F93;

  --font-display: "Tiro Devanagari Hindi", "Noto Serif Devanagari", "Kohinoor Devanagari", serif;
  --font-body: "Mukta", "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari", system-ui, sans-serif;

  --step--1: 0.889rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  --step-4: clamp(2.2rem, 1.6rem + 3vw, 3.4rem);

  --wrap: 1120px;
  --narrow: 720px;
  --gap: clamp(1rem, 0.6rem + 2vw, 2rem);
  --section: clamp(3rem, 2rem + 4vw, 5.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 90% 50% at 70% -10%, rgba(216, 178, 92, 0.10), transparent 60%),
    var(--night);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.6em;
  color: var(--ivory);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3, .h3 { font-size: var(--step-2); }

p { margin: 0 0 1em; }

a { color: var(--gold); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-soft); }

:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.muted { color: var(--mist); }
.small { font-size: var(--step--1); }
.lead { font-size: var(--step-1); color: var(--mist); max-width: 40em; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.narrow { max-width: var(--narrow); }
.wrap.narrow { width: min(100% - 2 * var(--gap), var(--narrow)); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--gold); color: var(--night); padding: 0.6rem 1rem; border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

.env-bar {
  background: var(--warn); color: #2A1E00; text-align: center;
  font-size: var(--step--1); padding: 0.35rem 1rem; font-weight: 500;
}

/* ---------------------------- Header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(17, 20, 58, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 0.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ivory); }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.01em; }
.nav-toggle { display: none; }
.site-nav { width: 100%; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--ivory); text-decoration: none; padding: 0.4rem 0; display: inline-block; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--gold-soft); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }

/* JS-enhanced mobile menu */
.nav-ready .nav-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto;
  background: transparent; color: var(--ivory); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.45rem 0.8rem; font: inherit; cursor: pointer; min-height: 44px;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }
.nav-ready .site-nav { display: none; }
.nav-ready.nav-open .site-nav { display: block; padding-bottom: 0.5rem; }
.nav-ready.nav-open .site-nav ul { flex-direction: column; }
.nav-ready.nav-open .site-nav a { padding: 0.55rem 0; }

@media (min-width: 760px) {
  .header-inner { flex-wrap: nowrap; }
  .site-nav, .nav-ready .site-nav { display: block; width: auto; margin-left: auto; }
  .nav-ready .nav-toggle { display: none; }
  .nav-ready.nav-open .site-nav ul { flex-direction: row; }
}

/* ---------------------------- Buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.4rem;
  font: 500 var(--step-0)/1.3 var(--font-body);
  border-radius: 8px; text-decoration: none; cursor: pointer; text-align: center;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: var(--gold-soft); color: var(--night); }
.btn-ghost { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-ghost:hover { background: rgba(216, 178, 92, 0.1); color: var(--gold-soft); }
.btn-disabled { background: var(--indigo-2); color: var(--mist); cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: var(--step-1); padding-inline: 2rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.text-link { color: var(--gold); }
.link-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ----------------------------- Hero ------------------------------- */
.hero { padding-block: clamp(2rem, 1rem + 5vw, 5rem) var(--section); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero-title { font-size: var(--step-4); max-width: 12em; margin-bottom: 0.5em; }
.hero-text { font-size: var(--step-1); color: var(--mist); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1.25rem; }
.hero-author { color: var(--mist); font-size: var(--step--1); }

.hero-visual {
  position: relative; display: grid; place-items: center;
  width: min(100%, 440px); margin-inline: auto; aspect-ratio: 1 / 1.08;
}
.kundli { position: absolute; inset: 0 0 auto; width: 100%; aspect-ratio: 1; color: var(--gold); opacity: 0.55; }
.hero-cover {
  position: relative; width: 52%; margin-top: -8%;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--line);
  border-radius: 4px; overflow: hidden; transform: rotate(-2deg);
}
.hero-price {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.75rem; align-items: baseline; white-space: nowrap; margin: 0;
  font-size: var(--step--1); color: var(--mist);
}
.hero-price strong { color: var(--gold); font-size: var(--step-1); font-weight: 700; }

/* the one orchestrated motion: the chart draws itself once */
@media (prefers-reduced-motion: no-preference) {
  .kundli-draw path, .kundli-draw rect {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: kundli-draw 1.6s cubic-bezier(.6, .1, .2, 1) forwards;
  }
  .kundli-draw path:nth-child(2) { animation-delay: 0.25s; }
  .kundli-draw path:nth-child(3) { animation-delay: 0.4s; }
  .kundli-draw path:nth-child(4) { animation-delay: 0.65s; }
}
@keyframes kundli-draw { to { stroke-dashoffset: 0; } }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}

/* ---------------------------- Sections ---------------------------- */
.section { padding-block: var(--section); }
.section-tight { padding-block: 1rem var(--section); }
.section-band { background: var(--indigo); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }

.page-head { padding-block: 2rem 1.5rem; }
.page-head-compact { padding-bottom: 0.5rem; }
.page-head h1 { margin-bottom: 0.4em; }
.breadcrumbs { font-size: var(--step--1); color: var(--mist); margin: 1rem 0; }
.breadcrumbs a { color: var(--mist); }
.breadcrumbs a:hover { color: var(--gold); }

.empty { color: var(--mist); padding: 2rem 0; }

/* --------------------------- Book cards --------------------------- */
.book-grid {
  display: grid; gap: 2.25rem 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (min-width: 640px) { .book-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
.book-card { position: relative; display: flex; flex-direction: column; gap: 0.9rem; }
.book-card-cover {
  display: block; border-radius: 3px; overflow: hidden;
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line);
  transition: transform 0.2s ease;
}
.book-card:hover .book-card-cover { transform: translateY(-3px); }
.book-card-cat { color: var(--mist); font-size: var(--step--1); margin: 0; }
.book-card-title { font-size: var(--step-1); margin: 0.1rem 0 0.25rem; line-height: 1.4; }
.book-card-title a { color: var(--ivory); text-decoration: none; }
.book-card-title a::after { content: ""; position: absolute; inset: 0; }
.book-card-title a:hover { color: var(--gold-soft); }
.book-card-meta { color: var(--mist); font-size: var(--step--1); margin: 0 0 0.3rem; }

.price { display: flex; align-items: baseline; gap: 0.6rem; margin: 0; }
.price-now { color: var(--gold); font-weight: 700; font-size: var(--step-1); }
.price-was { color: var(--mist); }
.price-lg .price-now { font-size: var(--step-3); }
.badge { display: inline-block; border: 1px solid var(--line); color: var(--gold-soft); border-radius: 999px; padding: 0.1rem 0.7rem; font-size: var(--step--1); }

/* ------------------------------ Steps ----------------------------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.75rem; }
.steps > li { counter-increment: step; position: relative; padding-left: 3.25rem; }
.steps > li::before {
  content: counter(step, devanagari);
  position: absolute; left: 0; top: 0;
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold); border-radius: 2px;
  font-family: var(--font-display); font-size: 1.1rem;
}
.steps h3 { font-size: var(--step-1); margin-bottom: 0.25rem; }
.steps p { color: var(--mist); margin: 0; }
.steps-compact { gap: 1rem; }
.steps-compact p { color: var(--ivory); }
@media (min-width: 760px) { .steps:not(.steps-compact) { grid-template-columns: repeat(3, 1fr); } }

/* ------------------------------ Author ---------------------------- */
.author-teaser { border-left: 2px solid var(--gold); padding-left: clamp(1rem, 3vw, 2rem); max-width: 760px; }
.author-photo { border-radius: 50%; margin-bottom: 1.5rem; border: 2px solid var(--gold); }

/* ------------------------------- FAQ ------------------------------ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 2.25rem 1rem 0; position: relative;
  font-weight: 500; font-size: var(--step-1);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 0.85rem;
  color: var(--gold); font-size: 1.5rem; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--mist); padding-bottom: 1rem; margin: 0; }

/* ----------------------------- Product ---------------------------- */
.product-hero { padding-block: 0.5rem var(--section); }
.product-grid { display: grid; gap: 2rem; align-items: start; }
.product-cover { width: min(70%, 340px); margin-inline: auto; }
.product-cover img { border-radius: 4px; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line); }
.product-cat { color: var(--mist); margin: 0 0 0.25rem; font-size: var(--step--1); }
.product-info { max-width: 36rem; }
.product-info h1 { font-size: var(--step-3); margin-bottom: 0.3em; }
.product-subtitle { font-size: var(--step-1); color: var(--mist); margin-bottom: 0.5rem; }
.product-author { color: var(--mist); }
.buy-box {
  margin: 1.5rem 0; padding: 1.25rem; background: var(--indigo);
  border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 0.9rem;
}
.buy-note { margin: 0; font-size: var(--step--1); color: var(--mist); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem 1.5rem; }
.facts div { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.facts dt { font-size: var(--step--1); color: var(--mist); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.facts-stack { grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .product-grid { grid-template-columns: minmax(260px, 380px) 1fr; gap: 3.5rem; }
  .product-cover { width: 100%; position: sticky; top: 6rem; }
}

.ticks { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 0.6rem; }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.72em; width: 0.5rem; height: 0.5rem;
  border: 1px solid var(--gold); transform: rotate(45deg);
}

.toc { margin: 0; padding-left: 0; list-style: none; counter-reset: ch; }
.toc li { counter-increment: ch; display: flex; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px dashed var(--line); }
.toc li::before { content: counter(ch, devanagari) "."; color: var(--gold); min-width: 1.75rem; font-family: var(--font-display); }

.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .samples { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.sample { display: block; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: #fff; }

.buy-bar {
  position: fixed; inset: auto 0 0 0; z-index: 25;
  background: rgba(27, 31, 82, 0.97); border-top: 1px solid var(--line);
  padding: 0.6rem var(--gap) calc(0.6rem + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform 0.2s ease;
}
.buy-bar.is-visible { transform: none; }
.buy-bar-inner { display: flex; align-items: center; gap: 0.75rem; max-width: var(--wrap); margin-inline: auto; }
.buy-bar-title { flex: 1; font-size: var(--step--1); line-height: 1.35; color: var(--mist); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.buy-bar .btn { min-height: 44px; padding-inline: 1rem; white-space: nowrap; }
@media (min-width: 860px) { .buy-bar { display: none; } }

/* ------------------------------ Forms ----------------------------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 500; }
.optional { color: var(--mist); font-weight: 400; font-size: var(--step--1); }
.field input, .field select, .field textarea, .form-inline input {
  width: 100%; font: inherit; color: var(--ivory);
  background: var(--indigo); border: 1px solid var(--indigo-2); border-radius: 8px;
  padding: 0.7rem 0.85rem; min-height: 48px;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: 2px solid rgba(240, 220, 160, 0.4); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: var(--step--1); margin: 0; }
.field-check { grid-template-columns: auto 1fr; align-items: start; column-gap: 0.75rem; }
.field-check input { width: 1.35rem; height: 1.35rem; min-height: 0; margin-top: 0.3rem; accent-color: var(--gold); }
.field-check .field-error { grid-column: 1 / -1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.form-inline input { width: auto; flex: 1 1 220px; }

/* ----------------------------- Notices ---------------------------- */
.notice {
  border: 1px solid var(--line); border-left-width: 4px; border-left-color: var(--gold);
  background: var(--indigo); border-radius: 8px; padding: 1rem 1.15rem; margin: 1.25rem 0;
}
.notice > :last-child { margin-bottom: 0; }
.notice h2 { font-size: var(--step-2); }
.notice-warn { border-left-color: var(--warn); }
.notice-error { border-left-color: var(--danger); }
.notice-ok { border-left-color: var(--ok); }

/* ---------------------------- Checkout ---------------------------- */
.checkout-grid { display: grid; gap: 2rem; align-items: start; }
.order-summary {
  display: grid; grid-template-columns: 96px 1fr; gap: 1rem;
  background: var(--indigo); border: 1px solid var(--line); border-radius: 12px; padding: 1rem;
}
.order-summary img { border-radius: 3px; }
.order-summary-title { font-size: var(--step-1); margin-bottom: 0.25rem; }
.total { margin: 0.75rem 0 0.5rem; }
.total div { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.total dd { margin: 0; color: var(--gold); font-weight: 700; font-size: var(--step-2); }
.checkout-status { border-radius: 8px; padding: 0.8rem 1rem; background: var(--indigo); border: 1px solid var(--line); }
.checkout-status.is-error { border-color: var(--danger); color: var(--danger); }
.secure-note { font-size: var(--step--1); color: var(--mist); margin: 0; }
@media (min-width: 860px) {
  .checkout-grid { grid-template-columns: 340px 1fr; gap: 3rem; }
  .order-summary { grid-template-columns: 1fr; position: sticky; top: 6rem; }
  .order-summary img { width: 60%; }
}

/* ------------------------------ Order ----------------------------- */
.order-page h1 { font-size: var(--step-3); }
.checking { display: flex; align-items: center; gap: 0.75rem; color: var(--mist); }
.spinner { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ------------------------------ Contact --------------------------- */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 0.85fr 1.15fr; gap: 4rem; } }
.contact-info h3 { font-size: var(--step-1); margin-top: 2rem; }

/* ------------------------------ Prose ----------------------------- */
.prose h2 { font-size: var(--step-2); margin-top: 2.25rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }

/* ------------------------------ Error ----------------------------- */
.error-page { text-align: left; }
.error-code { font-family: var(--font-display); font-size: 4.5rem; color: var(--gold); line-height: 1; margin-bottom: 0.5rem; opacity: 0.8; }

/* ------------------------------ Setup ----------------------------- */
.checklist { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.checklist li { display: grid; grid-template-columns: 4rem 1fr; gap: 0.75rem; padding: 0.6rem 0.8rem; background: var(--indigo); border-radius: 6px; border-left: 4px solid var(--mist); }
.checklist .check-ok { border-left-color: var(--ok); }
.checklist .check-warn { border-left-color: var(--warn); }
.checklist .check-fail { border-left-color: var(--danger); }
.checklist small { color: var(--mist); overflow-wrap: anywhere; }

/* ------------------------------ Footer ---------------------------- */
.site-footer { border-top: 1px solid var(--line); background: #0E1132; padding-top: 3rem; margin-top: 2rem; }
.page-product .site-footer { padding-bottom: 4.5rem; }
@media (min-width: 860px) { .page-product .site-footer { padding-bottom: 0; } }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.footer-heading { font-family: var(--font-body); font-size: var(--step-0); font-weight: 700; color: var(--gold); margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.footer-brand p { color: var(--mist); margin-top: 0.75rem; }
.footer-social { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-base { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-block: 1.25rem 1.5rem; font-size: var(--step--1); color: var(--mist); }
.footer-base p { margin: 0.2rem 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
