/* 
 * Academic Personal Website
 * Minimal, timeless, content-first
 */

:root {
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --accent: #8b0000; /* Deep, muted red - scholarly feel */
  --bg: #fff;
  --bg-sidebar: #fafafa;
  --border: #e5e5e5;
  --font-main: Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', Menlo, Monaco, monospace;
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.7;
}

/* Layout */
.container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 3rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-top {
  /* Contains portrait, name, and nav */
}

.sidebar-icons {
  display: flex;
  gap: 1rem;
}

.sidebar-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.15s ease;
  position: relative;
}

.sidebar-icons a:hover,
.sidebar-icons a:focus {
  opacity: 0.8;
}

.sidebar-icons a:focus {
  outline: none;
}

.sidebar-icons img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: grayscale(100%);
}

.sidebar-icons img[src*="ssrn"] {
  width: 20px;
  height: 20px;
}

/* Tooltips */
.sidebar-icons a::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-main);
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  pointer-events: none;
}

.sidebar-icons a:hover::before,
.sidebar-icons a:focus::before {
  opacity: 1;
  visibility: visible;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sidebar-icons a,
  .sidebar-icons a::before {
    transition: none;
  }
}

.sidebar-portrait {
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-bottom: 1.25rem;
}

.site-name {
  font-size: 1.4rem;
  font-weight: normal;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.site-name a {
  color: var(--text-primary);
  text-decoration: none;
}

.site-name a:hover {
  color: var(--accent);
}

.site-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

nav ul {
  list-style: none;
  padding-left: 0;
}

nav li {
  margin-bottom: 0.6rem;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

nav a:hover,
nav a.active {
  color: var(--accent);
}

/* Main content */
.main {
  flex: 1;
  padding: 3rem 4rem;
  max-width: 720px;
}

/* Typography */
h1 {
  font-size: 1.6rem;
  font-weight: normal;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

h3 {
  font-size: 1rem;
  font-weight: normal;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Paper/Item lists */
.item-list {
  list-style: none;
  padding-left: 0;
}

.item-list li {
  margin-bottom: 1.25rem;
}

.item-title {
  font-style: italic;
}

.item-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.item-links {
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.item-links a {
  margin-right: 1rem;
}

/* CV specific */
.cv-section {
  margin-bottom: 2rem;
}

.cv-entry {
  margin-bottom: 1rem;
}

.cv-entry-title {
  font-weight: normal;
}

.cv-entry-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cv-download {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Contact & Links */
.contact-info {
  font-size: 0.95rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.external-links {
  margin-top: 1.5rem;
}

.external-links a {
  display: inline-block;
  margin-right: 1.5rem;
  font-size: 0.9rem;
}

/* Portrait */
.portrait {
  width: 140px;
  height: auto;
  margin-bottom: 1.5rem;
  filter: grayscale(10%);
}

/* Footer note */
.footer-note {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1.25rem;
  }

  .sidebar-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1.25rem;
    width: 100%;
  }

  .sidebar-portrait {
    width: 70px;
    height: 70px;
    margin-bottom: 0;
  }

  .sidebar-top > .site-name {
    flex-basis: calc(100% - 95px);
  }

  .site-tagline {
    margin-bottom: 0;
  }

  nav {
    width: 100%;
    margin-top: 1rem;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
  }

  nav li {
    margin-bottom: 0;
  }

  .sidebar-icons {
    margin-top: 1rem;
    width: 100%;
  }

  .main {
    padding: 2rem 1.5rem;
  }
}

