/* ===================================================================
   PINGALA LABS — Design System & Styles
   A fusion of ancient Indian mathematical wisdom and modern AI aesthetics
   =================================================================== */

/* --- Design Tokens --- */
:root {
    /* Colors */
    --bg-primary: #0a0c14;
    --bg-secondary: #0d0f1a;
    --bg-card: rgba(16, 19, 34, 0.7);
    --bg-card-hover: rgba(22, 26, 48, 0.85);

    --gold-primary: #c9a84c;
    --gold-light: #e4cc7a;
    --gold-dark: #9a7d30;
    --gold-glow: rgba(201, 168, 76, 0.15);
    --gold-subtle: rgba(201, 168, 76, 0.06);

    --text-primary: #e8e4db;
    --text-secondary: rgba(232, 228, 219, 0.6);
    --text-muted: rgba(232, 228, 219, 0.35);

    --border-subtle: rgba(201, 168, 76, 0.1);
    --border-card: rgba(201, 168, 76, 0.12);

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', sans-serif;
    --font-devanagari: 'Noto Serif Devanagari', serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    --space-4xl: 10rem;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 200ms;
    --duration-normal: 400ms;
    --duration-slow: 800ms;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--gold-light);
}

::selection {
    background: var(--gold-primary);
    color: var(--bg-primary);
}

/* --- Neural Network Canvas --- */
#neural-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* --- Peacock Feather Accents --- */
.peacock-accent {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    opacity: 0.06;
    transition: opacity 2s var(--ease-out);
}

.peacock-accent img {
    width: 320px;
    height: auto;
    filter: sepia(0.3) saturate(1.4);
}

.peacock-accent--top {
    top: -40px;
    right: -60px;
    transform: rotate(25deg);
}

.peacock-accent--bottom {
    bottom: -60px;
    left: -80px;
    transform: rotate(-150deg) scaleX(-1);
}

body:hover .peacock-accent {
    opacity: 0.1;
}

/* --- Site Wrapper --- */
.site-wrapper {
    position: relative;
    z-index: 2;
}

/* --- Top Bar --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    background: rgba(10, 12, 20, 0.7);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--duration-normal) var(--ease-out);
}

.topbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.topbar__mark {
    border-radius: 50%;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.topbar__mark:hover {
    transform: rotate(15deg) scale(1.05);
}

.topbar__wordmark {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.topbar__wordmark-light {
    font-weight: 300;
    color: var(--gold-primary);
}

.topbar__tagline {
    display: flex;
    align-items: center;
}

.binary-ticker {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: var(--gold-primary);
    opacity: 0.4;
    letter-spacing: 0.15em;
    animation: binaryPulse 4s ease-in-out infinite;
}

@keyframes binaryPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4xl) var(--space-xl) var(--space-3xl);
    overflow: hidden;
}

.hero__bg-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(201, 168, 76, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(13, 15, 26, 0.9) 0%, var(--bg-primary) 100%);
    z-index: 0;
}

.hero__yantra {
    position: absolute;
    width: min(80vw, 600px);
    height: min(80vw, 600px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.35;
    animation: yantraRotate 120s linear infinite;
    z-index: 0;
}

@keyframes yantraRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
}

/* --- Hero Emblem --- */
.hero__emblem {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    margin: 0 auto var(--space-md);
}

/* Decorative connector line from emblem to content below */
.hero__emblem::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, rgba(201, 168, 76, 0.4), transparent);
}

.hero__emblem-rings {
    position: absolute;
    inset: -8px;
    width: calc(100% + 16px);
    height: calc(100% + 16px);
    animation: emblemOrbit 50s linear infinite;
    pointer-events: none;
}

.hero__emblem-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.2) 0%, rgba(201, 168, 76, 0.05) 50%, transparent 70%);
    filter: blur(20px);
    animation: emblemPulse 5s ease-in-out infinite alternate;
    pointer-events: none;
}

