/* ============================================================
   style.css — Dr. Mini Thekkechangarampatt
   Complete stylesheet for the professional profile page
   ============================================================ */

/* style.css */

:root {
  --ink: #1c2541;
  --ink-soft: #3a4363;
  --parchment: #f7f5b7;
  --parchment-deep: #f5f0e6;
  --burgundy: #7a2e2e;
  --gold: #b08d57;
  --slate: #5b6472;
  --hairline: #e5ddd0;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--parchment);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.serif {
  font-family: 'Source Serif 4', serif;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

a {
  color: inherit;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 28px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- NAV ---------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

/* --- Mobile Navigation --- */
.nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
  padding: 12px 20px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brandmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}

.brandmark .monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  flex-shrink: 0;
}

.brandmark .name-text {
  display: inline;
}

/* Hamburger Button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--ink);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Navigation Links */
.navlinks {
  display: flex;
  gap: 24px;
  align-items: center;
}

.navlinks a {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.navlinks a:hover {
  color: var(--burgundy);
  border-bottom-color: var(--burgundy);
}

/* Nav Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.nav-overlay.active {
  display: block;
}

/* ---------- HERO ---------- */
header.hero {
  padding: 72px 0 40px;
  padding-top: 100px; /* Extra padding for fixed nav */
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.portrait-frame {
  flex-shrink: 0;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--burgundy);
  box-shadow: 0 0 0 5px var(--parchment), 0 0 0 6px var(--burgundy);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}

h1 {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 16.5px;
  color: var(--ink-soft);
  max-width: 600px;
  margin-bottom: 26px;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--slate);
  margin-bottom: 46px;
}

.contact-row a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}

.contact-row a:hover {
  color: var(--burgundy);
  border-color: var(--burgundy);
}

/* ---------- TIMELINE INSTRUMENT ---------- */
.instrument {
  border: 1px solid var(--hairline);
  background: var(--card);
  border-radius: 3px;
  padding: 26px 26px 18px;
}

.instrument-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--burgundy);
  font-weight: 700;
  margin-bottom: 16px;
}

.timeline-track {
  position: relative;
  height: 34px;
  background: var(--parchment-deep);
  border-radius: 2px;
  overflow: hidden;
}

.seg {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--ink);
  opacity: .92;
  transform: scaleX(0);
  transform-origin: left;
  animation: grow 1.1s cubic-bezier(.22, .9, .3, 1) forwards;
  cursor: default;
}

.seg:nth-of-type(odd) {
  background: var(--burgundy);
}

.seg .tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  padding: 6px 9px;
  border-radius: 2px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
  z-index: 5;
}

.seg:hover .tip {
  opacity: 1;
  transform: translateY(0);
}

.seg:hover {
  opacity: 1;
}

@keyframes grow {
  to {
    transform: scaleX(1);
  }
}

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--burgundy);
  font-weight: 700;
}

.axis span {
  position: relative;
}

/* ---------- SECTION SHELL ---------- */
section {
  padding: 54px 0;
  border-top: 1px solid var(--hairline);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 30px;
}

.section-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--gold);
}

h2 {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 26px;
}

/* ---------- STRENGTHS PILLS ---------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  border: 1px solid var(--hairline);
  padding: 7px 13px;
  border-radius: 20px;
  color: var(--ink-soft);
  background: var(--card);
}

/* ---------- EXPERIENCE LEDGER ---------- */
.role {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
}

.role:last-child {
  border-bottom: none;
}

.role-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink);
  padding-top: 2px;
}

.role-date .current {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--burgundy);
  margin-right: 6px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .35;
  }
}

.role-title {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 17.5px;
  margin-bottom: 2px;
}

.role-org {
  font-size: 13.5px;
  color: var(--burgundy);
  margin-bottom: 8px;
}

.role-desc {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 560px;
}

/* earlier roles compact */
.earlier-list {
  font-size: 13.5px;
  color: var(--ink-soft);
}

.earlier-item {
  padding: 11px 0;
  border-bottom: 1px dashed var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}

.earlier-item:last-child {
  border-bottom: none;
}

.earlier-item .e-role {
  font-weight: 600;
  color: var(--ink);
}

.earlier-item .e-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--slate);
  margin-left: auto;
}

