/* =========================================================================
   Goti Family — Heritage palette + responsive layout + tasteful motion.
   ========================================================================= */

:root {
    --c-marigold: #E97C00;
    --c-marigold-dark: #B85F00;
    --c-marigold-soft: #FFE3C2;
    --c-indigo: #1E1B4B;
    --c-indigo-2: #312E81;
    --c-gold: #F59E0B;
    --c-cream: #FFFBEB;
    --c-cream-2: #FFF6E0;
    --c-ink: #1F2937;
    --c-ink-soft: #4B5563;
    --c-line: #EADBC0;
    --c-white: #ffffff;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(30, 27, 75, 0.06);
    --shadow: 0 8px 24px rgba(30, 27, 75, 0.10);
    --shadow-lg: 0 24px 60px rgba(30, 27, 75, 0.18);

    --ease: cubic-bezier(.22,.61,.36,1);
    --ease-out: cubic-bezier(.16,1,.3,1);

    --font-en: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-gu: 'Mukta Vaani', 'Noto Sans Gujarati', system-ui, sans-serif;

    --maxw: 1180px;
    --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-en);
    color: var(--c-ink);
    background: var(--c-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
}
body.page-tree { overflow: hidden; height: 100vh; }

img, svg { max-width: 100%; }
a { color: var(--c-indigo); text-decoration: none; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Gujarati text uses dedicated font */
.gu, .brand-gu, .line-gu, .lede-gu, .prose.gu, h1 .line-gu, h2 .gu, h3 .gu, .qs-form input, #searchInput {
    font-family: var(--font-gu);
}

/* =====================  NAV  ===================== */
.site-nav {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px clamp(16px, 4vw, 32px);
    background: rgba(255, 251, 235, .82);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid rgba(234, 219, 192, .6);
    height: var(--nav-h);
}
.site-nav--compact { background: var(--c-cream); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--c-indigo); }
.brand-mark {
    display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, var(--c-marigold) 0%, var(--c-gold) 100%);
    color: var(--c-white);
    box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-gu { font-family: var(--font-gu); font-weight: 700; font-size: 1.05rem; color: var(--c-indigo); }
.brand-en { font-family: var(--font-en); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-ink-soft); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: 8px 14px; border-radius: 10px; line-height: 1.1;
    color: var(--c-indigo); transition: background .25s var(--ease), color .2s var(--ease);
    font-family: var(--font-gu); font-weight: 500;
}
.nav-links a em { font-style: normal; font-family: var(--font-en); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-ink-soft); }
.nav-links a:hover { background: var(--c-marigold-soft); }
.nav-links a.active { background: var(--c-indigo); color: var(--c-cream); }
.nav-links a.active em { color: var(--c-marigold-soft); }

@media (max-width: 720px) {
    .nav-links a em { display: none; }
    .nav-links a { padding: 6px 10px; font-size: .92rem; }
    .brand-en { display: none; }
}

/* =====================  BUTTONS  ===================== */
.btn {
    --btn-bg: var(--c-indigo);
    --btn-fg: var(--c-cream);
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 22px;
    background: var(--btn-bg); color: var(--btn-fg);
    border: none; border-radius: 999px; cursor: pointer;
    font-family: var(--font-gu); font-weight: 700; font-size: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn em { font-style: normal; font-family: var(--font-en); font-weight: 500; font-size: .82rem; letter-spacing: .04em; opacity: .85; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary { --btn-bg: linear-gradient(135deg, var(--c-marigold) 0%, var(--c-marigold-dark) 100%); --btn-fg: #fff; }
.btn-primary:hover { --btn-bg: linear-gradient(135deg, var(--c-marigold-dark) 0%, var(--c-marigold) 100%); }
.btn-ghost {
    --btn-bg: transparent; --btn-fg: var(--c-indigo);
    border: 1.5px solid rgba(30,27,75,.18);
    box-shadow: none;
}
.btn-ghost:hover { background: rgba(30,27,75,.06); }

/* =====================  HERO  ===================== */
.hero {
    position: relative;
    padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 32px) clamp(32px, 5vw, 64px);
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(233,124,0,.10), transparent 60%),
        radial-gradient(900px 600px at 0% 110%, rgba(30,27,75,.08), transparent 60%),
        var(--c-cream);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; color: var(--c-indigo); }
.banyan {
    position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
    width: min(1100px, 100%); height: 80%;
}
.banyan-roots path {
    stroke-dasharray: 600; stroke-dashoffset: 600;
    animation: drawBranch 2.4s var(--ease-out) forwards;
}
.banyan-roots path:nth-child(2){ animation-delay: .2s; }
.banyan-roots path:nth-child(3){ animation-delay: .25s; }
.banyan-roots path:nth-child(4){ animation-delay: .4s; }
.banyan-roots path:nth-child(5){ animation-delay: .42s; }
.banyan-roots path:nth-child(6){ animation-delay: .55s; }
.banyan-roots path:nth-child(7){ animation-delay: .58s; }
.banyan-roots path:nth-child(8){ animation-delay: .7s; }
.banyan-leaves circle {
    transform-origin: center; transform: scale(0);
    animation: leafPop .9s var(--ease-out) forwards;
}
.banyan-leaves circle:nth-child(1) { animation-delay: .8s; }
.banyan-leaves circle:nth-child(2) { animation-delay: .9s; }
.banyan-leaves circle:nth-child(3) { animation-delay: 1.0s; }
.banyan-leaves circle:nth-child(4) { animation-delay: 1.1s; }
.banyan-leaves circle:nth-child(5) { animation-delay: 1.25s; }

@keyframes drawBranch { to { stroke-dashoffset: 0; } }
@keyframes leafPop { to { transform: scale(1); } }

.hero-content { position: relative; max-width: var(--maxw); margin: 0 auto; text-align: center; }
.eyebrow {
    display: inline-block;
    padding: 6px 14px; border-radius: 999px;
    background: var(--c-marigold-soft); color: var(--c-marigold-dark);
    font-family: var(--font-gu); font-weight: 700; font-size: .85rem; letter-spacing: .06em;
    margin: 0 0 18px;
}
.hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1.05;
    margin: 0 0 18px;
    color: var(--c-indigo);
}
.hero h1 .line-gu { display: block; font-family: var(--font-gu); font-weight: 700; }
.hero h1 .line-en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .72em; margin-top: 6px; }

.lede { max-width: 720px; margin: 0 auto 30px; font-size: 1.1rem; color: var(--c-ink-soft); }
.lede-gu { display: block; font-size: 1.18rem; color: var(--c-ink); margin-bottom: 6px; }
.lede-en { display: block; font-style: italic; }

.hero-actions { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 56px; }

.hero-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
    gap: clamp(12px, 3vw, 32px);
    max-width: 720px; margin: 0 auto;
}
.stat {
    background: rgba(255,255,255,.7);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 18px 12px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}
.stat-num {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: var(--c-indigo); line-height: 1;
}
.stat-label { margin-top: 6px; font-family: var(--font-gu); color: var(--c-ink-soft); font-size: .92rem; }
.stat-label em { font-style: normal; font-family: var(--font-en); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-left: 6px; }

