:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1d2824;
  background: #eef1ed;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1d2824;
  --muted: #68736e;
  --line: #dbe2dc;
  --paper: #fbfcfa;
  --ground: #eef1ed;
  --accent: #28665c;
  --forest: #173d36;
  --forest-soft: #dce9e2;
  --content-width: 1120px;
  --reading-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-120%);
  transition: transform 150ms ease;
}

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

.site-header {
  position: relative;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.site-header-home {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  background: transparent;
  border-bottom: 0;
  pointer-events: none;
}

.site-header-home .header-inner {
  width: 100%;
  min-height: 76px;
  padding: 0 36px;
}

.site-header-home .language-switcher {
  pointer-events: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  width: min(calc(100% - 3rem), var(--content-width));
  min-height: 78px;
  margin: 0 auto;
}

.avatar-link {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
}

.avatar {
  position: absolute;
  top: -26%;
  left: -26%;
  width: 152%;
  max-width: none;
  height: 152%;
  object-fit: cover;
}

.site-label {
  margin-left: 11px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 720;
  letter-spacing: 0.02em;
}

.language-switcher {
  display: flex;
  align-items: center;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid #52615f66;
  border-radius: 999px;
  background: #ffffff4d;
  transition: border-color 150ms ease, background 150ms ease;
}

.language-toggle-label {
  padding: 4px 8px;
  border-radius: 999px;
  opacity: 0.62;
}

.language-toggle-label.is-active {
  background: var(--paper);
  box-shadow: 0 1px 4px #19383118;
  color: var(--ink);
  opacity: 1;
}

.language-toggle-separator {
  opacity: 0.45;
}

.language-toggle:hover {
  border-color: var(--accent);
  background: #ffffff80;
}

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

.language-toggle:hover .language-toggle-label {
  opacity: 1;
}

#main-content.paper {
  position: relative;
  width: min(calc(100% - 3rem), var(--content-width));
  margin: 0 auto;
  padding: 24px 0 96px;
  background: transparent;
}

#main-content.paper-wide {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.home-layout {
  min-height: 100vh;
  background: #eff0ee;
}

.home-content {
  min-width: 0;
}

