@font-face {
  font-family: 'Ziravel';
  src: url('/fonts/ziravel.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #17281d;
  --tan: #d9c7a2;
  --brown: #b98548;
  --black: #12100c;

  --tan-soft: rgba(217, 199, 162, 0.62);
  --tan-faint: rgba(217, 199, 162, 0.38);
  --brown-deep: #6b4322;
  --ink-mid: #33291b;
  --ink-faint: #524330;

  --type: 'Bitter', Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--green);
}

body {
  margin: 0;
}

.page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 28px 16px;
  color: var(--tan);
  font-family: var(--type);
  font-size: 16px;
  line-height: 1.7;
}

.page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--green) url(/img/page-bg.webp) center / cover no-repeat;
}

.page a {
  color: var(--tan);
  text-decoration: none;
}

.page a:hover {
  color: var(--brown);
}

.outer {
  max-width: 1080px;
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  padding: 40px 40px 64px;
  background: var(--green);
}

@media (max-width: 600px) {
  .page {
    padding: 16px 8px;
  }

  .outer {
    min-height: calc(100vh - 32px);
    padding: 40px 14px 64px;
  }
}

.header {
  margin: 0 0 48px;
}

.title {
  display: inline-block;
  margin: 0;
  color: var(--tan);
  font-family: 'Ziravel', var(--type);
  font-size: min(clamp(34px, 11vw, 60px), (100vw - 52px) / 10.6);
  font-weight: 400;
  line-height: 1.1;
  white-space: nowrap;
}

.page .title a,
.page .title a:hover {
  display: inline-block;
  color: var(--tan);
}

.title-face {
  width: 1.9em;
  height: auto;
  margin-left: 0.04em;
  vertical-align: -0.04em;
}

.columns {
  display: flex;
  align-items: flex-start;
  gap: 56px;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
}

