:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #555555;
  --rule: #000000;
  --bg-rgb: 255, 255, 255;
}

[data-theme="dark"] {
  --bg: #1b1d23;
  --fg: #c8cad1;
  --muted: #7e8290;
  --rule: #c8cad1;
  --bg-rgb: 27, 29, 35;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

ul {
  list-style: none;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.navbox {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 12px 26px;
  border: 1px solid var(--rule);
}

.navbox a.active {
  font-weight: 700;
  text-decoration: none;
}

.theme {
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}

main {
  flex: 1;
  text-align: center;
}

main h1 {
  font-size: 1.9rem;
  margin-bottom: 20px;
  text-align: center;
}

.home-title {
  text-align: center;
  font-size: 2.1rem;
  margin-bottom: 28px;
}

.entry__body,
.preview__text,
.archive__desc,
.notice {
  text-align: left;
}

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

.notice {
  border: 1px solid var(--rule);
  padding: 16px;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  padding: 1px 6px;
  border: 1px solid var(--muted);
  border-radius: 3px;
}

.notice p {
  margin-top: 6px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.entry {
  padding: 8px 0 20px;
  border-bottom: 1px dashed var(--muted);
}

.entry--full,
.entry--featured {
  border-bottom: none;
}

.entry__meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.entry__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.entry--full .entry__title {
  font-size: 1.9rem;
}

.entry__link {
  text-decoration: none;
}

.entry__link:hover {
  text-decoration: underline;
}

.entry__ext {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--muted);
}

.entry__body {
  white-space: pre-wrap;
}

.entry__body a,
.preview__text a {
  text-decoration: underline;
}

.preview {
  position: relative;
}

.preview__text {
  white-space: pre-wrap;
}

.preview--fade .preview__text {
  position: relative;
  overflow: hidden;
}

.preview--fade .preview__text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5em;
  background: linear-gradient(
    to bottom,
    rgba(var(--bg-rgb), 0) 0%,
    rgba(var(--bg-rgb), 0.85) 75%,
    var(--bg) 100%
  );
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  pointer-events: none;
}

.preview__bar {
  display: block;
  margin-top: 14px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--rule);
  background: var(--bg);
  font-weight: 600;
  font-size: 0.95rem;
}

.preview__bar:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.archive {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.archive__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 18px;
}

.archive__item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--muted);
}

.archive__item:last-child {
  border-bottom: none;
}

.archive__link {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
}

.archive__link:hover {
  text-decoration: none;
}

.archive__link:hover .archive__name {
  text-decoration: underline;
}

.archive__date {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  min-width: 6em;
}

.archive__name {
  font-weight: 700;
}

.archive__desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.more {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}

.more h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.more li {
  margin-bottom: 8px;
}

.more li span {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 8px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

.socials {
  display: flex;
  gap: 16px;
}

@media (max-width: 640px) {
  html,
  body {
    font-size: 16px;
  }
  .page {
    padding: 20px 18px 32px;
  }
  .navbox {
    gap: 12px;
    padding: 8px 10px;
    font-size: 0.95rem;
  }
  .archive__link {
    gap: 10px;
  }
  .archive__date {
    min-width: auto;
  }
  .navbox {
    gap: 20px;
    padding: 10px 16px;
  }
  .foot {
    flex-direction: column;
    align-items: flex-start;
  }
}
