@font-face {
  font-family: "Fieldnotes Serif";
  src: url("../fonts/fieldnotes-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f6f3ec;
  --ink: #193e35;
  --text: #484a43;
  --muted: #6f7068;
  --accent: #aa421f;
  --line: #dcd7cb;
  --serif: "Fieldnotes Serif", "Songti SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--serif); font-size: 18px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
::selection { background: #dce5d8; color: var(--ink); }
a { color: inherit; text-decoration: none; text-underline-offset: 5px; }
button, a { -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
main:focus { outline: none; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); }
.container { width: min(1200px, 84%); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 8px 16px; background: var(--ink); color: white; transform: translateY(-160%); font-family: var(--sans); }
.skip-link:focus { transform: translateY(0); color: white; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 26px 24px; }
.wordmark { color: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: -.8px; white-space: nowrap; }
.wordmark span { font-size: 25px; font-weight: 600; letter-spacing: 0; }
.site-nav { display: flex; align-items: center; gap: 40px; font-size: 18px; }
.site-nav > a { display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.nav-github { border-left: 1px solid var(--line); padding-left: 36px; }
.external-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.icon { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; background: currentColor; mask: var(--icon) center / contain no-repeat; -webkit-mask: var(--icon) center / contain no-repeat; }
.icon-external { --icon: url("../icons/arrow-up-right.svg"); width: 16px; height: 16px; }
.icon-down-right { --icon: url("../icons/arrow-down-right.svg"); }
.icon-arrow { --icon: url("../icons/arrow-right.svg"); }
.icon-github { --icon: url("../icons/github.svg"); }
.hero { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.25fr); gap: 56px; align-items: start; padding-block: 42px 36px; border-bottom: 1px solid var(--line); }
.hero-figure { margin-right: -40px; }
.hero h1 { font-size: clamp(64px, 6.9vw, 94px); line-height: 1.18; font-weight: 700; letter-spacing: -3px; margin-block: 3px 30px; white-space: nowrap; }
.hero-rule { width: 68px; height: 3px; background: var(--accent); margin-bottom: 26px; }
.hero-intro { font-size: 22px; line-height: 1.65; text-wrap: balance; }
.keep-together { white-space: nowrap; }
.project-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; margin-top: 26px; padding: 12px 32px; min-height: 58px; background: var(--ink); border: 1px solid var(--ink); border-radius: 4px; color: var(--paper); font-size: 22px; transition: background .15s ease; }
.project-button:hover { background: #2c5145; color: white; }
.forest-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }
.author-note { display: flex; align-items: center; gap: 24px; padding-top: 20px; }
.author-note img { width: 72px; height: 72px; border-radius: 50%; }
.author-note p { border-left: 1px solid var(--line); padding-left: 24px; font-size: 18px; text-wrap: balance; }
.projects-section { padding-block: 30px 38px; border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
h2 { font-size: 46px; line-height: 1.2; font-weight: 700; letter-spacing: -1.5px; }
.section-header > p { font-size: 18px; line-height: 1.4; color: var(--muted); margin-top: 4px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
.project { display: flex; flex-direction: column; min-width: 0; padding-inline: 36px; border-left: 1px solid var(--line); }
.project:first-child { padding-left: 0; border-left: 0; }
.project:last-child { padding-right: 0; }
.project-icon { width: 128px; height: 128px; border-radius: 27px; object-fit: contain; margin-bottom: 8px; }
.project h3 { font-size: 42px; font-weight: 600; line-height: 1.3; letter-spacing: -1px; }
.project-tagline { font-size: 22px; margin-top: 8px; }
.project-description { font-size: 19px; line-height: 1.6; margin-top: 18px; }
.project-meta { position: relative; padding-top: 16px; margin-top: 16px; color: var(--muted); font-family: var(--sans); font-size: 16px; line-height: 1.65; }
.project-meta::before { content: ""; position: absolute; top: 0; left: 0; width: 26px; height: 1px; background: var(--line); }
.project-link { gap: 8px; padding-top: 22px; margin-top: auto; font-size: 17px; line-height: 1.5; }
.project-link > span:first-child { overflow-wrap: anywhere; }
.project-link:hover > span:first-child { text-decoration: underline; }
.notes-section { padding-top: 36px; }
.notes-header { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 12px; }
.notes-header > a { white-space: nowrap; font-size: 17px; }
.post-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; gap: 60px; padding-block: 12px; }
.post-title { font-size: 22px; line-height: 1.55; color: var(--ink); }
.post-row time { color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.post-row .icon { color: var(--muted); }
.post-row:hover .post-title, .post-row:hover .icon { color: var(--accent); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 20px 24px; font-size: 16px; color: var(--muted); }
.site-footer > span { font-family: var(--sans); font-size: 14px; }
.archive-section { min-height: calc(100vh - 220px); padding-top: 56px; }
.page-heading { margin-bottom: 36px; }
.page-title { font-size: clamp(36px, 4vw, 56px); line-height: 1.4; font-weight: 600; letter-spacing: -1px; overflow-wrap: anywhere; }
.page-heading > p { color: var(--muted); margin-top: 16px; }
.pagination { display: flex; justify-content: center; gap: 24px; padding-block: 30px; font-family: var(--sans); }
.pagination .current { color: var(--accent); }
.reading-page { max-width: 800px; min-height: calc(100vh - 220px); margin-inline: auto; padding-block: 48px 32px; }
.back-link { display: inline-block; color: var(--accent); font-size: 16px; margin-bottom: 20px; }
.post-date { font-family: var(--sans); font-size: 15px; }
.prose { overflow-wrap: anywhere; font-family: var(--sans); font-size: 17px; line-height: 1.95; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--serif); line-height: 1.5; margin-block: 1.5em .6em; letter-spacing: 0; }
.prose h1 { font-size: 32px; }
.prose h2 { font-size: 28px; }
.prose h3 { font-size: 23px; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin-block: 0 1.25em; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose blockquote { margin-inline: 0; padding: 8px 24px; border-left: 2px solid var(--line); color: #666b5f; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre { max-width: 100%; overflow-x: auto; padding: 20px 24px; background: #ebe8df; border-radius: 4px; font-size: 14px; line-height: 1.8; overflow-wrap: normal; }
.prose code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .9em; }
.prose :not(pre) > code { background: #ebe8df; padding: 2px 5px; border-radius: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 32px; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { padding: 8px 14px; border: 1px solid var(--line); text-align: left; }
.post-navigation { display: flex; justify-content: space-between; gap: 32px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-navigation a { display: flex; flex-direction: column; max-width: 48%; }
.post-navigation span { color: var(--muted); font-family: var(--sans); font-size: 14px; }
.friend-list, .tag-list { padding: 0; list-style: none; }
.friend-list li { padding-block: 20px; border-bottom: 1px solid var(--line); }
.friend-list p { color: var(--muted); font-size: 16px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.tag-list a { display: flex; gap: 12px; align-items: center; min-height: 44px; }
.tag-list span { font-size: 14px; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
.gallery-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gallery-grid figcaption { padding-block: 12px; }

@media (min-width: 1500px) {
  .hero h1 { font-size: 100px; }
}

@media (max-width: 1100px) {
  .site-header { padding-block: 14px; }
  .hero { gap: 40px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); padding-top: 28px; }
  .hero h1 { font-size: clamp(58px, 7.4vw, 82px); line-height: 1.15; margin-bottom: 26px; }
  .hero-intro { font-size: 20px; }
  .project-button { font-size: 20px; padding-inline: 28px; }
  .author-note { gap: 18px; }
  .author-note img { width: 64px; height: 64px; }
  .author-note p { padding-left: 18px; font-size: 16px; }
  h2 { font-size: 46px; }
  .project-grid { margin-right: -36px; }
  .project { padding-inline: 30px; }
  .project-icon { width: 106px; height: 106px; border-radius: 24px; }
  .project h3 { font-size: 40px; }
  .project-tagline { font-size: 20px; }
  .project-description { font-size: 17px; }
  .project-meta { font-size: 14px; }
  .project-link { font-size: 15px; }
}

@media (max-width: 1000px) {
  .container { width: calc(100% - 48px); }
  .site-header { gap: 20px; padding-block: 18px; }
  .wordmark { font-size: 25px; }
  .wordmark span { font-size: 20px; }
  .site-nav { gap: 22px; font-size: 16px; }
  .nav-github { display: none !important; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 24px 32px; }
  .hero-figure { margin-right: 0; }
  .hero h1 { font-size: clamp(60px, 12vw, 84px); line-height: 1.2; margin-bottom: 24px; letter-spacing: -2px; }
  .hero-rule { margin-bottom: 22px; width: 52px; }
  .hero-intro { font-size: 19px; max-width: 420px; }
  .desktop-break { display: none; }
  .project-button { margin-top: 22px; min-height: 52px; padding: 10px 24px; font-size: 19px; }
  .author-note { padding-top: 16px; }
  .author-note img { width: 52px; height: 52px; }
  .author-note p { font-size: 15px; }
  .projects-section { padding-block: 30px 32px; }
  h2 { font-size: 32px; letter-spacing: -.5px; }
  .section-header > p { font-size: 16px; }
  .project-grid { grid-template-columns: 1fr; margin-top: 24px; margin-right: 0; }
  .project { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 20px; border: 0; padding: 26px 0; border-top: 1px solid var(--line); }
  .project:first-child { padding-top: 0; border-top: 0; }
  .project:last-child { padding-bottom: 0; }
  .project-icon { grid-column: 1; grid-row: 1 / 3; width: 76px; height: 76px; border-radius: 18px; margin: 0; }
  .project h3 { grid-column: 2; align-self: end; font-size: 30px; }
  .project-tagline { grid-column: 2; margin-top: 3px; font-size: 18px; }
  .project-description, .project-meta, .project-link { grid-column: 1 / -1; }
  .project-description { font-size: 17px; margin-top: 16px; }
  .project-meta { margin-top: 16px; padding-top: 14px; font-size: 14px; }
  .project-link { padding-top: 18px; font-size: 16px; min-height: 44px; }
  .notes-section { padding-top: 30px; }
  .notes-header { align-items: center; gap: 12px; }
  .notes-header h2 { font-size: 29px; }
  .notes-header > a { font-size: 14px; gap: 5px; }
  .post-row { grid-template-columns: minmax(0, 1fr) 18px; gap: 4px 12px; padding-block: 16px; }
  .post-title { font-size: 19px; }
  .post-row time { grid-column: 1; font-size: 14px; }
  .post-row .icon { grid-column: 2; grid-row: 1 / 3; }
  .site-footer { padding-block: 24px; font-size: 15px; }
  .site-footer > a { min-height: 44px; }
  .site-footer > span { font-size: 12px; }
  .archive-section { padding-top: 28px; }
  .page-heading { margin-bottom: 28px; }
  .page-title { font-size: 36px; }
  .reading-page { padding-block: 28px; }
  .prose { font-size: 16px; }
  .prose pre { padding: 16px; font-size: 13px; }
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .container { width: calc(100% - 36px); }
  .wordmark { font-size: 23px; }
  .wordmark span { font-size: 18px; }
  .site-nav { gap: 15px; font-size: 15px; }
  .hero h1 { font-size: 58px; }
  .author-note p { font-size: 14px; }
  .notes-header h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project-button { transition: none; }
}
