:root {
  --text: #202124;
  --muted: #667085;
  --line: #dfe3e8;
  --link: #1756a9;
  --soft: #f7f8fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus-visible,
button:hover,
button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
}

.name {
  color: var(--text);
  font-weight: 650;
}

.name:hover,
.name:focus-visible {
  text-decoration: none;
}

nav {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 30px;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 22px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 34px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.intro > div > p,
.cite-help {
  margin-bottom: 0;
  color: var(--muted);
}

.cite-help {
  max-width: 420px;
  text-align: right;
  font-size: 13px;
}

.cite-help a {
  margin-left: 8px;
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.paper {
  display: flex;
  min-width: 0;
  min-height: 225px;
  flex-direction: column;
  padding: 17px 18px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.paper-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.paper h2 {
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.full-title {
  min-height: 39px;
  margin-bottom: 7px;
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
}

.source {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.summary {
  margin-bottom: 14px;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: auto;
  font-size: 12px;
}

.links button {
  cursor: pointer;
  padding: 0;
  border: 0;
  color: var(--link);
  background: none;
  font: inherit;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 8px 11px;
  border-radius: 3px;
  color: #ffffff;
  background: #303134;
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid #174ea6;
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .paper-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .cite-help {
    text-align: left;
  }

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

@media (max-width: 540px) {
  header {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 11px 16px;
  }

  nav {
    gap: 15px;
  }

  main {
    width: calc(100% - 28px);
    padding-top: 22px;
  }

  h1 {
    font-size: 30px;
  }

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

  .paper {
    min-height: 0;
  }

  .full-title {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}
