:root {
  --bg: #0a0a0a;
  --text: #e8e3da;
  --muted: #9e988f;
  --line: rgba(255, 255, 255, 0.12);
  --link: #f5f0e7;
  --blue-link: #64a8ff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    Georgia, serif;
}

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

.page {
  width: min(42rem, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 5rem;
}

.site-header,
.intro,
.site-header {
  border-top: 0;
  padding: 0.75rem 0 0;
}

.site-header + .intro {
  border-top: 0;
}

.post-date,
.post-link-date-month,
.back-link {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-date,
.post-link-summary,
.post-summary {
  color: var(--muted);
}

.site-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 1;
  object-fit: cover;
  border-radius: 1rem;
}

.post-link-summary,
.post-summary {
  color: var(--muted);
}

.profile-links {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin: 0 0 0.8rem;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  color: #5f5b54;
  border-radius: 999px;
  padding: 0.65rem;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

.profile-link svg {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-link:hover,
.profile-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.profile-link:active {
  opacity: 0.8;
}

.intro,
.post-page {
  padding: 1.5rem 0 0;
}

.intro h1,
.post-page h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-weight: 500;
  line-height: 1;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

.intro p,
.post-page p {
  margin: 1rem 0 0;
  line-height: 1.85;
  font-size: 1.02rem;
}

.post-list {
  margin-top: 0.75rem;
}

.year-marker {
  margin: 1.75rem 0 0.35rem;
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.year-marker:first-child {
  margin-top: 0;
}

.post-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
}

.post-link + .post-link {
  border-top: 1px solid var(--line);
}

.post-link-body {
  display: grid;
  gap: 0.4rem;
}

.post-link-date-badge {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.post-link-date-month {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1;
}

.post-link-date-day {
  color: var(--link);
  font-size: 1rem;
  line-height: 1;
}

.post-link-title {
  font-size: 1.35rem;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
}

.post-link-summary {
  line-height: 1.65;
}

.post-date {
  margin: 1rem 0 0;
}

.post-page .article-nav {
  margin: 0;
}

.post-page .article-nav-top {
  margin-bottom: 1.8rem;
}

.post-page .article-nav-bottom {
  margin-top: 1.5rem;
}

.back-link {
  color: var(--blue-link);
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.back-link-icon {
  display: inline-flex;
  width: 1em;
  height: 1em;
}

.back-link-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.post-body p + p {
  margin-top: 1rem;
}

.post-image {
  margin: 1.75rem 0;
}

.post-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.9rem;
}

.post-divider {
  margin: 2rem 0 0.75rem;
  border: 0;
  border-top: 1px solid var(--line);
}

.ani-canvas-widget {
  width: 100%;
  margin: 1.85rem 0;
  overflow: hidden;
  border-radius: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--line);
}

.ani-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}

.ani-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.35;
}

.ani-spacer {
  flex: 1;
}

.ani-toggle {
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.45rem;
  background: transparent;
  color: var(--blue-link);
  font: inherit;
  cursor: pointer;
  outline: 0;
  text-transform: lowercase;
}

.ani-toggle:hover,
.ani-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

.ani-toggle:focus-visible {
  box-shadow: 0 0 0 1px var(--line);
}

.ani-workspace {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.ani-canvas-widget[data-code-open="true"] .ani-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ani-preview {
  min-width: 0;
  width: 100%;
  aspect-ratio: var(--ani-ratio, 1 / 1);
  background: #090909;
}

.ani-canvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--ani-ratio, 1 / 1);
}

.ani-editor-panel {
  min-width: 0;
  background: #080808;
  border-left: 1px solid var(--line);
}

.ani-editor {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 16rem;
  padding: 0.75rem;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--muted);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.5;
}

.ani-source {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.post-body a {
  color: var(--blue-link);
  text-decoration: underline;
  text-decoration-color: rgba(100, 168, 255, 0.45);
  text-underline-offset: 0.18em;
}

.post-body a:hover,
.post-body a:focus-visible {
  text-decoration-color: currentColor;
}

.post-body h2 {
  margin: 2rem 0 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
}

.post-body h2 + p {
  margin-top: 0.65rem;
}

@media (max-width: 720px) {
  .page {
    width: min(42rem, calc(100vw - 1.25rem));
    padding-top: 1.5rem;
  }

  .page:has(.site-header) {
    width: 100%;
    padding-top: 0;
  }

  .page:has(.site-header) .site-header {
    padding-top: 0;
  }

  .page:has(.site-header) .site-banner {
    border-radius: 0;
  }

  .page:has(.site-header) .intro,
  .page:has(.site-header) .post-list {
    width: min(42rem, calc(100vw - 1.25rem));
    margin-left: auto;
    margin-right: auto;
  }

  .post-link {
    gap: 0.85rem;
  }

  .post-link-date-badge {
    width: 3rem;
    height: 3rem;
  }

  .ani-canvas-widget[data-code-open="true"] .ani-workspace {
    grid-template-columns: 1fr;
  }

  .ani-editor-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
