/* ============================================
   Ink & Paper — Personal Academic Website
   ============================================ */

/* Design Tokens */
:root {
  --color-text: #0a0a0a;
  --color-bg: #ffffff;
  --color-accent: #2563eb;
  --color-muted: #666;
  --color-border: #e0e0e0;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ============================================
   Sidebar
   ============================================ */
aside.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  border-right: 1px solid var(--color-border);
  background: #ffffff;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-profile {
  text-align: center;
  padding: 32px 20px 16px;
}

.profile-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 900;
  margin-top: 12px;
  margin-bottom: 4px;
}

.profile-title {
  font-size: 13px;
  color: var(--color-muted);
  margin: 2px 0;
}

.profile-company {
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 600;
  margin: 2px 0;
}

.profile-location {
  font-size: 13px;
  color: var(--color-muted);
  margin: 2px 0;
}

/* Sidebar Navigation */
.sidebar-nav {
  margin-top: 8px;
}

.nav-link {
  display: block;
  padding: 8px 16px 8px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.nav-link.active,
.nav-link:hover {
  color: #0a0a0a;
  border-left: 2px solid #0a0a0a;
  font-weight: 700;
}

/* Social Links */
.sidebar-links {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.sidebar-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  transition: all 0.2s;
}

.sidebar-links a:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

/* CV Button */
.cv-button {
  display: block;
  margin: 12px 20px;
  padding: 8px 0;
  text-align: center;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all 0.2s;
}

.cv-button:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================
   Main Content
   ============================================ */
main.content {
  margin-left: 260px;
  padding: 20px 48px 40px 48px;
  margin-right: 24px;
  min-height: 100vh;
}

/* Links in content area */
main.content a {
  color: var(--color-accent);
  text-decoration: none;
}

main.content a:hover {
  text-decoration: underline;
}

/* Section Headings */
main.content h2 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 28px;
  border-left: 3px solid #0a0a0a;
  padding-left: 12px;
  margin-bottom: 24px;
}

/* Sections */
section {
  margin-bottom: 48px;
  padding-top: 10px;
}

section:first-child {
  padding-top: 0;
}

section:last-child {
  min-height: 80vh;
}

/* ============================================
   Experience & Skills Tables
   ============================================ */
.experience-table {
  width: 100%;
  border-collapse: collapse;
}

.experience-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.exp-period {
  font-weight: 700;
  white-space: nowrap;
  width: 1%;
}

.exp-company {
  white-space: nowrap;
  width: 1%;
}

.exp-note {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 13px;
}

.experience-table td a {
  color: var(--color-accent);
}

.skills-table {
  width: 100%;
  border-collapse: collapse;
}

.skills-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.skills-table td:first-child {
  font-weight: 700;
}

.skills-table td a {
  color: var(--color-accent);
}

.subsection-heading {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
}

.cv-button-inline {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--color-text);
  color: var(--color-text) !important;
  text-decoration: none !important;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 2px;
  margin-top: 8px;
}

.cv-button-inline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent) !important;
  text-decoration: none !important;
}

.education-table {
  width: 100%;
  border-collapse: collapse;
}

.education-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.edu-degree {
  font-weight: 700;
  white-space: nowrap;
  width: 1%;
}

.skill-area {
  font-weight: 700;
  white-space: nowrap;
  width: 1%;
}

/* ============================================
   Services
   ============================================ */
.service-group h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 8px;
}

.service-group ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.service-group li {
  margin-bottom: 4px;
}

/* ============================================
   Publications
   ============================================ */
.pub-metrics {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.pub-links {
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
}

.pub-links a {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  transition: all 0.2s;
}

.pub-links a:hover {
  color: var(--color-text);
  border-color: var(--color-text);
  text-decoration: none;
}

.year-heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0e0e0;
}

.paper {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.paper-title {
  font-weight: 700;
  font-size: 15px;
  color: #0a0a0a;
  line-height: 1.4;
}

.paper-authors {
  font-size: 13px;
  color: #444;
  margin-top: 4px;
}

.author-highlight {
  color: var(--color-accent);
  font-weight: 600;
}

.paper-venue {
  font-size: 12px;
  font-weight: 700;
  color: #0a0a0a;
  margin-top: 4px;
}

.paper-badges {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
}

.badge-pdf {
  border: 1px solid #333;
  color: #333;
}

.badge-video {
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.badge-link {
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.badge-bibtex {
  border: 1px solid #5d88ab;
  color: #5d88ab;
  background: none;
}

.award-badge {
  background: #e91e63;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
}

.paper-company {
  font-size: 12px;
  color: var(--color-muted);
  font-style: italic;
  margin-top: 4px;
}

.paper-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}

.paper-new {
  color: #e53935;
  font-weight: 700;
  font-size: 12px;
}

/* ============================================
   BibTeX Modal
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: #ffffff;
  max-width: 600px;
  width: 90%;
  border-radius: 4px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  font-family: monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  background: #f8f8f8;
}

.copy-button {
  display: block;
  margin: 0 16px 12px auto;
  padding: 6px 16px;
  background: #0a0a0a;
  color: #ffffff;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 12px;
}

.copy-button:hover {
  opacity: 0.85;
}

/* ============================================
   Mobile Top Bar (hidden on desktop)
   ============================================ */
.mobile-topbar {
  display: none;
}

/* ============================================
   Overlay Navigation (hidden by default)
   ============================================ */
.overlay-nav {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 1);
  display: none;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

.overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
}

.overlay-nav .nav-link {
  color: #ffffff;
  font-size: 18px;
  padding: 12px 0;
  border-left: none;
  text-align: center;
}

.overlay-nav .nav-link.active {
  color: #ffffff;
  font-weight: 700;
}

/* ============================================
   Mobile Responsive (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  aside.sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #0a0a0a;
    color: #ffffff;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
  }

  .mobile-name {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 16px;
  }

  .hamburger {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
  }

  main.content {
    margin-left: 0;
    margin-top: 56px;
    padding: 20px;
  }
}
