:root {
  --ink: #1c1c19;
  --muted: #6f7069;
  --paper: #f6f3eb;
  --paper-2: #ebe6da;
  --line: rgba(28, 28, 25, 0.14);
  --red: #b84a37;
  --blue: #225e74;
  --green: #3e6549;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 64px);
  color: #fffaf0;
  mix-blend-mode: difference;
}

.brand {
  font-weight: 760;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 34px);
  font-size: 14px;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #15191a;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.96;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 12, 13, 0.74), rgba(8, 12, 13, 0.18) 58%, rgba(8, 12, 13, 0.55));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(920px, calc(100% - 40px));
  padding: 0 0 clamp(64px, 11vh, 120px) clamp(20px, 7vw, 96px);
  color: #fff8ea;
}

.kicker,
.section-label,
.post-meta {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 760;
}

.hero .kicker {
  color: #ffd8a7;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 880px;
  margin-bottom: 18px;
  font-size: clamp(48px, 8.3vw, 112px);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-copy {
  max-width: 560px;
  color: rgba(255, 248, 234, 0.84);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions a,
.post a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.hero-actions a:first-child {
  background: #fff8ea;
  color: #15191a;
  border-color: #fff8ea;
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(70px, 10vw, 126px) 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr);
  gap: clamp(28px, 8vw, 110px);
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 10px 0 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p,
.about p {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.86;
}

.split {
  display: grid;
  grid-template-columns: 0.62fr 1.38fr;
  gap: clamp(30px, 7vw, 90px);
}

.section-head {
  align-self: start;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 150px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

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

.post h3 {
  margin: 8px 0 10px;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.16;
}

.post p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.featured-post h3 {
  color: var(--blue);
}

.resources {
  display: grid;
  grid-template-columns: 0.62fr 1.38fr;
  gap: clamp(30px, 7vw, 90px);
  border-bottom: 1px solid var(--line);
}

.resource-list {
  display: grid;
  gap: 14px;
}

.resource-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 132px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.resource-item:last-child {
  border-bottom: 1px solid var(--line);
}

.resource-item h3 {
  margin: 8px 0 10px;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.16;
  color: var(--green);
}

.resource-item p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.resource-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.photo-section {
  width: 100%;
  max-width: none;
  padding-left: clamp(20px, 4vw, 64px);
  padding-right: clamp(20px, 4vw, 64px);
  background: #1d1f1d;
  color: #f7f1e4;
}

.photo-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  width: min(1180px, 100%);
  margin: 0 auto 34px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filters button {
  min-width: 70px;
  min-height: 38px;
  border: 1px solid rgba(247, 241, 228, 0.22);
  border-radius: 999px;
  color: #f7f1e4;
  background: transparent;
  cursor: pointer;
}

.filters button.active {
  background: #f7f1e4;
  color: #1d1f1d;
}

.gallery {
  width: min(1180px, 100%);
  margin: 0 auto;
  columns: 3 260px;
  column-gap: 18px;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
  break-inside: avoid;
  text-align: left;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 500ms ease, opacity 300ms ease;
}

.photo-card.tall img {
  aspect-ratio: 3 / 4.4;
}

.photo-card span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #fff8ea;
  font-size: 14px;
  font-weight: 760;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.photo-card:hover img {
  transform: scale(1.035);
  opacity: 0.9;
}

.photo-card.is-hidden {
  display: none;
}

.about {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 380px);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}

.stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stack span {
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--green);
  font-weight: 760;
  background: rgba(255, 255, 255, 0.22);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 30px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer p {
  margin: 0;
}

.article-page {
  background: #f8f4ea;
}

.article-header {
  position: sticky;
  color: var(--ink);
  background: rgba(248, 244, 234, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  mix-blend-mode: normal;
}

.article-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 118px 0 84px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 14px;
}

.back-link:hover {
  color: var(--blue);
}

.article-hero {
  width: min(880px, 100%);
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.article-hero h1 {
  max-width: 820px;
  margin: 12px 0 20px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 1;
  color: var(--ink);
}

.article-summary {
  max-width: 720px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.72;
}

.article-meta {
  margin: 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 760;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 820px);
  gap: clamp(34px, 5vw, 76px);
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 96px;
  padding-top: 34px;
  color: var(--muted);
}

.article-toc p {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-toc nav {
  display: grid;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.article-toc a {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.article-toc a:hover {
  color: var(--blue);
}

.article-toc .toc-level-3 {
  padding-left: 14px;
  font-size: 13px;
}

.article-content {
  padding-top: 30px;
}

.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
  scroll-margin-top: 104px;
  margin: 42px 0 16px;
  letter-spacing: 0;
  color: var(--ink);
}

.article-content h2 {
  padding-top: 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

.article-content h3 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
}

.article-content h4,
.article-content h5 {
  font-size: 21px;
  line-height: 1.28;
}

.article-content h2 + h2 {
  margin-top: 22px;
}

.article-content p,
.article-content li {
  color: #34342f;
  font-size: 18px;
  line-height: 1.88;
}

.article-content p {
  margin: 0 0 18px;
}

.article-content ul {
  margin: 0 0 26px;
  padding-left: 1.2em;
}

.article-content li + li {
  margin-top: 8px;
}

.article-content blockquote {
  margin: 30px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--blue);
  background: rgba(34, 94, 116, 0.08);
}

.article-content blockquote p {
  margin-bottom: 0;
  color: var(--blue);
  font-weight: 700;
}

.article-content pre {
  overflow-x: auto;
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: #22231f;
  color: #f8f4ea;
  font-size: 15px;
  line-height: 1.7;
}

.math-block {
  overflow-x: auto;
  margin: 28px 0;
  padding: 20px 22px;
  border: 1px solid rgba(34, 94, 116, 0.2);
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
}

.math-inline {
  white-space: nowrap;
}

.article-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.article-content p code,
.article-content li code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  color: var(--blue);
}

.figure-note {
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px dashed rgba(62, 101, 73, 0.42);
  background: rgba(62, 101, 73, 0.07);
  color: var(--green);
  font-size: 15px;
}

.article-content hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 56px 20px 32px;
  background: rgba(11, 12, 11, 0.92);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 78vh;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
}

.lightbox p {
  margin: 18px 0 0;
  color: #f7f1e4;
  font-weight: 760;
}

.close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(247, 241, 228, 0.4);
  border-radius: 999px;
  color: #f7f1e4;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 820px) {
  .site-header {
    padding: 18px 20px;
  }

  .nav {
    gap: 14px;
    font-size: 13px;
  }

  .hero {
    min-height: 88vh;
  }

  .hero-content {
    padding-left: 20px;
  }

  .intro,
  .split,
  .resources,
  .about {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
    padding: 22px 0 6px;
  }

  .article-toc nav {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 0 10px;
    border-left: 0;
  }

  .article-toc a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.42);
  }

  .article-toc .toc-level-3 {
    padding-left: 12px;
  }

  .photo-head {
    align-items: start;
    flex-direction: column;
  }

  .filters {
    justify-content: flex-start;
  }

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

  .post a,
  .resource-item a {
    width: fit-content;
  }

  .resource-item {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }

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

@media (max-width: 520px) {
  .brand {
    font-size: 14px;
  }

  .nav {
    gap: 10px;
  }

  .hero-actions a {
    width: 100%;
  }

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