/*
 * astro-jyot: a night sky of astrology symbols.
 *
 * Warm ghee-white pages with a deep indigo night panel (CTA) lit by an amber
 * glow; dark mode turns the whole site indigo.
 * Heading font is Fraunces, body is Hind, and Tiro Devanagari Hindi carries the Sanskrit accents and Hindi headings.
 *
 * Built on the shared token base; everything below the import overrides tokens or
 * adds the jy-* decorative utilities used by src/tenant/templates/astro-jyot.
 */
@import url("./index.css");
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..800;1,9..144,300..800&family=Hind:wght@300;400;500;600;700&family=Tiro+Devanagari+Hindi&display=swap");

:root {
    --background: oklch(0.988 0.007 80); /* ghee white */
    --foreground: oklch(0.24 0.045 278); /* indigo ink */
    --card: oklch(1 0.003 80);
    --card-foreground: oklch(0.24 0.045 278);
    --popover: oklch(1 0.003 80);
    --popover-foreground: oklch(0.24 0.045 278);

    /* amber. --primary itself is assembled from these three numbers by
       index.css, so the tenant's primary-colour preset (data-primary-color) can
       override them. Never set --primary directly here. */
    --primary-h: 52;
    --primary-c: 0.15;
    --primary-l: 0.56;
    --primary-foreground: oklch(0.99 0.008 80);
    --secondary: oklch(0.955 0.02 76);
    --secondary-foreground: oklch(0.28 0.05 278);
    --muted: oklch(0.958 0.013 78);
    --muted-foreground: oklch(0.49 0.035 278);
    --accent: oklch(0.93 0.045 76);
    --accent-foreground: oklch(0.28 0.05 278);
    --destructive: oklch(0.55 0.22 27);
    --destructive-foreground: oklch(1 0 0);
    --border: oklch(0.905 0.022 75);
    --input: oklch(0.89 0.025 75);
    --ring: var(--primary);

    --chart-1: var(--primary);
    --chart-2: oklch(0.75 0.14 80);
    --chart-3: oklch(0.45 0.1 278);
    --chart-4: oklch(0.65 0.15 40);
    --chart-5: oklch(0.34 0.07 278);

    --sidebar: oklch(0.97 0.012 78);
    --sidebar-foreground: oklch(0.24 0.045 278);
    --sidebar-accent: oklch(0.93 0.045 76);
    --sidebar-accent-foreground: oklch(0.28 0.05 278);
    --sidebar-border: oklch(0.905 0.022 75);
    --sidebar-ring: var(--primary);

    /* template-only tokens. The glow core follows the tenant's primary hue, so a
       primary-colour preset recolours the glow too. */
    --jy-gold: oklch(0.87 var(--primary-c) calc(var(--primary-h) + 32));
    --jy-text-from: var(--primary);
    --jy-text-to: oklch(calc(var(--primary-l) - 0.06) var(--primary-c) calc(var(--primary-h) - 22));

    --font-heading: "Fraunces", "Tiro Devanagari Hindi", serif;
    --font-sans: "Hind", "Tiro Devanagari Hindi", sans-serif;
    --font-deva: "Tiro Devanagari Hindi", serif;
    --radius: 0.875rem; /* overridden by the tenant corner-style preset */
    --shadow-color: oklch(0.3 0.06 278);
}

/* Night tokens: the whole site when the tenant picks dark mode, and the indigo
   panel (CTA) via .jy-night in light mode. */
.dark {
    --primary-l: 0.77;
    --primary-c: 0.14;
    --primary-foreground: oklch(0.17 0.04 278);
}

.dark,
.jy-night {
    --background: oklch(0.17 0.04 278);
    --foreground: oklch(0.95 0.015 80);
    --card: oklch(0.225 0.045 278);
    --card-foreground: oklch(0.95 0.015 80);
    --popover: oklch(0.225 0.045 278);
    --popover-foreground: oklch(0.95 0.015 80);
    --secondary: oklch(0.2 0.045 278);
    --secondary-foreground: oklch(0.95 0.015 80);
    --muted: oklch(0.25 0.045 278);
    --muted-foreground: oklch(0.77 0.03 278);
    --accent: oklch(0.3 0.055 278);
    --accent-foreground: oklch(0.95 0.015 80);
    --border: oklch(0.34 0.045 278);
    --input: oklch(0.38 0.045 278);
    --ring: var(--primary);
    --jy-text-from: var(--jy-gold);
    --jy-text-to: var(--primary);
}

/* Night panel inside a light page: keep the tenant's hue/chroma but make sure
   the primary is bright enough to read on indigo. */
.jy-night {
    --primary: oklch(max(var(--primary-l), 0.77) var(--primary-c) var(--primary-h));
    --primary-foreground: oklch(0.17 0.04 278);
    background-color: var(--background);
    color: var(--foreground);
}

body {
    font-family: var(--font-sans);
}

.font-deva {
    font-family: var(--font-deva);
}

/* ---------- section spacing ---------- */

/* Covers the shared sections too (reports, videos, webinars, ...). Unlayered, so
   it wins over their Tailwind padding without touching other templates. The hero
   sets its own. */
.jy-sections > section:not(.jy-hero),
.jy-sections > div > section {
    padding-block: 1.5rem;
}

@media (min-width: 640px) {
    .jy-sections > section:not(.jy-hero),
    .jy-sections > div > section {
        padding-block: 2.5rem;
    }
}

/* ---------- corner style ---------- */

/* Some shared sections hard-code pill buttons. Make their text buttons (the ones
   with side padding) and the tab bars around them follow the tenant's corner
   style; round icon buttons stay round. */
