/* ============================================================================
   style.css — the single stylesheet for the entire website.
   ----------------------------------------------------------------------------
   HOW THIS FILE IS ORGANISED (search for the numbers to jump around):
     1. Design tokens (colors, fonts, spacing) — change the look of the whole
        site by editing ONLY this section.
     2. Base / reset styles
     3. Layout containers
     4. Header & navigation
     5. Typography & sections
     6. Home page components (profile card, news, interest tags)
     7. Publications
     8. Teaching tables
     9. Students / positions
    10. Footer
    11. Animations (respect reduced-motion)
    12. Responsive rules (tablet & phone)
    13. Print styles
   ============================================================================ */


/* ============================================================
   1. DESIGN TOKENS — the only section you need to touch to
      re-theme the site. Every color and font below is reused
      everywhere via var(--name).
   ============================================================ */
:root {
  /* ----- Colors ------------------------------------------------
     --navy is taken from the header color of Tushar's LaTeX CV
     (RGB 0,51,102) so the website and CV share one identity.   */
  --navy:       #003366;   /* headings, links, rules            */
  --navy-deep:  #00234a;   /* link hover / active states        */
  --ink:        #171a1f;   /* main body text                    */
  --slate:      #5b6470;   /* secondary text: dates, meta       */
  --paper:      #ffffff;   /* page background                   */
  --wash:       #f5f7fa;   /* light panel background            */
  --rule:       #e2e7ee;   /* hairline borders                  */
  --key-bg:     #eef2f7;   /* background of [J24]-style keys    */

  /* ----- Fonts --------------------------------------------------
     STIX Two Text: designed for scientific/mathematical publishing
                    (used for the name and section headings).
     Inter:         clean screen font for body text and navigation.
     IBM Plex Mono: for citation keys, dates and small labels.   */
  --font-display: "STIX Two Text", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", "SF Mono", Consolas, Menlo, monospace;

  /* ----- Sizing -------------------------------------------------- */
  --content-width: 68rem;   /* maximum width of page content        */
  --prose-width:   46rem;   /* comfortable width for paragraphs     */
}


/* ============================================================
   2. BASE / RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;               /* 16px base */
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
a:hover  { color: var(--navy-deep); border-bottom-color: currentColor; }
a:focus-visible {                 /* clear keyboard-focus outline (accessibility) */
  outline: 2px solid var(--navy);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link: invisible until focused with the keyboard (accessibility). */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }


/* ============================================================
   3. LAYOUT CONTAINERS
   ============================================================ */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { padding: 2.5rem 0 4rem; }


/* ============================================================
   4. HEADER & NAVIGATION
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);     /* subtle frosted effect when scrolling */
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 0;
}

/* The name in the top-left corner — links back to the home page. */
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: .01em;
  color: var(--ink);
  border-bottom: none;
}
.brand:hover { color: var(--navy); border-bottom: none; }

.site-nav ul {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--slate);
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--navy); border-bottom-color: var(--rule); }
/* aria-current="page" is set on the link of the page you are on. */
.site-nav a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* Hamburger button — hidden on desktop, shown on phones (section 12). */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: .45rem .6rem;
  cursor: pointer;
  color: var(--navy);
  font-size: 1.1rem;
  line-height: 1;
}


/* ============================================================
   5. TYPOGRAPHY & SECTIONS
   ============================================================ */
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; }

.page-title {
  font-size: 2.1rem;
  font-weight: 600;
  margin: 0 0 .4rem;
}

/* Small monospace label that sits above a page title, e.g. "TEACHING". */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 .5rem;
}

/* Section heading with the thin navy rule — mirrors the CV design. */
.section-title {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 6rem 0 0;
  padding-bottom: .9rem;
  border-bottom: 2px solid var(--navy);
}
.section-title:first-of-type { margin-top: 0; }

.lead { font-size: 1.08rem; max-width: var(--prose-width); color: var(--ink); }
.prose { max-width: var(--prose-width); }
.muted { color: var(--slate); }
.small { font-size: .88rem; }

/* Bulleted list variant for prose content — matches paragraph width/spacing. */
.bullet-list {
  max-width: var(--prose-width);
  margin: 1rem 0 0;
  padding-left: 1.3rem;
}
.bullet-list li {
  margin-bottom: .7rem;
  line-height: 1.6;
  color: var(--ink);
}
.bullet-list li::marker { color: var(--navy); }


/* ============================================================
   6. HOME PAGE COMPONENTS
   ============================================================ */

/* --- Profile layout: photo card on the left, intro on the right --- */
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.6rem;
  align-items: start;
}

.profile-card { text-align: left; }

.profile-photo {
  width: 100%;
  height: auto;                   /* override the HTML height attribute  */
  aspect-ratio: 4 / 5;            /* keeps a consistent portrait shape   */
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--wash);
}

/* Vertical list of contact / profile links under the photo. */
.profile-links {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  font-size: .9rem;
}
.profile-links li {
  padding: .42rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: .55rem;
}
.profile-links li:last-child { border-bottom: none; }
/* The small monospace tag before each link, e.g. "email" */
.profile-links .tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: .08em;
  min-width: 4.6rem;
}

