:root {
  color-scheme: only light;
  --paper: #fffcf0;
  --paper-soft: #f2f0e5;
  --paper-deep: #e6e4d9;
  --ink: #100f0f;
  --ink-soft: #403e3c;
  --ink-muted: #6f6e69;
  --line: #d5d0bf;
  --red: #d14d41;
  --red-dark: #af3029;
  --orange: #da702c;
  --yellow: #d0a215;
  --green: #66800b;
  --cyan: #24837b;
  --blue: #205ea6;
  --purple: #5e409d;
  --code-bg: #100f0f;
  --code-text: #f2f0e5;
  --font-hand:
    "Hannotate SC",
    "HannotateSC-W5",
    "手札体-简",
    "HanziPen SC",
    cursive;
  --font-mono:
    "ComicShannsMono Nerd Font",
    "ComicShannsMono Nerd Font Mono",
    "ComicShannsMono NF",
    "Hannotate SC",
    "HannotateSC-W5",
    "手札体-简",
    "HanziPen SC",
    ui-monospace,
    "SFMono-Regular",
    Menlo,
    Consolas,
    monospace;
  --wide: 1120px;
  --reading: 720px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 3px;
  --ease: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  font-family: var(--font-hand);
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(209, 77, 65, 0.035), transparent 22rem),
    radial-gradient(circle at 88% 66%, rgba(36, 131, 123, 0.035), transparent 26rem);
  content: "";
  pointer-events: none;
}

::selection {
  color: var(--ink);
  background: #f9d9a7;
}

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

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.container-wide {
  width: min(100%, calc(var(--wide) + (var(--gutter) * 2)));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container {
  width: min(100%, calc(var(--reading) + (var(--gutter) * 2)));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.main {
  min-height: calc(100vh - 180px);
}

.progress-bar {
  position: fixed;
  z-index: 300;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--red);
  transition: width 80ms linear;
}

/* Navigation */
.navbar {
  position: sticky;
  z-index: 200;
  top: 0;
  border-bottom: 1px solid transparent;
  background: rgba(255, 252, 240, 0.94);
  transition:
    border-color var(--ease),
    box-shadow var(--ease);
  backdrop-filter: blur(14px);
}

.navbar.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 5px 20px rgba(16, 15, 15, 0.035);
}

.navbar-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.8rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  transition: transform var(--ease);
}

.logo:hover .logo-mark {
  transform: rotate(-5deg) translateY(-1px);
}

.logo-copy {
  display: grid;
  gap: 0.28rem;
  line-height: 0.9;
}

.logo-copy strong {
  font-family: var(--font-hand);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.logo-copy small {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition:
    color var(--ease),
    transform var(--ease);
}

.nav-links a::after {
  position: absolute;
  right: 0.7rem;
  bottom: 0.25rem;
  left: 0.7rem;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--red);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 1.5px;
  background: var(--ink);
}

/* Shared type and controls */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.eyebrow > span {
  width: 2rem;
  height: 1px;
  flex: 0 0 auto;
  background: currentColor;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.65rem 1.05rem;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  transition:
    color var(--ease),
    background var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}

.button span {
  font-size: 1rem;
  transition: transform var(--ease);
}

.button:hover {
  transform: translate(-2px, -2px);
}

.button:hover span {
  transform: translate(2px, -2px);
}

.button-primary {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--red);
}

.button-primary:hover {
  color: var(--paper);
  background: var(--red);
  box-shadow: 6px 6px 0 var(--ink);
}

.button-quiet {
  border-color: transparent;
}

.button-quiet:hover {
  color: var(--red);
  background: var(--paper-soft);
}

/* Home hero */
.home-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.home-hero::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - (var(--wide) / 2));
  width: 1px;
  background: var(--line);
  content: "";
  opacity: 0.55;
}

.hero-grid {
  display: grid;
  min-height: min(720px, calc(100vh - 82px));
  align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.75fr);
  gap: clamp(4rem, 8vw, 8rem);
  padding-block: clamp(4rem, 8vw, 7rem);
}

.hero-copy {
  position: relative;
}

.hero-copy h1 {
  max-width: 6em;
  margin-top: 1.5rem;
  font-family: var(--font-hand);
  font-size: clamp(5rem, 10vw, 8.7rem);
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 0.86;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy h1 span:last-child {
  margin-left: 0.55em;
  color: var(--red);
}

.hero-lede {
  max-width: 27rem;
  margin: 2rem 0 0 0.2rem;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  letter-spacing: 0.03em;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.2rem;
}

.hero-index {
  position: relative;
  display: flex;
  min-height: 420px;
  padding: 1.25rem 1.4rem 1.4rem;
  border: 1px solid var(--ink);
  background: rgba(255, 252, 240, 0.78);
  box-shadow: 9px 9px 0 var(--paper-deep);
  flex-direction: column;
  transform: rotate(0.8deg);
}

.hero-index::before {
  position: absolute;
  z-index: 1;
  top: -9px;
  left: 50%;
  width: 92px;
  height: 20px;
  background: rgba(218, 112, 44, 0.2);
  content: "";
  transform: translateX(-50%) rotate(-2deg);
}

.hero-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.writing-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--cyan);
}

