:root {
  --paper: #f4f0e6;
  --paper-deep: #eae3d5;
  --ink: #1c211e;
  --muted: #64685f;
  --line: rgba(28, 33, 30, 0.16);
  --line-soft: rgba(28, 33, 30, 0.09);
  --accent: #2d5a4a;
  --accent-soft: #b9d0c4;
  --warm: #b4512c;
  --card: #1d2924;
  --card-ink: #e9e5d9;
  --code: #202723;
  --code-ink: #e6e1d4;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

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

::selection {
  background: var(--accent);
  color: #fffdf7;
}

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

p,
h1,
h2,
h3,
dl,
dd,
figure,
pre {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  font-family: var(--mono);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: #fffdf7;
  font-size: 13px;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.wrap {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(244, 240, 230, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: -0.06em;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.brand-text small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.19em;
  line-height: 1.2;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-header nav a {
  position: relative;
  padding-block: 6px;
  color: var(--muted);
  font-size: 14px;
  transition: color 180ms ease;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms var(--ease);
}

.site-header nav a:hover {
  color: var(--ink);
}

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

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

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(280px, 0.82fr);
  gap: clamp(44px, 7vw, 92px);
  align-items: end;
  padding-block: clamp(68px, 9vw, 112px) clamp(68px, 8vw, 100px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(42px, 5.5vw, 68px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.16;
}

.lede {
  max-width: 620px;
  margin-top: 28px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 16.5px);
  line-height: 1.95;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 38px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.hero-meta time {
  color: var(--ink);
}

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

.now-card {
  position: relative;
  padding: 25px 26px 22px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--card);
  color: var(--card-ink);
  box-shadow: 0 26px 60px -44px rgba(24, 36, 30, 0.8);
}

.now-card::after {
  position: absolute;
  top: -70px;
  right: -60px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(233, 229, 217, 0.1);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(233, 229, 217, 0.14);
}

.mono {
  color: rgba(233, 229, 217, 0.58);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-soft);
  font-size: 10.5px;
  white-space: nowrap;
}

.status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8fc7a8;
  box-shadow: 0 0 0 3px rgba(143, 199, 168, 0.12);
}

.now-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-block: 14px;
  border-bottom: 1px solid rgba(233, 229, 217, 0.1);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.now-list li span {
  min-width: 18px;
  color: rgba(185, 208, 196, 0.64);
  font-family: var(--mono);
  font-size: 9px;
}

.now-note {
  padding-top: 19px;
  color: rgba(233, 229, 217, 0.56);
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

/* ---------- notes ---------- */

.notes {
  padding-block: clamp(58px, 7vw, 88px) clamp(72px, 8vw, 104px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 46px;
}

.section-kicker {
  margin-bottom: 9px;
  color: var(--warm);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  line-height: 1.5;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.section-intro {
  max-width: 310px;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.note-list {
  border-top: 1px solid var(--line);
}

.note {
  display: grid;
  grid-template-columns: 54px minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(24px, 4vw, 52px);
  padding-block: 42px 46px;
  border-bottom: 1px solid var(--line);
}

.note-index {
  padding-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.note-head h3 {
  max-width: 330px;
  text-wrap: balance;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.5;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.note-meta span {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
}

.note-body {
  max-width: 590px;
}

.note-body p {
  color: #4f554d;
  font-size: 13.5px;
  line-height: 1.95;
}

.note-body p code {
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(45, 90, 74, 0.08);
  color: var(--accent);
  font-size: 0.9em;
}

.note-body pre {
  margin-block: 19px;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: 2px;
  background: var(--code);
  color: var(--code-ink);
  font-size: 11.5px;
  line-height: 1.75;
  tab-size: 4;
}

.note-body pre code {
  font-family: var(--mono);
  white-space: pre;
}

/* ---------- about ---------- */

.about {
  padding-block: clamp(62px, 7vw, 84px);
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.about .section-head {
  margin-bottom: 34px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(44px, 8vw, 100px);
}

.about-lead {
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.6;
}

.about-copy p:not(.about-lead) {
  color: #53584f;
  font-size: 14px;
  line-height: 1.95;
}

.about-copy p + p {
  margin-top: 15px;
}

.facts {
  align-self: start;
  border-top: 1px solid var(--line);
}

.facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.facts dd {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  text-align: right;
}

/* ---------- 404 ---------- */

.not-found {
  padding-block: clamp(84px, 12vw, 140px) clamp(100px, 14vw, 160px);
}

.not-found h1 {
  max-width: 720px;
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.24;
}

.not-found .lede {
  margin-top: 20px;
}

.not-found-action {
  margin-top: 34px;
}

.back-link {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  font-size: 13px;
  transition: background-color 180ms ease, color 180ms ease;
}

.back-link:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- footer ---------- */

.site-footer {
  padding-block: 46px 38px;
  background: #1a241f;
  color: #d8d4c8;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.brand-mark--light {
  border-color: rgba(233, 229, 217, 0.4);
  color: #e9e5d9;
}

.footer-brand p {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
}

.footer-brand small {
  color: rgba(216, 212, 200, 0.48);
  font-family: var(--sans);
  font-size: 11px;
  line-height: 1.6;
}

.footer-legal {
  text-align: right;
}

.footer-legal p {
  color: rgba(216, 212, 200, 0.5);
  font-size: 11px;
  line-height: 1.95;
}

.footer-legal .icp {
  margin-top: 12px;
}

.footer-legal .icp a {
  display: inline-block;
  padding: 2px 0 3px;
  border-bottom: 1px solid rgba(216, 212, 200, 0.55);
  color: #f1ede2;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  transition: border-color 180ms ease, color 180ms ease;
}

.footer-legal .icp a:hover {
  border-color: rgba(233, 229, 217, 0.8);
  color: #fffdf7;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
    align-items: start;
  }

  .now-card {
    width: min(100%, 520px);
  }

  .note {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 16px 26px;
  }

  .note-head {
    grid-column: 2;
  }

  .note-body {
    grid-column: 2;
    max-width: 680px;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .facts {
    max-width: 520px;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 82px;
  }

  .wrap {
    width: calc(100% - 32px);
  }

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

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    font-size: 9px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .brand-text small {
    font-size: 7.5px;
  }

  .site-header nav {
    gap: 17px;
  }

  .site-header nav a {
    font-size: 12px;
  }

  .hero {
    padding-block: 52px 64px;
  }

  .eyebrow {
    margin-bottom: 18px;
    font-size: 9px;
  }

  .hero h1 {
    font-size: clamp(35px, 10vw, 46px);
    letter-spacing: -0.04em;
  }

  .lede {
    margin-top: 22px;
    font-size: 14px;
  }

  .hero-meta {
    margin-top: 28px;
    gap: 9px;
    font-size: 9.5px;
  }

  .sep {
    width: 12px;
  }

  .now-card {
    padding: 21px 20px 18px;
  }

  .note {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-block: 32px 36px;
  }

  .note-index {
    display: none;
  }

  .note-head,
  .note-body {
    grid-column: 1;
  }

  .note-head h3 {
    max-width: none;
    font-size: 21px;
  }

  .note-meta {
    margin-top: 10px;
  }

  .note-body {
    margin-top: 17px;
  }

  .note-body pre {
    margin-block: 16px;
    padding: 15px 16px;
    font-size: 10.5px;
  }

  .section-head {
    display: block;
    margin-bottom: 30px;
  }

  .section-intro {
    max-width: none;
    margin-top: 14px;
    padding-bottom: 0;
  }

  .about {
    padding-block: 52px;
  }

  .about .section-head {
    margin-bottom: 24px;
  }

  .about-lead {
    font-size: 21px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 28px;
  }

  .footer-legal {
    text-align: left;
  }

  .footer-legal .icp a {
    font-size: 11px;
  }
}

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

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