@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+Tamil:wght@400;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap");

/* ——— Theme tokens ——— */
[data-theme="light"] {
  --bg-primary: #faf9ff;
  --bg-secondary: #f0ebff;
  --bg-card: #ffffff;
  --bg-dark-section: #1a0a2e;
  --text-primary: #1e1e2e;
  --text-secondary: #6b7280;
  --text-on-dark: #ffffff;
  --border-color: #e5e0f5;
  --shadow-color: rgba(107, 33, 168, 0.12);
  --nav-bg: rgba(255, 255, 255, 0.88);
  --nav-text: #1e1e2e;
  --card-shadow: 0 4px 24px rgba(107, 33, 168, 0.1);
  --input-bg: #ffffff;
  --input-border: #d8d0f0;
  --neomorphic-bg: #eeeaf6;
  --neomorphic-shadow-dark: #c5bfe0;
  --neomorphic-shadow-light: #ffffff;
  --timeline-line: #6b21a8;
  --footer-bg: #1a0a2e;
  --footer-text: #a89bc2;
  --color-primary: #6b21a8;
  --color-accent-gold: #d4af37;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-tamil: "Noto Sans Tamil", sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f0a1e;
  --bg-secondary: #1a1030;
  --bg-card: #1e1535;
  --bg-dark-section: #080412;
  --text-primary: #f0ebff;
  --text-secondary: #a89bc2;
  --text-on-dark: #f0ebff;
  --border-color: #2e2050;
  --shadow-color: rgba(212, 175, 55, 0.1);
  --nav-bg: rgba(15, 10, 30, 0.92);
  --nav-text: #f0ebff;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --input-bg: #1e1535;
  --input-border: #3a2860;
  --neomorphic-bg: #1a1030;
  --neomorphic-shadow-dark: #0a0618;
  --neomorphic-shadow-light: #2a1a48;
  --timeline-line: #d4af37;
  --footer-bg: #080412;
  --footer-text: #7a6a9a;
  --color-primary: #6b21a8;
  --color-accent-gold: #d4af37;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-tamil: "Noto Sans Tamil", sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .about-section {
  background: var(--bg-primary);
}
[data-theme="dark"] .publications-section {
  background: var(--bg-secondary);
}
[data-theme="dark"] .events-section {
  background: var(--bg-secondary);
}
[data-theme="dark"] .contact-section {
  background: var(--bg-primary);
}
[data-theme="dark"] .timeline__card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
[data-theme="dark"] .event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea {
  background: var(--input-bg);
  border-color: var(--input-border);
  color: var(--text-primary);
}
[data-theme="dark"] .contact-form input::placeholder,
[data-theme="dark"] .contact-form textarea::placeholder {
  color: var(--text-secondary);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: max(14px, clamp(0.9rem, 2vw, 1rem));
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
}
h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}
h3 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: var(--text-on-dark);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(1120px, 100% - clamp(1rem, 5vw, 2.5rem));
  margin-inline: auto;
}