.writing-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(36, 131, 123, 0.12);
}

.hero-stats {
  display: grid;
  margin-top: 0.15rem;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.hero-stats > div {
  padding: 1.1rem 1rem;
  background: rgba(242, 240, 229, 0.72);
}

.hero-stats > div + div {
  padding-left: 1rem;
}

.hero-stats dt {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 5vw, 3.15rem);
  line-height: 1;
}

.hero-stats > div:first-child dt {
  color: var(--red);
}

.hero-stats > div:last-child dt {
  color: var(--cyan);
}

.hero-stats dd {
  margin-top: 0.45rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.latest-note {
  position: relative;
  z-index: 1;
  display: grid;
  margin-top: 0.8rem;
  padding: 1rem 1.05rem;
  border-left: 3px solid var(--red);
  background: rgba(242, 240, 229, 0.78);
  gap: 0.7rem;
}

.latest-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.latest-note-head span,
.latest-note-head time,
.latest-note-meta {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.latest-note a {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  line-height: 1.4;
  transition:
    color var(--ease),
    transform var(--ease);
}

.latest-note a > span:first-child {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.latest-note a:hover {
  color: var(--red);
  transform: translateX(2px);
}

.latest-note-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: background var(--ease);
}

.latest-note a:hover .latest-note-arrow {
  background: var(--red);
}

.latest-note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--red);
}

.wind-sketch {
  position: absolute;
  z-index: 0;
  right: -0.8rem;
  bottom: -1.3rem;
  width: 56%;
  color: var(--red);
  opacity: 0.14;
  pointer-events: none;
}

.wind-sketch path,
.about-principle path,
.error-wind path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

/* Topic strip */
.topic-strip {
  border-bottom: 1px solid var(--line);
}

.topic-strip .container-wide {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.topic-strip-label {
  flex: 0 0 auto;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.topic-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}

.topic-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  transition: color var(--ease);
}

.topic-links a:hover {
  color: var(--red);
}

.topic-links small {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

/* Home sections */
.home-section {
  padding-top: clamp(4.5rem, 9vw, 7.5rem);
}

.latest-section {
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-heading p {
  margin-bottom: 0.35rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}

.section-heading > span {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.1rem, 2.5vw, 2rem);
}

.featured-card {
  position: relative;
  display: grid;
  min-height: 315px;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--ink);
  overflow: hidden;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 1rem;
  transition:
    box-shadow var(--ease),
    transform var(--ease);
}

.featured-card:first-child {
  color: var(--paper);
  background: var(--red);
  box-shadow: 7px 7px 0 var(--ink);
}

.featured-card:nth-child(2) {
  color: var(--paper);
  background: var(--cyan);
  box-shadow: 7px 7px 0 var(--ink);
}

.featured-card::after {
  position: absolute;
  right: -3rem;
  bottom: -4rem;
  width: 12rem;
  height: 12rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.18;
}

.featured-card:hover {
  box-shadow: 11px 11px 0 var(--ink);
  transform: translate(-4px, -4px);
}

.featured-number {
  padding-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  opacity: 0.72;
}

.featured-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  opacity: 0.78;
}

.featured-content h3 {
  margin-top: auto;
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  line-height: 1.25;
}

.featured-content p {
  display: -webkit-box;
  margin-top: 0.75rem;
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1.55;
  opacity: 0.82;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured-arrow {
  position: absolute;
  z-index: 2;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  transition: transform var(--ease);
}

.featured-card:hover .featured-arrow {
  transform: translate(4px, -4px);
}

/* Article rows */
.post-rows {
  border-top: 1px solid var(--ink);
}

.post-row {
  position: relative;
  display: grid;
  min-height: 176px;
  align-items: start;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 4.5rem minmax(0, 1fr) 3rem;
  gap: 1rem;
  transition:
    background var(--ease),
    padding var(--ease);
}

.post-row::before {
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--gutter));
  background: var(--paper-soft);
  content: "";
  opacity: 0;
  transition: opacity var(--ease);
}

.post-row:hover::before {
  opacity: 1;
}

