:root {
  --paper: #f3f6f2;
  --surface: #ffffff;
  --ink: #171a18;
  --muted: #657068;
  --line: #ccd5ce;
  --forest: #245443;
  --vermilion: #c64b36;
  --blue: #355d86;
  --max-width: 1180px;
  --page-pad: 32px;
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --body: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --utility: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--vermilion);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  background: rgba(243, 246, 242, 0.96);
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms ease, color 180ms ease;
}

.is-home .site-header {
  position: fixed;
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.is-home .site-header.is-scrolled {
  background: rgba(243, 246, 242, 0.96);
  border-bottom-color: var(--line);
  color: var(--ink);
}

.header-inner,
.footer-inner,
.journal-section,
.archive-shell,
.article-shell {
  width: min(calc(100% - (var(--page-pad) * 2)), var(--max-width));
  margin-inline: auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: var(--vermilion);
  color: #ffffff;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.site-nav a {
  position: relative;
  padding-block: 8px;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  min-width: 52px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: min(620px, 76vh);
  display: flex;
  align-items: flex-end;
  background-color: #23322b;
  background-position: center;
  background-size: cover;
  color: #ffffff;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: rgba(10, 17, 13, 0.54);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(calc(100% - (var(--page-pad) * 2)), var(--max-width));
  margin-inline: auto;
  padding: 150px 0 72px;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--utility);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--display);
  font-size: 80px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

.hero-subtitle {
  max-width: 640px;
  margin: 20px 0 34px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.55;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  font-weight: 700;
}

.journal-section {
  padding-block: 84px 104px;
}

.portfolio-section,
.collection-shell,
.project-shell {
  width: min(calc(100% - (var(--page-pad) * 2)), var(--max-width));
  margin-inline: auto;
}

.portfolio-section {
  padding-block: 84px 24px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  padding-top: 28px;
}

.showcase-item {
  position: relative;
  min-height: 360px;
  grid-column: span 5;
  overflow: hidden;
  background: #23322b;
  color: #ffffff;
}

.showcase-project,
.showcase-skills {
  grid-column: span 7;
}

.showcase-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.showcase-item::after {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 15, 0.38);
  content: "";
  pointer-events: none;
}

.showcase-item:hover img {
  transform: scale(1.025);
}

.showcase-copy {
  position: absolute;
  z-index: 1;
  right: 28px;
  bottom: 26px;
  left: 28px;
  display: grid;
  gap: 4px;
}

.showcase-copy small {
  font-family: var(--utility);
  font-size: 11px;
}

.showcase-copy strong {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0;
}

.showcase-skills {
  display: grid;
  align-content: space-between;
  padding: 34px;
  background: #274f79;
}

.showcase-skills::after {
  display: none;
}

.showcase-skills .showcase-copy {
  right: 34px;
  bottom: 28px;
  left: 34px;
}

.skill-code {
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--utility);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.8;
}

.collection-shell,
.project-shell {
  padding-block: 110px 120px;
}

.collection-header {
  max-width: 860px;
  padding-bottom: 46px;
  border-bottom: 2px solid var(--ink);
}

.collection-header .eyebrow {
  color: var(--vermilion);
}

.collection-header h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 58px;
  letter-spacing: 0;
  line-height: 1.15;
}

.collection-header > p:last-child {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.project-list {
  border-bottom: 1px solid var(--ink);
}

.project-item {
  min-height: 280px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 36px;
  align-items: center;
  padding-block: 38px;
  border-bottom: 1px solid var(--line);
}

.project-item:last-child {
  border-bottom: 0;
}

.project-number {
  align-self: start;
  padding-top: 7px;
  color: var(--vermilion);
  font-family: var(--utility);
  font-size: 16px;
}

.project-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 31px;
  letter-spacing: 0;
  line-height: 1.3;
}

.project-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin: 14px 0 18px;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.project-item > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
}

.project-item:not(:has(> img)) .project-copy {
  grid-column: 2 / -1;
}

.album-section {
  padding-top: 72px;
}

.album-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
}

.album-header h2,
.album-header p {
  margin: 0;
}