/* ——— Header / Nav ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}

.site-header.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1200px;
  margin-inline: auto;
  padding: 0.85rem clamp(0.75rem, 3vw, 1.25rem);
  flex-wrap: nowrap;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-on-dark);
  text-decoration: none;
  flex-shrink: 0;
}

.site-header.is-scrolled .navbar__brand {
  color: var(--nav-text);
}

.navbar__logo {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 175, 55, 0.5);
}

.navbar__title {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.navbar__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0 0.65rem;
  width: min(90px, 28vw);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow var(--transition), background 0.25s, color 0.25s;
}

.theme-toggle:hover {
  transform: scale(1.02);
}

.theme-toggle__icon {
  display: inline-block;
  transition: transform 0.35s ease, opacity 0.25s;
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle.is-dark .theme-toggle__icon {
  transform: rotate(180deg);
}

@media (max-width: 379px) {
  .theme-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .theme-toggle {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  display: block;
  padding: 0.5rem 0.65rem;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.site-header.is-scrolled .nav-menu a {
  color: var(--nav-text);
}

.nav-menu a:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-accent-gold);
  text-decoration: none;
}

.nav-menu a.is-active {
  color: var(--color-accent-gold);
  font-weight: 600;
}

.site-header.is-scrolled .nav-menu a.is-active {
  color: var(--color-accent-gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1002;
}

.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.site-header.is-scrolled .nav-toggle__bar {
  background: var(--nav-text);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 10, 46, 0.5);
  z-index: 999;
}

.nav-backdrop.is-visible {
  display: block;
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 5.5rem 1.25rem 2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .nav-menu a {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
    color: var(--nav-text);
  }

  .nav-menu a:hover,
  .nav-menu a.is-active {
    color: var(--color-accent-gold);
  }
}

@media (min-width: 768px) {
  .nav-menu {
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ——— Hero (always dark) ——— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 72px;
  padding-bottom: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1250 45%, #6b21a8 100%);
  color: #fff;
  overflow: hidden;
}

.hero__kolam {
  position: absolute;
  inset: 0;
  color: rgba(255, 255, 255, 0.35);
  opacity: 0.45;
  pointer-events: none;
}

.kolam-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: end;
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(0.75rem, 2vw, 1.25rem) 0;
  min-height: calc(100svh - 72px);
}

.hero__col--text {
  padding-bottom: clamp(1.5rem, 4vw, 3rem);
  align-self: center;
  min-width: 0;
}

.hero__tamil-quote {
  font-family: var(--font-tamil);
  font-size: clamp(1.1rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-accent-gold);
  margin: 0 0 0.35rem;
  text-shadow: 0 2px 20px rgba(212, 175, 55, 0.25);
  white-space: nowrap;
  line-height: 1.2;
}

.hero__english-quote {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
}

.hero__divider {
  border: none;
  height: 1px;
  max-width: 200px;
  margin: 0 0 1.25rem;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.85), transparent);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

@media (max-width: 1024px) {
  .hero__divider {
    margin-inline: auto;
  }
}

.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 5vw, 3.25rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.hero__creds {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: rgba(212, 175, 55, 0.9);
}

.hero__role {
  min-height: 3.25rem;
  margin-bottom: 1.75rem;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.45;
  word-break: break-word;
}

.hero__typewriter {
  color: var(--color-accent-gold);
  font-weight: 600;
}

.hero__cursor {
  animation: blink 1s step-end infinite;
  color: var(--color-accent-gold);
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: rgba(107, 33, 168, 0.35);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  font-size: clamp(0.75rem, 2vw, 0.88rem);
  font-weight: 600;
  color: #fff;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: floatBadge 4s ease-in-out infinite;
}

.stat-badge__emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.stat-badge:nth-child(2) {
  animation-delay: 0.5s;
}

.stat-badge:nth-child(3) {
  animation-delay: 1s;
}

@keyframes floatBadge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow var(--transition), background var(--transition);
}

.btn:hover {
  text-decoration: none;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
  }
}

.btn--gold {
  background: linear-gradient(135deg, #e8c547 0%, var(--color-accent-gold) 50%, #b8860b 100%);
  color: #1a0a2e;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
}

.btn--outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
}

.btn--purple {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--small {
  padding: 0.65rem 1.35rem;
  font-size: 0.88rem;
}

.btn--submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 1rem 1.25rem;
  border: none;
  background: linear-gradient(135deg, #d4af37, #c9a227, #b8960c);
  color: #1a0a2e;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
  transition: transform 0.2s, box-shadow 0.25s, filter 0.2s;
}

@media (hover: hover) {
  .btn--submit:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 28px rgba(212, 175, 55, 0.45);
    filter: brightness(1.03);
  }
}

.hero__col--visual {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-bottom: clamp(-2rem, -4vw, -4rem);
  min-height: 80vh;
}

.hero__glow {
  position: absolute;
  bottom: 8%;
  right: 5%;
  width: min(95%, 480px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(107, 33, 168, 0.75) 0%, rgba(107, 33, 168, 0.2) 45%, transparent 70%);
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}

.hero__img {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 100%;
  height: min(80vh, 820px);
  min-height: 50vh;
  margin-left: auto;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.4));
  animation: heroFloat 5s ease-in-out infinite;
}

@keyframes heroFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__img {
    animation: none;
  }

  .stat-badge {
    animation: none;
  }
}

@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
  }

  .hero__col--text {
    order: 1;
    padding-bottom: 1rem;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn {
    width: 100%;
    justify-content: center;
  }

  .hero__col--visual {
    order: 2;
    justify-content: center;
    min-height: auto;
    margin-bottom: -1rem;
  }

  .hero__img {
    height: auto;
    max-height: 50vh;
    min-height: 0;
    margin-inline: auto;
    object-position: bottom center;
  }

  .hero__glow {
    right: 50%;
    transform: translateX(50%);
  }
}

/* ——— Sections ——— */
.section {
  padding: clamp(40px, 8vw, 100px) 0;
  position: relative;
}

