/* ===========================
   styles.css — Monisha Jegadeesan Portfolio
   =========================== */

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

:root {
  --sidebar-width: 280px;
  --nav-height: 56px;
  --white: #fff;
  --page-bg: #fff;
  --sidebar-bg: #f2f3f3;
  --text: #494e52;
  --heading: #494e52;
  --link: #52adc8;
  --link-hover: #1a6685;
  --border: #ddd;
  --muted: #7a8288;
  --pub-title: #52adc8;
  --tag-bg: #f0f6fa;
  --tag-border: #c8dfe8;
  --tag-color: #1a6685;
  --thumb-fs1a: #3b82c4; --thumb-fs1b: #1e5fa3;
  --thumb-fs2a: #0e9b8a; --thumb-fs2b: #0a7265;
  --thumb-fs3a: #6366f1; --thumb-fs3b: #4338ca;
  --thumb-ml1a: #e07b39; --thumb-ml1b: #b85a1a;
  --thumb-ml2a: #c0444a; --thumb-ml2b: #8f2328;
  --thumb-ml3a: #9b59b6; --thumb-ml3b: #6c3483;
  --thumb-ml4a: #2ecc71; --thumb-ml4b: #1a8a47;
}

/* ── BASE ── */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ── TOP NAV ── */
#masthead {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  height: var(--nav-height);
}

.masthead-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--heading);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-title:hover {
  color: var(--link);
  text-decoration: none;
}

/* Desktop nav links */
.greedy-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.greedy-nav a {
  display: inline-block;
  padding: 0 0.9rem;
  height: var(--nav-height);
  line-height: var(--nav-height);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nav-link, var(--text));
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.greedy-nav a:hover,
.greedy-nav a.active {
  color: var(--link);
  border-bottom-color: var(--link);
  text-decoration: none;
}

/* Hamburger — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 250;
  flex-direction: column;
  padding: 0.5rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  padding: 0.85rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: var(--sidebar-bg);
  border-left-color: var(--link);
  color: var(--link);
  text-decoration: none;
}

/* ── MAIN LAYOUT ── */
#main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

.author-avatar {
  margin-bottom: 1rem;
}

.author-avatar img,
.avatar-fallback {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: block;
}

.avatar-fallback {
  background: #d0e8f0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--link-hover);
}

.author-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 0.2rem;
}

.author-bio {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
  line-height: 1.4;
}

.follow-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.author-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.author-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-links a {
  font-size: 0.82rem;
  color: var(--link);
}

.link-icon {
  width: 15px;
  height: 15px;
  opacity: 0.55;
  flex-shrink: 0;
  fill: currentColor;
  color: var(--muted);
}

/* Mobile sidebar (horizontal strip) */
.mobile-author-strip {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
}

.mobile-author-strip img,
.mobile-avatar-fallback {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.mobile-avatar-fallback {
  background: #d0e8f0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--link-hover);
}

.mobile-author-info .mobile-author-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading);
}

.mobile-author-info .mobile-author-role {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.mobile-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.mobile-social-links a {
  font-size: 0.72rem;
  color: var(--link);
}

/* ── CONTENT ── */
.content {
  flex: 1;
  min-width: 0;
}

/* Page sections */
.page-section {
  display: none;
  animation: fadeIn 0.25s ease;
}

.page-section.active {
  display: block;
}

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

/* ── SECTION HEADINGS ── */
.section-h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-top: 2rem;
  margin-bottom: 1.2rem;
}

.section-h2.first {
  margin-top: 0;
}

/* ── ABOUT ── */
.about-text p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1.1rem;
}