.jy-sections :is(a, button).rounded-full[class*="px-"],
.jy-sections div.rounded-full:has(> button[class*="px-"]) {
    border-radius: var(--radius);
}

/* ---------- decorative utilities ---------- */

/* A pool of soft light. Size and position it with utilities. */
.jy-glow {
    pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in oklab, var(--primary) 42%, transparent), transparent);
}

.jy-gradient-text {
    background-image: linear-gradient(100deg, var(--jy-text-from), var(--jy-text-to));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Card that lights up on hover */
.jy-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.jy-card-lift:hover {
    transform: translateY(-4px);
    border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
    box-shadow: 0 18px 40px -20px color-mix(in oklab, var(--primary) 60%, transparent);
}

/* ---------- footer ---------- */

/* Its own page colour (the "Powered by" strip uses --background too) */
.jy-footer {
    --background: oklch(0.945 0.025 76);
    background-color: var(--background);
}

.dark .jy-footer {
    --background: oklch(0.14 0.04 278);
}

/* Scattered stars. The SVG is only a mask; the colour comes from --primary */
.jy-stars {
    background-color: var(--primary);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cpath d='M37 25Q37.72 28.28 41 29Q37.72 29.72 37 33Q36.28 29.72 33 29Q36.28 28.28 37 25z'/%3E%3Cpath d='M213 68Q213.54 70.46 216 71Q213.54 71.54 213 74Q212.46 71.54 210 71Q212.46 70.46 213 68z'/%3E%3Cpath d='M118 142Q118.9 146.1 123 147Q118.9 147.9 118 152Q117.1 147.9 113 147Q117.1 146.1 118 142z'/%3E%3Cpath d='M61 228Q61.54 230.46 64 231Q61.54 231.54 61 234Q60.46 231.54 58 231Q60.46 230.46 61 228z'/%3E%3Cpath d='M254 214Q254.72 217.28 258 218Q254.72 218.72 254 222Q253.28 218.72 250 218Q253.28 217.28 254 214z'/%3E%3Ccircle cx='104' cy='24' r='0.9'/%3E%3Ccircle cx='176' cy='12' r='0.7'/%3E%3Ccircle cx='268' cy='38' r='1'/%3E%3Ccircle cx='12' cy='92' r='0.7'/%3E%3Ccircle cx='87' cy='83' r='1'/%3E%3Ccircle cx='158' cy='64' r='0.8'/%3E%3Ccircle cx='285' cy='126' r='0.8'/%3E%3Ccircle cx='46' cy='152' r='0.9'/%3E%3Ccircle cx='193' cy='176' r='1'/%3E%3Ccircle cx='237' cy='139' r='0.6'/%3E%3Ccircle cx='22' cy='278' r='1'/%3E%3Ccircle cx='133' cy='262' r='0.7'/%3E%3Ccircle cx='181' cy='236' r='0.8'/%3E%3Ccircle cx='286' cy='284' r='0.6'/%3E%3Ccircle cx='104' cy='200' r='0.6'/%3E%3Ccircle cx='211' cy='284' r='0.9'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' viewBox='0 0 300 300'%3E%3Cpath d='M37 25Q37.72 28.28 41 29Q37.72 29.72 37 33Q36.28 29.72 33 29Q36.28 28.28 37 25z'/%3E%3Cpath d='M213 68Q213.54 70.46 216 71Q213.54 71.54 213 74Q212.46 71.54 210 71Q212.46 70.46 213 68z'/%3E%3Cpath d='M118 142Q118.9 146.1 123 147Q118.9 147.9 118 152Q117.1 147.9 113 147Q117.1 146.1 118 142z'/%3E%3Cpath d='M61 228Q61.54 230.46 64 231Q61.54 231.54 61 234Q60.46 231.54 58 231Q60.46 230.46 61 228z'/%3E%3Cpath d='M254 214Q254.72 217.28 258 218Q254.72 218.72 254 222Q253.28 218.72 250 218Q253.28 217.28 254 214z'/%3E%3Ccircle cx='104' cy='24' r='0.9'/%3E%3Ccircle cx='176' cy='12' r='0.7'/%3E%3Ccircle cx='268' cy='38' r='1'/%3E%3Ccircle cx='12' cy='92' r='0.7'/%3E%3Ccircle cx='87' cy='83' r='1'/%3E%3Ccircle cx='158' cy='64' r='0.8'/%3E%3Ccircle cx='285' cy='126' r='0.8'/%3E%3Ccircle cx='46' cy='152' r='0.9'/%3E%3Ccircle cx='193' cy='176' r='1'/%3E%3Ccircle cx='237' cy='139' r='0.6'/%3E%3Ccircle cx='22' cy='278' r='1'/%3E%3Ccircle cx='133' cy='262' r='0.7'/%3E%3Ccircle cx='181' cy='236' r='0.8'/%3E%3Ccircle cx='286' cy='284' r='0.6'/%3E%3Ccircle cx='104' cy='200' r='0.6'/%3E%3Ccircle cx='211' cy='284' r='0.9'/%3E%3C/svg%3E");
    -webkit-mask-size: 300px 300px;
    mask-size: 300px 300px;
}

@keyframes jy-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes jy-breathe {
    0%,
    100% {
        opacity: 0.75;
    }
    50% {
        opacity: 1;
    }
}

@keyframes jy-rise {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.jy-spin {
    animation: jy-spin 140s linear infinite;
}

.jy-breathe {
    animation: jy-breathe 5s ease-in-out infinite;
}

.jy-rise {
    opacity: 0;
    animation: jy-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .jy-spin,
    .jy-breathe {
        animation: none;
    }
    .jy-rise {
        animation: none;
        opacity: 1;
    }
}