/* ---------- STAT GRID ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  margin-bottom: 28px;
}

.stat {
  background: var(--card);
  padding: 22px 18px;
}

.stat .num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 28px;
  color: var(--burgundy);
  display: block;
  margin-bottom: 4px;
}

.stat .lbl {
  font-size: 12px;
  color: var(--slate);
}

.achieve-list {
  list-style: none;
}

.achieve-list li {
  position: relative;
  padding: 9px 0 9px 22px;
  font-size: 14.5px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
}

.achieve-list li:last-child {
  border-bottom: none;
}

.achieve-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
}

.book-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

.book {
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 18px;
  border-radius: 3px;
}

.book .b-title {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-size: 15px;
  margin-bottom: 4px;
}

.book .b-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--slate);
}

/* ---------- EDUCATION TRANSCRIPT ---------- */
.transcript {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.transcript tr {
  border-bottom: 1px solid var(--hairline);
}

.transcript tr:last-child {
  border-bottom: none;
}

.transcript td {
  padding: 12px 10px;
}

.transcript td:first-child {
  padding-left: 0;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--slate);
  white-space: nowrap;
}

.transcript td:nth-child(2) {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
}

.transcript td:last-child {
  color: var(--ink-soft);
  text-align: right;
  padding-right: 0;
}

.net {
  display: inline-block;
  margin-top: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  border: 1px solid var(--gold);
  color: var(--burgundy);
  padding: 5px 10px;
  border-radius: 2px;
}

/* ---------- MEMBERSHIPS ---------- */
.mem-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mem-item {
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 16px;
  position: relative;
}

.mem-item::before {
  content: "§";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-family: 'IBM Plex Mono', monospace;
}

/* ---------- FOOTER ---------- */
footer {
  padding: 60px 0 50px;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.seal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.4px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--burgundy);
  position: relative;
  overflow: hidden;
}

.seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--hairline);
  border-radius: 50%;
}

footer .fname {
  font-family: 'Source Serif 4', serif;
  font-size: 17px;
  margin-bottom: 6px;
}

footer .fmeta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--slate);
}

footer .fcontact {
  margin-top: 16px;
  font-size: 13px;
}

footer .fcontact a {
  text-decoration: none;
  color: var(--burgundy);
}

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- SELECTION & FOCUS ---------- */
::selection {
  background: var(--gold);
  color: var(--parchment);
}

a:focus-visible,
.seg:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 2px;
}

/* ============================================================
   MOBILE RESPONSIVE STYLES
   ============================================================ */

/* ---------- TABLETS AND SMALLER (max-width: 768px) ---------- */
@media (max-width: 768px) {
  /* --- Navigation --- */
  .hamburger {
    display: flex;
    z-index: 1002; /* Ensure hamburger is above overlay */
  }

  .brandmark .name-text {
    display: none; /* Hide full name on mobile, show only monogram */
  }

  .brandmark .monogram {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .navlinks {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    justify-content: center; /* Center items vertically */
    align-items: center;     /* Center items horizontally */
    gap: 24px;               /* Slightly more gap */
    padding: 40px 30px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1); /* Smoother easing */
    box-shadow: -6px 0 30px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    text-align: center;      /* Ensure text is centered */
  }

  .navlinks.open {
    right: 0;
  }

  .navlinks a {
    font-size: 18px;
    font-weight: 500;
    padding: 8px 0;
    width: 100%;
    color: var(--ink);
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
  }

  /* Mobile touch feedback */
  .navlinks a:active {
    color: var(--burgundy);
    border-bottom-color: var(--burgundy);
  }

  /* Overlay transition for smoothness */
  .nav-overlay {
    transition: opacity 0.35s ease;
    opacity: 0;
    pointer-events: none;
  }

  .nav-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
  }

  /* --- Hero --- */
  .hero {
    padding-top: 80px !important;
  }

  .hero-top {
    flex-direction: column !important;
    text-align: center;
  }

  .hero-text {
    order: 2;
  }

  .portrait-frame {
    order: 1;
    width: 180px !important;
    height: 180px !important;
    margin: 0 auto 20px;
  }

  .hero-text h1 {
    font-size: 28px !important;
  }

  .contact-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
  }

  .contact-row a,
  .contact-row span {
    font-size: 12px !important;
  }

  /* --- Timeline --- */
  .timeline-track {
    height: 40px !important;
  }

  .axis span {
    font-size: 10px !important;
  }

  .instrument-label {
    font-size: 12px !important;
  }

  /* --- Pills --- */
  .pills {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px !important;
  }

  .pill {
    font-size: 12px !important;
    padding: 6px 14px !important;
  }

  /* --- Stats Grid --- */
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  .stat .num {
    font-size: 28px !important;
  }

  .stat .lbl {
    font-size: 11px !important;
  }

  /* --- Roles --- */
  .role {
    flex-direction: column !important;
    gap: 4px !important;
    grid-template-columns: 1fr !important;
  }

  .role-date {
    font-size: 13px !important;
    min-width: auto !important;
  }

  .role-title {
    font-size: 16px !important;
  }

  .role-org {
    font-size: 14px !important;
  }

  .role-desc {
    font-size: 13px !important;
  }

  /* --- Earlier roles --- */
  .earlier-item {
    font-size: 13px !important;
    flex-wrap: wrap;
  }

  .e-date {
    display: block !important;
    margin-left: 0 !important;
  }

  /* --- Achievements list --- */
  .achieve-list li {
    font-size: 13px !important;
    padding-left: 20px !important;
  }

  /* --- Book cards --- */
  .book-cards {
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .book {
    padding: 14px 18px !important;
  }

  .b-title {
    font-size: 14px !important;
  }

  .b-meta {
    font-size: 12px !important;
  }

  /* --- Education table --- */
  .transcript td {
    padding: 8px 6px !important;
    font-size: 13px !important;
  }

  .transcript td:first-child {
    font-size: 12px !important;
    min-width: 80px !important;
  }

  .transcript td:last-child {
    font-size: 12px !important;
  }

  /* --- Memberships --- */
  .mem-item {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }

  /* --- Footer --- */
  footer .fname {
    font-size: 18px !important;
  }

  footer .fmeta {
    font-size: 11px !important;
  }

  footer .fcontact {
    font-size: 12px !important;
    flex-wrap: wrap;
    justify-content: center;
  }

  .seal {
    width: 70px !important;
    height: 70px !important;
  }

  /* --- Section spacing --- */
  section {
    padding: 40px 0 !important;
  }

  .wrap {
    padding: 0 16px !important;
  }

  .section-head {
    margin-bottom: 20px !important;
  }

  .section-head h2 {
    font-size: 20px !important;
  }

  .section-num {
    font-size: 14px !important;
    min-width: 28px !important;
  }

  .eyebrow {
    justify-content: center;
  }

  .eyebrow::before {
    display: none;
  }
}

