@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --background: 40 11% 97%;
  --foreground: 0 0% 7%;
  --primary: 40 85% 47%;
  --primary-foreground: 40 11% 97%;
  --muted: 40 6% 92%;
  --muted-foreground: 40 2% 44%;
  --border: 40 6% 88%;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  min-height: 100vh;
}

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

button {
  font: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

.text-hero {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 500;
}

.text-section {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 400;
}

.text-body {
  font-size: 1.125rem;
  line-height: 1.65;
}

.theorem-line {
  height: 0.5px;
  width: 3rem;
  background: hsl(var(--border));
}

.px-page { padding-left: 4vw; padding-right: 4vw; }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  mix-blend-mode: difference;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 4vw;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.index-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.index-btn span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

.index-btn:hover span { opacity: 1; }

.index-btn svg { width: 1.25rem; height: 1.25rem; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: #fff;
}

.lang-switch button {
  color: #fff;
  opacity: 0.42;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}

.lang-switch button.is-active,
.lang-switch button:hover {
  opacity: 1;
}

.lang-switch .lang-sep { opacity: 0.35; }

@media (max-width: 639px) {
  .index-btn span { display: none; }
}

/* Overlay */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: hsl(var(--foreground) / 0.2);
  backdrop-filter: blur(8px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 24rem;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

body.nav-open { overflow: hidden; }

body.nav-open .overlay-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open .overlay-panel { transform: translateX(0); }

.overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
}

.overlay-head span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
}

.overlay-close {
  padding: 0.5rem;
  opacity: 1;
}

.overlay-close:hover { opacity: 0.7; }

.overlay-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 2rem 4rem;
}

.overlay-link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid hsl(var(--background) / 0.1);
}

.overlay-link .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.4;
  width: 2rem;
}

.overlay-link .label {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  transition: color 0.3s;
}

.overlay-link:hover .label,
.overlay-link.is-active .label {
  color: hsl(var(--primary));
}

/* Footer */
.site-footer {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  margin-top: auto;
}

.footer-inner {
  padding: 5rem 4vw;
}

@media (min-width: 768px) {
  .footer-inner { padding-top: 8rem; padding-bottom: 8rem; }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
  }
  .footer-copy { grid-column: span 7; }
  .footer-map {
    grid-column: 10 / span 3;
  }
}

.footer-copy p {
  opacity: 0.6;
  max-width: 32rem;
  margin: 0;
}

.footer-email {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: hsl(var(--primary));
}

.footer-email:hover { opacity: 0.8; }

.footer-map-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.4;
  display: block;
  margin-bottom: 1.5rem;
}

.footer-map nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-map a {
  font-size: 0.875rem;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
}

.footer-map a:hover {
  opacity: 1;
  color: hsl(var(--primary));
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-bottom span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.3;
}

.footer-rule {
  margin-top: 5rem;
  margin-bottom: 2rem;
  opacity: 0.2;
  height: 0.5px;
  background: hsl(var(--background));
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.hero-bg::after {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 8rem 4vw 4rem;
}

@media (min-width: 768px) {
  .hero-content { padding-bottom: 6rem; }
}

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 1.35rem;
  width: 100%;
  max-width: 52rem;
}

.hero-bio,
.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

.hero-bio {
  gap: 1rem;
  width: max-content;
  max-width: 100%;
}

.hero-meta {
  gap: 0.2rem;
}

.hero-portrait {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 1px solid hsl(var(--primary) / 0.75);
  box-shadow: 0 0 0 6px hsl(40 10% 96% / 0.9);
  flex-shrink: 0;
}

.hero h1 { color: hsl(var(--foreground)); }

.hero-role,
.hero-affil,
.hero-email {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--primary));
}

.hero-affil {
  margin-top: 0;
}

.hero-email {
  display: block;
  margin-top: 0;
}

.hero-email:hover { opacity: 0.8; }

.hero-about {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--foreground) / 0.12);
  max-width: 48rem;
}

.hero-about span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.hero-about p {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-style: normal;
  line-height: 1.7;
  color: hsl(var(--foreground) / 0.78);
  margin: 0.75rem 0 0;
}

/* Sections */
.section {
  padding: 6rem 4vw;
}

@media (min-width: 768px) {
  .section { padding-top: 8rem; padding-bottom: 8rem; }
}

.section-muted { background: hsl(var(--muted) / 0.5); }

.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .section-grid {
    grid-template-columns: repeat(12, 1fr);
  }
  .section-label { grid-column: span 3; }
  .section-main { grid-column: span 9; }
}

.section-label span,
.page-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.section-label .theorem-line { margin-top: 1rem; }

/* Homepage timeline */
.section-timeline {
  padding: 3.25rem 4vw 3.5rem;
}