.section__title {
  font-family: var(--font-heading);
  text-align: center;
  margin: 0 auto 0.75rem;
  position: relative;
  display: inline-block;
  width: 100%;
  color: var(--text-primary);
}

.section__title-line {
  display: block;
  width: 72px;
  height: 4px;
  margin: 0.65rem auto 0;
  background: linear-gradient(90deg, transparent, var(--color-accent-gold), transparent);
  border-radius: 2px;
}

.section__title-line--purple {
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.section__title--on-dark {
  color: var(--color-accent-gold);
}

.section__subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
}

.section__subtitle--on-dark {
  color: rgba(255, 255, 255, 0.75);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— About ——— */
.about {
  background: var(--bg-primary);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin-bottom: 3rem;
}

@media (max-width: 767px) {
  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__photo-wrap {
    order: 1;
    max-width: 280px;
    margin: 0 auto;
  }

  .about__text {
    order: 2;
    padding: 0 clamp(0, 2vw, 16px);
  }
}

.about__frame {
  position: relative;
  padding: 6px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-accent-gold), #8b6914, var(--color-accent-gold));
  box-shadow: var(--card-shadow);
}

.about__frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 17px;
  border: 2px solid rgba(212, 175, 55, 0.55);
  pointer-events: none;
}

.about__img {
  border-radius: 14px;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 4/5;
}

.about__para {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.about__achievements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.achieve-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

[data-theme="dark"] .achieve-card {
  background: var(--bg-card);
}

.achieve-card__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.achieve-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.achieve-card__num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent-gold);
  line-height: 1.2;
}

.achieve-card__lbl {
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.25;
}

[data-theme="dark"] .achieve-card__lbl {
  color: var(--text-secondary);
}

.timeline__heading {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--color-primary);
}

.timeline {
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 800px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-accent-gold), var(--timeline-line));
  transform: translateX(-50%);
  border-radius: 2px;
}

.timeline__item {
  position: relative;
  width: 50%;
  padding: 0 1.5rem 2rem;
  box-sizing: border-box;
}

.timeline__item::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--color-primary);
  border: 3px solid var(--color-accent-gold);
  border-radius: 50%;
  top: 0.35rem;
  z-index: 1;
}

.timeline__item--left {
  left: 0;
  text-align: right;
  padding-right: 2rem;
}

.timeline__item--left::before {
  right: -8px;
}

.timeline__item--right {
  left: 50%;
  text-align: left;
  padding-left: 2rem;
}

.timeline__item--right::before {
  left: -8px;
}

.timeline__card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

@media (hover: hover) {
  .timeline__card:hover {
    transform: translateY(-4px);
  }
}

.timeline__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline__item.reveal.timeline__item--left {
  transform: translateX(-36px);
}

.timeline__item.reveal.timeline__item--right {
  transform: translateX(36px);
}

.timeline__item.reveal.is-visible.timeline__item--left,
.timeline__item.reveal.is-visible.timeline__item--right {
  transform: translateX(0);
}

@media (max-width: 767px) {
  .timeline::before {
    left: 20px;
    transform: none;
  }

  .timeline__item,
  .timeline__item--left,
  .timeline__item--right {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 44px;
    padding-right: 0;
  }

  .timeline__item--left::before,
  .timeline__item--right::before {
    left: 12px;
    right: auto;
  }

  .timeline__item.reveal.timeline__item--left,
  .timeline__item.reveal.timeline__item--right {
    transform: translateY(20px);
  }
}

/* ——— Publications ——— */
.publications {
  background: var(--bg-secondary);
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 1rem;
}

.pub-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.pub-card__tilt {
  perspective: 1000px;
  margin-bottom: 1.25rem;
}

.pub-card__cover-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pub-card__shine {
  position: absolute;
  top: -40%;
  left: -80%;
  width: 55%;
  height: 200%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.45) 45%, transparent 70%);
  transform: rotate(28deg);
  z-index: 2;
  pointer-events: none;
  transition: left 0.65s ease;
}

