:root {
  --bg: #f8f7f3;
  --bg-soft: #f1efe8;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #1f2733;
  --muted: #5e6775;
  --accent: #214d74;
  --accent-soft: #edf2f7;
  --border: #ddd8cb;
  --shadow: 0 8px 24px rgba(31, 39, 51, 0.05);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --max-width: 980px;
  --nav-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 18px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fcfbf8;
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[id] {
  scroll-margin-top: calc(var(--nav-height) + 18px);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(252, 251, 248, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 39, 51, 0.08);
}

.site-header-inner {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f4f6f8;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.96rem;
  font-weight: 600;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 4px;
  border-radius: 0;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}

.site-nav a:focus-visible,
.button:focus-visible,
.button-secondary:focus-visible,
.card-link:focus-visible,
.pub-link:focus-visible,
.chip:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.hero {
  padding: 44px 0 18px;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  align-items: start;
}

.about-main {
  min-width: 0;
}

.about-side {
  display: flex;
  justify-content: flex-end;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.hero-card,
.glass-card {
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.hero-card {
  padding: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0 0 6px;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-subtitle {
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  color: var(--muted);
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.hero h1,
.page-title {
  margin: 10px 0 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero p.lead,
.page-lead {
  max-width: 700px;
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: auto;
  padding: 0 0 2px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.button {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

.button-secondary {
  background: transparent;
  color: var(--text);
}

.button:hover,
.button-secondary:hover,
.chip:hover,
.pub-link:hover,
.card-link:hover {
  border-color: currentColor;
}

.hero-meta {
  height: auto;
  padding: 0;
  display: grid;
  gap: 14px;
}

.portrait {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.portrait-academic {
  width: 220px;
}

.hero-stack {
  display: grid;
  gap: 12px;
}

.hero-stat {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.hero-stat:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.hero-stat span {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.hero-stat strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.section {
  padding: 18px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 2.55rem);
  letter-spacing: -0.02em;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.news-table,
.post-table {
  display: grid;
  border-top: 1px solid var(--border);
}

.news-row,
.post-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.news-row time,
.post-row time {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.post-row a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card,
.timeline-card,
.post-card,
.quick-card,
.pub-card,
.contact-card {
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: none;
}

.feature-card,
.timeline-card,
.post-card,
.quick-card,
.contact-card {
  padding: 20px;
}

.feature-card h3,
.timeline-card h3,
.post-card h3,
.quick-card h3,
.contact-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.feature-card p,
.timeline-card p,
.post-card p,
.quick-card p,
.contact-card p,
.card-list,
.meta-list {
  color: var(--muted);
}

.tag-row,
.meta-list,
.filter-row,
.pub-actions,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag,
.chip,
.venue-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.83rem;
}

.tag,
.venue-pill {
  color: var(--muted);
  background: #f7f6f2;
  border: 1px solid var(--border);
}

.chip {
  cursor: pointer;
  color: var(--muted);
  background: #fbfaf7;
  border: 1px solid var(--border);
}

.chip.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #cfd8e2;
}

.publication-board {
  display: grid;
  gap: 12px;
}

.pub-list {
  margin: 0;
  padding-left: 1.4rem;
}

.pub-entry {
  padding: 0 0 18px 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.pub-entry:last-child {
  margin-bottom: 0;
}

.pub-entry-title {
  font-size: 1.06rem;
  line-height: 1.5;
  font-weight: 600;
  margin-bottom: 6px;
}

.pub-entry-authors,
.pub-entry-venue {
  color: var(--muted);
  margin-bottom: 6px;
}

.pub-card {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
}

.pub-card[hidden] {
  display: none;
}

.pub-thumb {
  width: 100%;
  height: 100%;
  min-height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.pub-copy h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  line-height: 1.45;
}

.pub-meta {
  color: var(--muted);
  margin-bottom: 10px;
}

.pub-copy p {
  margin: 0 0 10px;
  color: #465063;
}

.pub-link,
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 2px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--accent);
  background: transparent;
}

.pub-note {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.metrics {
  display: grid;
  gap: 12px;
}

.metric {
  padding: 14px 0;
  border-radius: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
}

.metric:first-child {
  padding-top: 0;
  border-top: 0;
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.timeline-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.timeline-item time {
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
}

.note-banner {
  padding: 16px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  box-shadow: none;
}

.article-shell {
  padding: 32px 0 64px;
}

.article-card {
  width: min(calc(100% - 32px), 820px);
  margin: 0 auto;
  padding: 28px 0 0;
  border-radius: 0;
  background: #fff;
  border: 0;
  box-shadow: none;
}

.article-card .meta-list {
  margin-bottom: 22px;
}

.article-card h1 {
  margin: 16px 0 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.6rem, 6vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.article-card h2 {
  margin: 30px 0 12px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.article-card p,
.article-card li {
  color: #35425a;
}

.article-card ul,
.article-card ol {
  padding-left: 1.35rem;
}

.article-card pre {
  margin: 18px 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 6px;
  background: #172033;
  border: 1px solid #22304d;
  color: #edf3ff;
}

.article-card code,
.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.93em;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.article-back:hover {
  color: var(--accent);
}

.article-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.article-card a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.article-card a:hover {
  color: #173f61;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 18px;
}

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contact-label {
  min-width: 96px;
  color: var(--muted);
}

.site-footer {
  padding: 20px 0 36px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 28px;
}

[data-reveal] {
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  .about-layout,
  .hero-grid,
  .grid-3,
  .grid-2,
  .contact-grid,
  .pub-card,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .hero-meta,
  .feature-card,
  .timeline-card,
  .post-card,
  .quick-card,
  .pub-card,
  .contact-card,
  .article-card {
    padding: 18px;
  }

  .pub-thumb {
    min-height: 150px;
  }
}

@media (max-width: 760px) {
  .site-header-inner {
    padding: 14px 0;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-nav {
    display: flex;
    width: 100%;
    padding-top: 12px;
  }

  .site-nav a {
    width: auto;
    padding: 6px 0;
  }

  .hero {
    padding-top: 28px;
  }

  .news-row,
  .post-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero h1,
  .page-title {
    font-size: clamp(2.3rem, 12vw, 3.6rem);
  }

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

  .article-shell {
    padding-top: 28px;
  }

  .article-card {
    width: min(calc(100% - 20px), 820px);
    padding: 24px 20px 26px;
  }

  .portrait-academic {
    width: min(220px, 100%);
  }
}
