/* =================================================================
   DESIGN TOKENS — SDM Ayurveda Library
   Palette drawn from the material world of an Ayurveda library:
   palm-leaf parchment, herbarium green, turmeric, sandalwood.
   ================================================================= */
:root {
  /* Color */
  --bg-parchment:   #F5EFDC;
  --bg-parchment-2: #EDE4C9;
  --ink:            #201D17;
  --ink-soft:       #4A453B;
  --green-deep:     #1E3A2B;
  --green-darker:   #142A1F;
  --gold:           #BD8123;
  --gold-soft:      #E7C077;
  --sandalwood:     #7B4B2A;
  --sage:           #6E8F6A;
  --line:           rgba(32, 29, 23, 0.14);
  --line-strong:    rgba(32, 29, 23, 0.28);
  --white-warm:     #FFFDF7;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", -apple-system, "Segoe UI", sans-serif;

  /* Scale (1.25 ratio) */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1:  clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --step-3:  clamp(2.1rem, 1.7rem + 2vw, 3rem);
  --step-4:  clamp(2.75rem, 2.1rem + 3.2vw, 4.4rem);

  /* Layout */
  --content-max: 1180px;
  --radius-sm: 3px;
  --shadow-card: 0 1px 0 rgba(32,29,23,0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-parchment:   #17211A;
    --bg-parchment-2: #1D281F;
    --ink:            #EFE8D6;
    --ink-soft:       #C7BFA9;
    --white-warm:     #1D281F;
    --line:           rgba(239, 232, 214, 0.14);
    --line-strong:    rgba(239, 232, 214, 0.28);
    --gold:           #E0A93F;
  }
}
:root[data-theme="dark"] {
  --bg-parchment:   #17211A;
  --bg-parchment-2: #1D281F;
  --ink:            #EFE8D6;
  --ink-soft:       #C7BFA9;
  --white-warm:     #1D281F;
  --line:           rgba(239, 232, 214, 0.14);
  --line-strong:    rgba(239, 232, 214, 0.28);
  --gold:           #E0A93F;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.1;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: var(--step-4); font-weight: 500; }
h2 { font-size: var(--step-3); font-weight: 500; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { max-width: 68ch; margin: 0 0 1em; color: var(--ink-soft); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.85em 1.5em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--green-deep);
  color: var(--white-warm);
}
.btn-primary:hover { background: var(--green-darker); }
.btn-outline {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn-outline:hover { border-color: var(--ink); }

/* Table row overflow safety */
.scroll-x { overflow-x: auto; }