@media (min-width: 768px) {
  .section-timeline {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
  }
}

.section-selected {
  padding: 3.5rem 4vw 4.5rem;
}

@media (min-width: 768px) {
  .section-selected {
    padding-top: 5rem;
    padding-bottom: 5.5rem;
  }
}

.tl-legend,
.tl-wrap,
.tl-more {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.tl-legend {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 38rem) 1.15rem;
  column-gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.tl-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.tl-kicker-news {
  grid-column: 2;
  text-align: right;
}

.tl-kicker-pub {
  display: none;
}

.tl-wrap {
  position: relative;
  padding-bottom: 12px;
}

.tl-axis {
  position: absolute;
  left: auto;
  right: calc((1.15rem - 1px) / 2);
  top: 0.53rem;
  bottom: 7px;
  width: 1px;
  background: hsl(var(--primary) / 0.85);
  transform: none;
  pointer-events: none;
  overflow: visible;
}

.tl-arrow {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 0;
  width: 9px;
  height: 7px;
  transform: translate(-50%, 100%);
  background: hsl(var(--primary));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border: none;
}

.tl {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 1.1rem;
}

.tl-item {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 38rem) 1.15rem;
  column-gap: 0.85rem;
  align-items: start;
  padding: 0.15rem 0 1.15rem;
}

.tl-item:last-child {
  padding-bottom: 0.35rem;
}

.tl-node {
  grid-column: 3;
  grid-row: 1;
  width: 0.62rem;
  height: 0.62rem;
  margin: 0.22rem auto 0;
  border: 1.5px solid hsl(var(--primary));
  border-radius: 50%;
  background: hsl(var(--background));
  z-index: 1;
}

.section-muted .tl-node {
  background: color-mix(in srgb, hsl(var(--muted)) 50%, hsl(var(--background)));
}

.tl-item.is-news .tl-panel {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
}

.tl-item.is-pub .tl-panel {
  grid-column: 3;
  grid-row: 1;
  text-align: left;
}

.tl-date-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.tl-item.is-news .tl-date-row {
  justify-content: flex-end;
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: hsl(var(--foreground));
}

.tl-kind {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.tl-body {
  margin-top: 0.28rem;
}

.tl-cat {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--primary));
  margin-bottom: 0.2rem;
}

.tl-body h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: break-word;
}

.tl-body h3 a:hover {
  color: hsl(var(--primary));
}

.tl-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  margin: 0.28rem 0 0;
}

.tl-excerpt a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tl-excerpt a:hover {
  color: hsl(var(--primary));
}

.tl-authors,
.tl-journal {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin: 0.22rem 0 0;
  line-height: 1.45;
}

.tl-journal {
  font-style: italic;
  color: hsl(var(--muted-foreground) / 0.7);
}

.tl-doi {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: hsl(var(--primary));
}

.tl-doi:hover { opacity: 0.75; }

.tl-doi svg {
  width: 0.8rem;
  height: 0.8rem;
}

.tl-media {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  max-width: min(100%, 22rem);
  padding-top: 0.05rem;
}

.tl-media:empty {
  display: none;
}

.tl-img {
  display: block;
  margin: 0 0 0 auto;
  max-width: 100%;
  max-height: 20rem;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid hsl(var(--border));
}

.tl-thumb {
  margin-top: 0.5rem;
  width: 4.6rem;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}

.tl-thumb.is-empty {
  display: none;
}

.tl-more {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 38rem) 1.15rem;
  column-gap: 0.85rem;
  margin-top: 0.35rem;
}

.tl-more .link-more {
  margin-top: 0;
  grid-column: 2;
  justify-content: flex-end;
}

.pub-tight .pub-card {
  padding: 1.15rem 0;
}

.pub-tight .pub-card h3 {
  font-size: 1.2rem;
}

.news-photo {
  margin-top: 1rem;
  max-width: min(100%, 36rem);
  border: 1px solid hsl(var(--border));
}

@media (max-width: 767px) {
  .tl-legend {
    display: flex;
    justify-content: flex-start;
    gap: 1.1rem;
    margin-bottom: 1rem;
  }

  .tl-kicker-news,
  .tl-kicker-pub {
    text-align: left;
  }

  .tl-axis {
    left: calc((0.62rem - 1px) / 2);
    right: auto;
    transform: none;
  }

  .tl-item {
    grid-template-columns: 0.62rem minmax(0, 1fr);
    column-gap: 0.8rem;
    padding-bottom: 1.25rem;
  }

  .tl-node {
    grid-column: 1;
    margin: 0.22rem 0 0;
  }

  .tl-item.is-news .tl-panel,
  .tl-item.is-pub .tl-panel {
    grid-column: 2;
    text-align: left;
  }

  .tl-item.is-news .tl-date-row {
    justify-content: flex-start;
  }

  .tl-kind { display: none; }

  .tl-item.is-news .tl-media,
  .tl-item.is-pub .tl-media {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
    margin-top: 0.4rem;
  }

  .tl-img {
    margin-left: 0;
    max-height: 16rem;
  }

  .tl-more {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-start;
  }

  .tl-more .link-more:first-child,
  .tl-more .link-more:last-child {
    grid-column: auto;
    justify-content: flex-start;
  }
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: hsl(var(--primary));
}