/* =====================  QUICK SEARCH  ===================== */
.quick-search {
    margin: -40px auto 64px;
    max-width: 880px;
    padding: 0 clamp(16px, 4vw, 32px);
    position: relative; z-index: 4;
}
.qs-card {
    background: linear-gradient(180deg, #fff 0%, #fffaf0 100%);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 4vw, 36px);
    box-shadow: var(--shadow-lg);
}
.qs-card h2 {
    margin: 0 0 6px;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.3rem, 2.6vw, 1.8rem); color: var(--c-indigo);
}
.qs-card h2 .gu { font-family: var(--font-gu); display: block; }
.qs-card h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .82em; }
.qs-card > p { margin: 0 0 18px; color: var(--c-ink-soft); font-size: .95rem; }

.qs-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qs-form { position: relative; }
.qs-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--c-ink-soft); pointer-events: none; }
.qs-form input {
    flex: 1; min-width: 0;
    padding: 16px 18px 16px 48px;
    border: 1.5px solid var(--c-line);
    border-radius: 999px;
    font-size: 1.05rem;
    background: #fff; color: var(--c-ink);
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.qs-form input:focus { outline: none; border-color: var(--c-marigold); box-shadow: 0 0 0 4px rgba(233,124,0,.15); }

/* =====================  ABOUT  ===================== */
.about {
    max-width: var(--maxw);
    margin: 0 auto 96px;
    padding: 0 clamp(16px, 4vw, 32px);
}
.section-eyebrow {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: var(--c-indigo); color: var(--c-marigold-soft);
    font-family: var(--font-en); font-weight: 600; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
    margin: 0 0 14px;
}
.section-eyebrow.center { display: inline-block; }
.center { text-align: center; }

.about-grid {
    display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
    gap: clamp(24px, 5vw, 56px); align-items: start;
}
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

.about-text h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15;
    margin: 0 0 18px; color: var(--c-indigo);
}
.about-text h2 .gu { font-family: var(--font-gu); display: block; }
.about-text h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .8em; margin-top: 4px; }
.prose { color: var(--c-ink-soft); font-size: 1.02rem; margin: 0 0 14px; }
.prose.gu { color: var(--c-ink); }

.about-points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.about-points li {
    background: rgba(255,255,255,.65); border: 1px solid var(--c-line);
    border-radius: var(--radius); padding: 12px 16px; color: var(--c-ink-soft);
}
.about-points strong { color: var(--c-indigo); }

.about-card {
    background: var(--c-indigo);
    color: var(--c-cream);
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3vw, 28px);
    box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.about-card::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(closest-side, rgba(245,158,11,.55), transparent 70%);
    filter: blur(2px);
}
.card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px dashed rgba(255,251,235,.18); position: relative; z-index: 1; }
.card-row:last-child { border-bottom: 0; }
.card-label { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-marigold-soft); }
.card-value { text-align: right; font-family: var(--font-gu); font-weight: 700; }
.card-value em { font-style: normal; font-family: var(--font-en); font-size: .85em; opacity: .8; display: block; }

/* =====================  FEATURES  ===================== */
.features {
    max-width: var(--maxw); margin: 0 auto 96px; padding: 0 clamp(16px, 4vw, 32px);
}
.features h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 36px; color: var(--c-indigo);
}
.features h2 .gu { font-family: var(--font-gu); display: block; }
.features h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .8em; }
.feature-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature {
    background: #fff; border: 1px solid var(--c-line);
    border-radius: var(--radius); padding: 22px;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--c-marigold); }
.feature-icon {
    display: grid; place-items: center;
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--c-marigold-soft), #fff);
    color: var(--c-marigold-dark); margin-bottom: 14px;
}
.feature h3 { margin: 0 0 8px; font-family: var(--font-gu); font-weight: 700; font-size: 1.12rem; color: var(--c-indigo); }
.feature h3 em { font-style: normal; font-family: var(--font-en); font-weight: 500; font-size: .82em; color: var(--c-ink-soft); display: block; }
.feature p { margin: 0; color: var(--c-ink-soft); font-size: .95rem; }
.feature p em { font-style: italic; }

/* =====================  CONTACT  ===================== */
.contact { max-width: 980px; margin: 0 auto 96px; padding: 0 clamp(16px, 4vw, 32px); }
.contact-card {
    background: linear-gradient(135deg, var(--c-indigo) 0%, var(--c-indigo-2) 100%);
    color: var(--c-cream);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 5vw, 56px);
    box-shadow: var(--shadow-lg);
    position: relative; overflow: hidden;
}
.contact-card::before, .contact-card::after {
    content: ''; position: absolute; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(245,158,11,.30), transparent 70%);
    filter: blur(8px);
}
.contact-card::before { top: -80px; left: -80px; width: 260px; height: 260px; }
.contact-card::after { bottom: -100px; right: -100px; width: 320px; height: 320px; background: radial-gradient(closest-side, rgba(233,124,0,.30), transparent 70%); }
.contact-card .section-eyebrow { background: var(--c-marigold); color: var(--c-indigo); }
.contact-card h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 16px; position: relative; }
.contact-card h2 .gu { font-family: var(--font-gu); display: block; }
.contact-card h2 .en { display: block; font-style: italic; color: var(--c-marigold-soft); font-size: .82em; }
.contact-card .prose { color: rgba(255,251,235,.86); position: relative; }

.contact-grid {
    display: grid; gap: 16px; margin-top: 20px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    position: relative;
}
.contact-item {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 20px;
    background: rgba(255,251,235,.10); border: 1px solid rgba(255,251,235,.18);
    border-radius: var(--radius); color: var(--c-cream);
    transition: background .25s var(--ease), transform .25s var(--ease);
}
.contact-item:hover { background: rgba(255,251,235,.18); transform: translateY(-2px); }
.ci-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-marigold-soft); }
.ci-value { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; letter-spacing: .02em; }
.ci-name { font-family: var(--font-gu); font-size: .95rem; opacity: .85; }
.ci-name em { font-style: normal; font-family: var(--font-en); opacity: .8; }

.privacy {
    margin-top: 22px;
    padding: 14px 16px;
    background: rgba(255,251,235,.08);
    border-radius: var(--radius);
    font-size: .9rem; color: rgba(255,251,235,.85);
    position: relative;
}
.privacy strong { color: var(--c-marigold-soft); }

