:root {
    /* Light gray overall theme */
    --bg: radial-gradient(circle at top, #f7f7f9 0, #f1f2f5 45%, #e5e7eb 100%);
    --bg-alt: radial-gradient(circle at top, #eff1f5 0, #e1e4ea 55%, #d4d4dc 100%);
    --card: rgba(255, 255, 255, 0.96);

    /* Accents: cool academic blue-gray */
    --accent: #2563eb; /* blue */
    --accent-soft: rgba(37, 99, 235, 0.14);

    /* Text colors */
    --text: #111827;         /* main text: dark gray */
    --text-muted: #4b5563;   /* secondary */
    --border: #d1d5db;       /* light border */

    /* Shadows */
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.10);

    /* Radii (unchanged) */
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    scroll-behavior: smooth;
}

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

/* Layout helpers */

.container {
    width: min(1120px, 100% - 2.5rem);
    margin: 0 auto;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background: var(--bg-alt);
}

/* Header / Nav */




.site-header {
    background: linear-gradient(
        to bottom,
        #5C5F63,
        #6B6E73,
        #797C82
    );
    border-bottom: 1px solid #2f3640;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 40%;
    background: radial-gradient(circle at 30% 30%, #e5e7eb 0, #38bdf8 30%, #0f172a 75%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #020617;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.45);
}

.logo-text {
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 0.98rem;
}

.nav {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.nav a {
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e5e7eb;  /* lighter text on dark tab */
    position: relative;
    padding-bottom: 0.25rem;
}

.nav a:hover {
    color: #ffffff;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(to right, #38bdf8, #a855f7);
    transition: width 0.18s ease-out;
}

.nav a:hover::after {
    width: 100%;
}

/* Mobile nav */

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: #e5e7eb;
    border-radius: 999px;
}

/* Hero */

.hero {
    padding: 4.5rem 0 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: center;
}

.hero-tagline {
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 4vw, 3rem);
    line-height: 1.1;
    margin: 0 0 1rem;
}

.hero-description {
    color: var(--text-muted);
    font-size: 0.98rem;
    max-width: 36rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.btn {
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn.primary {
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    color: #020617;
    box-shadow: 0 15px 35px rgba(56, 189, 248, 0.45);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(56, 189, 248, 0.55);
}

.btn.ghost {
    background: rgba(15,23,42,0.6);
    border-color: rgba(148,163,184,0.3);
    color: var(--text);
}

.btn.ghost:hover {
    background: rgba(15,23,42,0.95);
    border-color: var(--accent);
}

.btn.full-width {
    width: 100%;
}

/* Hero photo card */

.hero-photo-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.5rem 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.hero-photo-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 0%, rgba(56,189,248,0.18), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.photo-wrapper {
    border-radius: 999px;
    border: 2px solid rgba(148,163,184,0.6);
    padding: 0.25rem;
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
    background: radial-gradient(circle at 30% 0%, #38bdf8 0, #020617 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
}

.hero-meta {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0.7rem;
    font-size: 0.82rem;
}

.hero-meta .meta-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-bottom: 0.18rem;
}

.hero-meta .meta-value {
    color: var(--text);
}

/* Section titles */

.section-title {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title::after {
    content: "";
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, #38bdf8, #a855f7);
    border-radius: 999px;
}

/* Timeline (Academic Background) */

.timeline {
    border-left: 1px solid rgba(148,163,184,0.35);
    margin-left: 0.5rem;
    padding-left: 1.5rem;
    display: grid;
    gap: 1.75rem;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -1.8rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #e5e7eb 0, #38bdf8 45%, #0f172a 95%);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-content h3 {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
}

.timeline-meta {
    margin: 0 0 0.3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.timeline-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* Cards */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
}

.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.3rem 1.3rem 1.2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 0%, rgba(56,189,248,0.12), transparent 55%);
    opacity: 0.8;
    pointer-events: none;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.card p {
    margin: 0.2rem 0 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Tag list */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-list li {
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    background: rgba(15,23,42,0.90); /* keep dark pill background */
    border: 1px solid rgba(148,163,184,0.4);
    color: #ffffff;  /* ← MAKE TEXT WHITE */
}

.card-video-wrapper {
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.card-video {
  width: 100%;
  display: block;
}

/* Teaching */

.two-column {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
}

.course-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.9rem;
}

.course-list li {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Publications */

.section-subtitle {
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pub-list {
    padding-left: 1.2rem;
    margin: 0;
    display: grid;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* Other */

.simple-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Contact */

.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr;
    gap: 2.5rem;
}

.contact-grid p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.contact-grid a {
    color: var(--accent);
    text-decoration: none;
}

.contact-grid a:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.contact-form {
    background: rgba(15,23,42,0.85);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148,163,184,0.4);
    padding: 1.2rem 1.2rem 1.1rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.7);
}

.form-row {
    margin-bottom: 0.8rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.9);
    padding: 0.6rem 0.7rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(148,163,184,0.8);
}

/* Footer */

.site-footer {
    border-top: 1px solid #d4d4d8;
    padding: 1.2rem 0 1.6rem;
    background: linear-gradient(to bottom, #f3f4f6, #e5e7eb);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-note {
    opacity: 0.8;
}

/* Back to top */

.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: radial-gradient(circle at 30% 0, #2563eb 0, #3b82f6 55%, #1d4ed8 95%);
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.15s ease-out, transform 0.15s ease-out, visibility 0.15s;
    z-index: 40;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive */

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-grid,
    .two-column {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    /* Keep header always at the top */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000; /* above the hero card */
    }

    .nav-container {
        position: relative;
    }

    /* Mobile dropdown menu */
    .nav {
        position: fixed;        /* <— key change */
        left: 0;
        right: 0;
        top: 56px;              /* ≈ header height; adjust if needed */
        margin-top: 0;
        background: rgba(3,7,18,0.98);
        padding: 0.7rem 1rem 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        border-bottom: 1px solid rgba(15,23,42,0.9);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-4px);
        transition: max-height 0.16s ease-out,
                    opacity 0.16s ease-out,
                    transform 0.16s ease-out;
        z-index: 1001;          /* above everything else */
    }

    .nav.open {
        max-height: 220px;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-toggle {
        display: flex;
    }


    /* Push content down so it doesn't hide behind fixed header */
    .hero {
        padding-top: 5.5rem; /* header (≈56px) + some breathing room */
    }

    .section {
        padding: 3.5rem 0;
    }

    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}




.flow-canvas-wrapper {
  margin-top: 1rem;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
}

#flowCanvas {
  width: 100%;
  height: auto;
  display: block;
}



.card-image {
    width: 100%;
    margin-top: 1rem;

    /* Let the image define its height */
    display: flex;
    justify-content: center;

    border-radius: 20px;
    overflow: hidden;

    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(200,200,200,0.45);
    box-shadow: 0 6px 22px rgba(0,0,0,0.08);
    padding: 0.5rem; /* optional soft padding */
}

.card-image img {
    width: 100%;              /* scale to fit width */
    height: auto;             /* preserve aspect ratio */
    display: block;

    border-radius: 14px;      /* match styling */
    object-fit: contain;      /* NO cropping, NO distortion */
    background-color: white;  /* optional clean background */
}




.caption-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin-top: 0.5rem;
}


.mayek {
    font-family: "Noto Sans Meetei Mayek", "Eeyek", sans-serif;
    font-size: 1.5rem;    /* make it bigger */
}

.mayek {
    font-family: "Noto Sans Meetei Mayek", "Eeyek", sans-serif;
}





/* FINAL OVERRIDE FOR MOBILE NAV – PUT AT VERY BOTTOM OF CSS */

@media (max-width: 720px) {

  /* Keep header at the very top */
  .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99996 !important;
  }

  /* Make sure the page content starts below the fixed header */
  body {
    padding-top: 60px;  /* adjust if your header is taller/shorter */
  }

  .nav-container {
    position: relative !important;
  }

  /* FORCE the mobile menu to overlay content below the header */
  .nav {
    position: fixed !important;
    top: 60px !important;  /* just under the header */
    left: 0 !important;
    right: 0 !important;

    background: rgba(3, 7, 18, 0.98) !important;
    padding: 0.7rem 1rem 0.9rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    border-bottom: 1px solid rgba(15,23,42,0.9) !important;

    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition:
      max-height 0.16s ease-out,
      opacity 0.16s ease-out,
      transform 0.16s ease-out;

    z-index: 99998 !important;  /* above hero-photo-card etc. */
  }

  .nav.open {
    max-height: 260px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex !important;
  }

  /* Optional: slightly reduce hero top padding if needed */
  .hero {
    padding-top: 1.5rem;
  }
}