/* ---------- SMALL PHONES (max-width: 480px) ---------- */
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .stat {
    padding: 12px 8px !important;
  }

  .stat .num {
    font-size: 22px !important;
  }

  .stat .lbl {
    font-size: 10px !important;
  }

  .hero-text h1 {
    font-size: 24px !important;
  }

  .brandmark {
    font-size: 14px;
  }

  .brandmark .monogram {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .nav-wrapper {
    padding: 10px 16px;
  }

  .hamburger span {
    width: 24px;
    height: 2.5px;
  }
}

/* ---------- LARGE SCREENS (min-width: 1400px) ---------- */
@media (min-width: 1400px) {
  .wrap {
    max-width: 1100px;
  }

  .portrait-frame {
    width: 160px;
    height: 160px;
  }
}

/* ---------- DARK MODE SUPPORT (optional) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --parchment: #1a1a1a;
    --parchment-deep: #2a2a2a;
    --card: #242424;
    --hairline: #3a3a3a;
    --ink: #e8e0d4;
    --ink-soft: #b8b0a4;
    --slate: #8a8a8a;
    --gold: #c9a86c;
    --burgundy: #b85a5a;
  }

  .seal::before {
    border-color: var(--hairline);
  }

  .nav-wrapper {
    background: rgba(26, 26, 26, 0.96);
  }

  .brandmark .monogram {
    background: var(--gold);
    color: var(--parchment);
  }

  .navlinks {
    background: var(--parchment);
  }

  .navlinks a {
    color: var(--ink);
  }

  .navlinks a:hover {
    color: var(--gold);
  }

  .hamburger span {
    background: var(--ink);
  }

  .portrait-frame {
    border-color: var(--gold);
    box-shadow: 0 0 0 5px var(--parchment), 0 0 0 6px var(--hairline);
  }
}

/* ---------- ORCID ROW ---------- */
.orcid-row {
  margin-top: 1px;
  margin-bottom: 10px;
}

.orcid-link {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--slate);
  text-decoration: none;  /* ← Removes the underline */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.orcid-link .orcid-icon {
  font-weight: 600;
  color: var(--burgundy);
  letter-spacing: 0.5px;
}

.orcid-link .orcid-id {
  font-weight: 600;
  color: var(--burgundy);
}

.orcid-link:hover {
  color: var(--ink);
}

.orcid-link:hover .orcid-icon {
  color: #A6CE39;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .orcid-row {
    text-align: center;
  }
  
  .orcid-link {
    font-size: 12px;
  }
}


/* ---------- PUBLICATION HEADER ---------- */
.transcript .header-row td {
  font-weight: 700;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--ink);
}