.intro h1 {
  font-size: 2.4rem;
  font-weight: 600;
  margin: 0 0 .3rem;
}
.intro .role {
  font-size: 1.05rem;
  color: var(--slate);
  margin: 0 0 1.2rem;
}
.intro .role a { color: inherit; }

/* Buttons, e.g. "Download CV". */
.btn {
  display: inline-block;
  font-size: .9rem;
  font-weight: 500;
  padding: .55rem 1.1rem;
  border: 1px solid var(--navy);
  border-radius: 6px;
  color: var(--navy);
  margin: .8rem .5rem 0 0;
}
.btn:hover { background: var(--navy); color: #fff; border-bottom-color: var(--navy); }
.btn.solid { background: var(--navy); color: #fff; }
.btn.solid:hover { background: var(--navy-deep); border-color: var(--navy-deep); }

/* --- News list ------------------------------------------------ */
.news-list { list-style: none; margin: 1.2rem 0 0; padding: 0; max-width: var(--prose-width); }
.news-list li {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
}
.news-date {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--slate);
  padding-top: .2rem;
}

/* --- Research interest tags ----------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; }
.pill {
  font-size: .85rem;
  padding: .3rem .85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--wash);
  color: var(--ink);
}


/* ============================================================
   7. PUBLICATIONS
   ============================================================ */
.pub-list { list-style: none; margin: 1.7rem 0 0; padding: 0; }

/* Each publication: monospace key on the left, reference on the right. */
.pub-item {
  display: grid;
  grid-template-columns: 4.4rem 1fr;
  gap: 1.1rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
}

/* The bracketed citation key, e.g. [J24] — the site's signature detail. */
.pub-key {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--navy);
  background: var(--key-bg);
  border-radius: 5px;
  height: fit-content;
  padding: .18rem .4rem;
  text-align: center;
}

.pub-body { font-size: .95rem; }
.pub-title { font-weight: 600; }
.pub-venue { font-style: italic; }
.pub-meta  { color: var(--slate); font-size: .85rem; margin-top: .15rem; }
/* Highlight the site owner's name inside author lists. */
.me { font-weight: 600; }

/* Small links after a publication, e.g. DOI / PDF / arXiv. */
.pub-links a {
  font-family: var(--font-mono);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: .8rem;
}

/* Status badge for preprints, e.g. "revision submitted". */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--slate);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: .12rem .45rem;
  margin-left: .5rem;
  vertical-align: middle;
}


/* ============================================================
   8. TEACHING TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }   /* lets wide tables scroll on phones */

table.courses {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  margin-top: 1.2rem;
}
table.courses th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--slate);
  font-weight: 500;
  border-bottom: 2px solid var(--navy);
  padding: .5rem .8rem .5rem 0;
}
table.courses td {
  padding: .6rem .8rem .6rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.courses td.code { font-family: var(--font-mono); font-size: .8rem; color: var(--navy); white-space: nowrap; }


/* ============================================================
   9. STUDENTS / OPEN POSITIONS
   ============================================================ */
.notice {
  background: var(--wash);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 1.1rem 1.4rem;
  max-width: var(--prose-width);
  margin-top: 1.2rem;
}
.notice h3 { margin: 0 0 .4rem; font-size: 1.05rem; }

.person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule);
  max-width: var(--prose-width);
}
.person .years { font-family: var(--font-mono); font-size: .78rem; color: var(--slate); }


/* ============================================================
   10. FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.6rem 0 2rem;
  font-size: .84rem;
  color: var(--slate);
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }


/* ============================================================
   11. ANIMATIONS
   Elements with class "reveal" fade in gently as they scroll
   into view (handled by js/main.js). If the visitor's system
   prefers reduced motion, everything appears instantly.
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  a, .btn { transition: none; }
}


/* ============================================================
   12. RESPONSIVE RULES
   ============================================================ */
/* Tablets and below */
@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 220px 1fr; gap: 1.8rem; }
  .intro h1 { font-size: 2rem; }
}

/* Phones */
@media (max-width: 680px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { max-width: 260px; }

  /* Collapse the navigation into a hamburger menu. */
  .nav-toggle { display: block; }
  .site-nav {
    display: none;                 /* hidden until the button is pressed */
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px rgba(0,0,0,.06);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: .4rem 1.5rem 1rem; }
  .site-nav a { display: block; padding: .7rem 0; font-size: 1rem; }

  .pub-item { grid-template-columns: 1fr; gap: .3rem; }
  .pub-key { width: fit-content; }
  .news-list li { grid-template-columns: 1fr; gap: .1rem; }
}


/* ============================================================
   13. PRINT STYLES — pages print cleanly without navigation.
   ============================================================ */
@media print {
  .site-header, .site-footer, .btn, .nav-toggle { display: none; }
  body { font-size: 11pt; }
  a { color: #000; }
}