.link-more:hover { opacity: 0.7; }

.link-more svg { width: 1rem; height: 1rem; }

/* Publications */
.pub-card {
  padding: 2rem 0;
  border-bottom: 1px solid hsl(var(--border));
  cursor: default;
  transition: opacity 0.4s ease;
}

.pub-group:hover .pub-card:not(:hover) { opacity: 0.4; }

.pub-row {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.pub-row > div:last-child {
  flex: 1;
  min-width: 0;
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.pub-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0;
  transition: color 0.3s;
}

@media (min-width: 768px) {
  .pub-card h3 { font-size: 1.5rem; }
}

.pub-card:hover h3 { color: hsl(var(--primary)); }

.pub-authors {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0.5rem 0 0;
}

.pub-journal {
  font-size: 0.875rem;
  font-style: italic;
  color: hsl(var(--muted-foreground) / 0.6);
  margin: 0.25rem 0 0;
}

.pub-abstract {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground) / 0.7);
  margin: 0.75rem 0 0;
  max-width: 48rem;
  line-height: 1.625;
}

.pub-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  justify-content: flex-end;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

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

.pub-links svg { width: 0.875rem; height: 0.875rem; }

.pub-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

/* News cards */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.news-meta .date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.news-meta .cat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--primary));
  text-transform: uppercase;
}

.news-card h3,
.news-item h2 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0;
  transition: color 0.3s;
}

.news-card:hover h3,
.news-item:hover h2 { color: hsl(var(--primary)); }

.news-card p,
.news-item .content {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0.5rem 0 0;
  line-height: 1.625;
}

.news-card a,
.news-item .content a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-card a:hover,
.news-item .content a:hover {
  color: hsl(var(--primary));
}

.opening-card {
  max-width: 42rem;
}

.opening-card p {
  font-size: 0.875rem;
  line-height: 1.625;
  margin: 0 0 0.75rem;
  color: hsl(var(--muted-foreground));
}

.opening-contact {
  margin-top: 1.25rem !important;
}

.opening-contact a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: hsl(var(--primary));
  margin-left: 0.35rem;
}

.opening-contact a:hover { opacity: 0.8; }

#openings {
  scroll-margin-top: 5.5rem;
}

.cv-email {
  margin: 0.35rem 0 0;
}

.cv-email a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: hsl(var(--primary));
}

html[lang="zh-CN"] {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", var(--font-sans);
}

html[lang="zh-CN"] .text-hero,
html[lang="zh-CN"] .text-section,
html[lang="zh-CN"] .news-card h3,
html[lang="zh-CN"] .news-item h2,
html[lang="zh-CN"] .tl-body h3,
html[lang="zh-CN"] .cv-body h3,
html[lang="zh-CN"] .gallery-cap h3 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", var(--font-serif);
}

html[lang="zh-CN"] .kicker,
html[lang="zh-CN"] .section-label span,
html[lang="zh-CN"] .index-btn span,
html[lang="zh-CN"] .news-meta .cat,
html[lang="zh-CN"] .cv-meta .cat,
html[lang="zh-CN"] .chip,
html[lang="zh-CN"] .gallery-cap span,
html[lang="zh-CN"] .hero-about span,
html[lang="zh-CN"] .tl-kicker,
html[lang="zh-CN"] .tl-kind,
html[lang="zh-CN"] .tl-cat {
  text-transform: none;
  letter-spacing: 0.06em;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-all { margin-top: 3rem; }

@media (min-width: 768px) {
  .news-all { margin-left: 25%; }
}

/* Inner pages */
.inner {
  padding: 7rem 4vw 6rem;
}

.inner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .inner-grid {
    grid-template-columns: repeat(12, 1fr);
  }
  .inner-side {
    grid-column: span 3;
  }
  .inner-main { grid-column: span 9; }
  .inner-side-sticky {
    position: sticky;
    top: 7rem;
  }
}

.page-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin: 0.5rem 0 0;
}

/* Filters */
.filters {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .filters {
    flex-direction: row;
    gap: 3rem;
  }
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: 0.125rem;
  color: hsl(var(--muted-foreground));
  transition: all 0.3s;
}

