/* CSS Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0f172a;
    --primary-accent: #0369a1;
    --secondary-accent: #0284c7;
    --text-primary: #ffffff;
    --text-secondary: #334155;
    --text-light: #64748b;
    --border-color: rgba(3, 105, 161, 0.16);
    --hover-bg: rgba(3, 105, 161, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
    background: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animation - flag theme (saffron, white, green) */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.gradient-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg,
            #ff8f1f 0%,
            #ffffff 18%,
            #ff9933 32%,
            #ffffff 50%,
            #138808 68%,
            #ffffff 82%,
            #0f7a06 100%);
    background-size: 360% 360%;
    animation: gradientShift 18s ease-in-out infinite;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.56);
}

/* Ashoka Chakra - above background, spin effect */
.ashoka-chakra-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ashoka-chakra {
    width: min( clamp(280px, 42vw, 480px), 480px );
    height: auto;
    opacity: 0.22;
    animation: chakraSpin 50s linear infinite;
}

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

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* Container & Layout */
.container {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.center-holder {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Transparent wrapper: logo + hero + card in one section */
.hero-wrapper {
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 14px;
    padding: 30px 28px 26px;
    backdrop-filter: blur(3px) saturate(115%);
    -webkit-backdrop-filter: blur(3px) saturate(115%);
    animation: fadeIn 1s ease-out;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

header {
    margin-bottom: 20px;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.header-divider {
    border: none;
    height: 1px;
    margin: 22px auto 0;
    max-width: 620px;
    background: linear-gradient(90deg,
        transparent,
        rgba(3, 105, 161, 0.18) 20%,
        rgba(3, 105, 161, 0.38) 50%,
        rgba(3, 105, 161, 0.18) 80%,
        transparent);
}

.logo-image {
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
    transition: var(--transition);
}

.logo-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
}

/* Main Content */
.content {
    flex: 1;
    animation: fadeIn 1s ease-out;
}

.hero-section {
    text-align: center;
    margin-bottom: 4px;
    overflow: visible;
}

.main-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 0.15em;
    line-height: 1.35;
    overflow: visible;
    color: #075985;
    opacity: 1;
    text-shadow: none;
    animation: slideUp 0.8s ease-out;
}

.description {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: #0f172a;
    opacity: 1;
    font-weight: 500;
    margin-bottom: 26px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    text-shadow: none;
}

/* Sections - single joined card */
.main-card {
    margin-bottom: 36px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(186, 230, 253, 0.9);
    border-radius: 12px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
    transition: var(--transition);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

.main-card:hover {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(3, 105, 161, 0.24);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.card-divider {
    border: none;
    height: 1px;
    background: rgba(3, 105, 161, 0.12);
    margin: 24px 0;
}

.publications-section,
.subscribe-section,
.contact-section {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
    box-shadow: none;
}

.publications-section:hover,
.subscribe-section:hover,
.contact-section:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.publications-section {
    margin-bottom: 0;
}

.subscribe-section,
.contact-section {
    padding-top: 0;
}

.subscribe-section h2,
.contact-section h2 {
    margin-top: 0;
}

.contact-section .email-links {
    margin-top: 4px;
}

section > h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #075985;
    display: flex;
    align-items: center;
    gap: 10px;
}

section > h2 i {
    color: #0369a1;
}

/* Lists */
.publications-list {
    list-style: none;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.publications-list li {
    margin-bottom: 0;
}

.publication-link,
.email-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 8px;
    transition: var(--transition);
    word-break: break-word;
}

.publication-link {
    width: 100%;
    min-height: 78px;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    background: #f8fbff;
    border: 1px solid rgba(125, 211, 252, 0.52);
    color: #1e293b;
    font-weight: 500;
}

.new-badge {
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
}

.publication-link:hover,
.email-link:hover {
    color: #075985;
    background: #eef8ff;
    border-color: rgba(3, 105, 161, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(3, 105, 161, 0.09);
}

.publication-link i,
.email-link i {
    width: 1.15rem;
    flex-shrink: 0;
    font-size: 0.95rem;
    color: #0369a1;
    transition: var(--transition);
}

.publication-link:hover i,
.email-link:hover i {
    color: #0284c7;
}

.publication-extra[hidden] {
    display: none;
}

.show-more-toggle {
    margin: 18px auto 0;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(3, 105, 161, 0.22);
    border-radius: 8px;
    background: rgba(248, 251, 255, 0.88);
    color: #075985;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: var(--transition);
}

.show-more-toggle:hover {
    background: #eef8ff;
    border-color: rgba(3, 105, 161, 0.36);
    transform: translateY(-1px);
}

.show-more-toggle:focus {
    outline: 2px solid rgba(3, 105, 161, 0.45);
    outline-offset: 2px;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.show-more-toggle[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

/* Subscribe Link */
.substack-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    padding: 13px 16px;
    border: 1px solid #ff6719;
    border-radius: 8px;
    background: #ff6719;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(255, 103, 25, 0.18);
}

.substack-link:hover {
    color: #ffffff;
    background: #e85d17;
    border-color: #e85d17;
    box-shadow: 0 10px 22px rgba(255, 103, 25, 0.24);
}

.substack-link i {
    font-size: 0.875rem;
}

/* Email Links / Contact */
.email-links {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fbff;
    border: 1px solid rgba(125, 211, 252, 0.52);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(3, 105, 161, 0.06);
}

.email-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    color: #334155;
    text-decoration: none;
    padding: 15px 18px;
    border-radius: 0;
    transition: var(--transition);
    font-size: 0.95rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(125, 211, 252, 0.42);
    width: 100%;
    min-height: 76px;
    max-width: none;
    text-align: left;
}

.email-link:last-child {
    border-bottom: none;
}

.email-link:hover {
    color: #075985;
    background: #eef8ff;
    transform: none;
    box-shadow: none;
}

.email-link i {
    font-size: 1rem;
    color: #0369a1;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(3, 105, 161, 0.08);
    text-align: center;
}

.email-link:hover i {
    color: #0284c7;
}

.email-item {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
    min-width: 0;
    text-align: left;
    width: 100%;
}

.email-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.3;
    letter-spacing: 0;
}

.email-label::after {
    content: ":";
}

.email-address {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    word-break: break-word;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
}

.email-link:hover .email-label {
    color: #475569;
}

.email-link:hover .email-address {
    color: #0b5fc9;
}

/* Footer */
footer {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid rgba(3, 105, 161, 0.16);
    text-align: center;
    color: #475569;
    font-size: 0.875rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

footer p {
    margin: 0;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .hero-wrapper {
        padding: 22px 16px 18px;
    }

    header {
        margin-bottom: 28px;
    }

    .logo {
        padding: 10px 14px;
    }

    .logo-image {
        max-width: 170px;
    }

    .main-title {
        font-size: 2rem;
        margin-bottom: 6px;
    }

    .description {
        font-size: 0.98rem;
        margin-bottom: 24px;
    }

    .main-card {
        margin-bottom: 30px;
        padding: 22px;
    }

    .publications-list {
        grid-template-columns: 1fr;
    }

    section > h2 {
        font-size: 1.25rem;
    }

    .email-links {
        gap: 0;
    }

    footer {
        margin-top: 40px;
        padding-top: 20px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }

    .hero-wrapper {
        padding: 18px 12px 14px;
    }

    header {
        margin-bottom: 24px;
    }

    .logo {
        padding: 9px 12px;
    }

    .logo-image {
        max-width: 150px;
    }

    .main-title {
        font-size: 1.85rem;
        margin-bottom: 4px;
    }

    .description {
        font-size: 0.94rem;
        margin-bottom: 18px;
    }

    .main-card {
        margin-bottom: 20px;
        padding: 16px;
    }

    section > h2 {
        font-size: 1.1rem;
        flex-wrap: wrap;
    }

    .publication-link,
    .email-link {
        font-size: 0.92rem;
        min-height: 70px;
    }

    .substack-link {
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
    }

    footer {
        margin-top: 30px;
        padding-top: 15px;
    }
}

/* Light mode: keep flag background, only adjust text/UI for readability */
@media (prefers-color-scheme: light) {
    :root {
        --primary-dark: #f5f5f5;
        --text-primary: #1a1a2e;
        --text-secondary: #444444;
        --text-light: #666666;
        --border-color: rgba(0, 0, 0, 0.12);
        --hover-bg: rgba(0, 102, 204, 0.08);
    }

    .video-overlay {
        background: rgba(255, 255, 255, 0.56);
    }
}
