/* Minimal White theme for Dianzhuo Wang
 * Adapted from the AmberLJC minimal layout, with a Harvard crimson accent.
 * Clean, lots of white space, serif typography, centered hero.
 */

:root {
  --primary: #1a1a1a;
  --accent: #666;
  --crimson: #750014;
  --crimson-light: #a51c30;
  --crimson-glow: rgba(117, 0, 20, 0.08);
  --crimson-glow-strong: rgba(117, 0, 20, 0.14);
  --text: #333;
  --text-light: #888;
  --bg: #fff;
  --bg-secondary: #fafafa;
  --border: #ececec;
}

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

::selection {
  background: var(--crimson-glow-strong);
  color: var(--primary);
}
::-moz-selection {
  background: var(--crimson-glow-strong);
  color: var(--primary);
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

/* Top navigation */
.topnav {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  gap: 40px;
}

.topnav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color 0.3s;
}

.topnav a:hover,
.topnav a.active {
  color: var(--crimson);
}

/* Main layout */
.wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 40px;
}

/* Profile hero */
.profile-section {
  text-align: center;
  margin-bottom: 70px;
}

.profile-picture {
  margin-bottom: 28px;
}

.profile-picture img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(30%);
  transition: filter 0.3s, box-shadow 0.3s;
}

.profile-picture img:hover {
  filter: grayscale(0%);
  box-shadow: 0 0 30px var(--crimson-glow-strong);
}

.profile-section h1 {
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 14px;
  position: relative;
  display: inline-block;
}

.profile-section h1::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--crimson-light), var(--crimson));
  border-radius: 2px;
}

.profile-section .tagline {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 4px;
}

.profile-section .tagline a {
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.profile-section .tagline a:hover {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}

/* Social icon row */
.list-inline {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  list-style: none;
  flex-wrap: wrap;
}

.social-icon {
  color: var(--text-light) !important;
  font-size: 26px !important;
  transition: color 0.3s, transform 0.3s;
  text-decoration: none;
}

.social-icon:hover {
  color: var(--crimson) !important;
  transform: translateY(-2px);
}

/* Typography */
h2 {
  font-size: 22px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-light);
  margin-top: 60px;
  margin-bottom: 30px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  transition: color 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h2:hover {
  color: var(--crimson);
}

h2 i {
  color: var(--crimson);
  font-size: 18px;
}

.content-section > section:first-of-type h2 {
  margin-top: 0;
}

p {
  margin-bottom: 18px;
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s;
}

a:hover {
  color: var(--crimson);
}

.section-note {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.7;
}

.section-note .representative-key {
  background: var(--crimson-glow-strong);
  color: var(--crimson);
  padding: 1px 7px;
  border-radius: 3px;
  font-style: normal;
}

/* About */
#about-me p {
  font-size: 16px;
  line-height: 1.95;
  margin-bottom: 20px;
}

#about-me .cta {
  border-left: 3px solid var(--crimson);
  background: var(--crimson-glow);
  padding: 14px 18px;
  border-radius: 0 4px 4px 0;
  font-size: 15px;
  margin-bottom: 0;
}

/* News */
.news-item {
  display: flex;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  transition: padding-left 0.3s, border-color 0.3s;
}

.news-item:hover {
  padding-left: 8px;
  border-bottom-color: var(--crimson);
}

.news-date {
  flex: 0 0 90px;
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.news-content {
  flex: 1;
  font-size: 15px;
}

/* Publications */
.pub-item {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, box-shadow 0.3s ease,
              border-color 0.3s ease, transform 0.3s ease;
}

/* Plain item hover — soft tint, like the Education rows */
.pub-item:hover {
  background: var(--crimson-glow);
}

.pub-item.representative {
  background: var(--crimson-glow);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--crimson);
  padding: 22px 22px;
  margin: 6px 0;
  border-radius: 0 4px 4px 0;
}

/* Representative item hover — deepen the tint and gently lift the card */
.pub-item.representative:hover {
  background: var(--crimson-glow-strong);
  box-shadow: 0 6px 22px var(--crimson-glow);
  transform: translateY(-2px);
}

.pub-item.representative:hover .pub-figure img {
  border-color: var(--crimson);
}

.pub-figure {
  flex: 0 0 210px;
}

.pub-figure img {
  width: 210px;
  max-width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: #fff;
  display: block;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

.pub-title {
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.pub-title a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--crimson);
  text-decoration: underline;
}

.pub-authors {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 6px;
  line-height: 1.6;
}

.pub-authors me {
  color: var(--crimson);
  font-weight: 700;
  font-style: normal;
}

