:root {
  --paper: #fbfaf6;
  --paper-soft: #f4f1e8;
  --ink: #181818;
  --ink-soft: #59574f;
  --line: #dfddd5;
  --accent: #304646;
  --radius: 12px;
  --max-width: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-size: 1.06rem;
  background: #ffffff;
  font-family: "Baskervville", "Baskerville", "Baskerville Old Face", "Iowan Old Style", "Times New Roman", serif;
  font-optical-sizing: auto;
  line-height: 1.72;
}

a {
  color: inherit;
}

.site-shell {
  width: min(var(--max-width), calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  margin-bottom: 2.2rem;
  text-align: center;
}

.site-title {
  text-decoration: none;
  font-size: clamp(1.5rem, 3.3vw, 2.2rem);
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.site-subtitle {
  margin: 0.22rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.intro {
  margin-bottom: 2rem;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.24;
  margin: 0 0 0.7rem;
}

h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
}

.story-section {
  margin-bottom: 2.2rem;
}

.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.4rem;
  row-gap: 0.9rem;
}

.story-item {
  position: relative;
  padding: 1rem 0.9rem 0.95rem;
  border: 1px solid var(--line);
  background: #ffffff;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.story-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 180ms ease;
}

.story-item:hover,
.story-item:focus-within {
  background: #f9f7f1;
  border-color: #ccc9bc;
  transform: translateY(-1px);
}

.story-item:hover::before,
.story-item:focus-within::before {
  opacity: 0.55;
}

.story-item p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.story-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.story-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.back-link {
  color: var(--accent);
  text-underline-offset: 3px;
}

.posting-note {
  border-top: 1px solid var(--line);
  padding-top: 1.3rem;
}

code {
  font-family: "Courier New", Courier, monospace;
  background: #f1efe8;
  padding: 0.12rem 0.32rem;
  border-radius: 4px;
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.story-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.story-page h1 {
  margin-top: 0.7rem;
}

.story-body {
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}

.story-body p {
  margin: 0;
  text-indent: 1.6rem;
  text-align: left;
}

.story-body p:first-of-type {
  text-indent: 0;
}

.story-body p:first-of-type::first-letter {
  float: left;
  font-size: 3.2em;
  line-height: 0.86;
  padding-right: 0.08em;
  padding-top: 0.04em;
}

.story-body h1 {
  margin: 1.9rem 0 4.6rem;
  text-align: center;
  font-size: clamp(0.98rem, 1.9vw, 1.2rem);
  font-variant: small-caps;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.story-body h2,
.story-body h3,
.story-body h4,
.story-body h5,
.story-body h6 {
  margin: 1.4rem 0 0.7rem;
}

.story-body ul,
.story-body ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.story-body li {
  margin-bottom: 0.35rem;
}

.story-body a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.story-body blockquote {
  margin: 0 0 1rem;
  padding: 0.15rem 0 0.15rem 0.9rem;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
}

.story-body pre {
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  background: #f4f1e8;
  border-radius: 8px;
  overflow-x: auto;
}

.story-body code {
  background: #f4f1e8;
}

.story-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.3rem 0;
}

.story-nav {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.story-nav-single {
  justify-content: center;
}

.fade-in {
  animation: rise-in 700ms ease both;
}

.delay-1,
.delay-2,
.delay-3 {
  opacity: 0;
  animation: rise-in 700ms ease forwards;
}

.delay-1 {
  animation-delay: 120ms;
}

.delay-2 {
  animation-delay: 220ms;
}

.delay-3 {
  animation-delay: 320ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  body {
    line-height: 1.62;
  }

  .site-shell {
    width: min(var(--max-width), calc(100% - 1.8rem));
    padding: 1.6rem 0 2rem;
  }

  .site-header {
    margin-bottom: 1.9rem;
  }

  .story-section {
    margin-bottom: 2rem;
  }

  .story-list {
    grid-template-columns: 1fr;
    row-gap: 0.55rem;
  }

  .story-item {
    padding: 0.82rem 0.65rem 0.75rem;
  }

  .story-body p {
    margin: 0;
  }

  .story-body h1 {
    margin: 1.35rem 0 3.35rem;
  }

  .story-nav {
    margin-top: 1.8rem;
    padding-top: 0.8rem;
    flex-direction: column;
  }
}
