/* ═══════════════════════════════════════════════════════════
   Ghar Mandir — shared site chrome
   Palette, base, ambient background, floating pill nav.
   Page-specific styles stay inline on each page.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Dark palette (default) */
  --ground: #0c0d10;
  --ground-2: #14161b;
  --surface: rgba(255, 250, 240, 0.045);
  --surface-elevated: rgba(255, 250, 240, 0.085);
  --glass-highlight: rgba(255, 245, 225, 0.06);
  --glass-border: rgba(210, 190, 160, 0.12);
  --glass-border-strong: rgba(220, 190, 140, 0.26);
  --nav-bg: rgba(20, 22, 27, 0.72);

  --text: #edeae2;
  --text-dim: #a09a8f;
  --text-mute: #6c665d;

  --marigold: #d5a15b;
  --marigold-warm: #e6b877;
  --marigold-dim: rgba(213, 161, 91, 0.13);

  --ambient-a: rgba(213, 161, 91, 0.22);
  --ambient-b: rgba(169, 74, 59, 0.18);

  /* App-mockup surface (mimics the actual iOS app screen — dark by default) */
  --mockup-bg: rgba(20, 22, 27, 0.9);
  --mockup-tile: rgba(255, 250, 240, 0.05);
  --mockup-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);

  /* Icon chips + scene swatches — themed so they stay visible in both palettes */
  --chip-bg: linear-gradient(160deg, rgba(255, 208, 138, 0.28), rgba(213, 161, 91, 0.10));
  --chip-border: rgba(255, 220, 160, 0.10);
  --swatch-ring: rgba(255, 255, 255, 0.18);

  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --font-display: 'New York', 'Charter', 'Iowan Old Style', ui-serif, Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Noto Sans Gujarati', 'Shruti', system-ui, sans-serif;

  color-scheme: dark;
}

/* Light palette — applied via data-theme, set pre-paint by the head snippet */
:root[data-theme="light"] {
  --ground: #f5f0e4;
  --ground-2: #ede6d3;
  --surface: rgba(80, 55, 25, 0.05);
  --surface-elevated: rgba(80, 55, 25, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(120, 85, 40, 0.14);
  --glass-border-strong: rgba(120, 85, 40, 0.28);
  --nav-bg: rgba(255, 250, 240, 0.72);

  --text: #1c1a15;
  --text-dim: #5c544a;
  --text-mute: #8c8578;

  --marigold: #a67435;
  --marigold-warm: #c28848;
  --marigold-dim: rgba(166, 116, 53, 0.14);

  --ambient-a: rgba(213, 161, 91, 0.40);
  --ambient-b: rgba(200, 120, 80, 0.24);

  --mockup-bg: rgba(255, 250, 240, 0.85);
  --mockup-tile: rgba(80, 55, 25, 0.06);
  --mockup-shadow: 0 20px 60px rgba(80, 55, 25, 0.18);

  --chip-bg: linear-gradient(160deg, rgba(140, 90, 30, 0.26), rgba(140, 90, 30, 0.10));
  --chip-border: rgba(120, 85, 40, 0.28);
  --swatch-ring: rgba(80, 55, 25, 0.45);

  color-scheme: light;
}

/* ── Base ──────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--ground);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
img { max-width: 100%; height: auto; }
@media (max-width: 480px) {
  body { font-size: 16px; }
}

/* ── Ambient background ────────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55% 45% at 25% 20%, var(--ambient-a) 0%, transparent 65%),
    radial-gradient(45% 40% at 80% 80%, var(--ambient-b) 0%, transparent 60%),
    linear-gradient(160deg, var(--ground-2) 0%, var(--ground) 100%);
  filter: blur(30px);
  transition: background 400ms ease;
}
.ambient::before {
  content: '';
  position: absolute;
  inset: -10%;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' seed='7'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.35'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
}

/* ── Floating pill nav ─────────────────────────────────────── */
.nav-wrap {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--nav-bg);
  backdrop-filter: blur(30px) saturate(1.6);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 var(--glass-highlight);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1),
              opacity 300ms,
              background 400ms ease;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
  border-right: 1px solid var(--glass-border);
  margin-right: 8px;
  text-decoration: none;
  color: inherit;
  font-family: var(--font-display);
  font-size: 0.98em;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.nav-brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.9em;
  transition: color 160ms, background 160ms;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--glass-highlight); }
.nav-cta {
  margin-left: 4px;
  padding: 7px 16px !important;
  background: var(--marigold) !important;
  color: var(--ground) !important;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--marigold-warm) !important; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border-radius: 50%;
  background: transparent !important;
  color: var(--text-dim) !important;
  border: none;
  cursor: pointer;
  transition: color 160ms, background 160ms;
}
.theme-toggle:hover {
  color: var(--text) !important;
  background: var(--glass-highlight) !important;
}
.theme-toggle svg {
  width: 17px; height: 17px;
  transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1),
              opacity 200ms;
}
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }

/* Icon swap: show the light-bg icon in light theme, dark-bg icon otherwise. */
:root[data-theme="light"] .icon-dark { display: none; }
:root:not([data-theme="light"]) .icon-light { display: none; }

/* Compact on narrow screens — drop the section links, keep brand + CTA */
@media (max-width: 720px) {
  .nav { padding: 6px 6px 6px 14px; }
  .nav-brand { border-right: none; padding-right: 0; margin-right: 6px; }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 480px) {
  .nav-brand { font-size: 0.92em; }
  .nav-brand img { width: 22px; height: 22px; }
}

/* ── Shared type helpers ───────────────────────────────────── */
.eyebrow {
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--marigold-warm);
  margin-bottom: 16px;
}

/* Anchor targets land clear of the fixed nav pill */
section[id], [id] { scroll-margin-top: 96px; }
