@font-face {
  font-family: "PP Kyoto";
  src: url("/fonts/PPKyoto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Kyoto";
  src: url("/fonts/PPKyoto-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #282828;
  --soft: #666;
  --line: #e5e5e5;
  font-family: "PP Kyoto", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171717;
  --ink: #ededed;
  --soft: #aaa;
  --line: #393939;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button {
  font: inherit;
}

a {
  color: inherit;
}

:where(a, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 2;
  background: var(--paper);
  padding: 10px 14px;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  width: min(1080px, 100%);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 8px 28px;
}

.site-brand {
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
}

.theme-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms ease-out, scale 150ms ease-out;
}

.theme-button:hover {
  background: var(--line);
}

.theme-button:active {
  scale: 0.96;
}

.theme-button .icon {
  width: 21px;
  height: 21px;
}

.article-shell {
  padding: 0 28px 120px;
}

.article-hero {
  width: min(760px, 100%);
  margin: 70px auto 0;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.article-hero h1 {
  margin: 0;
  font-size: 3.55rem;
  font-weight: 500;
  line-height: 1.08;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.article-summary {
  margin: 22px 0 28px;
  color: var(--soft);
  font-size: 1.3rem;
  line-height: 1.48;
  text-wrap: pretty;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.article-author-image {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

:root[data-theme="dark"] .article-author-image {
  outline-color: rgba(255, 255, 255, 0.1);
}

.article-byline-text {
  display: grid;
  gap: 2px;
  font-size: 0.94rem;
  line-height: 1.35;
}

.article-byline-text strong {
  font-weight: 500;
}

.article-byline-text span,
.article-bio {
  color: var(--soft);
}

.article-bio {
  margin: 17px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.article-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  margin-top: 23px;
  font-size: 0.91rem;
}

.article-links a,
.article-links button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--soft);
  text-underline-offset: 0.2em;
}

.article-links a:hover,
.article-links button:hover {
  text-decoration-color: var(--ink);
}

.article-body {
  width: min(680px, 100%);
  margin: 48px auto 0;
  font-size: 1.26rem;
  line-height: 1.7;
}

.article-body p {
  margin: 0 0 1.35em;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.article-body h2 {
  margin: 2.2em 0 0.68em;
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.2;
  scroll-margin-top: 30px;
  text-wrap: balance;
}

.article-body h2:first-child {
  margin-top: 0;
}

.copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.not-found {
  width: min(680px, 100%);
  margin: 100px auto;
  padding: 0 24px;
}

.not-found h1 {
  font-size: 2.7rem;
  font-weight: 500;
}

@media (max-width: 680px) {
  .site-header-inner {
    min-height: 60px;
    padding-inline: 20px;
  }

  .article-shell {
    padding: 0 20px 80px;
  }

  .article-hero {
    margin-top: 40px;
    padding-bottom: 22px;
  }

  .article-hero h1 {
    font-size: 2.52rem;
  }

  .article-summary {
    margin: 18px 0 22px;
    font-size: 1.1rem;
  }

  .article-links {
    gap: 4px 20px;
    margin-top: 15px;
  }

  .article-body {
    margin-top: 32px;
    font-size: 1.14rem;
    line-height: 1.68;
  }

  .article-body h2 {
    font-size: 1.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-button {
    transition: none;
  }
}

@media print {
  :root,
  :root[data-theme="dark"] {
    --paper: #fff;
    --ink: #111;
    --soft: #555;
    --line: #ddd;
    color-scheme: light;
  }

  .site-header,
  .article-links {
    display: none;
  }

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

  .article-body h2 {
    break-after: avoid;
  }

  .article-body p {
    orphans: 3;
    widows: 3;
  }
}
