:root {
  --paper: #eef3f8;
  --paper-dark: #e2eaf4;
  --ink: #042955;
  --ink-soft: #04376c;
  --line: #7d97b8;
  --accent: #04376c;
  --shadow: 0 10px 26px rgba(4, 41, 85, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.6;
  background:
    radial-gradient(
      circle at 20% 15%,
      rgba(255, 255, 255, 0.48),
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 85%,
      rgba(255, 255, 255, 0.34),
      transparent 26%
    ),
    linear-gradient(120deg, #6f88a7, #9ab0cb 45%, #6a85a8);
  padding: 2rem 1rem;
}

body.home-page {
  padding: 0;
}

.paper-frame {
  width: min(860px, 96vw);
  margin: 0 auto;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent 140px),
    repeating-linear-gradient(
      to bottom,
      rgba(4, 55, 108, 0.04),
      rgba(4, 55, 108, 0.04) 1px,
      transparent 1px,
      transparent 32px
    ),
    var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.home-frame {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.paper-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 1px 1px,
    rgba(4, 41, 85, 0.08) 1px,
    transparent 1px
  );
  background-size: 4px 4px;
  opacity: 0.18;
}

.site-header,
.site-footer,
main {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.75rem;
}

.wordmark {
  color: var(--ink);
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.wordmark img {
  display: block;
  height: 26px;
  width: auto;
}

.main-nav {
  display: flex;
  gap: 0.9rem;
}

.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.9rem;
  text-transform: lowercase;
}

.main-nav a[aria-current="page"],
.main-nav a:hover {
  color: var(--accent);
}

.hero {
  padding: 2rem 0 1.2rem;
  animation: fade-up 420ms ease-out both;
}

.logo-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 1.5rem 0;
}

.home-intro {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  align-content: center;
  min-height: 100%;
  padding: 1.2rem 0;
}

.home-intro .lead {
  max-width: 64ch;
}

.home-intro .lead + .lead {
  margin-top: 0.25rem;
}

.blog-stage {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.article-stage {
  display: grid;
  place-items: start center;
}

.home-logo {
  width: min(92vw, 1400px);
  max-height: calc(100vh - 170px);
  height: auto;
  object-fit: contain;
  display: block;
}

.hero.compact {
  padding-bottom: 0.6rem;
}

.kicker {
  margin: 0;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0.2rem 0 0.7rem;
}

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

h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
}

h3 {
  font-size: 1.2rem;
}

.lead {
  max-width: 56ch;
  margin: 0;
  color: var(--ink-soft);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.text-link {
  color: var(--accent);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.86rem;
}

.card {
  background: linear-gradient(to bottom, var(--paper), var(--paper-dark));
  border: 1px solid var(--line);
  padding: 1rem;
  margin-top: 0.9rem;
}

.template-callout {
  margin-bottom: 1.1rem;
}

.article-sheet {
  width: min(760px, 100%);
}

.article-sheet h2 {
  margin-top: 1.4rem;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-mark {
  width: 68px;
  height: 68px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  letter-spacing: 0.06em;
  font-size: 1.15rem;
  color: var(--ink);
  background: linear-gradient(to bottom, #f7f7f6, #dfdfde);
  flex-shrink: 0;
}

.logo-text {
  margin: 0;
}

.post-preview,
.post-item {
  animation: fade-up 500ms ease-out both;
}

.post-link {
  display: block;
  text-decoration: none;
}

.post-item {
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.post-item:hover,
.post-item:focus-within {
  border-color: var(--ink-soft);
  box-shadow: 0 10px 24px rgba(4, 41, 85, 0.12);
  transform: translateY(-1px);
}

.post-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.post-preview:nth-of-type(2),
.post-item:nth-of-type(2) {
  animation-delay: 80ms;
}

.post-preview:nth-of-type(3),
.post-item:nth-of-type(3) {
  animation-delay: 160ms;
}

.meta {
  margin: 0;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.78rem;
}

p {
  margin: 0.5rem 0;
}

a {
  color: inherit;
}

.site-footer {
  border-top: 1px dashed var(--line);
  margin-top: 1.5rem;
  padding-top: 0.8rem;
  color: var(--ink-soft);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 0.8rem;
}

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

@media (max-width: 640px) {
  body {
    padding: 0.8rem;
  }

  .paper-frame {
    padding: 0.9rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo-lockup {
    align-items: flex-start;
  }

  .home-logo {
    width: 94vw;
    max-height: calc(100vh - 190px);
  }
}