.chip:hover { color: hsl(var(--foreground)); }

.chip.is-active {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.chip.is-sort {
  background: none;
  color: hsl(var(--muted-foreground));
}

.chip.is-sort.is-active {
  background: none;
  color: hsl(var(--primary));
}

.side-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .side-filters { flex-direction: column; }
}

.side-filters .chip {
  text-align: left;
}

.year-list {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .year-list { display: flex; }
}

.year-list span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground) / 0.4);
}

/* CV timeline */
.cv-item {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .cv-item { gap: 2rem; }
}

.cv-rail {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cv-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.cv-line {
  width: 1px;
  flex: 1;
  background: hsl(var(--border));
}

.cv-body {
  grid-column: span 11;
  padding-bottom: 3rem;
}

.cv-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.cv-meta .years {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.cv-meta .cat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--primary));
  text-transform: uppercase;
}

.cv-body h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0;
  transition: color 0.3s;
}

@media (min-width: 768px) {
  .cv-body h3 { font-size: 1.5rem; }
}

.cv-item:hover h3 { color: hsl(var(--primary)); }

.cv-inst {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0.25rem 0 0;
}

.cv-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground) / 0.7);
  margin: 0.75rem 0 0;
  line-height: 1.625;
  max-width: 42rem;
}

/* News list */
.news-item {
  padding: 2rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.news-item h2 {
  font-size: 1.25rem;
}

@media (min-width: 768px) {
  .news-item h2 { font-size: 1.5rem; }
}

.news-item .content {
  max-width: 42rem;
  margin-top: 0.75rem;
}

.pin {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.125rem 0.5rem;
  border-radius: 0.125rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--primary));
}

.read-more:hover { opacity: 0.7; }

.empty {
  padding: 4rem 0;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem 1.25rem;
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: 1fr 1fr 1fr; } }
.gallery-card {
  display: flex;
  flex-direction: column;
  background: transparent;
}
.gallery-media {
  position: relative;
  overflow: hidden;
  background: hsl(var(--muted));
  aspect-ratio: 4 / 3;
}
.gallery-card.is-video .gallery-media {
  aspect-ratio: 16 / 9;
}
.gallery-media img,
.gallery-media video,
.gallery-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  transition: transform 0.7s;
}
.gallery-card:hover img { transform: scale(1.03); }
.gallery-cap {
  padding: 0.85rem 0 0;
}
.gallery-cap span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}
.gallery-cap h3 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0.35rem 0 0;
  line-height: 1.35;
}

main { flex: 1; }

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.grid-12 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .grid-12 { grid-template-columns: repeat(12, 1fr); }
  .col-3 { grid-column: span 3; }
  .col-7 { grid-column: span 7; }
  .col-9 { grid-column: span 9; }
  .col-start-10 { grid-column: 10 / span 3; }
}

.hero-inner {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 8rem 4vw 4rem;
}

@media (min-width: 768px) {
  .hero-inner { padding-bottom: 6rem; }
}

.hero-left { }
@media (min-width: 768px) {
  .hero-left { grid-column: span 8; }
}

.hero-aff {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--primary));
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

main.page {
  padding: 7rem 4vw 6rem;
}

.page-title { margin: 0; }
.page-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin: 0.5rem 0 0;
}

.sticky-col {
  position: static;
}
@media (min-width: 768px) {
  .sticky-col { position: sticky; top: 7rem; }
}

.filters.stack,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .filters.stack { flex-direction: column; margin-top: 2rem; }
}

.filter-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .filter-row { flex-direction: row; gap: 3rem; align-items: flex-start; }
}
.sorts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.filter-btn,
.chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: 0.125rem;
  color: hsl(var(--muted-foreground));
  transition: all 0.3s;
}

.filter-btn:hover,
.chip:hover { color: hsl(var(--foreground)); }

.filter-btn.active,
.chip.is-active {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.filter-btn.accent,
.chip.is-sort.is-active {
  background: none;
  color: hsl(var(--primary));
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: hsl(var(--primary));
}

.text-link:hover { opacity: 0.7; }
.text-link svg { width: 1rem; height: 1rem; }

.ml-25 { margin-top: 3rem; }
@media (min-width: 768px) {
  .ml-25 { margin-left: 25%; }
}

.news-date { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.news-cat { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--primary)); text-transform: uppercase; }
.news-meta .date { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.news-meta .cat { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--primary)); text-transform: uppercase; }

.cv-range { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.cv-cat { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--primary)); text-transform: uppercase; }
.cv-meta .years { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.cv-meta .cat { font-family: var(--font-mono); font-size: 0.75rem; color: hsl(var(--primary)); text-transform: uppercase; }