.album-header h2 {
  font-family: var(--display);
  font-size: 36px;
  letter-spacing: 0;
}

.album-header p,
.album-header > span {
  color: var(--muted);
  font-size: 13px;
}

.photo-grid {
  columns: 3;
  column-gap: 14px;
}

.photo-grid figure {
  margin: 0 0 14px;
  break-inside: avoid;
  background: #dfe6e1;
}

.photo-grid img {
  width: 100%;
  height: auto;
}

.video-list {
  padding-top: 24px;
}

.video-item {
  padding-block: 54px;
  border-bottom: 1px solid var(--line);
}

.video-item header {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: end;
  gap: 20px;
  padding-bottom: 20px;
}

.video-item header > span {
  color: var(--vermilion);
  font-family: var(--utility);
  font-size: 14px;
}

.video-item header p,
.video-item header h2 {
  margin: 0;
}

.video-item header p {
  color: var(--muted);
  font-size: 13px;
}

.video-item header h2 {
  font-family: var(--display);
  font-size: 32px;
  letter-spacing: 0;
}

.video-item video {
  width: 100%;
  max-height: 680px;
  display: block;
  background: #111413;
}

.track-list {
  margin: 32px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
  counter-reset: tracks;
}

.track-item {
  min-height: 116px;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1fr);
  align-items: center;
  gap: 36px;
  padding: 22px 0 22px 68px;
  border-bottom: 1px solid var(--line);
  counter-increment: tracks;
}

.track-item::before {
  position: absolute;
  margin-left: -68px;
  color: var(--vermilion);
  content: counter(tracks, decimal-leading-zero);
  font-family: var(--utility);
  font-size: 13px;
}

.track-copy {
  display: grid;
  gap: 4px;
}

.track-copy strong {
  font-family: var(--display);
  font-size: 22px;
}

.track-copy span {
  color: var(--muted);
  font-size: 13px;
}

.track-item audio {
  width: 100%;
  height: 42px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--ink);
}

.section-heading .eyebrow {
  color: var(--vermilion);
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 42px;
  letter-spacing: 0;
  line-height: 1.15;
}

.section-heading > a {
  flex: none;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.post-list {
  border-bottom: 1px solid var(--ink);
}

.empty-state {
  min-height: 260px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-bottom: 1px solid var(--ink);
}

.empty-state .eyebrow {
  color: var(--vermilion);
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state h2 {
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0;
}

.empty-state > p:last-child,
.archive-empty {
  color: var(--muted);
}

.post-row {
  min-height: 170px;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 38px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}

.post-row:last-child {
  border-bottom: 0;
}

.post-meta {
  align-self: start;
  display: grid;
  gap: 7px;
  padding-top: 8px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 12px;
  line-height: 1.4;
}

.post-summary {
  min-width: 0;
}

.post-summary h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.3;
}

.post-summary h2 a {
  text-decoration-color: var(--vermilion);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.post-summary h2 a:hover {
  text-decoration-line: underline;
}

.post-summary p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 20px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.post-arrow:hover {
  background: var(--forest);
  color: #ffffff;
  transform: translateX(4px);
}

.archive-shell,
.article-shell {
  padding-block: 110px 120px;
}

.archive-heading {
  align-items: flex-start;
}

.archive-list {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  padding-top: 40px;
}

.archive-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding-block: 40px;
  border-bottom: 1px solid var(--line);
}

.archive-year {
  grid-column: 1;
  margin: 0;
  padding: 20px 24px 20px 0;
  color: var(--vermilion);
  font-family: var(--utility);
  font-size: 18px;
  letter-spacing: 0;
}

.archive-row {
  grid-column: 2;
  min-height: 72px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.archive-row time {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 12px;
}

.archive-row a {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
}

.article-shell {
  max-width: 860px;
}

.article-header {
  padding-bottom: 40px;
  border-bottom: 2px solid var(--ink);
}

.article-header .eyebrow {
  color: var(--vermilion);
}

.article-header h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 54px;
  letter-spacing: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 26px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 12px;
}

.article-content {
  padding-block: 44px 36px;
  font-size: 17px;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2em 0 0.7em;
  font-family: var(--display);
  letter-spacing: 0;
  line-height: 1.35;
}

.article-content h2 {
  font-size: 31px;
}

.article-content h3 {
  font-size: 24px;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote {
  margin-block: 1.3em;
}

.article-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-content blockquote {
  margin-inline: 0;
  padding: 4px 0 4px 24px;
  border-left: 4px solid var(--vermilion);
  color: #49524c;
  font-family: var(--display);
  font-size: 20px;
}

.article-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #e4eae5;
  font-family: var(--utility);
  font-size: 0.9em;
}

.article-content pre {
  overflow-x: auto;
  margin-block: 1.6em;
  padding: 22px;
  border-left: 4px solid var(--forest);
  background: #202723;
  color: #eef4ef;
}

.article-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  color: var(--forest);
  font-family: var(--utility);
  font-size: 13px;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 52px;
  background: var(--line);
  border: 1px solid var(--line);
}