/* =====================  FOOTER  ===================== */
.site-foot { background: var(--c-indigo); color: var(--c-cream); padding: 32px clamp(16px, 4vw, 32px); }
.foot-inner {
    max-width: var(--maxw); margin: 0 auto;
    display: grid; gap: 18px;
    grid-template-columns: 1fr 1fr 1fr; align-items: center;
}
.foot-brand { display: flex; flex-direction: column; line-height: 1.2; }
.foot-brand .brand-gu { color: var(--c-cream); }
.foot-brand .brand-en { color: var(--c-marigold-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.foot-links a { color: var(--c-marigold-soft); font-family: var(--font-gu); }
.foot-links a:hover { color: #fff; }
.foot-credit { text-align: right; color: rgba(255,251,235,.7); font-size: .82rem; }
@media (max-width: 720px) {
    .foot-inner { grid-template-columns: 1fr; text-align: center; }
    .foot-credit { text-align: center; }
}

/* =====================  HOW-TO DEMO  ===================== */
.how-to-demo { max-width: var(--maxw); margin: 0 auto 80px; padding: 0 clamp(16px, 4vw, 32px); }
.howto-card {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: clamp(24px, 4vw, 48px); align-items: center;
    background: linear-gradient(135deg, #fff, #fffaf0);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 48px);
    box-shadow: var(--shadow-sm);
}
@media (max-width: 820px) { .howto-card { grid-template-columns: 1fr; } }

.howto-text h2 { font-family: var(--font-display); margin: 0 0 18px; color: var(--c-indigo); font-size: clamp(1.5rem, 3vw, 2rem); }
.howto-text h2 .gu { font-family: var(--font-gu); display: block; }
.howto-text h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .82em; }
.howto-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.howto-steps li {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 14px 0; border-bottom: 1px dashed var(--c-line);
}
.howto-steps li:last-child { border-bottom: 0; }
.step-num {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: var(--c-marigold); color: #fff;
    display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
    box-shadow: 0 4px 12px rgba(233,124,0,.35);
}
.step-body { display: flex; flex-direction: column; gap: 4px; }
.step-body strong { font-family: var(--font-gu); color: var(--c-indigo); font-size: 1.05rem; }
.step-en { color: var(--c-ink-soft); font-size: .92rem; }
.step-en code {
    background: var(--c-marigold-soft); color: var(--c-marigold-dark);
    padding: 1px 6px; border-radius: 4px; font-family: var(--font-en);
    font-size: .9em; font-weight: 600;
}

/* Animated demo frame */
.demo-frame {
    background: var(--c-cream-2); border: 1px solid var(--c-line);
    border-radius: var(--radius); padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6), var(--shadow-sm);
}
.demo-bar {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1.5px solid var(--c-line); border-radius: 999px;
    padding: 12px 16px; min-height: 48px;
    color: var(--c-ink-soft);
}
.demo-input { font-family: var(--font-gu); color: var(--c-ink); font-size: 1rem; flex: 1; }
.demo-cursor { display: inline-block; width: 2px; background: var(--c-marigold); height: 1em; margin-left: 1px; vertical-align: middle; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-results { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 110px; }
.demo-result {
    background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
    padding: 10px 14px; display: flex; align-items: center; gap: 10px;
    opacity: 0; transform: translateY(8px);
    animation: demoSlideIn .4s var(--ease-out) forwards;
    font-family: var(--font-gu); color: var(--c-indigo);
}
.demo-result mark { background: var(--c-marigold-soft); color: var(--c-marigold-dark); padding: 0 3px; border-radius: 3px; font-weight: 600; }
.demo-result-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-marigold), var(--c-marigold-dark));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    flex-shrink: 0;
}
@keyframes demoSlideIn { to { opacity: 1; transform: none; } }

/* =====================  HOMEPAGE QS DROPDOWN  ===================== */
.qs-form { position: relative; }
.qs-voice {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--c-indigo); color: var(--c-marigold-soft);
    border: none; cursor: pointer; display: grid; place-items: center;
    transition: background .2s var(--ease);
    flex-shrink: 0;
}
.qs-voice:hover { background: var(--c-marigold); color: #fff; }
.qs-voice.is-listening { background: var(--c-marigold); color: #fff; animation: pulseRing 1.4s var(--ease) infinite; }
.qs-dropdown {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 360px; overflow-y: auto; padding: 8px;
    z-index: 30;
    display: flex; flex-direction: column; gap: 4px;
    animation: ddSlide .25s var(--ease-out);
}
@keyframes ddSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.qs-item {
    display: flex; gap: 12px; align-items: center;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--c-ink); text-decoration: none;
    transition: background .15s var(--ease), transform .15s var(--ease);
}
.qs-item:hover { background: var(--c-marigold-soft); transform: translateX(2px); }
.qs-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-marigold), var(--c-marigold-dark));
    color: #fff; display: grid; place-items: center;
    font-family: var(--font-gu); font-weight: 700; flex-shrink: 0;
}
.qs-meta { flex: 1; min-width: 0; line-height: 1.3; }
.qs-name { font-family: var(--font-gu); font-weight: 600; color: var(--c-indigo); display: block; }
.qs-rel { font-size: .82rem; color: var(--c-ink-soft); }
.qs-arrow { color: var(--c-ink-soft); }