.pub-links {
  font-size: 14px;
}

.pub-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s;
}

.pub-links a:hover {
  color: var(--crimson);
}

.pub-links .venue a {
  color: var(--primary);
  font-weight: 700;
}

.pub-links .venue a:hover {
  color: var(--crimson);
}

.pub-links .sep {
  color: #b8b8b8;
  margin: 0 4px;
}

/* Bibtex collapse + code snippet */
.collapse {
  display: none;
}

.collapse.show {
  display: block;
}

.snippet {
  position: relative;
  background: #f6f6f6;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  margin-top: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.representative .snippet {
  background: #fff;
}

.snippet code {
  display: block;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  color: #444;
}

.snippet .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: 'Georgia', serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.snippet .copy-btn:hover {
  color: var(--crimson);
  border-color: var(--crimson);
}

/* Tables (Education) */
table {
  width: 100%;
  margin: 10px 0 0;
  border-collapse: collapse;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s;
}

tbody tr:hover {
  background-color: var(--crimson-glow);
}

td {
  padding: 16px 12px;
  vertical-align: middle;
  font-size: 15px;
}

td.edu-logo {
  width: 56px;
  text-align: center;
}

td.edu-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  vertical-align: middle;
}

td .edu-school {
  font-weight: 700;
  color: var(--primary);
}

td .edu-school a {
  color: var(--primary);
  text-decoration: none;
}

td .edu-school a:hover {
  color: var(--crimson);
}

td .edu-degree {
  color: var(--text);
}

td .edu-meta {
  color: var(--text-light);
  font-size: 13px;
}

td.edu-time {
  text-align: right;
  white-space: nowrap;
  color: var(--text-light);
  font-size: 13px;
}

/* Mentoring / Services plain text blocks */
.text-block {
  font-size: 15px;
  line-height: 1.9;
}

.text-block a {
  color: var(--primary);
}

.text-block a:hover {
  color: var(--crimson);
}

/* Footer / contact */
footer {
  margin-top: 80px;
  padding-top: 36px;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--crimson), transparent) 1;
  text-align: center;
}

footer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--crimson);
  margin-bottom: 14px;
  font-weight: 400;
}

.contact-info {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.9;
}

.contact-info a {
  color: var(--text-light);
}

.contact-info a:hover {
  color: var(--crimson);
}

.copyright {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 22px;
}

/* Easter egg — a quiet heart in the footer */
.lovebug {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.lovebug .heart {
  color: #dcdcdc;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  transition: color 0.35s ease, transform 0.35s ease;
}

.lovebug .heart:hover {
  color: var(--crimson);
  animation: heartbeat 1s ease-in-out infinite;
}

.lovebug .note {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 11px;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.5px;
  color: var(--crimson);
  transition: max-width 0.6s ease, opacity 0.6s ease;
}

.lovebug:hover .note {
  max-width: 260px;
  opacity: 1;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1.2); }
  50% { transform: scale(1.45); }
}

/* Easter egg, hidden in plain sight — disguised as the copyright's period.
   Reads as ordinary punctuation until hovered, then blooms into a heart. */
.lovebug-secret {
  position: relative;
  white-space: nowrap;
}

.lovebug-secret a {
  text-decoration: none;
  cursor: default;
}

.lovebug-secret a::after {
  content: '.';
  display: inline-block;
  color: var(--text-light);
  transition: color 0.35s ease;
}

.lovebug-secret a:hover {
  cursor: pointer;
}

.lovebug-secret a:hover::after {
  content: '\2665';
  color: var(--crimson);
  animation: heartbeat 1s ease-in-out infinite;
}

.lovebug-secret .note {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  opacity: 0;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.5px;
  color: var(--crimson);
  transition: max-width 0.6s ease, opacity 0.6s ease;
}

.lovebug-secret:hover .note {
  max-width: 260px;
  opacity: 1;
  margin-left: 6px;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .wrapper {
    padding: 40px 20px;
  }

  .topnav {
    padding: 16px 20px;
    gap: 24px;
  }

  .profile-section h1 {
    font-size: 27px;
  }

  .pub-item,
  .pub-item.representative {
    flex-direction: column;
    gap: 14px;
  }

  .pub-figure {
    flex-basis: auto;
  }

  .pub-figure img {
    width: 100%;
    max-width: 320px;
  }

  .news-item {
    flex-direction: column;
    gap: 2px;
  }

  /* In column layout the 90px flex-basis becomes the date's HEIGHT,
     leaving a big gap before each headline — reset it to content size. */
  .news-date {
    flex: 0 0 auto;
  }

  td.edu-time {
    font-size: 12px;
  }
}