@media (hover: hover) {
  .pub-card:hover .pub-card__cover-wrap {
    transform: rotateY(-6deg) rotateX(5deg) translateY(-6px);
    box-shadow: 0 28px 56px rgba(107, 33, 168, 0.22);
  }

  .pub-card:hover .pub-card__shine {
    left: 130%;
  }
}

.pub-card__accent {
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent-gold), #f5e6a3, var(--color-accent-gold));
  border-radius: 0 0 4px 4px;
}

.pub-card__cover {
  width: 100%;
  object-fit: cover;
  aspect-ratio: 3/4;
  max-height: 400px;
}

.pub-card__title-ta {
  font-family: var(--font-tamil);
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.pub-card__author {
  font-family: var(--font-tamil);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}

.pub-card__desc {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 767px) {
  .pub-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .pub-card {
    max-width: 380px;
    width: 100%;
  }
}

/* ——— Gallery (fixed dark) ——— */
.gallery-section {
  background: var(--bg-dark-section);
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.gallery-section__kolam {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(107, 33, 168, 0.2) 0%, transparent 45%);
  pointer-events: none;
}

.gallery-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gallery-tab {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 999px;
  border: 2px solid rgba(107, 33, 168, 0.6);
  background: rgba(107, 33, 168, 0.25);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  min-height: 44px;
}

.gallery-tab:hover,
.gallery-tab.is-active {
  background: #6b21a8;
  border-color: var(--color-accent-gold);
  color: #fff;
}

.gallery-panel {
  display: none;
}

.gallery-panel.is-active {
  display: block;
}

.gallery-panel__empty {
  margin: 0 auto;
  max-width: 720px;
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.25);
}

.carousel {
  position: relative;
  max-width: 720px;
  margin-inline: auto;
}

.carousel__viewport {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/2;
  background: rgba(0, 0, 0, 0.35);
}

@media (max-width: 767px) {
  .carousel__viewport {
    height: 250px;
    aspect-ratio: auto;
  }
}

.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}

.carousel__slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.carousel__slide img,
.carousel__slide .carousel__yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  cursor: pointer;
}

.carousel__caption {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.carousel__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
}

.carousel__dot.is-active {
  background: var(--color-accent-gold);
  transform: scale(1.15);
}

.carousel__yt {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0a0612;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel__yt-thumb {
  position: absolute;
  inset: 0;
  opacity: 0.85;
}

.carousel__yt-play {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 52px;
  background: rgba(255, 0, 0, 0.88);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s;
  text-decoration: none;
}

.carousel__yt-play:hover {
  transform: scale(1.06);
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(40px, 10vw, 48px);
  height: clamp(40px, 10vw, 48px);
  border-radius: 50%;
  border: none;
  background: #6b21a8;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background var(--transition);
}

.carousel__btn--prev {
  left: 0.35rem;
}

.carousel__btn--next {
  right: 0.35rem;
}

.carousel.is-paused .carousel__viewport {
  outline: 2px solid rgba(212, 175, 55, 0.3);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 10, 46, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(6px);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__img {
  max-width: min(90vw, 1000px);
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.lightbox__nav:hover {
  background: rgba(212, 175, 55, 0.35);
}

.lightbox__nav--prev {
  left: clamp(0.4rem, 2vw, 1.25rem);
}

.lightbox__nav--next {
  right: clamp(0.4rem, 2vw, 1.25rem);
}

@media (max-width: 700px) {
  .lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
  }
}

/* ——— Events ——— */
.events {
  background: var(--bg-secondary);
}

.events__hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: -1.5rem auto 1rem;
}

@media (min-width: 768px) {
  .events__hint {
    display: none;
  }
}

.events__wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.events__scroller {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.5rem 0.25rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.events__scroller::-webkit-scrollbar {
  height: 8px;
}

.event-card {
  flex: 0 0 min(300px, 90vw);
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-accent-gold);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-bottom-color 0.3s;
  position: relative;
}

.event-card--pattimandram {
  border-left-color: #d4af37;
}

.event-card--talk {
  border-left-color: #6b21a8;
}

.event-card--workshop {
  border-left-color: #0d9488;
}

.event-card__badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.event-card--pattimandram .event-card__badge {
  background: #d4af37;
  color: #1a0a2e;
}

.event-card--talk .event-card__badge--talk {
  background: #6b21a8;
  color: #fff;
}

.event-card--workshop .event-card__badge--workshop {
  background: #0d9488;
  color: #fff;
}

.event-card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}

