/* ============================================================
   Amritbani — shared styles for all pages
   Palette: deep maroon dusk, temple-gold, marble cream
   ============================================================ */
:root {
  --night:      #3a0f14;
  --night-2:    #4a1620;
  --night-3:    #5c1f2a;
  --gold:       #d9a441;
  --gold-soft:  #e9c877;
  --cream:      #f8f1e6;
  --cream-2:    #f0e6d3;
  --ink:        #2b201c;
  --ink-soft:   #6f5f56;
  --sand:       #bfa584;
  --line:       #e6d9c3;
  --maxw:       720px;

  /* Fixed (non-theme-flipping) text colours for surfaces that stay the
     same maroon-night colour in every theme — the hero and the header
     when it sits over the hero (data-on-dark). --cream/--ink flip
     meaning between themes, so using them here would go dark-on-dark
     in Dark/OLED mode. */
  --on-dark-text:      #f8f1e6;
  --on-dark-text-soft: rgba(248,241,230,.88);

  --fs-gur:      clamp(22px, 4.4vw, 28px);
  --fs-translit: 16px;
  --fs-en:       18px;
  --fs-body:     17px;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Inter", system-ui, sans-serif;
  --gur:   "Mukta Mahee", "Mukta", "Inter", sans-serif;

  --off-h: 0px;
}

[data-theme="dark"] {
  --cream:   #17110f;
  --cream-2: #1f1613;
  --ink:     #f1e9de;
  --ink-soft:#c9b8a8;
  --line:    #3a2c24;
}

[data-theme="oled"] {
  --cream:   #000000;
  --cream-2: #0a0807;
  --ink:     #f1e9de;
  --ink-soft:#c9b8a8;
  --line:    #241c17;
}

[data-text-size="sm"] { --fs-gur: 20px; --fs-translit: 14px; --fs-en: 16px; --fs-body: 15px; }
[data-text-size="lg"] { --fs-gur: 30px; --fs-translit: 18px; --fs-en: 20px; --fs-body: 19px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: rgba(248,241,230,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(217,164,65,.18);
}
[data-theme="dark"] .site-header, [data-theme="oled"] .site-header {
  background: rgba(23,17,15,.92);
}
/* header that sits over the dark hero gets a transparent variant */
.site-header[data-on-dark] {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

.brand {
  font-family: var(--gur);
  font-weight: 600; font-size: 17px; letter-spacing: .01em;
  display: flex; align-items: center; gap: 11px;
  color: var(--ink); text-decoration: none;
}
.site-header[data-on-dark] .brand { color: var(--on-dark-text); }
.brand .ek { display: inline-flex; }

/* Har Nishaan emblem — har-nishaan.png (black on transparent) rendered via
   CSS mask so its colour follows background-color in any context. */
.har-nishaan {
  display: block;
  width: 24px; height: 24px;
  background-color: var(--gold);
  -webkit-mask: url("har-nishaan.png") center / contain no-repeat;
  mask: url("har-nishaan.png") center / contain no-repeat;
}

/* "Read: Amritbani" brandmark — shared by the hero and the header.
   A gold shine sweeps across twice, then settles; re-fires every 60s. */
.brandmark {
  position: relative; display: inline-block; white-space: nowrap;
  overflow: hidden; padding: 0 .08em;
}
.brandmark::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.55) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: brand-sweep 60s ease-in-out infinite;
}
@keyframes brand-sweep {
  0%          { transform: translateX(-130%); }
  2%          { transform: translateX(130%); }
  2.01%       { transform: translateX(-130%); }
  4%          { transform: translateX(130%); }
  4.01%, 100% { transform: translateX(130%); }
}
.brandmark .bm-read {
  font-family: var(--serif); font-weight: 600; font-style: italic;
  background: linear-gradient(95deg, var(--gold-soft) 0%, var(--gold) 58%, #b9822e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brandmark .bm-colon { color: var(--gold); margin: 0 1px; font-weight: 600; }
.brandmark .bm-amritbani {
  font-family: var(--sans); font-weight: 700; letter-spacing: .04em;
  color: inherit; margin-left: 6px;
}
.site-header[data-on-dark] .brandmark .bm-amritbani { color: var(--on-dark-text); }
.brandmark-lg { display: inline-block; font-size: clamp(32px, 7vw, 56px); }

/* right-side icon buttons (menu) */
.header-actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
  width: 38px; height: 38px;
  background: transparent; border: none; border-radius: 4px;
  cursor: pointer; color: var(--ink-soft);
  display: grid; place-items: center;
  transition: color .18s, background .18s;
}
.site-header[data-on-dark] .icon-btn { color: rgba(248,241,230,.66); }
.icon-btn:hover { color: var(--gold); background: rgba(217,164,65,.08); }
.site-header[data-on-dark] .icon-btn:hover { color: var(--gold-soft); background: rgba(255,255,255,.07); }
.icon-btn svg { width: 18px; height: 18px; pointer-events: none; }

/* hamburger bars → X animation */
.ham { display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.bar {
  display: block; width: 18px; height: 1.5px;
  background: currentColor; border-radius: 1px;
  transition: transform .22s ease, opacity .22s ease;
}
.menu-btn[aria-expanded="true"] .bar-top { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar-mid { opacity: 0; transform: scaleX(0); }
.menu-btn[aria-expanded="true"] .bar-bot { transform: translateY(-6.5px) rotate(-45deg); }

/* dropdown nav menu */
.site-menu {
  position: absolute; top: 100%; right: 0;
  background: var(--night-2);
  border: 1px solid rgba(217,164,65,.22); border-top: none;
  min-width: 210px; max-width: 88vw;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.site-menu a { flex-shrink: 0; }
.site-menu.open { opacity: 1; pointer-events: auto; transform: none; }
.site-menu a {
  display: block; padding: 13px 20px;
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(248,241,230,.68); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color .15s, background .15s;
}
.site-menu a:last-child { border-bottom: none; }
.site-menu a:hover { color: var(--gold-soft); background: rgba(255,255,255,.04); }
.site-menu a[aria-current="page"] { color: var(--gold-soft); }

/* ============================================================
   Nav menu settings (theme toggle + text size) — shown at the
   bottom of the dropdown menu, and reused on settings.html
   ============================================================ */
.menu-settings {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 4px 0 6px;
  flex-shrink: 0;
}
.menu-theme-row, .menu-size-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(248,241,230,.68);
}
.theme-btns, .size-btns { display: flex; gap: 5px; }
.theme-btn, .size-btn {
  height: 30px; padding: 0 9px; border-radius: 2px;
  border: 1px solid rgba(248,241,230,.22); background: transparent;
  cursor: pointer;
  font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .06em;
  color: rgba(248,241,230,.55);
  transition: all .15s;
}
.size-btn { width: 30px; padding: 0; font-size: 11px; }
.theme-btn:hover, .size-btn:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.theme-btn.active, .size-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }

/* settings.html reuses the same rows outside the dark menu context */
.settings-card { border: 1px solid var(--line); border-radius: 10px; background: var(--cream-2); padding: 6px 14px; margin-bottom: 18px; }
.settings-rows { border: none !important; padding: 0 !important; margin: 0 !important; }
.settings-rows .menu-theme-row, .settings-rows .menu-size-row { color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.settings-rows > :last-child { border-bottom: none; }
.settings-rows .theme-btn, .settings-rows .size-btn { color: var(--ink-soft); border-color: var(--line); }
.settings-rows .theme-btn.active, .settings-rows .size-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }
.settings-links { padding: 0 14px; }
.settings-link {
  display: block; padding: 15px 4px; font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); cursor: pointer;
}
.settings-links .settings-link:last-child { border-bottom: none; }
.settings-link:hover { color: var(--gold); }
.page-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 5vw, 38px);
  text-align: center; margin: 0 0 24px;
}