.home-hero {
  position: relative;
  display: flex;
  min-height: 420px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 34px 54px 76px;
  overflow: hidden;
  background: linear-gradient(135deg, #7e8988 0%, #aeb9b6 48%, #667371 100%);
  color: #fff;
}

.home-hero::before {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 24% 35%, #ffffff66 0, transparent 35%),
    radial-gradient(ellipse at 83% 72%, #3c504f88 0, transparent 39%),
    repeating-linear-gradient(125deg, transparent 0 83px, #ffffff1c 84px 86px, transparent 88px 154px),
    repeating-linear-gradient(35deg, transparent 0 125px, #263b391c 127px 130px, transparent 132px 215px);
  content: "";
  filter: blur(3px);
  opacity: 0.92;
  pointer-events: none;
  transform: rotate(-4deg);
}

.home-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, #263b3966, #73807d40 58%, #263b3966);
  content: "";
  pointer-events: none;
}

.home-hero-frame {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 1100px);
  min-height: 250px;
  align-items: center;
  justify-content: center;
  padding: 22px 30px 18px;
}

.home-hero-copy {
  position: relative;
  width: 100%;
  text-align: center;
}

.section-kicker,
.page-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.home-hero h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  font-weight: 760;
  letter-spacing: -0.08em;
  line-height: 1.08;
  text-shadow: 0 2px 8px #35414022;
}

.home-hero-avatar {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 50%;
}

.home-hero-avatar img {
  position: absolute;
  top: -26%;
  left: -26%;
  width: 152%;
  max-width: none;
  height: 152%;
  object-fit: cover;
}

.hero-description {
  max-width: 780px;
  margin: 23px auto 0;
  margin-right: auto;
  margin-left: auto;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 560;
  line-height: 1.7;
  text-shadow: 0 1px 5px #35414024;
}

.hero-bottomline {
  margin: 22px auto 0;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(24px, 4vw, 53px);
}

.hero-actions a {
  padding: 4px 0;
  border-bottom: 1px solid #ffffff8c;
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
}

.hero-actions a:hover {
  border-color: #fff;
  opacity: 0.72;
}

.home-feed {
  min-height: 700px;
  padding: 0 50px 88px;
  background: #eff0ee;
}

.home-feed .writing-section {
  position: relative;
  z-index: 2;
  max-width: 1090px;
  margin: -82px auto 0;
  padding: 0 0 72px;
}

.home-feed .writing-section > .section-heading {
  display: none;
}

.home-feed .article-card.featured {
  padding: 54px 58px 60px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 18px 44px #273b3714;
}

.home-feed .article-card.featured h3 {
  max-width: 900px;
  margin: 22px 0 15px;
  font-family: inherit;
  font-size: clamp(2.1rem, 4vw, 3.65rem);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1.13;
}

.home-feed .article-card.featured .article-card-label {
  max-width: none;
  margin: 0 0 19px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.home-feed .article-card.featured p {
  max-width: 850px;
  font-size: 1rem;
}

.article-card-cover {
  display: block;
  width: min(100%, 850px);
  height: auto;
  margin-top: 34px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.home-feed .works-section {
  max-width: 1090px;
  margin: 0 auto;
  padding-top: 4px;
}

.home-section {
  padding: 0 0 52px;
}

.home-section + .home-section {
  padding-top: 50px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 25px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 9px 0 0;
  font-family: inherit;
  font-size: clamp(1.85rem, 3.5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1;
}

.section-heading > p:last-child {
  max-width: 250px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: right;
}

.section-link {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 650;
}

.section-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-card {
  display: block;
  height: 100%;
  padding: 26px 28px 29px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.article-card:hover {
  border-color: #a9beb5;
  box-shadow: 0 16px 35px #1c393015;
  transform: translateY(-3px);
}

.article-card-content {
  min-width: 0;
}

.article-card-label {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-card-topline,
.project-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.article-card-arrow {
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
}

.article-card h3 {
  max-width: 760px;
  margin: 29px 0 12px;
  font-family: inherit;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.25;
}

.article-card p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.article-card.featured {
  padding: 28px 31px 30px;
  background: var(--paper);
}

.article-card.featured h3 {
  max-width: 800px;
  margin: 25px 0 12px;
  font-size: clamp(1.9rem, 3.8vw, 3.15rem);
  line-height: 1.1;
}

.article-card.featured p {
  max-width: 620px;
  font-size: 1rem;
  line-height: 1.85;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: #a9beb5;
  box-shadow: 0 18px 38px #1c393015;
  transform: translateY(-3px);
}

.project-card-media {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: #e8eeea;
}

.project-shot {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.project-card-index {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 8px;
  border: 1px solid #ffffffb8;
  border-radius: 999px;
  background: #173d36d9;
  color: #eff7f1;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.project-card-body {
  padding: 23px 25px 26px;
}

.eyebrow,
.project-card-kind {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-card-kind {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
}

.project-card h3 {
  margin: 17px 0 8px;
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.project-card h3 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.project-card p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.project-card-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.1rem;
  margin-top: 19px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 650;
}

.project-card-actions a,
.prose a {
  text-decoration: underline;
  text-decoration-color: #7faaa28a;
  text-underline-offset: 3px;
}

.project-card-actions a:hover,
.prose a:hover {
  color: var(--ink);
}

.empty-state {
  margin: 0;
  padding: 25px 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.writing-empty {
  padding-bottom: 20px;
}

.blog-index {
  padding: 45px 0 30px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.page-heading h1,
.article-header h1 {
  margin: 15px 0 0;
  font-family: inherit;
  font-size: clamp(2.8rem, 5.5vw, 4.4rem);
  font-weight: 560;
  letter-spacing: -0.075em;
  line-height: 1;
}

.page-heading > p:last-child,
.article-header .article-description {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.85;
}

.back-link {
  display: inline-block;
  margin-bottom: 35px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
}

.back-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 45px 0 45px;
}

.article-header {
  margin-bottom: 50px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  max-width: 900px;
  font-size: clamp(2.35rem, 4.2vw, 3.7rem);
  line-height: 1.12;
}

.article-meta {
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.article-header .article-description {
  max-width: 620px;
  margin-top: 22px;
  font-size: 1.05rem;
}

.prose {
  max-width: var(--reading-width);
  margin: 0 auto;
  overflow-wrap: anywhere;
  font-size: 1.06rem;
  line-height: 1.95;
}

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

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 3.3em 0 0.8em;
  font-family: inherit;
  line-height: 1.2;
  letter-spacing: -0.055em;
}

.prose h1 { font-size: 2.2rem; }
.prose h2 { font-size: 1.8rem; }
.prose h3 {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 1.8rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose table,
.prose pre {
  margin: 1.35em 0;
}

.prose blockquote {
  margin-left: 0;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.prose code {
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 0.88em;
}

.prose pre {
  overflow-x: auto;
  padding: 1.25rem 1.4rem;
  border: 1px solid #cedbd2;
  border-radius: 10px;
  background: #e9f0eb;
  box-shadow: inset 0 1px #ffffffaa;
  color: #2c4038;
  font-size: 0.9rem;
  line-height: 1.7;
}

.prose pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 2.75rem auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 14px 30px #1c393012;
}

.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  white-space: nowrap;
}

.prose th,
.prose td {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  text-align: left;
}

.site-footer {
  width: min(calc(100% - 3rem), var(--content-width));
  margin: 0 auto 25px;
  padding: 24px 0 30px;
  color: var(--muted);
  font-size: 0.76rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.footer-inner a {
  color: var(--accent);
  font-weight: 650;
}

.footer-inner a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 760px) {
  .header-inner,
  #main-content.paper,
  .site-footer {
    width: min(calc(100% - 2rem), var(--content-width));
  }

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

  .site-header-home .header-inner {
    min-height: 64px;
    padding: 0 20px;
  }

  #main-content.paper {
    padding-top: 16px;
    padding-bottom: 65px;
  }

  #main-content.paper-wide {
    width: 100%;
    padding: 0;
  }

  .home-layout {
    display: block;
  }

  .home-hero {
    min-height: 380px;
    padding: 30px 20px 60px;
  }

  .home-hero-frame {
    min-height: 220px;
    padding: 18px 8px 12px;
  }

  .home-hero h1 {
    gap: 12px;
    font-size: clamp(2rem, 9vw, 3.2rem);
    line-height: 1.08;
  }

  .home-hero-avatar {
    width: 72px;
    height: 72px;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .hero-bottomline {
    margin-top: 28px;
  }

  .hero-actions {
    gap: 22px;
  }

  .hero-actions a {
    font-size: 0.9rem;
  }

  .home-feed {
    padding: 0 16px 60px;
  }

  .home-feed .writing-section {
    margin-top: -58px;
    padding-bottom: 52px;
  }

  .home-feed .article-card.featured {
    padding: 34px 24px 38px;
  }

  .home-feed .article-card.featured h3 {
    font-size: 2.05rem;
  }

  .home-feed .works-section {
    padding-top: 4px;
  }

  .home-section {
    padding-bottom: 44px;
  }

  .home-section + .home-section {
    padding-top: 44px;
  }

  .section-heading,
  .page-heading {
    display: block;
  }

  .section-heading > p:last-child {
    max-width: none;
    margin-top: 14px;
    text-align: left;
  }

  .section-link {
    display: inline-block;
    margin-top: 17px;
  }

  .article-list,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .article-card.featured {
    padding: 24px 21px 26px;
  }

  .article-card.featured h3 {
    margin-top: 25px;
    font-size: 1.95rem;
  }

  .project-card-body {
    padding: 21px 22px 23px;
  }

  .blog-index {
    padding-top: 34px;
  }

  .page-heading {
    margin-bottom: 32px;
    padding-bottom: 27px;
  }

  .page-heading h1 {
    font-size: 3.55rem;
  }

  .page-heading > p:last-child {
    max-width: 300px;
    margin-top: 25px;
  }

  .article-shell {
    padding-top: 48px;
  }

  .article-header {
    margin-bottom: 52px;
    padding-bottom: 32px;
  }

  .article-header h1 {
    font-size: 2.25rem;
    line-height: 1.08;
  }

  .article-header .article-description {
    font-size: 0.98rem;
  }

  .prose {
    font-size: 1rem;
    line-height: 1.9;
  }

  .prose h3 {
    font-size: 1.55rem;
  }

  .prose img {
    margin: 2.1rem auto;
    border-radius: 7px;
  }

  .site-footer {
    margin-bottom: 10px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }
}

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

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