.post-nav a {
  min-height: 120px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 24px;
  background: var(--paper);
}

.post-nav span {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 11px;
}

.post-nav strong {
  font-family: var(--display);
  font-size: 18px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 42px;
}

.pagination a,
.pagination span {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding-inline: 10px;
  border: 1px solid var(--line);
}

.pagination .current {
  border-color: var(--forest);
  background: var(--forest);
  color: #ffffff;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner > p:first-child {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}

.footer-meta {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 11px;
}

@media (max-width: 760px) {
  :root {
    --page-pad: 20px;
  }

  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    gap: 0;
    padding: 10px var(--page-pad) 18px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }

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

  .hero {
    min-height: min(520px, 72svh);
    background-position: 58% center;
  }

  .hero-inner {
    padding: 130px 0 48px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero-subtitle {
    margin-block: 15px 26px;
    font-size: 19px;
  }

  .journal-section,
  .archive-shell,
  .article-shell {
    padding-block: 64px 78px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h1,
  .section-heading h2 {
    font-size: 34px;
  }

  .post-row {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 18px;
    padding-block: 26px;
  }

  .post-meta {
    grid-column: 1 / -1;
    display: flex;
    gap: 14px;
    padding-top: 0;
  }

  .post-summary h2 {
    font-size: 25px;
  }

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

  .archive-list {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .archive-year {
    padding-right: 12px;
    font-size: 14px;
  }

  .archive-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
  }

  .archive-row a {
    font-size: 18px;
  }

  .article-header h1 {
    font-size: 38px;
  }

  .article-content {
    font-size: 16px;
  }

  .article-content h2 {
    font-size: 27px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    min-height: 170px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

@media (max-width: 760px) {
  .portfolio-section,
  .collection-shell,
  .project-shell {
    padding-block: 64px 78px;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .showcase-item,
  .showcase-project,
  .showcase-skills {
    min-height: 300px;
    grid-column: auto;
  }

  .showcase-skills {
    padding: 26px;
  }

  .showcase-skills .showcase-copy {
    right: 26px;
    bottom: 24px;
    left: 26px;
  }

  .skill-code {
    font-size: 19px;
  }

  .collection-header h1 {
    font-size: 42px;
  }

  .collection-header > p:last-child {
    font-size: 16px;
  }

  .project-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 18px;
    padding-block: 30px;
  }

  .project-item > img {
    grid-column: 2;
    grid-row: 2;
  }

  .project-item:not(:has(> img)) .project-copy {
    grid-column: 2;
  }

  .project-copy h2 {
    font-size: 26px;
  }

  .photo-grid {
    columns: 2;
    column-gap: 9px;
  }

  .photo-grid figure {
    margin-bottom: 9px;
  }

  .album-header h2 {
    font-size: 29px;
  }

  .video-item {
    padding-block: 38px;
  }

  .video-item header {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 13px;
  }

  .video-item header h2 {
    font-size: 27px;
  }

  .track-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-left: 48px;
  }

  .track-item::before {
    margin-left: -48px;
  }
}
