:root {
  color-scheme: light dark;
  --bg: #f1f2f3;
  --surface: #ffffff;
  --surface-soft: #f0f1f2;
  --text: #202226;
  --muted: #656971;
  --line: #cfd2d6;
  --box-border-width: 1.5px;
  --accent: #3558a8;
  --accent-strong: #254487;
  --accent-soft: #e8edf9;
  --button-bg: #24272c;
  --button-text: #ffffff;
  --focus: #a95018;
  --shadow: 0 18px 48px rgb(25 28 35 / 7%);
  --radius: 14px;
  --shell: 1120px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151618;
  --surface: #1d1f22;
  --surface-soft: #292c31;
  --text: #f0f1f3;
  --muted: #a9adb5;
  --line: #383b40;
  --box-border-width: 1px;
  --accent: #9ab2ef;
  --accent-strong: #bdcbf4;
  --accent-soft: #29334c;
  --button-bg: #eef1f8;
  --button-text: #17191d;
  --focus: #e3a06f;
  --shadow: 0 18px 48px rgb(0 0 0 / 24%);
}

:root[data-theme="light"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #151618;
    --surface: #1d1f22;
    --surface-soft: #292c31;
    --text: #f0f1f3;
    --muted: #a9adb5;
    --line: #383b40;
    --box-border-width: 1px;
    --accent: #9ab2ef;
    --accent-strong: #bdcbf4;
    --accent-soft: #29334c;
    --button-bg: #eef1f8;
    --button-text: #17191d;
    --focus: #e3a06f;
    --shadow: 0 18px 48px rgb(0 0 0 / 24%);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
summary {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 720;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 9px;
  border: var(--box-border-width) solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.theme-control select {
  padding: 8px 30px 8px 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.hero {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 64px;
  padding-block: clamp(76px, 11vw, 132px) clamp(68px, 9vw, 108px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 28px;
  font-family: inherit;
  font-size: clamp(50px, 9vw, 88px);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.03;
}

.intro {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.archive-summary {
  display: flex;
  min-width: 140px;
  flex-direction: column;
  align-items: flex-end;
  padding-bottom: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.archive-summary strong {
  color: var(--text);
  font-family: inherit;
  font-size: 48px;
  font-weight: 650;
  line-height: 1;
}

.browser {
  padding-block: 52px 104px;
}

.controls {
  position: sticky;
  z-index: 8;
  top: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(148px, auto) minmax(180px, auto);
  gap: 12px;
  padding: 12px;
  border: var(--box-border-width) solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.search-field,
.select-field {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: var(--box-border-width) solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
}

.search-field {
  padding: 0 13px;
  color: var(--muted);
}

.search-field:focus-within,
.select-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field input,
.select-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-field input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.search-field kbd {
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.select-field select {
  min-height: 48px;
  padding: 0 34px 0 13px;
}

.results-bar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.results-bar p {
  margin: 0;
}

.text-button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.year-section {
  padding: 48px 0 24px;
  border-top: 1px solid var(--line);
}

.year-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.year-heading h2 {
  margin-bottom: 0;
  font-family: inherit;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.year-heading span {
  color: var(--muted);
  font-size: 13px;
}

.publication-list {
  display: grid;
  gap: 20px;
}

.publication-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 48px;
  padding: clamp(28px, 4.5vw, 40px);
  border: var(--box-border-width) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.publication-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 12px 34px rgb(25 28 35 / 8%);
  transform: translateY(-1px);
}

.publication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-label {
  color: var(--accent);
}

.publication-card h3 {
  max-width: 850px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 29px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.24;
}

.authors,
.venue {
  max-width: 850px;
}

.authors {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
}

.venue {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

.abstract,
.resources {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.abstract summary,
.resources summary {
  width: fit-content;
  padding-top: 16px;
  color: var(--accent);
  font-weight: 700;
  list-style: none;
}

.abstract summary::-webkit-details-marker,
.resources summary::-webkit-details-marker {
  display: none;
}

.abstract summary::after,
.resources summary::after {
  content: " +";
}

.abstract[open] summary::after,
.resources[open] summary::after {
  content: " −";
}

.abstract p {
  max-width: 78ch;
  margin: 16px 0 0;
}

.count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  margin-left: 4px;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: var(--box-border-width) solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.resource-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.publication-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 13px;
  border: var(--box-border-width) solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button-primary {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
}

.button-primary:hover {
  border-color: var(--text);
  background: var(--text);
}

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

.button-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-badge {
  display: inline-grid;
  min-width: 31px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  padding-inline: 5px;
  border: 1px solid currentColor;
  border-radius: 5px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.file-badge-pdf {
  color: #a53d3d;
}

.file-badge-video {
  color: #7951a8;
}

.file-badge-archive {
  color: #8b641d;
}

.file-badge-link,
.file-badge-cite {
  color: var(--accent);
}

.button-primary .file-badge {
  color: inherit;
  opacity: 0.78;
}

.button-note,
.link-origin {
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  white-space: nowrap;
}

.button-secondary:hover .button-note {
  color: inherit;
  opacity: 0.8;
}

.external-mark {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.resource-link:hover .external-mark,
.resource-link:hover .link-origin {
  color: inherit;
}

.empty-state {
  padding: 70px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty-state > span {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 42px;
}

.empty-state h2 {
  margin-bottom: 5px;
  font-family: inherit;
  font-size: 30px;
  font-weight: 500;
}

.empty-state p {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 30px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.citation-dialog {
  width: min(calc(100% - 32px), 720px);
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: var(--box-border-width) solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgb(0 0 0 / 28%);
}

.citation-dialog[open] {
  display: flex;
  flex-direction: column;
}

body:has(.citation-dialog[open]) {
  overflow: hidden;
}

.citation-dialog::backdrop {
  background: rgb(8 18 15 / 64%);
  backdrop-filter: blur(3px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 26px 18px;
}

.dialog-header h2 {
  margin: 0 0 5px;
  overflow: hidden;
  font-family: inherit;
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.01em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.dialog-header .eyebrow {
  margin-bottom: 5px;
}

#citation-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: var(--box-border-width) solid var(--line);
  border-radius: 9px;
  background: transparent;
  font-size: 23px;
  line-height: 1;
}

.citation-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin: 0 26px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.citation-tabs button {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.citation-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.citation-output {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 26px;
}

.citation-output textarea {
  width: 100%;
  height: min(320px, 38dvh);
  min-height: 180px;
  resize: none;
  padding: 14px;
  border: var(--box-border-width) solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.citation-output textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dialog-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 26px 26px;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  max-width: 700px;
  margin: 0 auto;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .header-inner {
    min-height: 64px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .archive-summary {
    align-items: flex-start;
  }

  .controls {
    position: relative;
    top: auto;
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .publication-card {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .publication-actions {
    flex-flow: row wrap;
  }

  .publication-actions .button {
    flex: 1 1 126px;
  }
}

@media (max-width: 480px) {
  .shell {
    width: calc(100% - 40px);
  }

  .header-inner {
    gap: 12px;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .theme-control {
    flex: 0 0 auto;
  }

  .theme-control select {
    width: 108px;
    min-width: 108px;
    max-width: none;
    padding-right: 32px;
  }

  .hero-inner {
    padding-block: 54px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(40px, 13vw, 54px);
    letter-spacing: -0.01em;
    overflow-wrap: normal;
  }

  .browser {
    padding-top: 20px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .year-heading {
    align-items: flex-end;
  }

  .publication-card {
    padding: 20px;
  }

  .publication-actions {
    flex-direction: column;
  }

  .publication-actions .button {
    width: 100%;
    min-height: 44px;
    flex: 0 0 auto;
    padding-block: 9px;
  }

  .citation-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .dialog-header,
  .citation-output {
    padding-right: 18px;
    padding-left: 18px;
  }

  .dialog-header {
    gap: 12px;
    padding-top: 18px;
    padding-bottom: 12px;
  }

  .dialog-header h2 {
    font-size: 19px;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .dialog-header .eyebrow {
    font-size: 10px;
  }

  #citation-meta {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 20px;
  }

  .citation-tabs {
    margin-inline: 18px;
  }

  .citation-tabs button {
    padding: 8px 9px;
    font-size: 12px;
  }

  .citation-output {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .citation-output textarea {
    height: min(280px, 35dvh);
    min-height: 150px;
    padding: 11px;
    font-size: 11px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 18px 18px;
  }

  .site-footer .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