.post-row-link {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.post-row-index {
  padding-top: 0.2rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.post-row-body {
  min-width: 0;
}

.post-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.post-row h3 {
  max-width: 48rem;
  margin-top: 0.55rem;
  font-size: clamp(1.3rem, 2.3vw, 1.72rem);
  line-height: 1.3;
  transition: color var(--ease);
}

.post-row h3 a {
  position: relative;
  z-index: 2;
}

.post-row:hover h3 {
  color: var(--red);
}

.post-row p {
  display: -webkit-box;
  max-width: 46rem;
  margin-top: 0.45rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-row-arrow {
  align-self: center;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  transition:
    color var(--ease),
    transform var(--ease);
}

.post-row:hover .post-row-arrow {
  color: var(--red);
  transform: translate(4px, -4px);
}

.section-end {
  display: flex;
  justify-content: flex-end;
  padding-top: 1.5rem;
}

.section-end a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition: color var(--ease);
}

.section-end a:hover {
  color: var(--red);
}

/* Category archive */
.listing-hero {
  padding-top: clamp(4.5rem, 9vw, 7.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  border-bottom: 1px solid var(--line);
}

.listing-title {
  display: grid;
  align-items: end;
  margin-top: 1.8rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.65fr);
  gap: 3rem;
}

.listing-title h1 {
  font-size: clamp(4.2rem, 9vw, 7.5rem);
  letter-spacing: -0.08em;
  line-height: 0.88;
}

.listing-title p {
  max-width: 23rem;
  padding-bottom: 0.5rem;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.category-index {
  display: grid;
  padding-block: clamp(3rem, 6vw, 5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1rem;
}

.category-index-card {
  position: relative;
  display: grid;
  min-height: 170px;
  padding: 1.2rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  transition:
    color var(--ease),
    background var(--ease),
    box-shadow var(--ease),
    transform var(--ease);
}

.category-index-card > span,
.category-index-card small {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.category-index-card strong {
  align-self: end;
  font-size: 1.5rem;
}

.category-index-card small {
  margin-top: 0.1rem;
}

.category-index-card i {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-style: normal;
}

.category-index-card:hover {
  color: var(--paper);
  background: var(--red);
  box-shadow: 6px 6px 0 var(--ink);
  transform: translate(-3px, -3px);
}

.category-index-card:hover > span,
.category-index-card:hover small {
  color: inherit;
  opacity: 0.75;
}

.category-sections {
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.category-section {
  padding-top: 6rem;
}

.category-section:first-child {
  padding-top: 1rem;
}

.category-header {
  display: grid;
  align-items: end;
  margin-bottom: 1.5rem;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 1rem;
}

.category-number,
.category-count,
.category-header p {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.category-header h2 {
  margin-top: 0.15rem;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1;
}

/* Works */
.works-hero {
  display: grid;
  align-items: end;
  padding-top: clamp(4.5rem, 9vw, 7.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.55fr);
  gap: clamp(3rem, 8vw, 7rem);
}

.works-hero-copy h1 {
  margin-top: 1.6rem;
  font-size: clamp(4.3rem, 9vw, 7.7rem);
  letter-spacing: -0.08em;
  line-height: 0.88;
}

.works-hero-copy em {
  color: var(--red);
  font-style: normal;
}

.works-hero-note {
  max-width: 340px;
  padding: 1.25rem 1.35rem;
  background: var(--paper-soft);
  box-shadow: 6px 6px 0 var(--paper-deep);
}

.works-hero-note span,
.work-card-head,
.work-brand p,
.work-highlights > p,
.work-stack > p {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.works-hero-note span {
  color: var(--red);
}

.works-hero-note p {
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.7;
}

.works-list {
  display: grid;
  padding-bottom: clamp(4.5rem, 9vw, 7rem);
  gap: clamp(4rem, 8vw, 7rem);
}

.work-card {
  --work-accent: var(--red);
  padding: 1rem;
  border: 1px solid var(--ink);
  background: var(--paper-soft);
  box-shadow: 10px 10px 0 var(--paper-deep);
}

.work-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.15rem 1rem;
  color: var(--ink-muted);
}

.work-status {
  display: inline-flex;
  align-items: center;
  color: var(--cyan);
  gap: 0.45rem;
}

.work-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: work-status-pulse 2.4s ease-in-out infinite;
  box-shadow: 0 0 0 5px rgba(36, 131, 123, 0.1);
}

.work-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.work-preview {
  position: relative;
  width: 100%;
  align-self: start;
  overflow: hidden;
  color: #f7f7f4;
  background: #ece7de;
}

.work-preview::after {
  position: absolute;
  z-index: 1;
  top: 32px;
  bottom: 3rem;
  left: -48%;
  width: 34%;
  background: linear-gradient(
    108deg,
    transparent,
    rgba(255, 252, 240, 0.32),
    transparent
  );
  content: "";
  pointer-events: none;
  transform: skewX(-14deg);
  animation: work-preview-sweep 5.8s 1.1s ease-in-out infinite;
}

.work-window-bar {
  position: relative;
  z-index: 2;
  display: flex;
  height: 32px;
  align-items: center;
  padding-inline: 0.75rem;
  background: #252622;
  gap: 0.4rem;
}

.work-window-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #83857d;
}

.work-window-bar i:first-child {
  background: var(--work-accent);
}

.work-preview img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 500ms var(--ease);
}

.work-preview-link {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: flex-end;
  padding: 0.55rem 1rem;
  color: #f7f7f4;
  background: #252622;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  transition:
    color var(--ease),
    background var(--ease),
    transform var(--ease);
}

.work-preview:hover img {
  filter: saturate(1.06) contrast(1.015);
}

.work-preview:hover .work-preview-link {
  color: #252622;
  background: var(--work-accent);
  transform: translate(-2px, -2px);
}

.work-copy {
  display: grid;
  padding: clamp(1.7rem, 4vw, 3rem);
  background: var(--paper);
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 6vw, 5rem);
}

.work-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.work-mark {
  width: 54px;
  height: 54px;
  transform-origin: 50% 75%;
  animation: work-mark-float 4.2s ease-in-out infinite;
}

.work-brand p {
  color: var(--ink-muted);
}

.work-brand h2 {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.work-tagline {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-left: calc(54px + 1rem);
  color: var(--work-accent);
  font-size: var(--work-tagline-size, clamp(1.5rem, 3vw, 2rem));
  font-weight: 700;
  line-height: 1.3;
}

.work-summary {
  max-width: 42rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.75;
}

.work-facts {
  display: grid;
  margin-top: 2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.work-facts > div {
  padding: 0.75rem;
  background: var(--paper-soft);
}

.work-facts dt,
.work-facts dd {
  font-family: var(--font-mono);
}

.work-facts dt {
  color: var(--ink-muted);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
}

.work-facts dd {
  margin-top: 0.25rem;
  font-size: 0.74rem;
}

.work-cta {
  align-self: flex-start;
  margin-top: 2rem;
}

.work-card-foot {
  display: grid;
  padding: 1.5rem 0.35rem 0.4rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.6fr);
  gap: clamp(2rem, 6vw, 5rem);
}

.work-highlights > p,
.work-stack > p {
  color: var(--red);
}

.work-highlights ul {
  display: grid;
  margin-top: 1rem;
  list-style: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem 1rem;
}

.work-highlights li {
  display: grid;
  align-items: baseline;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 252, 240, 0.72);
  font-size: 0.88rem;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.35rem;
}

.work-highlights li span {
  color: var(--work-accent);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.work-stack ul {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1rem;
  list-style: none;
  gap: 0.5rem;
}

.work-stack li {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.works-next {
  display: grid;
  align-items: center;
  margin-bottom: clamp(5rem, 10vw, 8rem);
  padding: clamp(1.7rem, 4vw, 2.5rem);
  color: var(--paper);
  background: var(--ink);
  box-shadow: 8px 8px 0 var(--red);
  grid-template-columns: minmax(180px, 0.5fr) minmax(0, 1.5fr);
  gap: 2rem;
}

.works-next > span {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.works-next h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
}

.works-next p {
  margin-top: 0.4rem;
  color: var(--paper-deep);
  font-size: 0.92rem;
}

/* Standard page */
.page-shell {
  padding-top: clamp(4rem, 8vw, 6.5rem);
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.page-header {
  max-width: var(--reading);
  margin-inline: auto;
  margin-bottom: 3rem;
}

.page-header h1 {
  margin-top: 1rem;
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.page-content {
  margin-inline: auto;
}

/* About */
.about-intro {
  display: grid;
  align-items: center;
  padding-bottom: clamp(4rem, 8vw, 7rem);
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.2fr);
  gap: clamp(3rem, 8vw, 7rem);
}

.about-portrait {
  position: relative;
  max-width: 370px;
  padding: 0 0 2rem 1.5rem;
}

.about-portrait::before {
  position: absolute;
  top: 1.6rem;
  right: -1.2rem;
  bottom: 0;
  left: 0;
  border: 1px solid var(--ink);
  content: "";
}

.about-portrait-frame {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-deep);
  filter: saturate(0.78) contrast(1.02);
}

.about-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-portrait > span {
  position: absolute;
  z-index: 2;
  right: -2rem;
  bottom: 1.2rem;
  padding: 0.45rem 0.7rem;
  color: var(--paper);
  background: var(--red);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  transform: rotate(-3deg);
}

.about-copy h1 {
  margin-top: 1.4rem;
  font-size: clamp(3.5rem, 7vw, 6.3rem);
  letter-spacing: -0.07em;
  line-height: 0.92;
}

.about-lede {
  max-width: 35rem;
  margin-top: 2rem;
  font-size: 1.28rem;
  line-height: 1.65;
}

.about-copy > p:last-child {
  max-width: 35rem;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.about-grid {
  display: grid;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-card {
  position: relative;
  min-height: 340px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.about-card-number {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.about-card-label {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.about-card h2 {
  max-width: 18rem;
  margin-top: 0.7rem;
  font-size: 1.8rem;
  line-height: 1.2;
}

.about-principle {
  color: var(--paper);
  background: var(--cyan);
}

.about-principle .about-card-label,
.about-principle .about-card-number {
  color: inherit;
  opacity: 0.75;
}

.about-principle blockquote {
  position: relative;
  z-index: 1;
  margin-top: 3.5rem;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.25;
}

.about-principle svg {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 55%;
  color: var(--paper);
  opacity: 0.28;
}

.tech-stack {
  display: flex;
  align-content: end;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 4.2rem;
}

.tech-stack span {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition:
    color var(--ease),
    border-color var(--ease),
    transform var(--ease);
}

.tech-stack span:hover {
  color: var(--red);
  border-color: var(--red);
  transform: rotate(-2deg);
}

.about-timeline ol {
  margin-top: 3rem;
  list-style: none;
}

.about-timeline li {
  display: grid;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
}

.about-timeline time {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.about-timeline strong {
  font-size: 0.98rem;
  font-weight: 500;
}

.about-connect > p:not(.about-card-label) {
  max-width: 22rem;
  margin-top: 2.5rem;
  color: var(--ink-soft);
}

.connect-links {
  display: flex;
  margin-top: 2rem;
  gap: 0.75rem;
}

.connect-links a {
  display: flex;
  min-width: 120px;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition:
    color var(--ease),
    border-color var(--ease);
}

.connect-links a:hover {
  color: var(--red);
  border-color: var(--red);
}

.github-strip {
  display: grid;
  align-items: center;
  margin-top: 3.5rem;
  padding: 2rem;
  border: 1px solid var(--ink);
  grid-template-columns: 0.6fr 1.4fr;
  gap: 2rem;
}

.github-strip h2 {
  margin-top: 0.5rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.github-strip img {
  width: 100%;
  filter: sepia(0.12) saturate(0.8);
}

/* Post layout */
.post-shell {
  padding-top: 1.2rem;
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.post-topline {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.post-topline > a,
.post-topline div {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.post-topline a {
  transition: color var(--ease);
}

.post-topline a:hover {
  color: var(--red);
}

.post {
  max-width: var(--reading);
  margin-inline: auto;
}

.post-header {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: 1.9rem;
}

.post-title {
  margin-top: 0.85rem;
  font-size: clamp(2.35rem, 4.6vw, 3.8rem);
  letter-spacing: -0.045em;
  line-height: 1.09;
  text-wrap: balance;
}

.post-deck {
  max-width: 42rem;
  margin-top: 0.95rem;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.45rem;
  padding: 0.8rem 0.9rem;
  background: rgba(242, 240, 229, 0.72);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-author img {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  object-fit: cover;
  filter: saturate(0.76);
}

.post-author > span {
  display: grid;
  gap: 0.05rem;
}

.post-author small,
.post-facts,
.post-tag-list {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.06em;
}

.post-author strong {
  font-size: 0.94rem;
  font-weight: 500;
}

.post-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem 1rem;
}

.post-facts > span + span::before {
  margin-right: 1rem;
  color: var(--line);
  content: "/";
}

.post-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-top: 0.65rem;
  color: var(--red);
}

/* Long-form typography */
.post-content {
  max-width: var(--reading);
  margin-inline: auto;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.72;
  overflow-wrap: break-word;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content > :last-child {
  margin-bottom: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.page-content > h1,
.page-content > h2,
.page-content > h3,
.page-content > h4 {
  color: var(--ink);
  font-family: var(--font-hand);
  font-weight: 700;
  line-height: 1.3;
}

.post-content h1,
.page-content > h1 {
  margin: 2.4rem 0 0.85rem;
  font-size: 1.8rem;
}

.post-content h2,
.page-content > h2 {
  position: relative;
  margin: 2.6rem 0 0.75rem;
  padding-left: 0.9rem;
  font-size: clamp(1.45rem, 2.8vw, 1.75rem);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.post-content h2::before,
.page-content > h2::before {
  position: absolute;
  top: 0.18em;
  left: 0;
  width: 3px;
  height: 1em;
  border-radius: 999px;
  background: var(--red);
  content: "";
}

.post-content h3,
.page-content > h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.22rem;
}

.post-content h4,
.page-content > h4 {
  margin: 1.7rem 0 0.55rem;
  font-size: 1.08rem;
}

.post-content p,
.page-content > p {
  margin-bottom: 0.9rem;
}

.post-content a,
.page-content > p a {
  color: var(--blue);
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition:
    color var(--ease),
    background-size var(--ease);
}

.post-content a:hover,
.page-content > p a:hover {
  color: var(--red);
  background-size: 100% 2px;
}

.post-content strong {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(209, 77, 65, 0.45);
  text-decoration-thickness: 0.22em;
  text-underline-offset: -0.08em;
  text-decoration-skip-ink: none;
}

.post-content em {
  color: var(--ink-soft);
}

.post-content ul,
.post-content ol,
.page-content > ul,
.page-content > ol {
  margin: 0.45rem 0 1.1rem;
  padding-left: 1.5rem;
}

.post-content li,
.page-content > ul li,
.page-content > ol li {
  margin-bottom: 0.3rem;
  padding-left: 0.25rem;
}

.post-content li::marker {
  color: var(--red);
  font-family: var(--font-mono);
}

.post-content blockquote {
  position: relative;
  margin: 1.55rem 0;
  padding: 1.1rem 1.25rem 1.1rem 1.8rem;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-soft);
}

.post-content blockquote::before {
  position: absolute;
  top: -0.35rem;
  left: 0.75rem;
  color: var(--red);
  content: "“";
  font-family: var(--font-hand);
  font-size: 3.8rem;
  line-height: 1;
}

.post-content blockquote > :last-child {
  margin-bottom: 0;
}

.post-content hr {
  width: 4px;
  height: 4px;
  margin: 3rem auto;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  box-shadow:
    -14px 0 0 var(--line),
    14px 0 0 var(--cyan);
}

.post-content :not(pre) > code,
.page-content :not(pre) > code {
  padding: 0.1em 0.32em;
  border: 1px solid #dfd2b2;
  border-radius: var(--radius);
  color: var(--red-dark);
  background: #f8e9c1;
  font-family: var(--font-mono);
  font-size: 0.84em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.post-content pre,
.page-content pre {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--code-text);
  background: var(--code-bg);
  box-shadow: 7px 7px 0 var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 2;
}

.post-content pre::after,
.page-content pre::after {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow:
    -13px 0 0 var(--yellow),
    -26px 0 0 var(--green);
  content: "";
}

.post-content pre code,
.page-content pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  white-space: pre;
}

.post-content .highlighter-rouge,
.page-content .highlighter-rouge {
  margin: 1.5rem 0;
}

.post-content .highlighter-rouge pre,
.page-content .highlighter-rouge pre {
  margin: 0;
}

.post-content .highlight,
.page-content .highlight {
  color: var(--code-text);
  background: transparent;
}

.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cp,
.highlight .cs {
  color: #878580;
  font-style: italic;
}

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt {
  color: #ce5d97;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sr,
.highlight .ss {
  color: #a2c35a;
}

.highlight .m,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .il {
  color: #f3b868;
}

.highlight .na,
.highlight .nb,
.highlight .nc,
.highlight .nd,
.highlight .ne,
.highlight .nf,
.highlight .nl,
.highlight .nn,
.highlight .nt,
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi {
  color: #8ecae6;
}

.highlight .o,
.highlight .ow,
.highlight .p {
  color: #dad8ce;
}

.highlight .err {
  color: #ffb4a9;
  background: rgba(209, 77, 65, 0.2);
}

.post-content table {
  display: block;
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: 0.93rem;
}

.post-content th,
.post-content td {
  min-width: 120px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  background: var(--paper-soft);
  font-weight: 700;
}

.post-content tbody tr:nth-child(even) {
  background: rgba(242, 240, 229, 0.55);
}

.post-content img {
  height: auto;
  margin: 1.7rem auto;
  border: 1px solid var(--line);
  box-shadow: 8px 8px 0 var(--paper-deep);
}

.post-content iframe {
  display: block;
  width: 100%;
  margin: 1.7rem auto;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  box-shadow: 8px 8px 0 var(--paper-deep);
}

.post-content iframe.dp-demo {
  aspect-ratio: 16 / 11;
}

.post-content mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.post-content mjx-container[display="true"] {
  margin: 1.35rem 0 !important;
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: var(--paper-soft);
}

/* Post end and discussion */
.post-signoff {
  display: flex;
  max-width: var(--reading);
  align-items: center;
  gap: 1rem;
  margin: 3.8rem auto 0;
  padding: 1rem 1.1rem;
  background: rgba(242, 240, 229, 0.72);
}

.post-signoff img {
  width: 46px;
  height: 46px;
}

.post-signoff strong {
  font-size: 1.08rem;
}

.post-signoff p {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.discussion-section {
  max-width: var(--reading);
  margin: 3.8rem auto 0;
}

.discussion-header {
  display: grid;
  padding-bottom: 0.8rem;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 2rem;
}

.discussion-header > p {
  grid-column: 1 / -1;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.discussion-header h2 {
  font-size: 1.6rem;
}

.discussion-header span {
  align-self: end;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.discussion-shell {
  min-height: 160px;
  padding-top: 1rem;
}

.discussion-shell .utterances {
  max-width: 100%;
}

/* Table of contents */
.toc-wrapper {
  position: fixed;
  z-index: 50;
  top: 7.5rem;
  right: max(1rem, calc((100vw - var(--wide)) / 2 - 14rem));
  width: 12rem;
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
  scrollbar-width: none;
}

.toc-wrapper::-webkit-scrollbar {
  display: none;
}

.toc-wrapper[hidden] {
  display: none;
}

.toc {
  padding: 0.2rem;
}

.toc > p {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.toc > p::before {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--red);
  content: "";
  flex: 0 0 auto;
}

.toc ul {
  display: grid;
  gap: 0.22rem;
  list-style: none;
}

.toc a {
  position: relative;
  display: block;
  padding: 0.18rem 0.25rem 0.18rem 0.85rem;
  color: var(--ink-soft);
  font-family: var(--font-hand);
  font-size: 0.76rem;
  line-height: 1.5;
  transition: color var(--ease);
}

.toc a::before {
  position: absolute;
  top: 0.72em;
  left: 0.25rem;
  width: 0.24rem;
  height: 0.24rem;
  border-radius: 50%;
  background: var(--line);
  content: "";
  transition:
    background-color var(--ease),
    transform var(--ease);
}

.toc a:hover,
.toc a.active {
  color: var(--red);
}

.toc a.active {
  font-weight: 700;
}

.toc a.active::before {
  background: var(--red);
  transform: scale(1.3);
}

.toc .toc-subitem {
  padding-left: 1.25rem;
  font-size: 0.71rem;
}

.toc .toc-subitem::before {
  left: 0.65rem;
}

/* 404 */
.error-page {
  position: relative;
  display: grid;
  min-height: calc(100vh - 250px);
  align-items: center;
  padding-block: 5rem;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 4rem;
  overflow: hidden;
}

.error-code {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: clamp(8rem, 20vw, 15rem);
  letter-spacing: -0.1em;
  line-height: 0.75;
}

.error-copy {
  position: relative;
  z-index: 2;
}

.error-copy h1 {
  margin-top: 1.2rem;
  font-size: clamp(3.2rem, 7vw, 5.8rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.error-copy > p:not(.eyebrow) {
  margin: 1.5rem 0 2rem;
  color: var(--ink-soft);
}

.error-wind {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 8%;
  width: 42%;
  color: var(--red);
  opacity: 0.25;
}

/* Footer and utility */
.footer {
  border-top: 1px solid var(--ink);
}

.footer-grid {
  display: grid;
  align-items: end;
  padding-block: 2.2rem;
  grid-template-columns: 1fr auto;
  gap: 3rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.footer-brand img {
  width: 44px;
  height: 44px;
}

.footer-brand strong {
  font-size: 1.1rem;
}

.footer-brand p {
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.footer-meta {
  text-align: right;
}

.footer-links {
  display: flex;
  justify-content: flex-end;
  gap: 1.2rem;
  margin-bottom: 0.55rem;
}

.footer-links a,
.footer-meta > p {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.footer-links a {
  transition: color var(--ease);
}

.footer-links a:hover {
  color: var(--red);
}

.back-to-top {
  position: fixed;
  z-index: 120;
  right: 1.5rem;
  bottom: 1.5rem;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    color var(--ease),
    background var(--ease),
    opacity var(--ease),
    transform var(--ease),
    visibility var(--ease);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--paper);
  background: var(--red);
  transform: translateY(-3px);
}

/* Motion */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes work-preview-sweep {
  0%,
  18% {
    opacity: 0;
    transform: translateX(0) skewX(-14deg);
  }

  28% {
    opacity: 0.82;
  }

  58%,
  100% {
    opacity: 0;
    transform: translateX(450%) skewX(-14deg);
  }
}

@keyframes work-status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(36, 131, 123, 0.08);
    transform: scale(0.92);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(36, 131, 123, 0.15);
    transform: scale(1);
  }
}

@keyframes work-mark-float {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-4px) rotate(1.5deg);
  }
}

.hero-copy,
.hero-index,
.listing-hero > *,
.works-hero > *,
.work-card,
.post-header > * {
  animation: rise-in 600ms both;
}

.hero-index,
.works-hero > :nth-child(2),
.work-card,
.post-header > :nth-child(2) {
  animation-delay: 90ms;
}

.post-header > :nth-child(3) {
  animation-delay: 150ms;
}

.post-header > :nth-child(4) {
  animation-delay: 210ms;
}

/* Responsive */
@media (max-width: 1240px) {
  .toc-wrapper {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-index {
    width: min(100%, 560px);
    min-height: 390px;
    margin-left: auto;
  }

  .listing-title,
  .about-intro,
  .works-hero,
  .work-layout {
    grid-template-columns: 1fr;
  }

  .listing-title {
    gap: 2rem;
  }

  .works-hero {
    align-items: start;
    gap: 2.5rem;
  }

  .works-hero-note {
    max-width: 520px;
  }

  .work-card-foot {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-portrait {
    width: min(80%, 370px);
  }

  .about-copy {
    max-width: 680px;
  }

  .github-strip {
    grid-template-columns: 1fr;
  }

  .error-page {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .error-copy {
    max-width: 520px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .navbar-inner {
    min-height: 72px;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
  }

  .logo-copy small {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    right: var(--gutter);
    left: var(--gutter);
    display: none;
    align-items: stretch;
    padding: 0.6rem;
    border: 1px solid var(--ink);
    background: var(--paper);
    box-shadow: 7px 7px 0 var(--paper-deep);
    flex-direction: column;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.72rem;
  }

  .nav-links a::after {
    display: none;
  }

  .hero-grid {
    padding-top: 4rem;
    padding-bottom: 5rem;
  }

  .hero-copy h1 {
    font-size: clamp(4.8rem, 24vw, 7rem);
  }

  .topic-strip .container-wide {
    align-items: flex-start;
    padding-block: 1.2rem;
    flex-direction: column;
    gap: 0.8rem;
  }

  .featured-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .works-list {
    gap: 4rem;
  }

  .works-next {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .featured-card {
    min-height: 280px;
  }

  .post-row {
    min-height: 0;
    grid-template-columns: 2.8rem minmax(0, 1fr) 1.5rem;
  }

  .post-row p {
    -webkit-line-clamp: 3;
  }

  .category-header {
    grid-template-columns: 2.8rem minmax(0, 1fr) auto;
  }

  .about-card {
    min-height: 300px;
  }

  .post-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-facts {
    justify-content: flex-start;
  }

  .post-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .discussion-header {
    grid-template-columns: 1fr;
  }

  .discussion-header span {
    margin-top: 0.35rem;
  }

  .footer-grid {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-meta {
    text-align: left;
  }

  .footer-links {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .work-copy {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 520px) {
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-index {
    min-height: 0;
    padding-inline: 1rem;
    box-shadow: 6px 6px 0 var(--paper-deep);
  }

  .hero-index-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .hero-stats > div + div {
    padding-left: 1rem;
  }

  .hero-stats {
    gap: 0.55rem;
  }

  .latest-note {
    padding: 0.9rem;
  }

  .latest-note a {
    font-size: 1rem;
  }

  .latest-note-arrow {
    width: 32px;
    height: 32px;
  }

  .wind-sketch {
    width: 68%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .featured-card {
    padding: 1.25rem;
    grid-template-columns: 2.2rem minmax(0, 1fr);
  }

  .category-index {
    grid-template-columns: 1fr;
  }

  .category-index-card {
    min-height: 145px;
  }

  .works-hero-copy h1 {
    font-size: clamp(3.4rem, 16vw, 5.2rem);
  }

  .work-card {
    padding: 0.75rem;
    box-shadow: 6px 6px 0 var(--paper-deep);
  }

  .work-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }

  .work-window-bar {
    height: 28px;
  }

  .work-preview::after {
    top: 28px;
  }

  .work-copy {
    padding: 1.4rem;
  }

  .work-mark {
    width: 46px;
    height: 46px;
  }

  .work-brand h2 {
    font-size: 2.4rem;
  }

  .work-tagline {
    margin-top: 2rem;
    padding-left: calc(46px + 1rem);
  }

  .work-facts {
    grid-template-columns: 1fr;
  }

  .work-card-foot {
    padding-inline: 0.15rem;
  }

  .work-highlights ul {
    grid-template-columns: 1fr;
  }

  .works-next {
    box-shadow: 6px 6px 0 var(--red);
  }

  .category-count {
    display: none;
  }

  .about-portrait {
    width: calc(100% - 1.5rem);
  }

  .about-portrait > span {
    right: -1rem;
  }

  .about-timeline li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .connect-links {
    align-items: stretch;
    flex-direction: column;
  }

  .github-strip {
    padding: 1.25rem;
  }

  .post-topline {
    align-items: flex-start;
    padding-block: 0.9rem;
    flex-direction: column;
  }

  .post-header {
    padding-top: 2rem;
  }

  .post-facts > span + span::before {
    margin-right: 0.55rem;
  }

  .post-content pre,
  .page-content pre {
    margin-right: calc(-1 * var(--gutter));
    margin-left: calc(-1 * var(--gutter));
    border-right: 0;
    border-left: 0;
    box-shadow: none;
  }

  .post-content blockquote {
    padding-right: 1rem;
    padding-left: 1.3rem;
  }

  .post-row {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }

  .post-row-arrow {
    display: none;
  }

  .back-to-top {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-preview::after {
    display: none;
  }

  .work-mark,
  .work-status i {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .navbar,
  .footer,
  .progress-bar,
  .back-to-top,
  .post-topline,
  .toc-wrapper,
  .discussion-section {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .post-shell,
  .post-header {
    padding: 0;
  }

  .post-content {
    max-width: none;
    font-size: 11pt;
  }
}
