@font-face { font-family: "Source Serif"; src: url(fonts/SourceSerifPro-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url(fonts/SourceSerifPro-It.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url(fonts/SourceSerifPro-Semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans"; src: url(fonts/SourceSansPro-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans"; src: url(fonts/SourceSansPro-It.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans"; src: url(fonts/SourceSansPro-Semibold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans"; src: url(fonts/SourceSansPro-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "LM Math"; src: url(fonts/LatinModernMath-sub.woff2) format("woff2"); font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #030306;
  --card: #0a0a0f;
  --card-2: #101017;
  --text: #d7d7de;
  --bright: #f6f6f8;
  --muted: #9a9aa6;
  --faint: #66667a;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --pink: #ffb7c5;
  --pink-2: #ffb7c5;
  --on-pink: #2a0f17;
  --plate: #ffffff;
  --sans: "Source Sans", "Source Sans Pro", -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Source Serif", "Source Serif Pro", Georgia, "Songti SC", serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --math: "LM Math", "Latin Modern Math", serif;
  --wide: 1240px;
  --col: 680px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: 0.85em; color: var(--bright); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px clamp(18px, 3vw, 40px); background: rgba(3, 3, 6, 0.72); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
.nav.over { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(3,3,6,.75), rgba(3,3,6,0)); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand { display: flex; align-items: center; gap: 6px; color: var(--bright); font: 400 16px/1 var(--sans); }
.brand a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; transition: color .2s; }
.brand a:hover { color: var(--pink-2); }
.brand b { font-weight: 700; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); font: 400 15px/1 var(--sans); }
.nav nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav nav a:hover { color: var(--bright); }
.nav .lang { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; margin: -7px 0; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: clamp(620px, 100svh, 980px); display: grid; align-items: center; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 75%); }
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-mark { position: absolute; right: max(-140px, calc(50% - 820px)); top: 50%; width: min(700px, 58vw); transform: translateY(-50%); opacity: 0.1; z-index: -1; animation: float 14s ease-in-out infinite; pointer-events: none; }
@keyframes float { 50% { transform: translateY(calc(-50% - 18px)) rotate(-1.5deg); } }
.hero-in { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 120px clamp(20px, 4vw, 48px) 120px; }
.hero h1 { margin: 0; font: 700 clamp(64px, 12.5vw, 188px)/0.86 var(--sans); letter-spacing: -0.045em; color: var(--bright); }
.hero h1 span { display: block; }
.hero h1 span + span { color: var(--pink); padding-bottom: 0.08em; }
.hero-line { margin: 36px 0 0; font: 400 clamp(19px, 2vw, 26px)/1.4 var(--sans); color: var(--bright); max-width: 26em; }
.hero-motto { margin: 14px 0 0; font: 400 14px/1.5 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
.scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); font: 400 13px/1 var(--mono); color: var(--faint); text-decoration: none; padding-bottom: 34px; }
.scroll::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 26px; background: var(--pink); animation: drip 2s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- sections ---------- */
.sec { max-width: var(--wide); margin: 0 auto; padding: clamp(72px, 10vw, 128px) clamp(20px, 4vw, 48px) 0; }
.sec:last-of-type { padding-bottom: clamp(72px, 10vw, 128px); }
.sec-h { display: flex; align-items: baseline; gap: 16px; font: 700 clamp(30px, 3.6vw, 48px)/1.05 var(--sans); letter-spacing: -0.03em; color: var(--bright); margin: 0 0 clamp(28px, 4vw, 44px); }
.sec-h::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--pink); transform: translateY(-4px); flex: none; }
.sec-h .more { margin-left: auto; font: 400 15px/1 var(--sans); letter-spacing: 0; color: var(--muted); text-decoration: none; }
.sec-h .more:hover { color: var(--pink-2); }