.label {
  display: inline-block;
  padding: 2px 8px;
  background: var(--brown);
  color: var(--black);
  font-family: var(--type);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.widget:nth-child(1) .label {
  transform: rotate(0.5deg);
}

.widget:nth-child(2) .label {
  transform: rotate(-0.5deg);
}

.widget:nth-child(3) .label {
  transform: rotate(0.6deg);
}

.comments-title .label {
  transform: rotate(-0.4deg);
}

.label-banner .label {
  margin: 0 6px;
  transform: rotate(-0.5deg);
}

.post {
  position: relative;
  margin: 0 0 56px;
  overflow: hidden;
  background: linear-gradient(160deg, #e8dbbd 0%, #e0d0ae 46%, #d0bc95 100%);
  color: var(--black);
}

.post::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(/img/papertexture.webp) 30% 40% / cover;
  mix-blend-mode: multiply;
  opacity: 0.4;
  filter: grayscale(1);
  pointer-events: none;
}

.post > * {
  position: relative;
  z-index: 1;
}

.post-link {
  cursor: pointer;
}

.js .fold {
  max-height: 480px;
  overflow: hidden;
}

.folded {
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.page .read-more {
  display: inline-block;
  margin-top: 10px;
  color: var(--brown-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
}

.page .read-more[hidden] {
  display: none;
}

.page .read-more:hover {
  color: var(--black);
}

.tab-row {
  display: flex;
}

.tab-gap {
  flex: 1 1 0;
  background: var(--green);
}

.sheet {
  padding: 30px 40px 26px;
}

@media (max-width: 600px) {
  .sheet {
    padding: 24px 20px 20px;
  }
}

.post-title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 10px 18px 8px;
  color: var(--black);
  font-family: var(--type);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page .post-title a,
.page .post-title a:hover {
  color: var(--black);
}

.post-body {
  font-size: 16px;
  line-height: 1.75;
}

.post-body p,
.post-body .paragraph {
  margin: 0 0 1.1em;
}

.page .post-body a {
  color: var(--black);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.page .post-body a:hover {
  color: var(--brown-deep);
}

.post-body blockquote {
  margin: 1.5em 0;
  padding: 18px 20px;
  background: rgba(245, 237, 219, 0.72);
  color: var(--black);
  font-size: 15px;
  line-height: 1.7;
}

.figure {
  margin: 0;
}

.figure img {
  display: block;
  max-width: 100%;
  height: auto;
}

.caption {
  display: block;
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.gallery .figure {
  display: block;
}

.gallery .figure img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

@media (max-width: 600px) {
  .gallery {
    gap: 10px;
  }
}

.inline-photo {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.4em 0;
}

.inline-photo a {
  display: block;
}

.inline-photo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 75vh;
}

.inline-photo .caption {
  width: 0;
  min-width: 100%;
}

.document {
  max-width: 100%;
  margin: 1.4em 0;
}

.document-frame {
  position: relative;
}

.document-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.document-page img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.document-bar {
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.document-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  text-align: center;
}

.document-count {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.document-arrow {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  background: var(--brown);
  color: var(--black);
  cursor: pointer;
  transition: opacity 160ms ease-out;
}

.document-arrow svg {
  display: block;
}

.document-prev {
  left: 10px;
  transform: translateY(-50%) rotate(-0.8deg);
}

.document-next {
  right: 10px;
  transform: translateY(-50%) scaleX(-1) rotate(-0.6deg);
}

.document-next svg {
  transform: scaleX(-1);
}

.document-arrow:disabled {
  visibility: hidden;
}

@media (hover: hover) {
  .document-arrow {
    opacity: 0;
  }

  .document:hover .document-arrow,
  .document:focus-within .document-arrow {
    opacity: 1;
  }
}

.post-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page .post-footer a {
  color: var(--ink-mid);
}

.page .post-footer a:hover {
  color: var(--brown-deep);
}

.author {
  color: var(--ink-mid);
}

.comments {
  margin: -16px 0 56px;
}

.comments-title {
  margin: 0 0 22px;
  font-size: inherit;
  font-weight: 400;
}

.comment-tree,
.comment-replies {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-replies {
  margin: 14px 0 0 4px;
  padding-left: 20px;
}

.comment {
  margin: 0 0 22px;
}

.comment-replies .comment:last-child {
  margin-bottom: 4px;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  margin-bottom: 6px;
}

.comment-name {
  color: var(--tan);
  font-weight: 700;
}

.comment-author {
  color: var(--brown);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.comment-body {
  margin: 0 0 6px;
  color: var(--tan);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.comment-notice {
  margin: 0;
  color: var(--tan-soft);
  font-size: 14px;
}

.page .comment-notice a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pager > :nth-child(2) {
  text-align: center;
}

.pager > :last-child {
  text-align: right;
}

.label-banner {
  margin: 0 0 30px;
  color: var(--tan);
  font-size: 14px;
}

.not-found {
  padding: 32px 44px;
  background: var(--tan);
  color: var(--black);
  text-align: center;
}

.not-found p {
  margin: 0;
}

.not-found-code {
  margin: 0 0 10px;
  font-family: 'Ziravel', var(--type);
  font-size: 56px;
  line-height: 1;
}

.page .not-found a {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar {
  position: sticky;
  top: 24px;
  flex: 0 0 230px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--tan-faint) transparent;
}

@media (max-width: 800px) {
  .columns {
    flex-direction: column;
    gap: 40px;
  }

  .sidebar {
    position: static;
    flex-basis: auto;
    width: 100%;
    max-height: none;
    overflow: visible;
  }
}

.widget {
  margin-bottom: 34px;
}

.widget-title {
  margin: 0 0 14px;
  font-size: inherit;
  font-weight: 400;
}

.about-name {
  margin: 0 0 6px;
  color: var(--tan);
  font-weight: 700;
}

.about-text {
  margin: 0 0 10px;
  color: var(--tan);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  padding: 3px 0 3px 16px;
  text-indent: -16px;
}

.list li::before {
  content: '› ';
  color: var(--tan-faint);
}

.tree,
.tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree ul {
  padding-left: 16px;
}

.tree li {
  padding: 2px 0;
}

.tree summary {
  color: var(--tan);
  cursor: pointer;
  list-style: none;
}

.tree summary::-webkit-details-marker {
  display: none;
}

.tree summary::before {
  content: '▸';
  display: inline-block;
  width: 16px;
  color: var(--tan-faint);
}

.tree details[open] > summary::before {
  content: '▾';
}

.tree-count {
  color: var(--tan-soft);
}
