:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1a1d21;
  --text-soft: #55606b;
  --accent: #0b6e64;
  --accent-soft: #0b6e6415;
  --border: #e3e6ea;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --bg-soft: #1c2024;
    --text: #e8eaed;
    --text-soft: #9aa4ae;
    --accent: #4fc3b8;
    --accent-soft: #4fc3b818;
    --border: #2a2f34;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  opacity: 0.98;
}
header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-name { font-weight: 700; font-size: 1.15rem; color: var(--text); }
nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: 0.95rem; }
nav a { color: var(--text-soft); }
nav a:hover { color: var(--accent); text-decoration: none; }

/* Hero */
.hero { padding: 3rem 0 1.5rem; }
.hero h1 { font-size: 2.1rem; margin: 0 0 0.3rem; letter-spacing: -0.02em; }
.hero .tagline { color: var(--text-soft); font-size: 1.12rem; margin: 0 0 1.2rem; }
.hero p { max-width: 46rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.links a {
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.28rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-soft);
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Sections */
section { padding: 1.8rem 0; }
h2 {
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  padding-top: 0.5rem;
}
h3 { font-size: 1.12rem; margin: 1.6rem 0 0.4rem; }
.section-note { color: var(--text-soft); font-size: 0.95rem; margin-top: -0.6rem; }

/* News */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
}
.news time { color: var(--text-soft); font-size: 0.92rem; white-space: nowrap; }

/* Project cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1.1rem;
  margin-top: 1.2rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--bg-soft);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}
.card .body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card .venue {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.card p { margin: 0 0 0.8rem; font-size: 0.93rem; color: var(--text-soft); flex: 1; }
.card .tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.card .tags a {
  font-size: 0.83rem;
  background: var(--accent-soft);
  border-radius: 0.35rem;
  padding: 0.12rem 0.55rem;
}

/* Past projects */
.past-entry { margin-bottom: 1.1rem; }
.past-entry b { color: var(--text); }
.past-entry .meta { color: var(--text-soft); font-size: 0.88rem; }

/* Publications */
.pubs { list-style: none; padding-left: 0; counter-reset: pub 25; }
.pubs li {
  counter-increment: pub -1;
  margin-bottom: 0.85rem;
  padding-left: 2.6rem;
  position: relative;
  font-size: 0.95rem;
}
.pubs li::before {
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
}
.pubs .title { font-weight: 600; }
.pubs .venue-name { font-style: italic; }
.me { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.5rem 0 2.5rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .news li { grid-template-columns: 1fr; gap: 0; }
  .hero h1 { font-size: 1.7rem; }
}

/* Portrait */
.hero-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem 2.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.hero-top .tagline { margin-bottom: 0; }
.hero .portrait {
  width: 9.5rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
}
@media (max-width: 600px) {
  .hero-top { justify-content: center; text-align: center; }
}