.hero__emblem-img {
    position: relative;
    z-index: 1;
    border-radius: 50%;
    padding: 16px;
    background: rgba(10, 12, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(201, 168, 76, 0.2);
    box-shadow:
        0 0 40px rgba(201, 168, 76, 0.12),
        0 0 80px rgba(201, 168, 76, 0.05),
        inset 0 0 30px rgba(201, 168, 76, 0.06);
    transition: transform 0.8s var(--ease-spring), border-color 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.hero__emblem:hover .hero__emblem-img {
    transform: scale(1.06) rotate(8deg);
    border-color: rgba(201, 168, 76, 0.45);
    box-shadow:
        0 0 50px rgba(201, 168, 76, 0.25),
        0 0 100px rgba(201, 168, 76, 0.08),
        inset 0 0 35px rgba(201, 168, 76, 0.12);
}

.hero__emblem:hover .hero__emblem-rings {
    animation-duration: 15s;
}

@keyframes emblemOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes emblemPulse {
    0% { transform: scale(0.92); opacity: 0.4; }
    100% { transform: scale(1.12); opacity: 1; }
}

/* --- Hero Label --- */
.hero__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-primary);
    padding: var(--space-xs) var(--space-lg);
    border: 1px solid var(--border-card);
    border-radius: 100px;
    background: var(--gold-subtle);
    margin-bottom: var(--space-lg);
}

.hero__label-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-primary);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--gold-glow); }
    50% { opacity: 0.6; box-shadow: 0 0 12px 4px var(--gold-glow); }
}

/* --- Hero Title --- */
.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 4.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.hero__title-accent {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-light) 50%, var(--gold-primary) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 6s ease-in-out infinite;
}

@keyframes shimmerText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Hero Tagline --- */
.hero__tagline {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2.5vw, 1.75rem);
    font-weight: 500;
    color: var(--gold-light);
    letter-spacing: -0.01em;
    margin-bottom: var(--space-lg);
    line-height: 1.35;
}

/* --- Hero Subtitle --- */
.hero__subtitle {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.hero__subtitle em {
    color: var(--gold-primary);
    font-style: normal;
    font-weight: 500;
}

/* --- Sanskrit Shloka --- */
.hero__shloka {
    margin: 0 auto var(--space-2xl);
    padding: var(--space-lg) var(--space-xl);
    border-left: 2px solid var(--gold-primary);
    border-right: 2px solid var(--gold-primary);
    max-width: 500px;
    position: relative;
}

.hero__shloka::before,
.hero__shloka::after {
    content: '✦';
    position: absolute;
    color: var(--gold-primary);
    font-size: 0.6rem;
    opacity: 0.5;
}

.hero__shloka::before {
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
}

.hero__shloka::after {
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
}

.devanagari {
    font-family: var(--font-devanagari);
    font-size: 1.15rem;
    color: var(--gold-light);
    display: block;
    margin-bottom: var(--space-sm);
    line-height: 1.8;
}

.hero__shloka cite {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    letter-spacing: 0.03em;
}

/* --- CTA Form --- */
.cta-form__wrapper {
    display: flex;
    gap: 2px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    transition: border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out);
    max-width: 480px;
    margin: 0 auto;
}

.cta-form__wrapper:focus-within {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cta-form__input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
}

.cta-form__input::placeholder {
    color: var(--text-muted);
}

.cta-form__btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-primary));
    border: none;
    color: var(--bg-primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.cta-form__btn:hover {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    transform: translateX(2px);
}

.cta-form__btn svg {
    transition: transform var(--duration-fast) var(--ease-spring);
}

.cta-form__btn:hover svg {
    transform: translateX(3px);
}

.cta-form__error {
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: #e8625c;
    text-align: center;
}

/* --- CTA Success --- */
.cta-success {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    justify-content: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--gold-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    max-width: 480px;
    margin: 0 auto;
    animation: successFadeIn 0.6s var(--ease-out);
}

.cta-success p {
    color: var(--gold-light);
    font-size: 0.95rem;
    font-weight: 500;
}

@keyframes successFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Entrance Animations --- */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out) forwards;
}

