/* ==========================================================================
   SONAR SANSAR — INDIAN MOTIF LAYER
   Gold ornament that can sit on any component: jaali lattice, toran strip,
   mandala watermark, lotus title mark, ornate corner frame, gold foil type.
   All line-based and flat. No glow, no shadow.
   ========================================================================== */

:root {
  --gold-foil: linear-gradient(100deg, #8A6F00 0%, #C9A227 22%, #F3D36B 42%, #B8860B 60%, #E6BE00 78%, #8A6F00 100%);
  --jaali: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23C9A227' stroke-width='0.8'%3E%3Cpath d='M22 2C28 11 33 16 42 22 33 28 28 33 22 42 16 33 11 28 2 22 11 16 16 11 22 2Z'/%3E%3Ccircle cx='22' cy='22' r='3'/%3E%3C/g%3E%3Cg fill='%23C9A227'%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='44' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='44' r='1.6'/%3E%3Ccircle cx='44' cy='44' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  --toran: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='30' viewBox='0 0 56 30'%3E%3Cpath d='M0 3Q14 15 28 3T56 3' fill='none' stroke='%23C9A227' stroke-width='1.2'/%3E%3Cpath d='M28 9v5' stroke='%23C9A227' stroke-width='1'/%3E%3Cpath d='M28 14c4 3 5 7 0 13-5-6-4-10 0-13Z' fill='%23E6BE00'/%3E%3Cpath d='M28 17v8' stroke='%238A6F00' stroke-width='.6'/%3E%3Ccircle cx='0' cy='3' r='2.2' fill='%238A2BE2'/%3E%3Ccircle cx='56' cy='3' r='2.2' fill='%238A2BE2'/%3E%3C/svg%3E");
}

/* Jaali lattice background — add to any section */
.ss-jaali { position: relative; isolation: isolate; }
.ss-jaali::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--jaali) 0 0 / 44px 44px repeat;
  opacity: var(--jaali-opacity, 0.22);
  /* pattern lives at the edges and fades out behind content, so text keeps full contrast */
  -webkit-mask: radial-gradient(70% 75% at 50% 50%, transparent 35%, #000 100%);
          mask: radial-gradient(70% 75% at 50% 50%, transparent 35%, #000 100%);
}

/* Toran — mango-leaf garland strip */
.ss-toran { height: 30px; background: var(--toran) 0 0 / 56px 30px repeat-x; }
.ss-toran--sm { height: 22px; background-size: 42px 22px; }

/* Mandala watermark */
.ss-mandala { position: absolute; pointer-events: none; color: var(--gold-500); opacity: var(--mandala-opacity, 0.22); width: var(--mandala-size, 520px); height: auto; aspect-ratio: 1; }
@media (prefers-reduced-motion: no-preference) { .ss-mandala--spin { animation: ss-spin 140s linear infinite; } }

/* Lotus mark over section titles */
.ss-lotus { display: block; width: 64px; height: 32px; margin: 0 auto var(--space-3); color: var(--gold-600); }

/* Ornate frame: gold double hairline + corner flourishes */
.ss-ornate { position: relative; }
.ss-ornate::after {
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: calc(var(--radius-xl) - 8px);
}
.ss-ornate__corner { position: absolute; width: 54px; height: 54px; color: var(--gold-500); pointer-events: none; z-index: 1; }
.ss-ornate__corner--tl { top: 16px; left: 16px; }
.ss-ornate__corner--tr { top: 16px; right: 16px; transform: scaleX(-1); }
.ss-ornate__corner--bl { bottom: 16px; left: 16px; transform: scaleY(-1); }
.ss-ornate__corner--br { bottom: 16px; right: 16px; transform: scale(-1, -1); }

/* Gold foil type — for large display words only (decorative contrast) */
.ss-foil {
  background: var(--gold-foil);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@media (prefers-reduced-motion: no-preference) { .ss-foil--shimmer { animation: ss-foil 6s var(--ease-in-out) infinite; } }
@keyframes ss-foil { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

/* Section title upgrade: gold rules ending in a diamond */
.ss-title::before, .ss-title::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
  -webkit-mask: none; mask: none;
}
.ss-title::after { background: linear-gradient(270deg, transparent, var(--gold-500)); }
.ss-title > span { position: relative; padding-inline: 18px; }
.ss-title > span::before, .ss-title > span::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  background: var(--gold-500); transform: rotate(45deg);
}
.ss-title > span::before { left: 0; }
.ss-title > span::after { right: 0; }

/* Royal theme — deep violet with gold */
[data-theme="royal"] {
  --color-bg: #1E0838;
  --color-bg-alt: var(--violet-900);
  --color-surface: var(--violet-900);
  --color-ink: #FFF8E6;
  --color-ink-muted: rgba(255, 248, 230, 0.8);
  --color-ink-subtle: rgba(255, 248, 230, 0.6);
  --color-heading: #FFF8E6;
  --color-line: rgba(230, 190, 0, 0.24);
  --color-line-strong: rgba(230, 190, 0, 0.5);
  --color-accent: var(--gold-400);
  --color-accent-hover: var(--gold-200);
  --color-accent-ink: var(--violet-950);
  --color-gilt: var(--gold-400);
  --color-mark: transparent;
  --color-focus: var(--gold-400);
  --logo-a: var(--gold-400);
  --logo-b: #FFF8E6;
  color-scheme: dark;
}

/* Jharokha — scalloped Mughal arch card */
.ss-jharokha {
  --jharokha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 400' preserveAspectRatio='none'%3E%3Cpath d='M14 380V206C14 136 66 98 116 70C136 59 146 46 150 22C154 46 164 59 184 70C234 98 286 136 286 206V380Q286 400 266 400H34Q14 400 14 380Z'/%3E%3C/svg%3E");
  position: relative;
  display: grid;
  aspect-ratio: 3 / 4;
  isolation: isolate;
  color: #fff;
  text-align: center;
}
.ss-jharokha__shape {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  -webkit-mask: var(--jharokha) center / 100% 100% no-repeat; mask: var(--jharokha) center / 100% 100% no-repeat;
  background: var(--violet-100);
}
.ss-jharokha__shape img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); transition: transform 1200ms var(--ease-out); }
.ss-jharokha__shape::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(30, 8, 56, 0.85) 0%, rgba(30, 8, 56, 0.25) 40%, rgba(30, 8, 56, 0) 60%); }
.ss-jharokha__line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; stroke-width: 4; pointer-events: none; }
.ss-jharokha__line--inner { inset: 13px; width: calc(100% - 26px); height: calc(100% - 26px); stroke-width: 1.6; opacity: 0.9; }
.ss-jharokha__body { align-self: end; display: grid; justify-items: center; gap: 4px; padding: 0 var(--space-4) clamp(var(--space-6), 3vw, var(--space-10)); }
.ss-jharokha__kicker { font-size: var(--text-micro); font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-300); }
.ss-jharokha__value { font-family: var(--font-display); font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem); line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; }
.ss-jharokha__cta { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2); font-size: var(--text-micro); font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: #fff; opacity: 0.9; }
.ss-jharokha__cta .ss-icon { --icon-size: 14px; transition: transform var(--dur-base) var(--ease-out); }
@media (hover: hover) {
  .ss-jharokha:hover .ss-jharokha__shape img { transform: scale(1.07); }
  .ss-jharokha:hover .ss-jharokha__cta .ss-icon { transform: translateX(4px); }
}
