/* ========== Personal homepage styles ========== */

:root {
  --cardinal: #750014;
  --very-light-cardinal: #fff2f4;
  --light-cardinal: #ff94a4;
  --dark-cardinal: #200000;
  --light-gray: #c2c0bf;
  --dark-gray: #8a8b8c;
  --very-dark-gray: #2d2d2d;
  --bg-color: #ffffff;
  --text-color: #000000;

  --page-width: 800px;
  --font-size: 14px;
  --line-height: 24px;
  --section-title-font-size: 20px;
  --name-font-size: 32px;
}

[data-theme="dark"] {
  --cardinal: #ff6b7a;
  --very-light-cardinal: #2d1a1a;
  --light-cardinal: #a04550;
  --dark-cardinal: #ff94a4;
  --light-gray: #777777;
  --dark-gray: #a0a0a0;
  --very-dark-gray: #e0e0e0;
  --bg-color: #121212;
  --text-color: #e0e0e0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-color);
}

body {
  font-family: "Lato", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--text-color);
  background: var(--bg-color);
  text-align: left;
  margin: 40px auto;
  padding: 0 20px;
  max-width: var(--page-width);
}

/* ========== Links ========== */
a, a:link, a:visited {
  color: var(--cardinal);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ========== Images ========== */
img {
  border: 0;
  max-width: 100%;
}

/* ========== Typography ========== */
h1, h2, h3, h4 {
  font-weight: normal;
  margin: 0;
}

h1 {
  font-size: var(--name-font-size);
  margin-bottom: 10px;
}

h2 {
  font-size: var(--section-title-font-size);
  line-height: var(--line-height);
  margin-top: 30px;
  margin-bottom: 12px;
}

h3 {
  font-size: var(--font-size);
  line-height: var(--line-height);
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--dark-gray);
}

p {
  margin: 0 0 12px 0;
}

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

li {
  margin-bottom: 0;
}

/* ========== Section spacing ========== */
section {
  margin-top: 30px;
}

section:first-of-type {
  margin-top: 0;
}

/* ========== Hero ========== */
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
}

.hero-media {
  flex: 0 0 auto;
  align-self: center;
}

.hero-text {
  flex: 1 1 300px;
}

.hero-text h1 {
  margin-top: 0;
}

.hero-links {
  margin-top: 10px;
  margin-bottom: 0;
}

.hero-links a {
  margin-right: 6px;
}

.hero-links a::after {
  content: " /";
  color: var(--light-gray);
}

.hero-links a:last-child::after {
  content: "";
}

.portrait {
  display: block;
  width: 180px;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}

/* ========== News ========== */
.news-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 10px;
}

.news-scroll::-webkit-scrollbar {
  width: 4px;
}
.news-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.news-scroll::-webkit-scrollbar-thumb {
  background: var(--light-gray);
  border-radius: 2px;
}

.news-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-timeline li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
}

.news-timeline li:last-child {
  margin-bottom: 0;
}

.news-date {
  min-width: 64px;
  text-align: right;
  font-size: 12px;
  color: var(--dark-gray);
  font-weight: 600;
  padding-top: 1px;
  letter-spacing: 0.2px;
}

.news-text {
  flex: 1;
  margin-left: 16px;
  font-size: 14px;
  line-height: 22px;
}

/* ========== Publications ========== */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub-item {
  line-height: 22px;
}

.pub-title {
  font-weight: bold;
  margin-bottom: 2px;
}

.pub-authors {
  color: var(--dark-gray);
  margin-bottom: 2px;
}

.pub-venue {
  color: var(--dark-gray);
}

.pub-venue em strong,
.pub-venue strong {
  color: var(--cardinal);
}

.pub-links {
  color: var(--dark-gray);
}

.pub-links a::after {
  content: " /";
  color: var(--light-gray);
}

.pub-links a:last-child::after {
  content: "";
}

/* ========== Services / Internships ========== */
.clean-list {
  list-style: disc;
  padding-left: 20px;
}

.clean-list li {
  margin-bottom: 8px;
}

/* ========== Footer ========== */
.footer {
  color: var(--dark-gray);
  font-size: 12px;
  text-align: center;
  margin-top: 40px;
}

/* ========== Theme Toggle ========== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 1px solid var(--light-gray);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  border-color: var(--cardinal);
  background: var(--very-light-cardinal);
}

[data-theme="dark"] .theme-toggle:hover {
  background: #2a1a1a;
}

/* ========== Responsive ========== */
@media (max-width: 640px) {
  body {
    padding: 0 16px;
    margin: 24px auto;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .portrait {
    width: 160px;
  }

  .news-date {
    min-width: 56px;
  }
}