.animate-in--delay-1 { animation-delay: 0.15s; }
.animate-in--delay-2 { animation-delay: 0.3s; }
.animate-in--delay-3 { animation-delay: 0.45s; }
.animate-in--delay-4 { animation-delay: 0.6s; }
.animate-in--delay-5 { animation-delay: 0.75s; }
.animate-in--delay-6 { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section Shared Styles --- */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold-primary);
    margin-bottom: var(--space-md);
    position: relative;
    padding-left: 28px;
}

.section-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 1px;
    background: var(--gold-primary);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* --- Features Section --- */
.features {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1100px;
    margin: 0 auto;
}

.features__header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.features__header .section-label {
    padding-left: 0;
}

.features__header .section-label::before {
    display: none;
}

.features__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

/* --- Feature Card --- */
.feature-card {
    position: relative;
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(201, 168, 76, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 60px var(--gold-subtle);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card__icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-lg);
    opacity: 0.85;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.feature-card:hover .feature-card__icon {
    opacity: 1;
}

.feature-card__title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.feature-card__desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* --- Heritage Section --- */
.heritage {
    padding: var(--space-3xl) var(--space-xl) var(--space-4xl);
    max-width: 800px;
    margin: 0 auto;
}

.heritage__content {
    position: relative;
}

.heritage__text {
    margin-top: var(--space-xl);
}

.heritage__text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: var(--space-lg);
}

.heritage__text strong {
    color: var(--gold-primary);
    font-weight: 500;
}

.heritage__text em {
    color: var(--text-primary);
    font-style: italic;
}

/* --- Meru Prastara Triangle --- */
.heritage__meru {
    margin-top: var(--space-2xl);
    text-align: center;
}

.heritage__meru-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: var(--space-xl);
}

.meru-triangle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.meru-row {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
}

.meru-row span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--gold-primary);
    background: var(--gold-subtle);
    transition: all var(--duration-normal) var(--ease-out);
}

.meru-row span:hover {
    background: var(--gold-glow);
    border-color: var(--gold-primary);
    transform: scale(1.15);
    box-shadow: 0 0 20px var(--gold-glow);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-2xl) var(--space-xl);
    background: var(--bg-secondary);
}

.footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    text-align: center;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer__logo {
    border-radius: 50%;
}

.footer__name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.footer__copy {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer__founder {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer__founder strong {
    color: var(--gold-primary);
    font-weight: 500;
}

.footer__links {
    display: flex;
    gap: var(--space-lg);
}

.footer__link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color var(--duration-fast) var(--ease-out);
}

.footer__link:hover {
    color: var(--gold-primary);
}

.footer__accent {
    margin-top: var(--space-md);
}

.footer__binary {
    font-family: 'Courier New', monospace;
    font-size: 0.55rem;
    color: var(--text-muted);
    opacity: 0.3;
    letter-spacing: 0.2em;
    word-spacing: 0.5em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .topbar {
        padding: var(--space-sm) var(--space-md);
    }

    .topbar__tagline {
        display: none;
    }

    .hero {
        padding: var(--space-3xl) var(--space-md) var(--space-2xl);
    }

    .hero__yantra {
        width: 120vw;
        height: 120vw;
    }

    .features__grid {
        grid-template-columns: 1fr;
    }

    .features {
        padding: var(--space-2xl) var(--space-md);
    }

    .heritage {
        padding: var(--space-2xl) var(--space-md) var(--space-3xl);
    }

    .cta-form__wrapper {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .cta-form__btn {
        justify-content: center;
        padding: var(--space-md);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    .hero__shloka {
        padding: var(--space-md) var(--space-lg);
    }

    .meru-row span {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .peacock-accent img {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .hero__title {
        font-size: 1.8rem;
    }

    .hero__subtitle {
        font-size: 0.95rem;
    }

    .devanagari {
        font-size: 1rem;
    }

    .feature-card {
        padding: var(--space-lg);
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.35);
}