/* areas */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 14px; }
.area { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 250px; padding: 26px 24px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); text-decoration: none; overflow: hidden; transition: border-color .25s, transform .25s var(--ease); }
.area:hover { border-color: var(--pink); }
.icon { width: 40px; height: 40px; fill: none; stroke: var(--pink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.area h3 { margin: 18px 0 0; font: 700 21px/1.2 var(--sans); color: var(--bright); letter-spacing: -0.01em; }
.area p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.area .count { margin-top: auto; font: 400 12.5px/1.5 var(--mono); color: var(--faint); }

/* latest */
.latest { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; padding: clamp(18px, 2.4vw, 28px); border-radius: 24px; border: 1px solid var(--line); background: var(--card); text-decoration: none; }
.latest:hover { border-color: var(--pink); }
.latest-img { border-radius: 14px; background: var(--plate); padding: clamp(10px, 1.6vw, 20px); transform: perspective(1400px) rotateY(6deg) rotateX(2deg); transition: transform .6s var(--ease); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9); }
.latest:hover .latest-img { transform: perspective(1400px) rotateY(0) rotateX(0); }
.kicker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; font: 400 12.5px/1 var(--mono); color: var(--muted); }
.kicker span { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.kicker span:first-child { color: var(--on-pink); background: var(--pink); border-color: var(--pink); }
.latest h3 { margin: 0; font: 700 clamp(28px, 3.2vw, 42px)/1.05 var(--sans); letter-spacing: -0.025em; color: var(--bright); }
.latest-sub { margin: 10px 0 0; font: 400 19px/1.35 var(--sans); color: var(--text); }
.latest-sum { margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 34em; }
.go { display: inline-block; margin-top: 22px; font: 600 15px/1 var(--sans); color: var(--pink-2); }
.go::after { content: ""; display: inline-block; width: 22px; height: 1px; background: currentColor; vertical-align: middle; margin-left: 10px; transition: width .3s var(--ease); }
.latest:hover .go::after { width: 40px; }

/* projects */
.projs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--card); text-decoration: none; }
.proj:hover { border-color: var(--pink); }
.shot { aspect-ratio: 16 / 10; overflow: hidden; background: #0d0d13; border-bottom: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .7s var(--ease); }
.proj:hover .shot img { transform: scale(1.045); }
.shot.type { display: grid; place-items: center; background:
  linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px, #0b0b11; }
.shot.type span { font: 700 clamp(26px, 3vw, 38px)/1 var(--mono); letter-spacing: -0.03em; color: var(--bright); }
.proj-body { padding: 18px 20px 20px; }
.proj h3 { margin: 0; font: 700 19px/1.2 var(--sans); color: var(--bright); }
.proj p { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags span, .chip { font: 400 12px/1 var(--mono); color: var(--muted); padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid var(--line); text-decoration: none; }
.chip:hover { color: var(--bright); border-color: var(--pink); }

/* publication list */
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pub { display: grid; grid-template-columns: 110px 90px minmax(0, 1fr) auto; gap: 8px 22px; align-items: baseline; padding: 20px 6px; border-bottom: 1px solid var(--line); transition: background .25s; }
.pub:hover { background: rgba(255, 255, 255, 0.03); }
.pub[hidden] { display: none; }
.pub-date, .pub-kind { font: 400 13px/1.4 var(--mono); color: var(--faint); }
.pub-kind { color: var(--pink-2); }
.pub-title { font: 600 19px/1.3 var(--sans); color: var(--bright); text-decoration: none; }
.pub-title span { display: block; font-weight: 400; font-size: 16px; color: var(--muted); }
.pub-title:hover { color: var(--pink-2); }
.pub-areas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* inner pages */
.page { max-width: var(--wide); margin: 0 auto; padding: clamp(56px, 8vw, 104px) clamp(20px, 4vw, 48px) clamp(72px, 10vw, 120px); }
.page-head h1 { margin: 0 0 clamp(28px, 4vw, 44px); font: 700 clamp(48px, 7vw, 96px)/0.95 var(--sans); letter-spacing: -0.04em; color: var(--bright); }
.area-head .icon { width: 56px; height: 56px; margin-bottom: 24px; }
.area-head h1 { margin-bottom: 14px; }
.area-head .lead { margin: 0 0 32px; font-size: 22px; color: var(--bright); }
.area-text { max-width: var(--col); color: var(--text); margin-bottom: 56px; }
.area-text p { margin: 0 0 1em; }
.page .projs { margin-top: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.filters button { font: 400 14px/1 var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.filters button:hover { color: var(--bright); }
.filters button[aria-pressed="true"] { color: var(--on-pink); background: var(--pink); border-color: var(--pink); }
.empty { color: var(--muted); font-size: 18px; max-width: 32em; padding: 40px 0; border-top: 1px solid var(--line); }

/* ---------- post ---------- */
.post-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; min-height: clamp(560px, 86svh, 900px); max-width: none; padding: clamp(48px, 7vw, 96px) max(clamp(20px, 4vw, 48px), calc((100vw - var(--wide)) / 2));
  border-bottom: 1px solid var(--line); }
.post-hero.note-hero { grid-template-columns: minmax(0, 820px); min-height: auto; padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(48px, 7vw, 84px); }
.post-hero h1 { margin: 0; font: 700 clamp(42px, 5.6vw, 80px)/0.98 var(--sans); letter-spacing: -0.035em; color: var(--bright); }
.post-hero .subtitle { margin: 16px 0 0; font: 400 clamp(19px, 2vw, 25px)/1.3 var(--sans); color: var(--text); }
.post-hero .authors { margin: 26px 0 0; color: var(--muted); font-size: 16px; }
.post-hero .authors a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.post-hero .authors a:hover { color: var(--pink-2); border-color: var(--pink); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--bright); text-decoration: none; font: 600 15px/1 var(--sans); transition: border-color .2s, background .2s, box-shadow .2s; }
.btn:hover { border-color: var(--bright); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: var(--on-pink); }
.btn.primary:hover { background: #ffcbd6; border-color: #ffcbd6; }
.btn span { font-weight: 400; opacity: 0.85; }
.area-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.post-hero-fig { border-radius: 16px; background: var(--plate); padding: clamp(10px, 1.6vw, 20px); box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9); transform: perspective(1600px) rotateY(-7deg) rotateX(3deg); }

.post-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--col)) minmax(0, 1fr); gap: 0 56px; padding: clamp(56px, 8vw, 96px) 24px 112px; }
.toc { grid-column: 1; justify-self: end; width: 210px; position: sticky; top: 92px; align-self: start; font: 400 14px/1.45 var(--sans); }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.toc li { margin: 0 0 11px; }
.toc a { color: var(--faint); text-decoration: none; }
.toc a:hover { color: var(--pink-2); }
.prose { grid-column: 2; min-width: 0; font: 400 18px/1.72 var(--serif); }
.prose a { text-decoration-color: rgba(255, 183, 197, 0.5); text-underline-offset: 0.2em; }
.prose a:hover { color: var(--pink-2); }
.prose > p, .prose > ul, .prose > ol { margin: 0 0 1.15em; }
.prose > p:first-child { color: var(--bright); font-size: 20px; }
.prose h2 { font: 700 27px/1.25 var(--sans); letter-spacing: -0.015em; color: var(--bright); margin: 2em 0 0.65em; scroll-margin-top: 90px; }
.prose h3 { font: 700 19px/1.3 var(--sans); color: var(--bright); margin: 1.8em 0 0.6em; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin: 0.25em 0; }
.prose ol li::marker { color: var(--pink-2); font-family: var(--mono); }
.prose strong { color: var(--bright); font-weight: 600; }
.prose figure { margin: 2.2em 0 2.4em; }
.prose figure img { width: 100%; background: var(--plate); border-radius: 10px; padding: 14px; }
.prose figure.loop svg { max-width: 520px; margin: 0 auto; }
.prose figcaption { font: 400 14.5px/1.55 var(--sans); color: var(--muted); margin-top: 12px; }
.prose figcaption strong { color: var(--text); }
/* Display formulas sit in the text without a frame; wide ones scroll sideways. */
.prose .math-display { margin: 1.3em 0 1.4em; padding: 4px 0; overflow-x: auto; overflow-y: hidden; }
.prose .katex { font-size: 1.05em; color: var(--bright); }
.prose .katex-display { margin: 0; }
.prose .ref { font-size: 16px; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--pink); color: var(--text); }
.prose blockquote p { margin: 0; }
.prose .table-wrap { margin: 1.6em 0 1.8em; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font: 400 15px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.prose th { padding: 0 14px 10px; border-bottom: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: 13.5px; text-align: left; white-space: nowrap; }
.prose td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.prose th.right, .prose td.right { text-align: right; }
.prose th.center, .prose td.center { text-align: center; }
.prose td strong { color: var(--bright); }
.about { max-width: var(--col); }
.people-sec { max-width: var(--wide); margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); }
.people-sec h2 { font: 700 24px/1.2 var(--sans); letter-spacing: -0.015em; color: var(--bright); margin: 0 0 28px; }
.people { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 28px 40px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 112px; text-align: center; text-decoration: none; }
.person img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--card-2); border: 1px solid var(--line-2); transition: border-color .2s, transform .2s var(--ease); }
.person:hover img { border-color: var(--pink); transform: translateY(-2px); }
.person div { min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.person strong { font: 600 15px/1.25 var(--sans); color: var(--bright); }
.person span { font: 400 12.5px/1.3 var(--mono); color: var(--muted); }
.bib { position: relative; margin: 1em 0 1.6em; }
.bib pre { margin: 0; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font: 400 13px/1.6 var(--mono); color: var(--text); }
.bib button { position: absolute; top: 10px; right: 10px; font: 400 13px/1 var(--sans); color: var(--muted); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.bib button:hover { color: var(--bright); }
.files { font: 400 15.5px/1.6 var(--sans); color: var(--muted); }
.files a { color: var(--bright); }

/* loop & inline diagrams on dark */
.loop .region, .diagram .region { fill: #0c0c11; stroke: rgba(255, 255, 255, 0.09); }
.loop .box, .diagram .box { fill: #16161c; stroke: rgba(255, 255, 255, 0.15); }
.diagram .box-dim { fill: #111117; stroke: rgba(255, 255, 255, 0.10); }
.diagram .box-pink { fill: #ffb7c5; stroke: none; }
.loop .t, .diagram .t { fill: var(--bright); }
.loop .g, .diagram .g { fill: var(--muted); }
.loop .r, .diagram .r { fill: var(--faint); }
.diagram .on-pink { fill: var(--on-pink); }
.loop svg text, .diagram svg text { font-family: var(--sans); }
.diagram .mono { font-family: var(--mono); }
.loop .sym { font-family: var(--math); }
.loop .flow, .diagram .flow { fill: none; stroke: var(--pink); stroke-width: 2; stroke-linecap: round; }
.diagram .flow-dim { fill: none; stroke: rgba(255, 255, 255, 0.24); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linecap: round; }
.loop .head, .diagram .head { fill: var(--pink); }
.diagram .head-dim { fill: rgba(255, 255, 255, 0.32); }
.prose figure.diagram svg { width: 100%; height: auto; }
/* data marks in figures: validated against the dark card surface (CVD and contrast) */
.diagram .d-pink, .diagram .heat { fill: #e0628b; }
.diagram .d-blue { fill: #6d8ef0; }
.diagram .d-grey { fill: #5a5a64; }
.diagram .s-pink { stroke: #e0628b; }
.diagram .s-blue { stroke: #6d8ef0; }
.diagram .s-grey { stroke: #5a5a64; }
.diagram .gridl { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }

/* ---------- notes (blog) ---------- */
.nav nav a[aria-current="page"] { color: var(--bright); box-shadow: inset 0 -2px 0 var(--pink); padding-bottom: 6px; margin-bottom: -8px; }
.notes-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px; margin-bottom: clamp(28px, 4vw, 44px); }
.notes-head h1 { grid-column: 1 / -1; margin-bottom: 0; }
.notes-head .lead { margin: 0; max-width: 34em; font-size: 19px; line-height: 1.6; color: var(--muted); }
.notes-head .feed { justify-self: end; font: 400 13px/1 var(--mono); color: var(--muted); text-decoration: none; padding: 8px 12px 8px 30px; border: 1px solid var(--line-2); border-radius: 999px; position: relative; }
.notes-head .feed::before { content: ""; position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; transform: translateY(-50%); border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px rgba(255, 183, 197, 0.18); }
.notes-head .feed:hover { color: var(--bright); border-color: var(--pink); }
.note-feed { border-top: 1px solid var(--line); }
.note-year { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 clamp(20px, 3vw, 40px); padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--line); }
.note-year[hidden] { display: none; }
.note-year > h2 { margin: 0; position: sticky; top: 96px; align-self: start; font: 700 clamp(28px, 3vw, 40px)/1 var(--sans); letter-spacing: -0.03em; color: var(--faint); }
.note-list { display: grid; gap: 18px; }
.note-card { position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--card); transition: border-color .25s, transform .25s var(--ease); }
.note-card[hidden] { display: none; }
.note-card:hover { border-color: var(--pink); }
.note-link { display: grid; gap: clamp(20px, 3vw, 36px); padding: clamp(22px, 2.8vw, 34px) clamp(22px, 2.8vw, 34px) 0; text-decoration: none; color: inherit; }
.note-card.has-cover .note-link { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; }
.note-cover { border-radius: 12px; background: var(--plate); padding: 10px; overflow: hidden; }
.note-cover img { width: 100%; transition: transform .5s var(--ease); }
/* A cover drawn for the dark theme (image_plate: dark) sits on the card colour, not white. */
.post-hero-fig.dark, .note-cover.dark { background: var(--card); padding: 0; border: 1px solid var(--line-2); overflow: hidden; }
.note-card:hover .note-cover img { transform: scale(1.02); }
.note-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 14px; font: 400 12.5px/1.4 var(--mono); color: var(--faint); }
.note-meta > * + *::before { content: "·"; margin-right: 14px; color: var(--line-2); }
.note-card h3 { margin: 0; font: 700 clamp(24px, 2.6vw, 32px)/1.15 var(--sans); letter-spacing: -0.02em; color: var(--bright); }
.note-card:hover h3 { color: var(--pink-2); }
.note-sub { margin: 10px 0 0; font: 400 18px/1.45 var(--sans); color: var(--text); }
.note-sum { margin: 14px 0 0; font-size: 16px; line-height: 1.65; color: var(--muted); max-width: 44em; }
.note-card .go { margin-top: 18px; }
.note-card:hover .go::after, .note-tile:hover .go::after { width: 40px; }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 18px clamp(22px, 2.8vw, 34px) clamp(22px, 2.8vw, 30px); }
.note-by { font: 400 13px/1.4 var(--sans); color: var(--muted); }
.note-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.note-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.note-tile { display: flex; flex-direction: column; min-height: 260px; padding: 26px 24px 24px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: inherit; transition: border-color .25s; }
.note-tile:hover { border-color: var(--pink); }
.note-tile .note-meta { margin-bottom: 18px; }
.note-tile h3 { margin: 0; font: 700 22px/1.25 var(--sans); letter-spacing: -0.01em; color: var(--bright); }
.note-tile p:not(.note-meta) { margin: 10px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-tile .go { margin-top: auto; padding-top: 20px; }
.area-lists .sec-h { margin-top: clamp(40px, 6vw, 64px); }
.area-lists > .sec-h:first-child { margin-top: 0; }
.discuss { margin-top: 3.2em; padding-top: 4px; }
.prose .discuss h2 { margin-top: 0; }
/* A frame whose colour scheme differs from the page gets an opaque canvas; "normal"
   keeps giscus's transparent theme transparent on the dark page. */
.discuss .giscus, .discuss .giscus-frame { width: 100%; color-scheme: normal; }
.post-pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; margin-top: 3.2em; padding-top: 28px; border-top: 1px solid var(--line); font: 400 15px/1.4 var(--sans); }
.post-pager a { text-decoration: none; color: var(--bright); }
.post-pager .older, .post-pager .newer { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s; }
.post-pager .newer { text-align: right; }
.post-pager a.older:hover, .post-pager a.newer:hover { border-color: var(--pink); }
.post-pager .none { border-color: transparent; }
.post-pager span:not(.none) { font: 400 12px/1 var(--mono); color: var(--faint); }
.post-pager .all { align-self: center; font: 400 13px/1 var(--mono); color: var(--muted); padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; }
.post-pager .all:hover { color: var(--bright); border-color: var(--pink); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 88px) 0 36px; }
.foot-motto, .foot-row { padding: 0 clamp(20px, 4vw, 48px); }
.foot-motto { max-width: var(--wide); margin: 0 auto 40px; font: italic 400 clamp(28px, 4.4vw, 60px)/1.1 var(--serif); color: var(--bright); letter-spacing: -0.01em; }
.foot-row { max-width: var(--wide); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font: 400 14px/1.6 var(--sans); color: var(--faint); }
.foot-row a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.foot-row span:first-child a { margin-left: 0; }
.foot-row a:hover { color: var(--bright); }

/* ---------- Chinese ---------- */
html:lang(zh-CN) .hero-line { font-size: clamp(19px, 2vw, 25px); }
html:lang(zh-CN) .prose { font-family: var(--sans); font-size: 17px; line-height: 1.9; }
html:lang(zh-CN) .foot-motto { font-family: var(--sans); font-style: normal; font-weight: 700; letter-spacing: 0.02em; }
html:lang(zh-CN) .area-text, html:lang(zh-CN) .about { line-height: 1.9; }

@media (max-width: 1100px) {
  .post-body { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .toc { display: none; }
  .prose { grid-column: 1; width: 100%; max-width: var(--col); }
  .post-hero { grid-template-columns: 1fr; min-height: auto; }
  .post-hero-fig { transform: none; }
  .latest { grid-template-columns: 1fr; }
  .note-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note-card.has-cover .note-link { grid-template-columns: 1fr; }
  .latest-img { transform: none; }
}
@media (max-width: 720px) {
  .nav nav a:not(.lang) { display: none; }
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .pub-areas { justify-content: flex-start; margin-top: 6px; }
  .note-year { grid-template-columns: 1fr; gap: 16px; }
  .note-year > h2 { position: static; }
  .note-tiles { grid-template-columns: 1fr; }
  .note-tile { min-height: 0; }
  .notes-head { grid-template-columns: 1fr; }
  .notes-head .feed { justify-self: start; }
  .post-pager { grid-template-columns: 1fr; }
  .post-pager .newer { text-align: left; }
  .post-pager .none { display: none; }
  .hero-mark { width: 120vw; right: -40vw; opacity: 0.07; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mark, .scroll::after { animation: none; }
  html { scroll-behavior: auto; }
}
