:root {
  --paper: #f3f0e8;
  --paper-deep: #e8e2d6;
  --ink: #1f2824;
  --ink-soft: #657068;
  --forest: #29463b;
  --forest-deep: #173129;
  --vermilion: #a24732;
  --line: rgba(31, 40, 36, 0.16);
  --white: #fffdf7;
  --shadow: 0 24px 80px rgba(13, 28, 22, 0.2);
  --display: "STKaiti", "Kaiti SC", "KaiTi", "FangSong", serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
  line-height: 1.8;
  letter-spacing: 0;
  transition: color .25s ease, background .25s ease;
}

body.dark {
  --paper: #18221f;
  --paper-deep: #202c28;
  --ink: #eeeade;
  --ink-soft: #aeb7b1;
  --forest: #b8c8bb;
  --forest-deep: #101816;
  --line: rgba(238, 234, 222, 0.16);
  --white: #f4f0e5;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
svg { width: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

::selection { color: var(--white); background: var(--vermilion); }

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: .6rem 1rem;
  color: #fff;
  background: var(--vermilion);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(1.2rem, 4vw, 4.5rem);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.brand { display: flex; align-items: center; gap: .8rem; width: max-content; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: var(--vermilion);
  font-family: var(--display);
  font-size: 1.25rem;
}
.brand-text { display: grid; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 600; }
.brand-text small { margin-top: .15rem; font-family: Georgia, serif; font-size: .55rem; letter-spacing: .18em; opacity: .68; }

.site-nav { display: flex; align-items: center; gap: 2.3rem; }
.site-nav a { position: relative; font-size: .86rem; opacity: .72; }
.site-nav a:hover, .site-nav a.active { opacity: 1; }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -.7rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.theme-toggle { justify-self: end; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.theme-toggle:hover { background: rgba(255,255,255,.12); }
.moon-icon { display: none; }
body.dark .sun-icon { display: none; }
body.dark .moon-icon { display: block; }
.menu-toggle { display: none; }

.hero {
  position: relative;
  min-height: 720px;
  height: 96svh;
  max-height: 1040px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: #20352d;
}
.hero-photo, .hero-shade { position: absolute; inset: 0; }
.hero-photo {
  background: url("assets/hero-fog.jpg") center 52% / cover no-repeat;
  transform: scale(1.02);
  animation: settle 1.8s ease-out both;
}
.hero-shade {
  background:
    linear-gradient(90deg, rgba(12, 27, 21, .82) 0%, rgba(12, 27, 21, .46) 48%, rgba(12, 27, 21, .13) 78%),
    linear-gradient(0deg, rgba(10, 24, 19, .42), transparent 45%);
}
.hero-content {
  position: relative;
  z-index: 2;
  width: min(700px, 80vw);
  margin-left: clamp(1.5rem, 10vw, 10rem);
  padding-top: 5rem;
}
.eyebrow {
  margin: 0 0 1.2rem;
  font-family: Georgia, serif;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .75;
}
.eyebrow.dark { color: var(--vermilion); opacity: 1; }
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 6.2vw, 6.7rem);
  font-weight: 400;
  line-height: 1.22;
}
.hero-copy { max-width: 530px; margin: 2rem 0 0; font-size: 1rem; line-height: 2; opacity: .78; }
.hero-actions { display: flex; align-items: center; gap: 2rem; margin-top: 2.7rem; }
.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 50px;
  padding: .65rem 1.2rem .65rem 1.5rem;
  color: var(--forest-deep);
  background: #f4f0e6;
  font-size: .85rem;
  font-weight: 600;
}
.primary-button svg { width: 1rem; transition: transform .2s ease; }
.primary-button:hover svg { transform: translateX(4px); }
.text-button {
  padding: .4rem 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.6);
  font-size: .85rem;
  cursor: pointer;
}
.hero-side-note {
  position: absolute;
  z-index: 2;
  right: clamp(1.2rem, 3vw, 3.5rem);
  top: 50%;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: Georgia, serif;
  font-size: .57rem;
  letter-spacing: .2em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}
.hero-side-note i { width: 1px; height: 68px; background: rgba(255,255,255,.46); }
.scroll-cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  font-size: .65rem;
  opacity: .7;
  transform: translateX(-50%);
}
.scroll-cue svg { width: .95rem; animation: float 1.8s ease-in-out infinite; }