/* =====================  EVENTS (BIRTHDAYS / MEMORIAL)  ===================== */
.events { max-width: var(--maxw); margin: 0 auto 96px; padding: 0 clamp(16px, 4vw, 32px); }
.events-head { text-align: center; margin-bottom: 22px; }
.events h2 { font-family: var(--font-display); margin: 0; color: var(--c-indigo); font-size: clamp(1.6rem, 3vw, 2.2rem); }
.events h2 .gu { font-family: var(--font-gu); display: block; }
.events h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .8em; }
.events-list {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.events-loading { grid-column: 1 / -1; text-align: center; padding: 30px; color: var(--c-ink-soft); }
.events-note {
    grid-column: 1 / -1;
    text-align: center; padding: 6px 0 4px;
    color: var(--c-marigold-dark); font-family: var(--font-gu); font-size: .9rem;
}
.events-empty {
    grid-column: 1 / -1; text-align: center; padding: 30px;
    background: #fff; border: 1px dashed var(--c-line); border-radius: var(--radius);
    color: var(--c-ink-soft);
}
.evt {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--c-line);
    border-radius: var(--radius); padding: 14px 16px;
    text-decoration: none; color: var(--c-ink);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
    position: relative; overflow: hidden;
}
.evt:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--c-marigold); }
.evt-icon { font-size: 1.6rem; flex-shrink: 0; }
.evt-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.evt-kind { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-marigold-dark); font-weight: 600; }
.evt-kind em { font-style: normal; color: var(--c-ink-soft); }
.evt-name { font-family: var(--font-gu); font-weight: 700; color: var(--c-indigo); font-size: 1.05rem; }
.evt-date { font-size: .85rem; color: var(--c-ink-soft); }
.evt-date strong { color: var(--c-indigo); font-family: var(--font-gu); }
.evt--memorial .evt-kind { color: #6b7280; }
.evt--memorial { background: #faf9f5; }
.evt.is-today {
    background: linear-gradient(135deg, var(--c-marigold-soft), #fff);
    border-color: var(--c-marigold);
    box-shadow: 0 0 0 3px rgba(233,124,0,.18);
}
.evt.is-today::before {
    content: 'આજે · TODAY'; position: absolute; top: 8px; right: 10px;
    background: var(--c-marigold); color: #fff;
    font-size: .65rem; letter-spacing: .12em; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
}
.evt-wa {
    display: inline-flex; align-items: center; gap: 6px;
    background: #25D366; color: #fff;
    padding: 8px 12px; border-radius: 999px;
    font-size: .82rem; text-decoration: none; font-weight: 600;
    flex-shrink: 0; align-self: center;
    transition: background .2s var(--ease), transform .2s var(--ease);
    box-shadow: var(--shadow-sm);
}
.evt-wa svg { width: 14px; height: 14px; display: block; }
.evt-wa:hover { background: #128C7E; transform: scale(1.05); }
.evt-wa span { white-space: nowrap; }

/* =====================  TRIBUTE  ===================== */
.tribute { max-width: 980px; margin: 0 auto 96px; padding: 0 clamp(16px, 4vw, 32px); }
.tribute-card {
    background: linear-gradient(135deg, #fff7ea 0%, #fff 100%);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 5vw, 56px);
    text-align: center; position: relative; overflow: hidden;
    box-shadow: var(--shadow);
}
.tribute-card::before {
    content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
    width: 220px; height: 220px;
    background: radial-gradient(closest-side, rgba(233,124,0,.18), transparent 70%);
    pointer-events: none;
}
.tribute-mark { font-size: 3rem; margin-bottom: 6px; position: relative; }
.tribute-card h2 { font-family: var(--font-display); margin: 8px 0 22px; color: var(--c-indigo); font-size: clamp(1.5rem, 3vw, 2rem); position: relative; }
.tribute-card h2 .gu { font-family: var(--font-gu); display: block; }
.tribute-card h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .82em; }
.tribute-quote {
    margin: 0 auto 14px; max-width: 720px; padding: 0;
    color: var(--c-ink); font-size: 1.08rem; line-height: 1.7;
    font-style: italic;
    position: relative;
}
.tribute-quote.gu { font-family: var(--font-gu); font-style: normal; font-size: 1.15rem; color: var(--c-indigo); }
.tribute-quote.en { color: var(--c-ink-soft); }
.tribute-by {
    display: inline-flex; align-items: center; gap: 14px;
    margin-top: 24px; padding: 14px 24px;
    background: var(--c-indigo); color: var(--c-cream); border-radius: 999px;
    box-shadow: var(--shadow);
}
.tribute-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-marigold), var(--c-marigold-dark));
    color: #fff; display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    flex-shrink: 0;
}
.tribute-by-text { text-align: left; line-height: 1.3; }
.tribute-by-text strong { font-family: var(--font-gu); }
.tribute-by-text em { font-style: italic; opacity: .85; font-size: .85rem; display: block; }

.tribute-body { position: relative; max-width: 760px; margin: 0 auto; }
.tribute-body .tribute-quote { text-align: left; margin-bottom: 18px; }
.tribute-body .tribute-quote.gu { font-size: 1.08rem; line-height: 1.85; }
.tribute-body .tribute-quote.en { font-size: 1rem; line-height: 1.7; }

.tribute-call {
    display: flex; gap: 16px; align-items: flex-start;
    background: rgba(233, 124, 0, .08);
    border: 1px solid var(--c-marigold-soft);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-top: 26px;
    text-align: left;
    position: relative;
}
.tribute-call .tc-icon {
    font-size: 1.8rem; flex-shrink: 0;
    width: 48px; height: 48px;
    background: var(--c-marigold-soft); border-radius: 50%;
    display: grid; place-items: center;
}
.tribute-call .tc-body { flex: 1; }
.tribute-call .tc-body strong {
    display: block; font-family: var(--font-gu); color: var(--c-indigo);
    font-size: 1.08rem; margin-bottom: 4px;
}
.tribute-call .tc-body p { margin: 0; color: var(--c-ink-soft); font-size: .96rem; line-height: 1.6; }
.tribute-call .tc-body em { font-style: italic; }
.tribute-call a { color: var(--c-marigold-dark); font-weight: 600; }
.tribute-call a:hover { text-decoration: underline; }

/* =====================  ROADMAP  ===================== */
.roadmap { max-width: var(--maxw); margin: 0 auto 96px; padding: 0 clamp(16px, 4vw, 32px); }
.roadmap-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.roadmap h2 {
    font-family: var(--font-display); margin: 6px 0 14px; color: var(--c-indigo);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.roadmap h2 .gu { font-family: var(--font-gu); display: block; }
.roadmap h2 .en { display: block; font-style: italic; color: var(--c-marigold-dark); font-size: .8em; }
.roadmap-lede { color: var(--c-ink-soft); font-size: 1rem; }
.roadmap-lede em { font-style: italic; }

.roadmap-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.rm-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    padding: 24px 22px;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
    overflow: hidden;
}
.rm-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--c-marigold), var(--c-gold));
    opacity: .9;
}
.rm-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--c-marigold);
}
.rm-status {
    display: inline-block;
    padding: 4px 10px; border-radius: 999px;
    font-family: var(--font-en); font-size: .68rem; letter-spacing: .12em;
    text-transform: uppercase; font-weight: 700;
    margin-bottom: 14px;
}
.rm-card--soon    .rm-status { background: #DCFCE7; color: #15803D; }
.rm-card--planned .rm-status { background: #DBEAFE; color: #1E40AF; }
.rm-card--idea    .rm-status { background: var(--c-marigold-soft); color: var(--c-marigold-dark); }
.rm-card--soon::before    { background: linear-gradient(90deg, #16a34a, #4ade80); }
.rm-card--planned::before { background: linear-gradient(90deg, #1E40AF, #60a5fa); }
.rm-card--idea::before    { background: linear-gradient(90deg, var(--c-marigold), var(--c-gold)); }

.rm-icon {
    display: grid; place-items: center;
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--c-marigold-soft), #fff);
    color: var(--c-marigold-dark); margin-bottom: 14px;
}
.rm-card--soon    .rm-icon { background: linear-gradient(135deg, #DCFCE7, #fff); color: #15803D; }
.rm-card--planned .rm-icon { background: linear-gradient(135deg, #DBEAFE, #fff); color: #1E40AF; }
.rm-card h3 {
    margin: 0 0 8px; font-family: var(--font-gu); font-weight: 700;
    color: var(--c-indigo); font-size: 1.12rem; display: flex; flex-direction: column; gap: 2px;
}
.rm-card h3 em { font-style: normal; font-family: var(--font-en); font-size: .78em; font-weight: 500; color: var(--c-ink-soft); }
.rm-card p { margin: 0; color: var(--c-ink-soft); font-size: .95rem; line-height: 1.55; }
.rm-card p em { font-style: italic; }
.rm-card p a { color: var(--c-marigold-dark); font-weight: 600; }

/* =====================  TODAY POPUP  ===================== */
.today-popup {
    position: fixed; bottom: 20px; right: 20px; z-index: 80;
    background: linear-gradient(135deg, var(--c-marigold), var(--c-marigold-dark));
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 14px;
    max-width: 380px;
    animation: popupIn .5s var(--ease-out) both;
    cursor: pointer;
}
@keyframes popupIn {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to   { opacity: 1; transform: none; }
}
.today-popup .tp-icon {
    font-size: 2rem; width: 48px; height: 48px;
    background: rgba(255,255,255,.2); border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0;
}
.today-popup .tp-body { flex: 1; min-width: 0; line-height: 1.3; }
.today-popup .tp-label {
    display: block; font-size: .72rem; letter-spacing: .14em;
    text-transform: uppercase; font-weight: 700; opacity: .85;
}
.today-popup .tp-name {
    display: block; font-family: var(--font-gu); font-weight: 700; font-size: 1.05rem;
    margin-top: 2px;
}
.today-popup .tp-actions { display: flex; gap: 6px; margin-top: 8px; }
.today-popup .tp-btn {
    background: rgba(255,255,255,.95); color: var(--c-marigold-dark);
    padding: 5px 10px; border-radius: 999px;
    font-size: .8rem; font-weight: 600; text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.today-popup .tp-btn:hover { background: #fff; }
.today-popup .tp-close {
    position: absolute; top: 6px; right: 8px;
    background: transparent; border: none; color: rgba(255,255,255,.85);
    font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 4px;
}
.today-popup .tp-close:hover { color: #fff; }
@media (max-width: 600px) {
    .today-popup { left: 10px; right: 10px; max-width: none; bottom: 10px; }
}

/* =====================  CONTACT BUTTONS (call + WhatsApp)  ===================== */
.ci-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ci-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 999px;
    font-family: var(--font-gu); font-weight: 600; font-size: .92rem;
    text-decoration: none;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.ci-btn svg { width: 16px; height: 16px; display: block; }
.ci-btn--call { background: #fff; color: var(--c-indigo); border: 1.5px solid #fff; }
.ci-btn--call:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ci-btn--wa   { background: #25D366; color: #fff; border: 1.5px solid #25D366; }
.ci-btn--wa:hover { background: #128C7E; border-color: #128C7E; transform: translateY(-1px); }

/* =====================  REVEAL ANIMATION  ===================== */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* =====================  TREE PAGE LAYOUT  ===================== */
.tree-shell {
    height: calc(100vh - var(--nav-h));
    display: grid;
    grid-template-columns: 360px 1fr;
}
@media (max-width: 900px) {
    .tree-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}

.search-panel {
    background: var(--c-cream-2);
    border-right: 1px solid var(--c-line);
    padding: 18px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 14px;
}
@media (max-width: 900px) {
    .search-panel { border-right: 0; border-bottom: 1px solid var(--c-line); max-height: 50vh; }
}

.sp-head h1 { font-family: var(--font-display); margin: 0 0 4px; color: var(--c-indigo); font-size: 1.6rem; }
.sp-head h1 .gu { font-family: var(--font-gu); }
.sp-head h1 .en { font-style: italic; color: var(--c-marigold-dark); font-size: .72em; margin-left: 8px; }
.sp-head p { margin: 0; color: var(--c-ink-soft); font-size: .9rem; }
.sp-head p em { font-style: italic; }

.sp-search { position: relative; display: flex; align-items: center; }
.sp-icon { position: absolute; left: 14px; color: var(--c-ink-soft); pointer-events: none; }
#searchInput {
    width: 100%; padding: 14px 56px 14px 42px;
    border: 1.5px solid var(--c-line); border-radius: 999px;
    background: #fff; font-size: 1rem;
    transition: border-color .2s var(--ease), box-shadow .25s var(--ease);
}
#searchInput:focus { outline: none; border-color: var(--c-marigold); box-shadow: 0 0 0 4px rgba(233,124,0,.15); }

.voice-btn {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--c-indigo); color: var(--c-marigold-soft);
    border: none; cursor: pointer; display: grid; place-items: center;
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.voice-btn:hover { background: var(--c-marigold); color: #fff; }
.voice-btn.is-listening { background: var(--c-marigold); color: #fff; animation: pulseRing 1.4s var(--ease) infinite; }
@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(233,124,0,.5); }
    70%  { box-shadow: 0 0 0 14px rgba(233,124,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(233,124,0,0); }
}

.sp-results { display: flex; flex-direction: column; gap: 8px; }
.sp-result {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--c-line);
    border-radius: var(--radius); padding: 12px 14px;
    cursor: pointer; text-align: left;
    transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.sp-result:hover { border-color: var(--c-marigold); transform: translateX(2px); }
.sp-result .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-marigold) 0%, var(--c-marigold-dark) 100%);
    color: #fff; display: grid; place-items: center;
    font-family: var(--font-gu); font-weight: 700;
    flex-shrink: 0;
}
.sp-result .who { flex: 1; min-width: 0; }
.sp-result .name { font-family: var(--font-gu); font-weight: 600; color: var(--c-indigo); }
.sp-result .name mark { background: var(--c-marigold-soft); color: var(--c-marigold-dark); padding: 0 2px; border-radius: 3px; }
.sp-result .relation { font-size: .82rem; color: var(--c-ink-soft); }
.sp-result .relation em { font-style: normal; font-family: var(--font-en); }
.sp-result .arrow { color: var(--c-ink-soft); transition: transform .2s var(--ease); }
.sp-result:hover .arrow { transform: translateX(3px); color: var(--c-marigold-dark); }

.sp-empty { color: var(--c-ink-soft); font-size: .92rem; }
.sp-empty .hint .gu { display: block; font-family: var(--font-gu); }
.sp-empty .hint .en { display: block; font-style: italic; }
.legend { display: flex; gap: 16px; margin-top: 14px; font-size: .82rem; color: var(--c-ink-soft); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot--alive { background: #16a34a; }
.dot--passed { background: #94a3b8; }

/* =====================  TREE STAGE  ===================== */
.tree-stage {
    position: relative; overflow: hidden;
    background:
        radial-gradient(800px 400px at 20% 10%, rgba(233,124,0,.06), transparent 70%),
        radial-gradient(800px 400px at 80% 90%, rgba(30,27,75,.06), transparent 70%),
        var(--c-cream);
}
#treeSvg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#treeSvg:active { cursor: grabbing; }

.stage-toolbar {
    position: absolute; top: 14px; right: 14px; z-index: 5;
    display: flex; gap: 8px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--c-line);
    padding: 6px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}
.tb-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: transparent; color: var(--c-indigo);
    cursor: pointer; font-size: 1.1rem; display: grid; place-items: center;
    transition: background .2s var(--ease);
}
.tb-btn:hover { background: var(--c-marigold-soft); }
.tb-btn--wide { width: auto; padding: 0 14px; gap: 6px; font-size: .82rem; font-family: var(--font-gu); }

.stage-hint {
    position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
    background: rgba(30,27,75,.86); color: var(--c-cream);
    padding: 8px 16px; border-radius: 999px; font-size: .82rem;
    pointer-events: none; opacity: .9;
    display: flex; flex-direction: column; align-items: center; line-height: 1.2;
}
.stage-hint .gu { font-family: var(--font-gu); }
.stage-hint .en { font-style: italic; color: var(--c-marigold-soft); font-size: .8em; }

.tree-loading {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: var(--c-cream); z-index: 4; transition: opacity .4s var(--ease);
}
.tree-loading.is-hidden { opacity: 0; pointer-events: none; }
.tree-loading p { color: var(--c-ink-soft); font-family: var(--font-gu); }
.tree-loading p em { font-style: italic; font-family: var(--font-en); }
.loader {
    width: 44px; height: 44px; border-radius: 50%;
    border: 3px solid var(--c-marigold-soft); border-top-color: var(--c-marigold);
    animation: spin .9s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* D3 tree node + link styles */
.node-card {
    cursor: pointer;
    transition: transform .2s var(--ease);
    opacity: 1; /* default visible — never depend on JS to make visible */
}
.node-card rect {
    fill: #fff;
    stroke: #cbd2dd;
    stroke-width: 1.5;
    transition: stroke .25s var(--ease), fill .25s var(--ease);
}

/* Entry animation — CSS-only so it works even when RAF is throttled.
   Note: don't animate `transform` here because that conflicts with the SVG
   transform attribute used by d3 to position nodes. Fade only. */
.node-card.node-enter {
    animation: nodeEnter .5s var(--ease-out) both;
}
@keyframes nodeEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tree-link {
    opacity: 1;
}
.tree-link.link-enter {
    animation: linkEnter .45s var(--ease-out) both;
}
@keyframes linkEnter {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.node-card:hover rect { stroke: var(--c-marigold); }
.node-card.is-highlighted rect { stroke: var(--c-marigold); fill: var(--c-marigold-soft); }
.node-card.is-passed rect { fill: #f8f7f4; stroke: #c8c2b3; }
.node-card.is-collapsed rect { stroke-dasharray: 4 3; }
.node-card text.name { font-family: var(--font-gu); font-weight: 700; fill: var(--c-indigo); }
.node-card text.dates { font-family: var(--font-en); fill: var(--c-ink-soft); font-size: 11px; }
.node-card text.kids { font-family: var(--font-en); fill: var(--c-marigold-dark); font-size: 11px; font-weight: 600; }
.node-card.is-passed text.name { fill: #4b5563; }

/* Kids badge — sits at the bottom of the node, click to expand/collapse */
.node-card .kids-badge { cursor: pointer; }
.node-card .kids-badge rect {
    fill: var(--c-cream-2); stroke: var(--c-line); stroke-width: 1; rx: 10;
    transition: fill .2s var(--ease), stroke .2s var(--ease);
}
.node-card .kids-badge:hover rect { fill: var(--c-marigold-soft); stroke: var(--c-marigold); }
.node-card.is-collapsed .kids-badge rect { fill: var(--c-marigold-soft); stroke: var(--c-marigold); }
.node-card .kids-badge text.kids { font-family: var(--font-en); fill: var(--c-marigold-dark); font-size: 10.5px; font-weight: 700; }

.tree-link { fill: none; stroke: #cbd2dd; stroke-width: 1.5; transition: stroke .3s var(--ease), stroke-width .3s var(--ease); }
.tree-link.is-highlighted { stroke: var(--c-marigold); stroke-width: 2.5; }

.stage-error {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(255,251,235,.95); padding: 24px; text-align: center;
    color: var(--c-ink-soft);
}
.stage-error em { font-style: italic; }
.stage-error small { display: block; margin-top: 8px; font-size: .8rem; opacity: .7; }

/* Lineage trace highlight overlay */
.trace-pulse rect { animation: pulseGlow 1.4s var(--ease) infinite; }
@keyframes pulseGlow {
    0%,100% { filter: drop-shadow(0 0 0 rgba(233,124,0,.0)); }
    50%     { filter: drop-shadow(0 0 12px rgba(233,124,0,.55)); }
}

/* =====================  TRACE MODAL  ===================== */
.trace-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.trace-modal[hidden] { display: none; }
.trace-backdrop {
    position: absolute; inset: 0;
    background: rgba(30,27,75,.55); backdrop-filter: blur(6px);
    animation: fadeIn .25s var(--ease-out);
}
.trace-card {
    position: relative; z-index: 1;
    width: min(560px, 100%); max-height: 90vh; overflow-y: auto;
    background: var(--c-cream); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    animation: popIn .45s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }

.trace-close {
    position: absolute; top: 14px; right: 14px;
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: rgba(30,27,75,.08); color: var(--c-indigo);
    font-size: 1.6rem; line-height: 1; cursor: pointer;
    transition: background .2s var(--ease), transform .2s var(--ease);
}
.trace-close:hover { background: var(--c-marigold); color: #fff; transform: rotate(90deg); }

.trace-head .eyebrow { margin-top: 0; }
.trace-head h2 { font-family: var(--font-display); margin: 6px 0 4px; color: var(--c-indigo); font-size: 1.6rem; }
.trace-head h2 .gu { font-family: var(--font-gu); }
.trace-meta { color: var(--c-ink-soft); margin: 0 0 18px; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 6px; }

/* Info chips inside trace modal — date, age, phone, WhatsApp */
.info-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    background: var(--c-cream-2); border: 1px solid var(--c-line);
    color: var(--c-ink); font-family: var(--font-gu); font-size: .84rem; font-weight: 500;
    white-space: nowrap;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.info-chip--passed { background: #f1f0eb; color: #4b5563; }
.info-chip--age    { background: var(--c-marigold-soft); color: var(--c-marigold-dark); border-color: var(--c-marigold-soft); }
.info-chip--call   { background: #1e3a8a; color: #fff; border-color: #1e3a8a; text-decoration: none; }
.info-chip--call:hover { background: #1e40af; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.info-chip--wa     { background: #25D366; color: #fff; border-color: #25D366; text-decoration: none; }
.info-chip--wa:hover { background: #128C7E; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.info-chip svg { display: block; }

.children-list li {
    display: flex; align-items: center; gap: 8px;
}
.children-list li .cn { flex: 1; min-width: 0; }
.ci-mini {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: #1e3a8a; color: #fff;
    text-decoration: none; flex-shrink: 0;
    transition: transform .2s var(--ease), background .2s var(--ease);
    box-shadow: var(--shadow-sm);
}
.ci-mini svg { width: 16px; height: 16px; display: block; }
.ci-mini--wa { background: #25D366; }
.ci-mini--wa:hover { background: #128C7E; }
.ci-mini--call:hover { background: #1e40af; }
.ci-mini:hover { transform: scale(1.08); }

.trace-section-title {
    margin: 18px 0 10px; font-family: var(--font-gu); color: var(--c-indigo);
    font-size: 1rem; letter-spacing: .02em;
    display: flex; align-items: center; gap: 10px;
}
.trace-section-title::after { content: ''; flex: 1; height: 1px; background: var(--c-line); }

.lineage-chain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lineage-chain li {
    position: relative; padding: 10px 14px 10px 38px;
    background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
    font-family: var(--font-gu); font-weight: 600; color: var(--c-indigo);
    cursor: pointer;
    transition: border-color .2s var(--ease), transform .2s var(--ease);
    opacity: 0; transform: translateX(-12px);
    animation: chainStep .5s var(--ease-out) forwards;
}
.lineage-chain li:hover { border-color: var(--c-marigold); transform: translateX(2px); }
.lineage-chain li::before {
    content: counter(li-counter); counter-increment: li-counter;
    position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--c-marigold); color: #fff;
    display: grid; place-items: center; font-size: .75rem; font-weight: 700;
}
.lineage-chain { counter-reset: li-counter; }
.lineage-chain li.is-self { background: var(--c-marigold-soft); border-color: var(--c-marigold); }
.lineage-chain li.is-self::before { background: var(--c-indigo); }
.lineage-chain li:nth-child(1) { animation-delay: .05s; }
.lineage-chain li:nth-child(2) { animation-delay: .12s; }
.lineage-chain li:nth-child(3) { animation-delay: .19s; }
.lineage-chain li:nth-child(4) { animation-delay: .26s; }
.lineage-chain li:nth-child(5) { animation-delay: .33s; }
.lineage-chain li:nth-child(n+6) { animation-delay: .4s; }
@keyframes chainStep { to { opacity: 1; transform: none; } }

.children-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.children-list li {
    padding: 8px 12px; border: 1px dashed var(--c-line); border-radius: var(--radius-sm);
    color: var(--c-ink); font-family: var(--font-gu); cursor: pointer;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.children-list li:hover { border-color: var(--c-marigold); background: var(--c-marigold-soft); }
.children-empty { color: var(--c-ink-soft); font-size: .9rem; padding: 6px 0; }

.trace-foot { display: flex; gap: 10px; margin-top: 22px; }

/* =====================  PDF CERTIFICATE TEMPLATE  =====================
   Hidden offscreen, rendered by html2canvas at scale=2 → A4 print quality.
   Designed to fit in ONE A4 page (794×1123 px @ 96dpi reference).
   We use 800×1130 to leave a hair of margin. */
.pdf-template {
    position: absolute; left: -10000px; top: 0;
    width: 800px;
    background: #FFFBEB;
    pointer-events: none;
    display: none;
}
.pdf-page {
    width: 800px;
    background: #FFFBEB;
    box-sizing: border-box;
    color: #1F2937;
    font-family: 'Mukta Vaani', 'Noto Sans Gujarati', sans-serif;
    position: relative;
    padding: 28px;
    /* Outer decorative gold border */
    border: 2px solid #E97C00;
    border-radius: 6px;
}

/* Inner thin border (offset inside) */
.pdf-border {
    border: 0.5px solid #E97C00;
    border-radius: 3px;
    margin: -10px;
    padding: 10px;
    opacity: .55;
}

/* Watermark removed — html2canvas struggles with rotated absolute text */
.pdf-watermark { display: none; }

/* Top band: solid indigo with logo + family name + village + certificate label */
.pdf-band {
    margin: 0 0 18px;
    background: #1E1B4B;
    border-radius: 6px;
    padding: 14px 22px;
    color: #FFFBEB;
    display: table;
    width: 100%;
    table-layout: fixed;
}
.pdf-band-left { display: table-cell; vertical-align: middle; }
.pdf-band-left .pdf-logo, .pdf-band-left .pdf-band-text { display: inline-block; vertical-align: middle; }
.pdf-band-left .pdf-logo { margin-right: 12px; }
.pdf-band-right { display: table-cell; vertical-align: middle; text-align: right; }
.pdf-logo { width: 44px; height: 44px; }
.pdf-band-gu { font-family: 'Mukta Vaani', sans-serif; font-weight: 700; font-size: 22px; line-height: 1.05; }
.pdf-band-en { font-family: 'Inter', sans-serif; font-size: 10px; letter-spacing: .18em; color: #FFE3C2; margin-top: 3px; font-weight: 600; }
.pdf-band-villages { font-family: 'Mukta Vaani', sans-serif; font-size: 14px; color: #FFE3C2; line-height: 1; }
.pdf-band-cert { font-family: 'Mukta Vaani', sans-serif; font-size: 11px; color: rgba(255,251,235,.75); margin-top: 4px; }

/* Center title */
.pdf-title {
    position: relative; z-index: 2;
    text-align: center; margin: 6px 0 14px;
}
.pdf-title-en {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14px; letter-spacing: .32em; font-weight: 700;
    color: #B85F00;
    text-transform: uppercase;
}
.pdf-title-divider {
    width: 80px; height: 2px;
    margin: 6px auto 0;
    background: linear-gradient(90deg, transparent, #E97C00, transparent);
}

/* Hero block: who this certificate is for */
.pdf-hero {
    margin: 0 0 18px;
    background: #FFE3C2;
    border: 1.5px solid #E97C00;
    border-radius: 8px;
    padding: 18px 24px;
    text-align: center;
}
.pdf-hero-label {
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 11px; color: #B85F00;
    letter-spacing: .04em;
    margin-bottom: 8px;
}
.pdf-hero-name {
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 36px; font-weight: 700; color: #1E1B4B;
    line-height: 1.05;
    margin-bottom: 4px;
}
.pdf-hero-stats {
    margin: 12px auto 0;
    display: table;
    border-spacing: 18px 0;
}
.pdf-stat {
    display: table-cell;
    text-align: center; min-width: 80px;
    vertical-align: top;
}
.pdf-stat-num {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 30px; font-weight: 700; color: #1E1B4B; line-height: 1;
}
.pdf-stat-lbl {
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 10px; color: #6b7280; margin-top: 4px; line-height: 1.2;
}
.pdf-stat-lbl em { font-style: italic; }

.pdf-hero-meta {
    margin-top: 14px;
    text-align: center;
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 11.5px; color: #4B5563;
}
.pdf-hero-chip {
    display: inline-block;
    background: #fff;
    border: 1px solid #EADBC0;
    padding: 5px 12px;
    border-radius: 999px;
    margin: 0 3px;
}
.pdf-hero-chip strong {
    color: #B85F00;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: 4px;
}
.pdf-hero-chip--dod { background: #f3f1ec; }
.pdf-hero-chip--dod strong { color: #6b7280; }
.pdf-hero-chip--empty {
    background: transparent; border: none;
    color: #6b7280; font-style: italic; font-size: 10px;
}
.pdf-hero-meta span {
    background: rgba(255,255,255,.85);
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid #EADBC0;
}

/* Two-column body — use table layout (most reliable in html2canvas) */
.pdf-body {
    margin: 0 0 14px;
    width: 100%;
    display: table;
    border-collapse: separate;
    border-spacing: 18px 0;
    table-layout: fixed;
}
.pdf-col { display: table-cell; width: 50%; vertical-align: top; }
.pdf-col-title {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid #E97C00;
    font-family: 'Mukta Vaani', sans-serif;
    color: #1E1B4B;
}
.pdf-col-title span { display: inline-block; }
.pdf-col-title em { display: inline-block; float: right; }
.pdf-col-title span { font-weight: 700; font-size: 15px; }
.pdf-col-title em {
    font-style: italic; font-family: 'Inter', serif; font-size: 10px; color: #B85F00; font-weight: 500;
}

/* Ancestor rows */
.pdf-anc-list { display: flex; flex-direction: column; gap: 5px; }
.pdf-anc-row {
    background: #ffffff;
    border: 1px solid #EADBC0;
    border-left: 3px solid #E97C00;
    border-radius: 4px;
    padding: 6px 10px;
    display: table;
    width: 100%;
    table-layout: fixed;
}
.pdf-anc-row > * { display: table-cell; vertical-align: middle; }
.pdf-anc-row.is-self {
    background: linear-gradient(90deg, #FFE3C2 0%, #FFFBEB 100%);
    border-color: #E97C00;
    border-left: 3px solid #1E1B4B;
}
.pdf-anc-num {
    width: 22px !important; height: 22px; border-radius: 50%;
    background: #E97C00; color: #fff;
    text-align: center; line-height: 22px;
    font-family: 'Inter', sans-serif; font-weight: 700; font-size: 11px;
}
.pdf-anc-row.is-self .pdf-anc-num { background: #1E1B4B; }
.pdf-anc-info { padding-left: 8px; padding-right: 8px; }
.pdf-anc-name { font-family: 'Mukta Vaani', sans-serif; font-weight: 700; font-size: 13px; color: #1E1B4B; line-height: 1.15; }
.pdf-anc-dates { font-family: 'Inter', sans-serif; font-size: 9px; color: #6b7280; margin-top: 1px; }
.pdf-anc-meta {
    margin-top: 2px;
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 9.5px; color: #4b5563;
    line-height: 1.35;
}
.pdf-anc-meta .pm-dob   { color: #15803D; }
.pdf-anc-meta .pm-dod   { color: #6b7280; }
.pdf-anc-meta .pm-phone { color: #1e3a8a; margin-left: 4px; }
.pdf-anc-meta span { margin-right: 6px; white-space: nowrap; }
.pdf-anc-rel {
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 9px; color: #6b7280;
    width: 60px !important;
    text-align: right;
}
.pdf-anc-self {
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 10px; font-weight: 700; color: #1E1B4B;
    background: #fff; padding: 2px 8px; border-radius: 999px;
    border: 1px solid #1E1B4B;
    width: 60px !important;
    text-align: center;
}

/* Descendants compact list */
.pdf-d-list {}
.pdf-d-row {
    padding: 5px 8px;
    border-bottom: 1px dashed rgba(233,124,0,.18);
}
.pdf-d-line { line-height: 1.3; }
.pdf-d-line > * { display: inline-block; vertical-align: baseline; margin-right: 4px; }
.pdf-d-meta {
    margin-top: 2px;
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 9px; color: #4b5563;
    line-height: 1.3;
}
.pdf-d-meta .pm-dob   { color: #15803D; margin-right: 6px; white-space: nowrap; }
.pdf-d-meta .pm-dod   { color: #6b7280; margin-right: 6px; white-space: nowrap; }
.pdf-d-meta .pm-phone { color: #1e3a8a; white-space: nowrap; }
.pdf-d-dot { color: #E97C00; font-size: 13px; flex-shrink: 0; line-height: 1; }
.pdf-d-name { font-family: 'Mukta Vaani', sans-serif; font-size: 12px; font-weight: 600; color: #1E1B4B; }
.pdf-d-date { font-family: 'Inter', sans-serif; font-size: 9px; color: #6b7280; }
.pdf-d-empty {
    background: #fff;
    border: 1.5px dashed #EADBC0;
    border-radius: 6px;
    padding: 14px; text-align: center; color: #6b7280;
    font-family: 'Mukta Vaani', sans-serif; font-size: 11px;
}
.pdf-d-empty em { font-style: italic; }

/* Footer band — elegant 3-column certificate-style design */
.pdf-foot {
    margin-top: 20px;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
    border-radius: 8px;
    padding: 18px 24px;
    color: #FFFBEB;
    position: relative;
    overflow: hidden;
}
.pdf-foot-divider {
    height: 2px;
    margin: -10px -10px 14px;
    background: linear-gradient(90deg, transparent, #E97C00, transparent);
    border-radius: 2px;
    opacity: .55;
}
.pdf-foot-grid {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.pdf-foot-cell {
    display: table-cell;
    vertical-align: middle;
    padding: 0 10px;
}
.pdf-foot-cell--left   { width: 30%; text-align: left; }
.pdf-foot-cell--center { width: 30%; text-align: center; border-left: 1px solid rgba(255,255,255,.15); border-right: 1px solid rgba(255,255,255,.15); padding: 0 18px; }
.pdf-foot-cell--right  { width: 40%; text-align: right; }

.pdf-foot-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 8.5px; font-weight: 700;
    letter-spacing: .18em;
    color: #FFE3C2;
    margin-bottom: 6px;
}
.pdf-foot-date {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px; font-weight: 700; color: #fff;
    line-height: 1;
}
.pdf-foot-id {
    font-family: 'Inter', sans-serif;
    font-size: 9px; color: rgba(255,251,235,.65);
    margin-top: 4px; letter-spacing: .08em;
}

.pdf-foot-mark {
    font-size: 26px;
    line-height: 1;
    margin-bottom: 4px;
}
.pdf-foot-tagline {
    font-family: 'Mukta Vaani', sans-serif;
    font-weight: 700; font-size: 12px; color: #FFE3C2;
    line-height: 1.1;
}
.pdf-foot-tagline-en {
    font-family: 'Inter', sans-serif;
    font-size: 8px; letter-spacing: .22em;
    color: rgba(255,251,235,.65);
    margin-top: 3px; font-weight: 600;
}

.pdf-foot-curator {
    font-family: 'Mukta Vaani', sans-serif;
    font-weight: 700; font-size: 13px; color: #fff;
    line-height: 1.1;
}
.pdf-foot-curator-en {
    font-family: 'Inter', sans-serif;
    font-size: 10.5px; color: rgba(255,251,235,.85);
    margin-top: 2px;
    font-style: italic;
}
.pdf-foot-contact {
    font-family: 'Inter', sans-serif;
    font-size: 9.5px; color: #FFE3C2;
    margin-top: 6px;
    letter-spacing: .04em;
}
.pdf-foot-mark {
    font-size: 26px;
    width: 42px; height: 42px;
    background: rgba(255,251,235,.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pdf-foot-main { flex: 1; line-height: 1.4; }
.pdf-foot-credit {
    font-family: 'Mukta Vaani', sans-serif;
    font-size: 12px;
}
.pdf-foot-credit strong { font-weight: 700; color: #FFE3C2; }
.pdf-foot-name { font-weight: 700; color: #fff; }
.pdf-foot-sub {
    font-family: 'Inter', sans-serif;
    font-size: 10px; color: rgba(255,251,235,.75);
    margin-top: 3px;
    letter-spacing: .04em;
}
.pdf-foot-stamp {
    text-align: right;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
    border-left: 1px solid rgba(255,255,255,.18);
    padding-left: 14px;
}
.pdf-stamp-date {
    font-size: 11px; font-weight: 700; color: #FFE3C2;
    line-height: 1;
}
.pdf-stamp-id {
    font-size: 9px; color: rgba(255,251,235,.6);
    margin-top: 3px;
    letter-spacing: .12em;
}

/* =====================  REDUCED MOTION  ===================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
