:root {
  color-scheme: dark;
  --bg: #101112;
  --surface: #171819;
  --surface-strong: #1d1e20;
  --text: #e9e4d8;
  --muted: #a8a397;
  --faint: #77746d;
  --line: rgba(233, 228, 216, 0.14);
  --line-strong: rgba(233, 228, 216, 0.28);
  --accent: #bd4b35;
  --gold: #c7a565;
  --shadow: rgba(5, 6, 7, 0.35);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --page: min(1280px, calc(100vw - 64px));
  --reading: min(760px, calc(100vw - 40px));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #e9e6de;
  --surface: #f1eee7;
  --surface-strong: #dedad0;
  --text: #202123;
  --muted: #5f5d58;
  --faint: #7c7971;
  --line: rgba(32, 33, 35, 0.16);
  --line-strong: rgba(32, 33, 35, 0.3);
  --accent: #a83f2c;
  --gold: #806635;
  --shadow: rgba(32, 33, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.article-page {
  --ink: var(--bg);
  --panel: var(--surface);
  --panel2: var(--surface-strong);
  --moon: var(--text);
  --moon-dim: var(--muted);
  --mist: var(--faint);
  --cf-wx-radius: 2px;
}

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

button {
  color: inherit;
  font: inherit;
}

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

::selection {
  background: var(--gold);
  color: var(--bg);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  width: max-content;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: var(--accent);
  color: #f2e9dc;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.brand-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  font-size: 14px;
  color: var(--muted);
}

.site-nav a,
.text-link {
  transition: color 220ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  color: var(--accent);
}

.theme-toggle,
.menu-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  padding: 10px 0;
  color: var(--muted);
  font-family: var(--serif);
}

.theme-divider {
  width: 22px;
  height: 1px;
  background: var(--line-strong);
}

.menu-toggle {
  display: none;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(560px, 1.45fr);
  gap: clamp(48px, 7vw, 112px);
  align-items: center;
  width: var(--page);
  min-height: calc(100dvh - 70px);
  margin: 0 auto;
  padding: clamp(48px, 7vh, 82px) 0;
}

.home-intro {
  align-self: start;
  padding-top: clamp(30px, 7vh, 86px);
}

.edition,
.article-category {
  margin: 0 0 22px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.home-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 7.3vw, 112px);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 0.98;
}

.home-lead {
  max-width: 22em;
  margin: 30px 0 34px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.8;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 600;
}

.text-link span {
  transition: transform 260ms var(--ease);
}

.text-link:hover span {
  transform: translateX(5px);
}

.article-waterfall {
  min-width: 0;
}

.article-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 22px 70px var(--shadow);
  break-inside: avoid;
  transition: border-color 260ms ease, transform 400ms var(--ease);
}

.article-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.article-card-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-strong);
}

.article-card-cover::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  content: "";
  pointer-events: none;
}

.article-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease), filter 500ms ease;
}

.article-card:hover .article-card-cover img {
  transform: scale(1.018);
  filter: contrast(1.04);
}

.article-card-body {
  display: block;
  padding: clamp(24px, 3vw, 38px);
}

.article-card-body .article-category {
  display: block;
  margin-bottom: 16px;
}

.article-card-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(29px, 3.1vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.22;
  transition: color 220ms ease;
}

.article-card:hover .article-card-title {
  color: var(--accent);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.7;
}

.article-card-body .byline {
  margin-top: 18px;
}

.article-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
}

.card-read {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 600;
}

.card-read > span {
  transition: transform 260ms var(--ease);
}

.article-card:hover .card-read > span {
  transform: translateX(5px);
}

/*
  The article stream becomes a true masonry-style column flow as soon as
  a second published card is present. A single article stays full-width.
*/
.article-waterfall:has(.article-card:nth-child(2)) {
  column-count: 2;
  column-gap: 28px;
}

.article-waterfall:has(.article-card:nth-child(3)) {
  column-count: 3;
}

.article-waterfall:has(.article-card:nth-child(2)) .article-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 28px;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  width: var(--page);
  min-height: 156px;
  margin: 0 auto;
  color: var(--faint);
  font-size: 12px;
}

.site-footer > p {
  margin: 0;
}

.site-footer .copyright {
  justify-self: end;
}

.footer-brand {
  color: var(--text);
}

.about-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.about-inner {
  display: grid;
  grid-template-columns: 0.65fr 1.1fr auto;
  gap: clamp(36px, 7vw, 110px);
  align-items: start;
  width: var(--page);
  margin: 0 auto;
  padding: clamp(76px, 9vw, 132px) 0;
}

.about-inner h1,
.about-inner h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 600;
  line-height: 1.2;
}

.about-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
}

.topics {
  margin: 4px 0 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 2.1;
  writing-mode: vertical-rl;
}

/* Article */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

@supports (animation-timeline: scroll()) {
  .reading-progress {
    animation: reading-progress linear both;
    animation-timeline: scroll();
  }
}

.article-header {
  width: min(1120px, calc(100vw - 64px));
  margin: 0 auto;
  padding: clamp(64px, 8vw, 116px) 0 0;
}

.article-tools {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 46px;
}

.back-link {
  display: inline-block;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  transition: color 180ms ease;
}

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

.article-share-slot {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 96px;
  min-height: 44px;
}

.article-page > .cf-wx-share-trigger {
  display: none;
}

