@font-face {
  font-family: "Newsreader";
  src: url("./assets/newsreader-s-izfB6B.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("./assets/montserrat-l_AIctKy.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --background: #fffbd8;
  --foreground: #20201d;
  --muted: #57564e;
  --line: rgba(32, 32, 29, 0.18);
  --paper: rgba(255, 255, 255, 0.34);
  --page-width: 72rem;
  --reading-width: 67rem;
  --page-padding: clamp(1.1rem, 4vw, 3rem);
  --header-height: 4rem;
  --radius: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.25rem);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.03rem, 0.98rem + 0.2vw, 1.12rem);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration-thickness: 0.1em;
}

a:focus-visible {
  border-radius: 0.15rem;
  outline: 2px solid currentColor;
  outline-offset: 0.24rem;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--foreground);
  border-radius: 0.4rem;
  background: var(--background);
  transform: translateY(-180%);
}

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

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.55rem;
  padding-inline: max(var(--page-padding), calc((100vw - var(--page-width)) / 2));
  border-bottom: 1px solid transparent;
  background: rgba(255, 251, 216, 0.94);
  background: color-mix(in srgb, var(--background) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand,
.site-header nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  text-decoration: none;
}

.brand {
  flex: 0 0 auto;
  font-size: 1.2rem;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.site-header nav a {
  font-size: 0.98rem;
}

.brand:hover,
.site-header nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.hero,
.content-column {
  width: min(calc(100% - (2 * var(--page-padding))), var(--page-width));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(17rem, 22rem) minmax(18rem, 1fr);
  column-gap: clamp(3rem, 7vw, 6.5rem);
  align-items: center;
  padding-block: clamp(3.25rem, 6vw, 5rem) clamp(2.5rem, 4vw, 3.5rem);
}

.portrait-frame {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin: 0;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 913 / 934;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #d7e2e4;
  box-shadow: 0 1.5rem 3.75rem -2.6rem rgba(22, 32, 35, 0.52);
  object-fit: cover;
  object-position: center;
}

h1,
h2 {
  margin: 0;
  color: var(--foreground);
  font-weight: 400;
}

h1 {
  max-width: 44rem;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(2.35rem, 4.5vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
  text-align: center;
  text-wrap: balance;
}

.hero h1 {
  grid-column: 2;
  grid-row: 1;
}

.content-column {
  max-width: var(--reading-width);
}

.introduction {
  max-width: var(--page-width);
  padding: 0;
}

.introduction p {
  margin: 0 0 1.05rem;
  text-wrap: pretty;
}

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

.research {
  max-width: var(--page-width);
  padding-top: clamp(3.25rem, 7vw, 5.25rem);
}

h2 {
  margin-bottom: 0.9rem;
  font-size: clamp(1.55rem, 1.4rem + 0.5vw, 1.9rem);
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.14em;
}

.paper-list {
  display: grid;
  gap: 0.82rem;
  margin: 0 0 clamp(2.8rem, 5vw, 4rem);
  padding-left: 1.35rem;
}

.paper-list li {
  padding-left: 0.15rem;
  text-wrap: pretty;
}

.paper-list li::marker {
  color: var(--muted);
  font-size: 0.8em;
}

.paper-list a {
  font-weight: 600;
}

.paper-meta {
  color: var(--muted);
}

.paper-meta strong {
  color: var(--foreground);
  font-weight: 600;
}

.social-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  max-width: var(--reading-width);
  padding-block: 0.35rem 1.25rem;
}

.social-links a {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--paper);
  text-align: center;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.social-links a:hover {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
  transform: translateY(-1px);
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem 1.35rem;
  max-width: var(--reading-width);
  padding-block: 0.9rem clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-page {
  width: min(calc(100% - (2 * var(--page-padding))), 56rem);
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
}

.legal-page h1 {
  max-width: none;
  margin-bottom: 0.75rem;
  font-size: clamp(2.15rem, 6vw, 3.25rem);
  text-align: left;
}

.legal-page .updated {
  margin: 0 0 2.5rem;
  color: var(--muted);
}

.legal-page h2 {
  margin-top: 2.4rem;
  margin-bottom: 0.65rem;
  font-size: 1.55rem;
  text-decoration: none;
}

.legal-page p {
  text-wrap: pretty;
}

.legal-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.stats-page {
  width: min(calc(100% - (2 * var(--page-padding))), 67rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.stats-page h1 {
  max-width: none;
  margin-bottom: 0.35rem;
  font-size: clamp(2.15rem, 6vw, 3.25rem);
  text-align: left;
}

.stats-note,
.stats-period,
.stats-empty {
  color: var(--muted);
}

.stats-note {
  margin: 0 0 1.75rem;
}

.stats-period {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-block: 1.5rem 2rem;
}

.stats-period a,
.stats-period strong {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}

.stats-period strong {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.75rem;
}

.stat-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--paper);
}

.stat-card span,
.stat-card strong {
  display: block;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  margin-top: 0.25rem;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 4rem);
}

.stats-section h2 {
  margin-top: 0;
  font-size: 1.45rem;
  text-decoration: none;
}

.stats-daily {
  margin-top: 2.75rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.stats-table th,
.stats-table td {
  padding: 0.52rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.stats-table th:last-child,
.stats-table td:last-child {
  text-align: right;
}

.stats-table th {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.stats-page-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 52rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding-block: clamp(2.5rem, 8vw, 4rem);
  }

  .portrait-frame {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, 21rem);
    margin-inline: auto;
  }

  .hero h1 {
    grid-column: 1;
    grid-row: 1;
    margin-inline: auto;
    font-size: clamp(2.15rem, 8vw, 3.1rem);
    text-align: center;
  }

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

@media (max-width: 38rem) {
  .site-header {
    gap: clamp(0.65rem, 3vw, 1rem);
    padding-block: 0.35rem;
    border-bottom-color: var(--line);
  }

  .site-header nav {
    min-width: 0;
    width: auto;
    gap: clamp(0.65rem, 3vw, 0.9rem);
  }

  .brand,
  .site-header nav a {
    min-height: 2.75rem;
    white-space: nowrap;
  }

  .brand {
    font-size: 1.05rem;
  }

  .site-header nav a {
    font-size: 0.9rem;
  }

  .hero {
    gap: 1.85rem;
    padding-top: 2.35rem;
  }

  .portrait-frame {
    width: min(100%, 19rem);
  }

  .research {
    padding-top: 3.25rem;
  }

  .paper-list {
    gap: 1rem;
    padding-left: 1.15rem;
  }

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

  .social-links a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .legal-links {
    flex-direction: column;
  }

  .stats-grid,
  .stats-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 21rem) {
  :root {
    --page-padding: 0.9rem;
  }

  .site-header .brand {
    display: none;
  }

  .site-header nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .social-links a {
    transition: none;
  }
}

@media print {
  .site-header,
  .social-links,
  .legal-links,
  .skip-link {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .hero {
    padding-block: 1rem 2rem;
  }
}
