@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=STIX+Two+Text:wght@400;500;600&display=swap');

:root {
  --academic-paper: #f6f8ff;
  --academic-white: #fff;
  --academic-ink: #1e2349;
  --academic-muted: #4b5272;
  --academic-accent: #4735ba;
  --academic-tint: #edebff;
  --academic-line: #dce1f5;
  --academic-peach: #fff0e8;
  --academic-serif: "STIX Two Text", Georgia, serif;
  --academic-sans: "DM Sans", system-ui, sans-serif;
}

body {
  background: radial-gradient(ellipse at 6% 5%, #e8f8ff 0%, transparent 38%),
    radial-gradient(ellipse at 95% 9%, #f3e9ff 0%, transparent 39%),
    var(--academic-paper);
  color: var(--academic-ink);
  font-family: var(--academic-sans);
}

body.academic-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-bottom: 0 !important;
}

[hidden] { display: none !important; }

.academic-skip {
  position: absolute;
  z-index: 5;
  inset: 1rem auto auto 1rem;
  padding: .5rem 1rem;
  background: var(--academic-white);
  transform: translateY(-250%);
}

.academic-skip:focus { transform: none; }

.academic-header {
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, #3569f3, #8a51e8 58%, #ff8f76) 1;
  border-bottom: 1px solid var(--academic-line);
  background: #ffffffb8;
}

.academic-header-inner,
.academic-shell,
.academic-footer {
  width: min(1120px, calc(100% - 72px));
  margin-inline: auto;
}

.academic-header-inner {
  display: flex;
  min-height: 68px;
  justify-content: space-between;
  align-items: center;
  gap: 12px 28px;
}

.academic-brand {
  color: var(--academic-ink);
  font: 600 1.5rem/1 var(--academic-serif);
  white-space: nowrap;
  text-decoration: none;
}

.academic-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem 1.55rem;
}

.academic-nav a {
  padding-block: .45rem;
  border-bottom: 2px solid transparent;
  color: var(--academic-muted);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}

.academic-nav a:hover,
.academic-nav [aria-current="page"] {
  color: var(--academic-accent);
  border-bottom-color: currentColor;
}

.academic-shell {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  align-items: start;
  gap: clamp(32px, 5vw, 72px);
  margin-block: clamp(34px, 5vw, 68px) 72px;
  font-size: .92rem;
}

.academic-shell a, .academic-footer a { color: var(--academic-accent); }
.academic-shell a:hover, .academic-footer a:hover { text-decoration: underline; }

.academic-profile {
  padding-top: 6px;
}

.academic-portrait {
  display: block;
  width: min(100%, 180px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 18px;
  background: var(--academic-tint);
}

.academic-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
}

.academic-name {
  margin: 17px 0 4px;
  font: 600 1.35rem/1.18 var(--academic-serif);
}

.academic-name a { color: var(--academic-ink); text-decoration: none; }
.academic-name span { margin-left: .24em; font-size: .7em; color: var(--academic-muted); }

.academic-affiliation {
  margin: 0 0 17px;
  color: var(--academic-muted);
  font-size: .73rem;
  line-height: 1.55;
}

.academic-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--academic-line);
  max-width: 180px;
}

.academic-contact li { margin: 0; border-bottom: 1px solid var(--academic-line); }

.academic-contact a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-block: .5rem;
  font-size: .73rem;
  font-weight: 600;
  text-decoration: none;
}

.academic-content { min-width: 0; }
.academic-content h1, .academic-content h2, .academic-content h3 {
  font-family: var(--academic-serif);
  letter-spacing: -.022em;
}

.academic-intro { padding-bottom: clamp(25px, 3vw, 40px); }

.academic-intro h1 {
  margin: 0 0 .15em;
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 500;
  line-height: .99;
  letter-spacing: -.055em;
}

.academic-intro h1 span {
  margin-left: .2em;
  font-size: .36em;
  letter-spacing: 0;
  color: var(--academic-accent);
  white-space: nowrap;
  vertical-align: .16em;
}

.academic-intro p {
  max-width: 63ch;
  margin: 0 0 .85em;
  color: var(--academic-muted);
  line-height: 1.62;
}

.academic-intro .academic-deck {
  margin: .4em 0 .6em;
  color: var(--academic-accent);
  font: 500 clamp(1.18rem, 2.4vw, 1.65rem)/1.24 var(--academic-serif);
}

.academic-intro p:last-child { margin-bottom: 0; }

.home-intro {
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--academic-line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 100% 0%, #ffdcca 0%, transparent 53%),
    linear-gradient(122deg, #e4efff, #eee8ff 63%, #fff2ee);
}

.academic-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.academic-button {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .55rem .8rem;
  border: 1px solid var(--academic-line);
  border-radius: 10px;
  background: var(--academic-white);
  font-size: .77rem;
  font-weight: 700;
  text-decoration: none;
}
.academic-shell .academic-button.primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(115deg, #3348c8, #6734c4) border-box;
}

.news-section { margin-top: clamp(26px, 4vw, 44px); }

.news-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }

.news-section h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