/* ── PUBLICATIONS ── */
.pub-entry {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.pub-entry:last-child {
  border-bottom: none;
}

.pub-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pub-title a {
  color: var(--pub-title);
}

.pub-title a:hover {
  color: var(--link-hover);
}

.pub-authors {
  font-size: 0.84rem;
  font-style: italic;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.pub-venue {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
}

/* ── CONTACT ── */
.contact-email {
  display: block;
  font-size: 1rem;
  color: var(--pub-title);
  margin-bottom: 0.3rem;
}

.contact-email:hover {
  color: var(--link-hover);
}

/* ── PROJECTS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.project-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Serif 4', serif;
  font-size: 3rem;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
}

.project-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pub-title);
  margin-bottom: 0.4rem;
  display: block;
  line-height: 1.3;
}

.project-title:hover {
  color: var(--link-hover);
}

.project-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.9rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ptag {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
  border-radius: 2px;
  letter-spacing: 0.03em;
}


/* Thumb color classes — Full Stack */
.thumb-fs1 { background: linear-gradient(135deg, var(--thumb-fs1a), var(--thumb-fs1b)); }
.thumb-fs2 { background: linear-gradient(135deg, var(--thumb-fs2a), var(--thumb-fs2b)); }
.thumb-fs3 { background: linear-gradient(135deg, var(--thumb-fs3a), var(--thumb-fs3b)); }
/* Thumb color classes — ML */
.thumb-ml1 { background: linear-gradient(135deg, var(--thumb-ml1a), var(--thumb-ml1b)); }
.thumb-ml2 { background: linear-gradient(135deg, var(--thumb-ml2a), var(--thumb-ml2b)); }
.thumb-ml3 { background: linear-gradient(135deg, var(--thumb-ml3a), var(--thumb-ml3b)); }
.thumb-ml4 { background: linear-gradient(135deg, var(--thumb-ml4a), var(--thumb-ml4b)); }

.thumb-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}

/* Section h2 with icon */
.section-h2-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  vertical-align: middle;
  opacity: 0.6;
}

/* Sub-heading for project categories */
h2.section-h2 {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Project card footer with links */
.project-card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s;
}

.project-link:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.project-link-demo {
  color: var(--muted);
}

.project-link-demo:hover {
  color: var(--heading);
}

/* ── CV ── */
.cv-entry {
  margin-bottom: 1.2rem;
}

.cv-role {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
}

.cv-org {
  font-size: 0.85rem;
  color: var(--link);
}

.cv-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.cv-desc {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── FOOTER ── */
footer {
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.76rem;
  color: var(--muted);
}

/* =========================================
   RESPONSIVE — MOBILE FIRST BREAKPOINTS
   ========================================= */

/* Tablet: hide sidebar, show mobile strip */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-author-strip {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .greedy-nav {
    display: none;
  }

  #main {
    padding: 1.5rem 1rem;
    gap: 0;
  }

  .content {
    width: 100%;
  }

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

/* Small mobile */
@media (max-width: 480px) {
  .masthead-inner {
    padding: 0 1rem;
  }

  .site-title {
    font-size: 0.9rem;
  }

  #main {
    padding: 1.2rem 0.9rem;
  }

  .mobile-author-strip {
    padding: 1rem;
    gap: 0.8rem;
  }

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

  .about-text p {
    font-size: 0.9rem;
  }

  .pub-title {
    font-size: 0.88rem;
  }

  .contact-email {
    font-size: 0.9rem;
    word-break: break-all;
  }
}

/* ══════════════════════════════════
   CV PDF UPLOAD VIEWER
══════════════════════════════════ */

.cv-upload-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 4px;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.cv-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  background: var(--link);
  color: #fff;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.cv-upload-label:hover { background: var(--link-hover); }

.cv-upload-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.cv-dropzone {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 3rem 2rem;
  text-align: center;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.cv-dropzone.drag-over {
  border-color: var(--link);
  background: var(--tag-bg);
}

.cv-dropzone-icon {
  color: var(--border);
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.cv-dropzone-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.cv-dropzone-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.cv-viewer-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.cv-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.cv-file-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.cv-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.cv-btn-download {
  background: var(--link);
  color: #fff;
}

.cv-btn-download:hover {
  background: var(--link-hover);
  color: #fff;
  text-decoration: none;
}

.cv-btn-remove {
  background: #f5f5f5;
  color: var(--muted);
  border: 1px solid var(--border);
}

.cv-btn-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.cv-iframe {
  width: 100%;
  height: 780px;
  border: none;
  display: block;
  background: #525659;
}

@media (max-width: 768px) {
  .cv-iframe { height: 500px; }
  .cv-dropzone { padding: 2rem 1rem; }
  .cv-upload-bar { gap: 0.6rem; }
}

@media (max-width: 480px) {
  .cv-iframe { height: 420px; }
  .cv-file-name { max-width: 150px; }
}

.cv-btn-open {
  background: #f0f6fa;
  color: var(--link-hover);
  border: 1px solid var(--tag-border);
}

.cv-btn-open:hover {
  background: var(--tag-border);
  color: var(--link-hover);
  text-decoration: none;
}