.event-card__meta {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.event-card__meta--date {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.event-card__meta--loc {
  font-weight: 500;
}

.event-card__ico {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.85;
}

@media (hover: hover) {
  .event-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px var(--shadow-color);
    border-bottom: 3px solid var(--color-accent-gold);
  }
}

.events__arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: var(--bg-card);
  color: var(--color-primary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

@media (min-width: 768px) and (max-width: 1024px) {
  .event-card {
    flex: 0 0 calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
  }
}

@media (max-width: 767px) {
  .events__arrow {
    display: none;
  }

  .event-card {
    flex: 0 0 90vw;
  }
}

/* ——— Contact ——— */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.info-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.info-card__label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.info-card__value {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.social-block {
  margin-top: 2rem;
}

.social-block__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: var(--color-primary);
}

.social-neuro {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
}

.social-neuro__btn {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: var(--neomorphic-bg);
  color: #6b21a8;
  box-shadow: 6px 6px 12px var(--neomorphic-shadow-dark), -6px -6px 12px var(--neomorphic-shadow-light);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
  /* Avoid WebKit clipping SVG ink inside a circle */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.social-neuro__btn:hover {
  text-decoration: none;
}

@media (hover: hover) {
  .social-neuro__btn:hover {
    transform: scale(1.06) translateZ(0);
    box-shadow: inset 4px 4px 10px var(--neomorphic-shadow-dark), inset -4px -4px 10px var(--neomorphic-shadow-light);
  }

  .social-neuro__btn:hover .social-neuro__icon {
    transform: scale(1.08);
  }
}

.social-neuro__icon {
  flex-shrink: 0;
  flex-basis: 22px;
  width: 22px;
  height: 22px;
  display: block;
  transition: transform 0.2s;
  shape-rendering: geometricPrecision;
}

/* YouTube: play “cutout” uses button fill (rect + polygon, no fragile compound path) */
.social-neuro__icon--youtube .social-neuro__youtube-play {
  fill: var(--neomorphic-bg);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  min-height: 44px;
  padding: 0.9rem 1.1rem;
  border: 2px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(107, 33, 168, 0.2);
}

.form-banner {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
}

.form-banner--success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #166534;
}

.form-banner--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #b91c1c;
}

.form-notice {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.45);
  border-radius: var(--radius-md);
  color: #854d0e;
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 767px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }

  .social-neuro {
    justify-content: center;
  }
}

/* ——— Footer ——— */
.site-footer {
  position: relative;
  background: var(--footer-bg);
  color: var(--footer-text);
  padding-top: 3rem;
  overflow: hidden;
}

.footer__kolam {
  position: absolute;
  inset: 0;
  color: rgba(212, 175, 55, 0.12);
  opacity: 0.5;
  pointer-events: none;
}

.footer__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer__logo {
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.45);
  margin-bottom: 0.75rem;
}

.footer__col--brand {
  text-align: left;
}

.footer__brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-accent-gold);
  margin: 0 0 0.35rem;
}

.footer__tagline {
  font-family: var(--font-tamil);
  font-size: 1.1rem;
  color: #c4a35a;
  margin: 0;
  opacity: 0.95;
  white-space: nowrap;
}

.footer__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__nav a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.footer__nav a:hover {
  color: var(--color-accent-gold);
}

.footer__contact-line {
  margin: 0.4rem 0;
  font-size: 0.92rem;
}

.footer__contact-line a {
  color: rgba(255, 255, 255, 0.88);
}

.footer__bar {
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  padding: 1rem;
  text-align: center;
}

.footer__bar--bottom {
  background: #050208;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  padding: 0.85rem 1rem;
}

.footer__copy {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer__copy--bottom {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 900px) {
  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__logo {
    margin-inline: auto;
  }

  .footer__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    gap: 0.5rem 1rem;
  }
}

/* ——— Back to top ——— */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: none;
  border-radius: 50%;
  background: #6b21a8;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.3s, background 0.2s;
}

.back-to-top:hover {
  background: #551a87;
  transform: translateY(-3px);
}

.back-to-top[hidden] {
  display: none !important;
}
