:root {
  --bg: #ffffff;
  --text: #141414;
  --muted: #7a7a7a;
  --soft: #a0a0a0;
  --line: rgba(20, 20, 20, 0.08);
  --sans: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background: var(--bg);
}

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

.nowrap-link {
  white-space: nowrap;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.page-shell {
  width: min(1140px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0;
}

.home-layout,
.post-page {
  background: var(--bg);
  min-height: calc(100vh - 7rem);
  padding: clamp(1.25rem, 4vw, 3rem);
}

.home-layout {
  display: grid;
  gap: 30px;
  align-content: start;
  align-items: start;
}

.intro-block {
  display: grid;
  gap: calc(0.703rem + 20px);
  max-width: 820px;
  align-content: start;
  animation: fade-up 400ms ease both;
}

.site-name {
  font-size: clamp(2rem, 3vw, 2.4rem);
}

.intro-copy {
  display: grid;
  gap: calc(0.415rem + 5px);
  max-width: 780px;
}

.intro-copy p {
  font-size: clamp(1.05rem, 2vw, 1.12rem);
  line-height: 1.36;
}

.intro-copy strong {
  color: var(--text);
  font-weight: 600;
}

.writing-list {
  display: grid;
  gap: calc(1.099rem + 15px);
  max-width: 620px;
  align-content: start;
  justify-items: start;
  animation: fade-up 520ms ease both;
}

.writing-heading {
  margin-top: 30px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.writing-item {
  display: grid;
  gap: 0;
  align-content: start;
  margin-bottom: 0;
}

.writing-item h2 {
  font-size: clamp(1.05rem, 2vw, 1.12rem);
  font-weight: 400;
  line-height: 1.36;
  letter-spacing: normal;
  color: var(--muted);
}

.writing-item .post-meta {
  margin-top: 0.5rem;
}

.writing-item a:hover,
.writing-item a:focus-visible,
.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.post-meta {
  margin-top: 0;
  font-size: 0.82rem;
  line-height: 1.05;
  color: var(--soft);
}

.post-page {
  width: min(920px, calc(100% - 2rem));
  animation: fade-up 400ms ease both;
  overflow-x: hidden;
}

.back-link {
  display: inline-flex;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  color: var(--soft);
}

.post-footer-link {
  margin-top: 2rem;
  margin-bottom: 0;
}

.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-top: 0.4rem;
  max-width: 12ch;
  font-size: clamp(2.1rem, 5vw, 3.5rem);
}

.post-body {
  display: grid;
  gap: 1.25rem;
  max-width: 740px;
  min-width: 0;
}

.post-body h2 {
  margin-top: 1.2rem;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.post-body h3,
.post-body h4 {
  margin-top: 1rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.post-body h3 {
  font-size: 1.15rem;
}

.post-body h4 {
  font-size: 1.02rem;
}

.post-body p,
.post-body blockquote {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #4f4f4f;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-body ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #4f4f4f;
  display: grid;
  gap: 0.65rem;
}

.post-body ol {
  margin: 0;
  padding-left: 1.35rem;
  color: #4f4f4f;
  display: grid;
  gap: 0.65rem;
}

.post-body li {
  padding-left: 0.1rem;
  font-size: 1.02rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-body li strong {
  font-size: 0.94em;
  font-weight: 600;
}

.post-body p strong {
  font-size: 0.94em;
  font-weight: 600;
}

.post-body blockquote {
  margin: 0.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100%, calc(100% - 1rem));
    padding: 3rem 0;
  }

  .home-layout,
  .post-page {
    min-height: auto;
    padding: 1.25rem 1.2rem 2.25rem;
  }

  .intro-block {
    gap: calc(0.989rem + 20px);
  }

  .intro-copy {
    gap: calc(0.588rem + 5px);
  }

  .intro-copy p {
    line-height: 1.43;
  }

  .writing-list {
    gap: calc(0.835rem + 15px);
  }

  .writing-item {
    margin-bottom: 0;
  }

  .writing-item h2 {
    font-size: clamp(1.05rem, 2vw, 1.12rem);
    line-height: 1.43;
  }

  .writing-item .post-meta {
    margin-top: 0.3rem;
  }

  .writing-item h2,
  .post-header h1 {
    max-width: none;
  }

  .post-body p,
  .post-body blockquote,
  .post-body li {
    font-size: 1rem;
    line-height: 1.55;
  }

  .post-body ul,
  .post-body ol {
    padding-left: 1.1rem;
  }
}