.news-section h2 i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--academic-peach);
  color: #a34222;
  font-size: .9rem;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  --news-accent: #5842bd;
  --news-tint: #ebe5ff;
  --news-icon: #6b43d4;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--academic-line);
  border-radius: 16px;
  background: var(--academic-white);
}

.news-item:first-child {
  grid-column: 1 / -1;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding: clamp(16px, 3vw, 30px);
  background: linear-gradient(135deg, var(--news-tint), #fff 76%);
  border-inline-start: 4px solid var(--news-icon);
}

.news-item:nth-child(2):last-child { grid-column: 1 / -1; }

.news-item[data-type="publication"] { --news-accent: #254ca9; --news-tint: #e3edff; --news-icon: #3963da; }
.news-item[data-type="acceptance"] { --news-accent: #056254; --news-tint: #ddf8ee; --news-icon: #127a65; }
.news-item[data-type="talk"] { --news-accent: #5a36af; --news-tint: #ece4ff; --news-icon: #714bc8; }
.news-item[data-type="award"] { --news-accent: #913e1e; --news-tint: #ffecdc; --news-icon: #b44e2b; }
.news-item[data-type="journal"], .news-item[data-type="preprint"] { --news-accent: #254ca9; --news-tint: #e3edff; --news-icon: #3963da; }
.news-item[data-type="funding"], .news-item[data-type="collaboration"] { --news-accent: #056254; --news-tint: #ddf8ee; --news-icon: #127a65; }
.news-item[data-type="conference"] { --news-accent: #5a36af; --news-tint: #ece4ff; --news-icon: #714bc8; }

.news-icon {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 13px;
  background: var(--news-icon);
  color: white;
  font-size: .9rem;
}

.news-item:first-child .news-icon { font-size: 1.1rem; }
.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; font-size: .67rem; font-weight: 700; }
.news-meta span { color: var(--news-accent); }
.news-meta time { color: var(--academic-muted); font-variant-numeric: tabular-nums; }
.news-item h3 { margin: 6px 0; font-size: 1.12rem; line-height: 1.2; overflow-wrap: anywhere; }
.news-item:first-child h3 { font-size: clamp(1.2rem, 3vw, 1.58rem); }
.news-item p { margin: 5px 0 0; color: var(--academic-muted); font-size: .8rem; line-height: 1.55; overflow-wrap: anywhere; }
.academic-shell .news-link { display: inline-block; margin-top: 9px; color: var(--news-accent); font-size: .73rem; font-weight: 700; text-underline-offset: .18em; }
.news-empty { color: var(--academic-muted); }

.news-editor {
  width: min(570px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid var(--academic-line);
  border-radius: 18px;
  background: var(--academic-white);
  color: var(--academic-ink);
  box-shadow: 0 18px 70px #20275935;
  font: .85rem/1.45 var(--academic-sans);
}
.news-editor::backdrop { background: #1e234978; }
.news-editor-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.news-editor-header h2, .news-editor-header form { margin: 0; }
.news-editor-header h2 { font-size: 1.18rem; }
.news-editor label { display: block; margin-bottom: 12px; font-weight: 600; }
.news-editor input, .news-editor select, .news-editor textarea {
  display: block;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  margin: 5px 0 0;
  padding: 7px 9px;
  border: 1px solid #aab4db;
  border-radius: 8px;
  background: #f8f9ff;
  box-shadow: none;
  font: inherit;
  font-weight: 400;
}
.news-editor textarea { resize: vertical; }
.news-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.news-editor button, .news-heading-row button {
  padding: .45em .85em;
  border: 1px solid var(--academic-line);
  border-radius: 8px;
  background: var(--academic-tint);
  color: var(--academic-ink);
  font: 700 .78rem/1.4 var(--academic-sans);
  cursor: pointer;
}
.news-editor button.news-editor-primary, .news-heading-row button.news-editor-primary { background: var(--academic-accent); color: #fff; }
.news-editor button:disabled { opacity: .6; cursor: wait; }
.news-editor .news-editor-close { font-size: 1.1rem; padding: .1em .5em; }
.news-editor-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.news-editor-hint, .news-editor-status { color: var(--academic-muted); font-size: .75rem; }
.news-editor-status { margin: 12px 0 4px; }
.news-editor-status:empty { margin: 0; }
.news-editor a { color: var(--academic-accent); }
.news-editor :focus-visible { outline: 2px solid var(--academic-accent); outline-offset: 2px; }

.research-topics { display: grid; gap: 14px; margin-top: 20px; }
.research-topic { padding: clamp(17px, 3vw, 25px); border: 1px solid var(--academic-line); border-radius: 16px; background: var(--academic-white); }
.research-topic i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--academic-tint); color: var(--academic-accent); }
.research-topic:nth-child(2) i { background: #e0f6ff; color: #166380; }
.research-topic:nth-child(3) i { background: var(--academic-peach); color: #a34222; }
.research-topic h2 { margin: 11px 0 5px; font-size: 1.35rem; }
.research-topic p { max-width: 65ch; margin: 0 0 7px; color: var(--academic-muted); }
.research-topic a { font-size: .76rem; font-weight: 700; }

.paper-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(152px, 28%);
  gap: 14px;
  padding: 14px 16px;
  margin: 0;
  border: 1px solid var(--academic-line);
  border-radius: 8px;
  background: var(--academic-tint);
}

.paper-filters label {
  display: grid;
  min-width: 0;
  gap: 6px;
  margin: 0;
  color: var(--academic-muted);
  font-size: .73rem;
  font-weight: 700;
  line-height: 1.35;
}

.paper-search { position: relative; min-width: 0; }
.paper-search i {
  position: absolute;
  inset: 50% auto auto 12px;
  transform: translateY(-50%);
  color: var(--academic-accent);
  font-size: .72rem;
  pointer-events: none;
}

.paper-filters input, .paper-filters select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #aab4db;
  border-radius: 5px;
  margin: 0;
  background: var(--academic-white);
  color: var(--academic-ink);
  box-shadow: none;
  font: 400 .8rem/1.4 var(--academic-sans);
}
.paper-filters input { padding-inline-start: 34px; }
.paper-filters input:hover, .paper-filters select:hover { border-color: var(--academic-accent); }
.paper-filters input::placeholder { color: var(--academic-muted); }

.paper-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding-block: 14px;
  color: var(--academic-muted);
  font-size: .69rem;
}
.paper-count { font-weight: 700; color: var(--academic-accent); }
.paper-year {
  display: grid;
  grid-template-columns: 75px minmax(0, 1fr);
  gap: 15px;
  padding: 18px 0 12px;
  border-top: 1px solid var(--academic-line);
}
.paper-year h2 { margin: 0; color: var(--academic-accent); font-size: 1.5rem; font-weight: 500; }
.academic-paper { padding: 0 0 16px; overflow-wrap: anywhere; }
.academic-paper + .academic-paper { border-top: 1px solid var(--academic-line); padding-top: 16px; }
.paper-venue { margin: 0 0 4px; color: var(--academic-accent); font-size: .7rem; font-weight: 700; line-height: 1.45; }
.academic-content .paper-title { margin: 0 0 3px; font-size: clamp(1.08rem, 2.1vw, 1.38rem); font-weight: 600; line-height: 1.18; }
.paper-title a { color: var(--academic-ink); text-decoration: none; }
.paper-authors { margin: .23em 0 0; color: var(--academic-muted); font-size: .75rem; }
.paper-authors strong { color: var(--academic-ink); }
.paper-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; font-size: .7rem; font-weight: 700; }
.paper-links a { text-underline-offset: .19em; }
.paper-empty { margin-top: 15px; color: var(--academic-muted); }
.paper-back { display: inline-block; margin-bottom: 17px; font-size: .78rem; }
.paper-detail h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.06; }

.academic-cv { max-width: 69ch; }
.academic-cv h2 { font-size: 1.6rem; font-weight: 500; margin: 1.1em 0 .45em; border-top: 1px solid var(--academic-line); padding-top: .65em; }
.academic-cv p, .academic-cv li { color: var(--academic-muted); }
.academic-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
.academic-gallery figure { display: block; width: auto; margin: 0; }
.academic-gallery a { display: block; }
.academic-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--academic-tint); }
.academic-gallery figcaption { color: var(--academic-muted); font-style: normal; }

.page__footer { margin-top: 0; background: var(--academic-paper); border-top: 1px solid var(--academic-line); color: var(--academic-muted); }
.academic-page .page__footer { position: static; margin-top: auto; animation: none; }
.page__footer footer { max-width: none; margin: 0; padding: 0; }
.page__footer a { color: var(--academic-accent); }
.academic-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 24px; font-size: .72rem; }
.academic-footer div { display: flex; gap: 16px; }

.academic-header a:focus-visible,
.academic-shell :focus-visible,
.academic-footer a:focus-visible { outline: 2px solid var(--academic-accent); outline-offset: 3px; }

@media (max-width: 760px) {
  .academic-header-inner, .academic-shell, .academic-footer { width: calc(100% - 40px); }
  .academic-shell { grid-template-columns: minmax(0, 1fr); gap: 31px; margin-block: 32px 55px; }
  .academic-profile {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 3px 15px;
    padding: 0 0 16px;
    border-top: 0;
    border-bottom: 1px solid var(--academic-line);
  }
  .academic-portrait { grid-row: span 3; align-self: start; }
  .academic-name, .academic-affiliation { margin: 0; }
  .academic-contact { max-width: none; border: 0; display: flex; flex-wrap: wrap; gap: 0 13px; }
  .academic-contact li { border: 0; }
  .academic-contact a { padding-block: .2rem; gap: 3px; }
}

@media (max-width: 620px) {
  .news-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 500px) {
  .paper-filters { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .news-item:first-child { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .news-editor-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 440px) {
  .academic-header-inner { align-items: flex-start; justify-content: center; flex-direction: column; gap: 4px; padding-block: 13px 8px; }
  .academic-nav { column-gap: 1rem; }
  .paper-year { grid-template-columns: 1fr; gap: 9px; }
  .academic-gallery { grid-template-columns: 1fr; }
}