/* ============================================================
   Hero (home page)
   ============================================================ */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 20px 60px;
  background:
    radial-gradient(ellipse at 50% -10%, var(--night-3), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  color: var(--on-dark-text);
  overflow: hidden;
}
.hero-center { max-width: 640px; }
.hero-greeting {
  font-family: var(--gur);
  font-size: clamp(20px, 5.2vw, 34px);
  line-height: 1.3;
  color: var(--gold-soft);
  margin: 0 0 8px;
}
.hero-welcome {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.2;
}
.hw-pre { display: block; font-size: .55em; opacity: .8; margin-bottom: 4px; }
.seva-line {
  font-size: 17px;
  opacity: .88;
  max-width: 520px;
  margin: 0 auto 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--night);
}
.btn-ghost {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.35);
  color: var(--on-dark-text);
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ============================================================
   Page shell (inner pages)
   ============================================================ */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 20px 96px;
}
.ek-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.ek-mark .har-nishaan { width: 44px; height: 44px; background-color: var(--gold); }
.page h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 38px);
  text-align: center;
  margin: 0 0 10px;
}
.page .lede {
  text-align: center;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto 24px;
}
.rule {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 32px;
  opacity: .6;
}

/* ============================================================
   Section / TOC cards
   ============================================================ */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.section-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: var(--cream-2);
  transition: border-color .15s ease, transform .15s ease;
}
.section-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.section-card h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 20px; }
.section-card p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ============================================================
   Reader
   ============================================================ */
.reader-controls {
  position: sticky;
  top: 61px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.reader-controls .nav-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  color: inherit;
}
.reader-controls .nav-btn:hover { border-color: var(--gold); }

.reader-body {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 96px;
}
.verse-line {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.verse-line:last-child { border-bottom: none; }
.v-gurmukhi {
  font-family: var(--gur);
  font-size: var(--fs-gur);
  line-height: 1.5;
  margin: 0 0 6px;
}
.v-translit {
  font-style: italic;
  color: var(--ink-soft);
  font-size: var(--fs-translit);
  margin: 0 0 6px;
}
.v-translation {
  font-size: var(--fs-en);
  margin: 0;
}
.sample-note {
  background: var(--cream-2);
  border: 1px dashed var(--sand);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 20px 48px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.site-footer a { text-decoration: none; color: var(--ink-soft); }
.site-footer a:hover { color: var(--gold); }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 10px; }

/* ============================================================
   Utility
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