.section-shell { width: min(1180px, calc(100% - 3rem)); margin-inline: auto; }
.manifesto {
  position: relative;
  min-height: 310px;
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}
.section-number { align-self: start; margin: 3rem 0 0; color: var(--ink-soft); font: .68rem Georgia, serif; letter-spacing: .12em; }
.manifesto blockquote {
  max-width: 790px;
  margin: 0 auto;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  line-height: 1.8;
  text-align: center;
}
.seal {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0;
  color: var(--vermilion);
  border: 1px solid var(--vermilion);
  font-family: var(--display);
  line-height: 1.1;
  writing-mode: vertical-rl;
}

.notes { padding-block: 8rem 9rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3.2rem; }
.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 5vw, 4.7rem);
  font-weight: 400;
  line-height: 1.2;
}
.section-heading > p { margin: 0 0 .5rem; color: var(--ink-soft); font-size: .85rem; text-align: right; }
.filter-bar { display: flex; gap: .55rem; margin-bottom: 2.2rem; border-bottom: 1px solid var(--line); }
.filter-button {
  position: relative;
  padding: .7rem 1.2rem 1rem;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.filter-button::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -1px;
  height: 2px;
  background: var(--vermilion);
  transition: left .2s ease, right .2s ease;
}
.filter-button:hover, .filter-button.active { color: var(--ink); }
.filter-button.active::after { left: 0; right: 0; }

.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4.5rem 2rem; }
.story { min-width: 0; }
.story-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: clamp(2rem, 5vw, 5.5rem); }
.story[hidden] { display: none; }
.story-image {
  position: relative;
  width: 100%;
  min-height: 340px;
  padding: 0;
  overflow: hidden;
  background-color: var(--paper-deep);
  background-position: center;
  background-size: cover;
  border: 0;
  cursor: pointer;
}
.story-featured .story-image { min-height: 490px; }
.story-image::after { content: ""; position: absolute; inset: 0; background: rgba(17,38,30,0); transition: background .35s ease; }
.story-image:hover::after { background: rgba(17,38,30,.18); }
.story-image-river { background-image: url("assets/river.jpg"); }
.story-image-autumn-street { background-image: url("assets/autumn-old-street.webp"); }
.story-image-sunset { background-image: url("assets/sunset.jpg"); }
.image-label {
  position: absolute;
  z-index: 2;
  left: 1.2rem;
  bottom: 1.2rem;
  padding: .4rem .7rem;
  color: #fff;
  background: rgba(19, 42, 33, .84);
  font-size: .67rem;
}
.story-body { padding: 1.4rem .5rem 0; }
.story-featured .story-body { padding: 0; }
.story-meta { margin: 0 0 .8rem; color: var(--vermilion); font-size: .68rem; letter-spacing: .12em; }
.story h3 { margin: 0; font-family: var(--display); font-size: clamp(1.55rem, 2.2vw, 2.3rem); font-weight: 400; line-height: 1.5; }
.story h3 button { padding: 0; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.story h3 button:hover { color: var(--vermilion); }
.story-body > p:not(.story-meta) { margin: 1rem 0 1.2rem; color: var(--ink-soft); font-size: .88rem; }
.read-link { padding: .25rem 0; color: var(--ink); background: transparent; border: 0; font-size: .78rem; cursor: pointer; }
.read-link span { display: inline-block; margin-left: .5rem; color: var(--vermilion); transition: transform .2s ease; }
.read-link:hover span { transform: translateX(4px); }
.empty-state { padding: 4rem 0; color: var(--ink-soft); text-align: center; }

.about { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); min-height: 700px; background: var(--paper-deep); }
.about-photo { min-height: 650px; background: url("assets/about-autumn.jpg") center / cover no-repeat; filter: saturate(.72); }
.about-content { align-self: center; max-width: 620px; padding: 5rem clamp(3rem, 7vw, 8rem); }
.about-content .section-number { margin: 0 0 4rem; }
.about h2 { margin: 0 0 2rem; font-family: var(--display); font-size: clamp(2.4rem, 4vw, 4.2rem); font-weight: 400; line-height: 1.4; }
.about h2 em { color: var(--vermilion); font-style: normal; }
.about-content > p:not(.eyebrow):not(.section-number) { color: var(--ink-soft); font-size: .9rem; }
.about-signature { display: flex; align-items: end; gap: 1rem; margin-top: 2.5rem; }
.about-signature span { color: var(--vermilion); font-family: var(--display); font-size: 2rem; transform: rotate(-5deg); }
.about-signature small { margin-bottom: .35rem; color: var(--ink-soft); }

