/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #18324A;
  --burgundy:#7A1F2B;
  --muted:   #6E6E6E;
  --light:   #F7F8FA;
  --border:  #E2E5EA;
  --text:    #1A1A1A;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--burgundy); text-decoration: underline; }

/* ── Nav ── */
nav {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Lora', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  padding: 0.9rem 0;
  white-space: nowrap;
}

.nav-brand:hover { text-decoration: none; color: var(--navy); }

nav ul {
  display: flex;
  list-style: none;
  gap: 0;
}

nav ul li a {
  display: block;
  padding: 0.9rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--navy);
  text-decoration: none;
}

nav ul li a.active {
  border-bottom: 2px solid var(--burgundy);
}

/* ── Page wrapper ── */
.page {
  flex: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  width: 100%;
}

/* ── Section headings ── */
.page-title {
  font-family: 'Lora', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.page-rule {
  border: none;
  border-top: 2px solid var(--navy);
  margin-bottom: 2rem;
  width: 3rem;
}

.sub-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2.2rem 0 1rem;
}

/* ── Hero (index) ── */
.hero {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 2.8rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.hero-photo {
  width: 190px;
  height: 235px;
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  display: block;
}

.hero-name {
  font-family: 'Lora', serif;
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.hero-title {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-bottom: 1.4rem;
  font-size: 0.83rem;
}

.hero-contact a,
.hero-contact span {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-contact a:hover { color: var(--burgundy); text-decoration: none; }

.hero-contact svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.8rem;
}

.tag {
  font-size: 0.74rem;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  background: var(--light);
  border: 1px solid var(--border);
  color: var(--navy);
  font-weight: 500;
}

.about-text p {
  margin-bottom: 0.9rem;
  max-width: 700px;
  color: var(--text);
}

/* ── Research ── */
.paper {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.paper:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.paper-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.2rem;
  line-height: 1.45;
}

.paper-authors {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.paper-status {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--burgundy);
  border: 1px solid var(--burgundy);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.abstract-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--navy);
  padding: 0;
  margin-top: 0.3rem;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: block;
}

.abstract-toggle:hover { color: var(--burgundy); }

.abstract-body {
  display: none;
  margin-top: 0.55rem;
  font-size: 0.83rem;
  color: #555;
  max-width: 700px;
  line-height: 1.7;
}

.abstract-body.open { display: block; }

/* ── Education ── */
.edu-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1.5rem;
  margin-bottom: 1.8rem;
  align-items: start;
}

.edu-entry:last-child { margin-bottom: 0; }

.edu-degree {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.97rem;
}

.edu-school {
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 0.1rem;
}

.edu-detail {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.6;
}

.edu-date {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  padding-top: 0.15rem;
}

.accent { color: var(--burgundy); font-weight: 500; }

/* ── Conferences ── */
.conf-year-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--navy);
  margin: 1.6rem 0 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.conf-year-label:first-of-type { margin-top: 0; }

.conf-entry {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.1rem 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.conf-date {
  font-size: 0.79rem;
  color: var(--muted);
  padding-top: 0.1rem;
}

.conf-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.conf-venue {
  grid-column: 2;
  font-size: 0.81rem;
  color: var(--muted);
}

.conf-pres {
  grid-column: 2;
  font-size: 0.81rem;
  color: var(--text);
  font-style: italic;
}

/* ── Teaching ── */
.teach-block {
  margin-bottom: 1.8rem;
}

.teach-role {
  font-weight: 600;
  color: var(--burgundy);
  font-size: 0.88rem;
}

.teach-institution {
  font-size: 0.85rem;
  color: var(--text);
}

.teach-detail {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.65;
}

/* ── Skills ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.skill-block dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--burgundy);
  margin-bottom: 0.25rem;
}

.skill-block dd {
  font-size: 0.85rem;
  color: var(--text);
}

/* ── Hidden pages ── */
.hidden { display: none !important; }

/* ── Inline link-style button (for SPA navigation) ── */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
}

.link-btn:hover { color: var(--burgundy); text-decoration: underline; }

/* ── CV button ── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: var(--navy);
  color: #fff !important;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s;
  text-decoration: none !important;
}

.btn:hover { background: var(--burgundy); }

/* ── Secondary (outline) button ── */
.btn-ghost {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--navy);
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  border-color: var(--burgundy);
  color: var(--burgundy);
  text-decoration: none;
}

/* ── CV page: actions + embedded PDF ── */
.cv-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

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

.pdf-frame {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--light);
  box-shadow: 0 2px 14px rgba(0,0,0,0.06);
  height: 82vh;
  min-height: 520px;
}

.pdf-frame object,
.pdf-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pdf-fallback {
  padding: 3rem 2rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.pdf-fallback p { margin-bottom: 0.5rem; }

/* ── Paper meta line (working-paper / SSRN details) ── */
.paper-meta {
  font-size: 0.79rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.35rem;
}

.paper-meta a { color: var(--navy); }
.paper-meta a:hover { color: var(--burgundy); }

/* ── Work experience ── */
.work-entry {
  margin-bottom: 1.8rem;
}

.work-entry:last-child { margin-bottom: 0; }

.work-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.97rem;
}

.work-org {
  font-size: 0.85rem;
  color: var(--text);
}

.work-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.work-desc {
  font-size: 0.83rem;
  color: #555;
  line-height: 1.65;
  max-width: 680px;
}

/* ── Footer ── */
footer {
  background: var(--light);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.6rem 2rem;
  font-size: 0.77rem;
  color: var(--muted);
}

footer a { color: var(--muted); }
footer a:hover { color: var(--burgundy); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    width: 150px;
    height: 185px;
    margin: 0 auto;
  }

  .hero-contact { justify-content: center; }
  .tags { justify-content: center; }

  .nav-inner { flex-wrap: wrap; }
  nav ul { flex-wrap: wrap; }

  .edu-entry { grid-template-columns: 1fr; }
  .edu-date { text-align: left; margin-top: 0.2rem; }

  .conf-entry { grid-template-columns: 1fr; }
  .conf-venue, .conf-pres { grid-column: 1; }

  /* inline PDF rendering is unreliable on mobile — keep it short and rely on the buttons */
  .pdf-frame { height: 60vh; min-height: 360px; }
  .cv-actions .btn, .cv-actions .btn-ghost { flex: 1 1 auto; text-align: center; }
}
