@charset "UTF-8";

@font-face {
  font-family: "WenKai Display";
  src: url("/assets/fonts/wenkai-display.woff2") format("woff2");
  font-weight: 500;
  font-display: block;
}
@font-face {
  font-family: "Noto Serif Page";
  src: url("/assets/fonts/noto-serif.woff2") format("woff2");
  font-weight: 500;
  font-display: block;
}

/* One sheet of red-ruled letter paper. Every size below is a pixel of the 1376 x 768
   reference layout multiplied by --s, so the page keeps its proportions on any screen. */
:root {
  --paper: #F3EFE4;
  --ink: #1D2125;
  --brush: #16171A;
  --zhu: #B4483C;
  --rule: rgb(180 72 60 / .7);
  --seal: #C0392B;
  --kai: "WenKai Display", "LXGW WenKai", "STKaiti", "KaiTi", serif;
  --serif: "Noto Serif Page", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --s: min(calc(100vw / 1376), calc(100svh / 768));
  color-scheme: light;
}

/* Dark mode turns the sheet into 乌丝栏 paper: light ink on dark ground, dimmer rules. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B1916;
    --ink: #E9E2D3;
    --brush: #F0E9DA;
    --zhu: #CF5446;
    --rule: rgb(207 84 70 / .5);
    --seal: #B8392C;
    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
body::after {
  /* Paper grain and fibres lie over everything, ink included, as on real paper. */
  content: "";
  position: fixed;
  inset: 0;
  background: url("/assets/paper.svg");
  mix-blend-mode: multiply;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  body::after { filter: invert(1); mix-blend-mode: screen; opacity: .6; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: calc(192 * var(--s));
  /* The reference sits 8 px right of centre. */
  margin-left: calc(17 * var(--s));
}

/* ---------- the letter paper ---------- */
.jian {
  position: relative;
  box-sizing: content-box;
  /* Rounded to whole pixels per column so all seven rules stay equally sharp. */
  width: round(calc(448 * var(--s)), 8px);
  height: calc(653 * var(--s));
  border: calc(2 * var(--s)) solid var(--zhu);
  background: linear-gradient(to left, var(--rule) 1px, transparent 1px) 0 0 / calc(100% / 8) 100% repeat-x;
}
.headline { margin: 0; font-weight: 500; }
.head {
  position: absolute;
  writing-mode: vertical-rl;
  padding: calc(6 * var(--s)) 0;
  transform: translateX(-50%);
  /* The characters sit on a rule; the paper behind them interrupts it. */
  background: var(--paper);
  color: var(--brush);
  font: 500 calc(92 * var(--s))/1 var(--kai);
  letter-spacing: calc(3 * var(--s));
  -webkit-text-stroke: .036em currentColor;
}
.head.first { left: calc(100% * 7 / 8); top: calc(58 * var(--s)); }
.head.second { left: calc(100% * 5 / 8); top: calc(98 * var(--s)); }
.head i {
  display: inline-block;
  font-style: normal;
  animation: ink .7s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i) * 110ms + 150ms);
}
.sign {
  position: absolute;
  left: calc(100% / 16);
  bottom: calc(10 * var(--s));
  margin: 0;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  color: var(--brush);
  font: 500 calc(22 * var(--s))/1 var(--kai);
  letter-spacing: calc(4.6 * var(--s));
  -webkit-text-stroke: .03em currentColor;
}
.seal {
  position: absolute;
  right: calc(100% + 12 * var(--s));
  bottom: calc(-2 * var(--s));
  display: grid;
  place-content: center;
  width: calc(45 * var(--s));
  height: calc(45 * var(--s));
  border-radius: calc(4 * var(--s));
  background: var(--seal);
  color: #F8F1E4;
  writing-mode: vertical-rl;
  font: 500 calc(17.5 * var(--s))/1.08 var(--serif);
  filter: url(#seal-edge);
  animation: stamp .42s ease-out 1.4s both;
}

/* ---------- the left column ---------- */
.info { width: calc(406 * var(--s)); }
.lede {
  margin: 0;
  font: 500 calc(406 / 17 * var(--s))/1.2 var(--serif);
  white-space: nowrap;
}
.figure {
  position: relative;
  margin: calc(8 * var(--s)) 0 0;
  line-height: 1;
}
.num {
  display: block;
  /* Pulled left by the 1's side bearing so the ink spans exactly the column width. */
  margin-left: calc(-10 * var(--s));
  font: 500 calc(171 * var(--s))/.98 var(--serif);
  letter-spacing: calc(-4 * var(--s));
  font-variant-numeric: lining-nums;
}
.unit {
  position: absolute;
  right: 0;
  /* Just under the baseline, clear of the percent sign's lower ring. */
  bottom: calc(-12 * var(--s));
  font: 500 calc(17 * var(--s))/1 var(--serif);
}
.get {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(52 * var(--s));
  margin-top: calc(44 * var(--s));
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font: 500 calc(19 * var(--s))/1 var(--serif);
  letter-spacing: calc(1 * var(--s));
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.get::before {
  content: "";
  position: absolute;
  inset: calc(4 * var(--s));
  border: 1px solid var(--zhu);
  pointer-events: none;
}
.get:hover, .get:focus-visible {
  background: rgb(180 72 60 / .08);
  color: var(--zhu);
  border-color: var(--zhu);
  outline: none;
}
.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(8 * var(--s));
  margin-top: calc(18 * var(--s));
  font: 500 max(12px, calc(13 * var(--s)))/1.4 var(--serif);
  color: var(--ink);
  opacity: .78;
}
.links a, .credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}
.links a:hover, .credit a:hover {
  color: var(--zhu);
  text-decoration-color: var(--zhu);
}
.credit {
  margin: calc(10 * var(--s)) 0 0;
  text-align: center;
  font: 500 max(11px, calc(11.5 * var(--s)))/1.5 var(--serif);
  color: var(--ink);
  opacity: .64;
}

@keyframes ink {
  from { opacity: 0; filter: blur(8px); transform: scale(1.08); }
  to { opacity: 1; filter: none; transform: none; }
}
@keyframes stamp {
  0% { opacity: 0; transform: scale(1.7) rotate(-9deg); }
  65% { opacity: 1; transform: scale(.94); }
  100% { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .head i, .seal { animation: none; }
}

/* Phones and tall windows: the sheet on top, the left column below it. The seal hangs
   57 reference pixels left of the sheet, so the scale leaves room for it. */
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
  :root { --s: min(calc((100vw - 36px) / 507), calc(100svh / 900)); }
  body { padding: 32px 16px; }
  .stage { flex-direction: column; gap: calc(72 * var(--s)); margin-left: 0; }
  .jian { margin-left: calc(57 * var(--s)); }
  .info { width: calc(450 * var(--s)); margin-left: calc(57 * var(--s)); }
  .lede { font-size: calc(450 / 17 * var(--s)); }
  .num { font-size: calc(195 * var(--s)); }
}