.article-share-slot .cf-wx-share-trigger {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.article-share-slot .cf-wx-share-trigger:hover,
.article-share-slot .cf-wx-share-trigger:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.article-header .article-category {
  margin-bottom: 20px;
}

.article-header h1 {
  max-width: 1080px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 82px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.17;
}

.article-header .byline {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-cover {
  width: min(1280px, calc(100vw - 64px));
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin: clamp(48px, 6vw, 86px) auto 0;
  background: var(--surface);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  width: var(--reading);
  margin: 0 auto;
  padding: clamp(70px, 9vw, 124px) 0 136px;
  font-family: var(--serif);
}

.article-body .standfirst {
  margin: 0 0 58px;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-size: clamp(22px, 2.3vw, 30px);
  font-weight: 500;
  line-height: 1.75;
}

.article-body h2 {
  margin: 90px 0 34px;
  color: var(--text);
  font-size: clamp(28px, 3.3vw, 42px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.35;
}

.article-body p {
  margin: 0 0 30px;
  color: color-mix(in srgb, var(--text) 91%, var(--muted));
  font-size: clamp(18px, 1.65vw, 21px);
  letter-spacing: 0.012em;
  line-height: 2.05;
}

.article-body strong {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.article-body .key-line {
  margin: 64px -44px;
  padding: 30px 0 30px 42px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.75;
}

.article-body .ending {
  margin-top: 70px;
  color: var(--text);
  font-size: clamp(24px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.7;
}

.article-end {
  width: var(--reading);
  margin: 0 auto 120px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.article-end p {
  margin: 0 0 18px;
  color: var(--faint);
  font-size: 13px;
}

.article-end a {
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
}

@keyframes reading-progress {
  to {
    transform: scaleX(1);
  }
}

@keyframes intro-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .home-intro,
  .article-waterfall,
  .article-header > *,
  .article-cover {
    animation: intro-in 720ms var(--ease) both;
  }

  .article-waterfall,
  .article-header h1 {
    animation-delay: 90ms;
  }

  .article-header .byline,
  .article-cover {
    animation-delay: 160ms;
  }
}

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

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

@media (max-width: 960px) {
  :root {
    --page: min(100% - 40px, 760px);
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 46px;
    min-height: auto;
    padding: 56px 0 82px;
  }

  .home-intro {
    padding-top: 0;
  }

  .home-lead {
    max-width: 32em;
  }

  .article-waterfall:has(.article-card:nth-child(3)) {
    column-count: 2;
  }

  .about-inner {
    grid-template-columns: 0.7fr 1.3fr;
  }

  .topics {
    grid-column: 2;
    writing-mode: horizontal-tb;
  }
}

@media (max-width: 680px) {
  :root {
    --page: calc(100vw - 32px);
    --reading: calc(100vw - 36px);
  }

  .site-header {
    grid-template-columns: 1fr auto auto;
    min-height: 64px;
    padding: 0 16px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-seal {
    width: 29px;
    height: 29px;
    font-size: 16px;
  }

  .menu-toggle {
    display: block;
    padding: 10px 14px;
    color: var(--muted);
    font-size: 13px;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    display: none;
    width: 100%;
    padding: 22px 16px 26px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

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

  .theme-toggle {
    font-size: 13px;
  }

  .theme-divider {
    width: 14px;
  }

  .home-hero {
    gap: 42px;
    padding: 48px 0 72px;
  }

  .home-intro h1 {
    font-size: clamp(56px, 18vw, 76px);
  }

  .home-lead {
    margin: 24px 0 28px;
    font-size: 18px;
  }

  .article-card-title {
    font-size: 29px;
    line-height: 1.3;
  }

  .article-card-body .byline {
    display: grid;
    grid-template-columns: auto auto;
  }

  .article-card-body .byline time {
    grid-column: 1 / -1;
  }

  .article-preview {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .article-waterfall:has(.article-card:nth-child(2)),
  .article-waterfall:has(.article-card:nth-child(3)) {
    column-count: 1;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 72px 0;
  }

  .about-copy p {
    font-size: 17px;
  }

  .topics {
    grid-column: 1;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 44px 0;
  }

  .site-footer .copyright {
    justify-self: start;
  }

  .article-header {
    width: calc(100vw - 36px);
    padding-top: 52px;
  }

  .article-tools {
    margin-bottom: 34px;
  }

  .article-header h1 {
    font-size: clamp(38px, 11vw, 54px);
    letter-spacing: -0.045em;
    line-height: 1.2;
  }

  .article-header .byline {
    display: grid;
    grid-template-columns: auto auto;
    margin-top: 24px;
    padding-top: 18px;
  }

  .article-header .byline time {
    grid-column: 1 / -1;
  }

  .article-cover {
    width: calc(100vw - 24px);
    margin-top: 42px;
  }

  .article-body {
    padding: 68px 0 96px;
  }

  .article-body .standfirst {
    margin-bottom: 50px;
    padding-bottom: 36px;
    font-size: 21px;
  }

  .article-body h2 {
    margin: 70px 0 28px;
    font-size: 30px;
  }

  .article-body p {
    margin-bottom: 26px;
    font-size: 18px;
    line-height: 2;
  }

  .article-body .key-line {
    margin: 52px 0;
    padding: 24px 0 24px 22px;
    font-size: 22px;
  }

  .article-body .ending {
    font-size: 25px;
  }

  .article-end {
    margin-bottom: 88px;
  }
}