.site-footer {
  color: rgba(255,255,255,.65);
  background: #14251f;
  font-size: .72rem;
}
.footer-primary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  min-height: 108px;
  padding: 2rem clamp(1.5rem, 5vw, 5rem);
}
.footer-brand { color: #fff; font-family: var(--display); font-size: 1.3rem; }
.site-footer p { margin: 0; }
.copyright { justify-self: end; }
.filing-records {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 48px;
  padding: .7rem 1.5rem;
  color: rgba(255,255,255,.52);
  background: rgba(0,0,0,.12);
  border-top: 1px solid rgba(255,255,255,.1);
}
.filing-link { display: inline-flex; align-items: center; gap: .45rem; transition: color .2s ease; }
.filing-link svg { width: .95rem; flex: 0 0 auto; }
.filing-link:hover { color: #fff; }
.filing-divider { width: 1px; height: 12px; background: rgba(255,255,255,.2); }

.article-dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: 88svh;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  box-shadow: var(--shadow);
}
.article-dialog::backdrop { background: rgba(10, 22, 18, .78); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; z-index: 2; top: 1rem; right: 1rem; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; }
.dialog-scroll { max-height: 88svh; overflow-y: auto; padding: clamp(3rem, 7vw, 5.5rem); }
.dialog-kicker { margin: 0 0 1rem; color: var(--vermilion); font-size: .72rem; }
.article-dialog h2 { margin: 0; font-family: var(--display); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 400; line-height: 1.45; }
.dialog-rule { width: 48px; height: 2px; margin: 2rem 0; background: var(--vermilion); }
.dialog-content { color: var(--ink-soft); font-size: .95rem; }
.dialog-content p { margin: 0 0 1.5rem; }
.dialog-content p:first-child::first-letter { float: left; margin: .25rem .5rem 0 0; color: var(--vermilion); font-family: var(--display); font-size: 3.8rem; line-height: .8; }

@keyframes settle { from { opacity: .5; transform: scale(1.08); } to { opacity: 1; transform: scale(1.02); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (max-width: 820px) {
  .site-header { height: 74px; grid-template-columns: 1fr auto auto; gap: .4rem; padding-inline: 1rem; }
  .brand-mark { width: 34px; height: 34px; }
  .menu-toggle { display: grid; color: #fff; }
  .theme-toggle { width: 38px; height: 38px; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 74px;
    display: grid;
    gap: 0;
    padding: 1rem;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 16px 35px rgba(0,0,0,.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: .2s ease;
  }
  .site-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .site-nav a { padding: .8rem; }
  .site-nav a.active::after { display: none; }
  .hero { min-height: 680px; height: 92svh; }
  .hero-photo { animation: none; transform: none; }
  .hero-shade { background: linear-gradient(90deg, rgba(12,27,21,.8), rgba(12,27,21,.3)), linear-gradient(0deg, rgba(10,24,19,.48), transparent); }
  .hero-content { width: calc(100% - 3rem); margin-inline: 1.5rem; padding-top: 4rem; }
  .hero h1 { font-size: clamp(3rem, 13vw, 4.4rem); }
  .hero-copy { font-size: .9rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 1.2rem; margin-top: 2rem; }
  .hero-side-note { display: none; }
  .scroll-cue { left: auto; right: 1.5rem; transform: none; }
  .section-shell { width: min(100% - 2rem, 1180px); }
  .manifesto { min-height: 280px; grid-template-columns: 1fr; padding: 4rem 1rem; }
  .manifesto .section-number { display: none; }
  .seal { position: absolute; right: 0; bottom: 1.5rem; width: 46px; height: 46px; }
  .notes { padding-block: 5.5rem 6rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .filter-bar { overflow-x: auto; }
  .filter-button { flex: 0 0 auto; }
  .story-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .story-featured { grid-column: auto; display: block; }
  .story-image, .story-featured .story-image { min-height: 330px; }
  .story-featured .story-body { padding: 1.4rem .5rem 0; }
  .about { grid-template-columns: 1fr; }
  .about-photo { min-height: 410px; }
  .about-content { padding: 4.5rem 1.5rem; }
  .about-content .section-number { margin-bottom: 2rem; }
  .footer-primary { grid-template-columns: 1fr; gap: .25rem; padding-block: 2.2rem; text-align: center; }
  .copyright { justify-self: center; }
  .filing-records { flex-direction: column; gap: .45rem; min-height: 82px; }
  .filing-divider { width: 38px; height: 1px; }
  .dialog-scroll { padding: 4.5rem 1.5rem 3rem; }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .hero h1 { font-size: 2.9rem; }
  .hero-copy { line-height: 1.8; }
  .primary-button { min-height: 48px; }
  .story-image, .story-featured .story-image { min-height: 270px; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-photo { min-height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
