/* ==========================================================================
   Lidong Yu — personal site design system
   Hand-written, zero external dependencies. Light + dark, print friendly.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #0c0e14;
  --ink-2: #2b3140;
  --muted: #5c6575;
  --line: #e4e7ee;
  --line-strong: #cfd4e0;

  --accent: #2447d8;
  --accent-ink: #1b36ad;
  --accent-soft: #eef2ff;
  --accent-line: #c8d4ff;
  --ok: #0b8a63;
  --ok-soft: #e7f7f1;
  --warn: #a4620a;
  --warn-soft: #fdf3e3;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(12, 14, 20, .05), 0 1px 1px rgba(12, 14, 20, .04);
  --shadow: 0 2px 4px rgba(12, 14, 20, .04), 0 12px 28px -12px rgba(12, 14, 20, .18);
  --shadow-lg: 0 4px 8px rgba(12, 14, 20, .05), 0 32px 60px -24px rgba(12, 14, 20, .28);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --maxw: 1120px;
  --maxw-prose: 74ch;
  --header-h: 62px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08090c;
    --bg-soft: #0d0f14;
    --bg-elev: #11141b;
    --surface: #101319;
    --surface-2: #151922;
    --ink: #eef1f6;
    --ink-2: #cfd5e0;
    --muted: #98a1b1;
    --line: #212630;
    --line-strong: #333a48;

    --accent: #8ea6ff;
    --accent-ink: #b3c3ff;
    --accent-soft: #161c33;
    --accent-line: #2c3866;
    --ok: #4ad6a8;
    --ok-soft: #0e2620;
    --warn: #e0a458;
    --warn-soft: #2a2114;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px -18px rgba(0, 0, 0, .7);
    --shadow-lg: 0 6px 14px rgba(0, 0, 0, .45), 0 40px 80px -30px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090c;
  --bg-soft: #0d0f14;
  --bg-elev: #11141b;
  --surface: #101319;
  --surface-2: #151922;
  --ink: #eef1f6;
  --ink-2: #cfd5e0;
  --muted: #98a1b1;
  --line: #212630;
  --line-strong: #333a48;

  --accent: #8ea6ff;
  --accent-ink: #b3c3ff;
  --accent-soft: #161c33;
  --accent-line: #2c3866;
  --ok: #4ad6a8;
  --ok-soft: #0e2620;
  --warn: #e0a458;
  --warn-soft: #2a2114;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 40px -18px rgba(0, 0, 0, .7);
  --shadow-lg: 0 6px 14px rgba(0, 0, 0, .45), 0 40px 80px -30px rgba(0, 0, 0, .8);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; letter-spacing: -.018em; font-weight: 660; }
p { margin: 0; }
ul, ol { margin: 0; }
code, pre, kbd, samp { font-family: var(--mono); font-size: .93em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.wrap--narrow { max-width: 860px; }
main { display: block; }
.section { padding-block: clamp(48px, 7vw, 92px); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.section + .section { border-top: 1px solid var(--line); }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 28px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; transition: top .18s var(--ease);
}
.skip:focus { top: 12px; color: #fff; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}
.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 680; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #7b3ff2 70%);
  color: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: -.03em;
  box-shadow: 0 4px 12px -4px rgba(36, 71, 216, .6);
}
.brand-text { font-size: 15px; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: 12.5px; letter-spacing: .01em; }
@media (max-width: 620px) { .brand-sub { display: none; } }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  color: var(--ink-2); font-size: 14px; font-weight: 550;
  padding: 8px 11px; border-radius: var(--pill); white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.header-tools { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 10px; cursor: pointer; padding: 0;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* theme toggle holds both icons; CSS picks one */
[data-theme-toggle] { grid-auto-flow: row; }
[data-theme-toggle] svg:first-child { display: block; }
[data-theme-toggle] svg:last-child { display: none; }
:root[data-theme="dark"] [data-theme-toggle] svg:first-child { display: none; }
:root[data-theme="dark"] [data-theme-toggle] svg:last-child { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] svg:first-child { display: none; }
  :root:not([data-theme="light"]) [data-theme-toggle] svg:last-child { display: block; }
}
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.lang-toggle:hover { background: var(--surface-2); color: var(--ink); }
.lang-toggle svg { width: 15px; height: 15px; }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px; margin: 0;
    box-shadow: var(--shadow); display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; font-size: 15px; border-radius: 10px; }
  .nav-toggle { display: grid; margin-left: auto; }
  .site-header { position: sticky; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; padding-block: clamp(44px, 7vw, 84px) clamp(40px, 6vw, 72px); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 620px; z-index: 0;
  background:
    radial-gradient(46% 52% at 18% 8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(40% 46% at 82% 0%, rgba(123, 63, 242, .14), transparent 72%),
    radial-gradient(38% 40% at 52% 24%, color-mix(in srgb, var(--ok) 10%, transparent), transparent 74%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(60% 50% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(60% 50% at 50% 0%, #000 0%, transparent 78%);
  opacity: .5;
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.65rem);
  line-height: 1.04; letter-spacing: -.035em; font-weight: 700;
  margin-block: 14px 0;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent) 0%, #7b3ff2 52%, #0ea5a1 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede {
  margin-top: 20px; font-size: clamp(1rem, 1.6vw, 1.14rem); color: var(--ink-2);
  max-width: 62ch; line-height: 1.7;
}
.hero-lede strong { color: var(--ink); font-weight: 640; }

/* the one-line keyword descriptor under the name */
.hero-line {
  margin-top: 14px; font-size: clamp(.95rem, 1.4vw, 1.05rem); font-weight: 550;
  letter-spacing: .01em; color: var(--muted);
}

/* research areas: a plain keyword list */
.area-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag--area {
  font-size: 14px; font-weight: 550; padding: 8px 14px;
  background: var(--surface); color: var(--ink-2); border-color: var(--line-strong);
}

.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 600; letter-spacing: .005em;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  white-space: nowrap;
}
.pill--live { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 28%, transparent); color: var(--ok); }
.pill--live .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
.pill--accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 18px; border-radius: 11px;
  font-size: 14.5px; font-weight: 620; letter-spacing: -.005em;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: transform .16s var(--ease), box-shadow .16s var(--ease),
                             background .16s var(--ease), border-color .16s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn--primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 86%, #000));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn--primary:hover { color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line-strong); }
.btn--sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 9px; }
.btn-row-inline { display: flex; flex-wrap: wrap; gap: 8px; }

/* portrait / callout card in hero */
.hero-side { display: grid; gap: 14px; }
.portrait {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.mini-card {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm); margin: 0;
}
.mini-card dt { font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mini-card dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.mini-card + .mini-card { margin-top: 0; }
.mini-list { display: grid; gap: 12px; }

/* ---------- Stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-top: 40px;
}
@media (max-width: 780px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); padding: 18px 20px; }
.stat b { display: block; font-size: clamp(1.35rem, 2.6vw, 1.75rem); letter-spacing: -.03em; font-weight: 700; }
.stat span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }

/* ---------- Section headers ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.sec-head__text { max-width: 62ch; }
.sec-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.sec-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.028em; }
.sec-head h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); letter-spacing: -.032em; }
.sec-head p { margin-top: 12px; color: var(--muted); font-size: 15px; }
.sec-head__link { flex: none; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.sec-head__link::after { content: "→"; transition: transform .16s var(--ease); }
.sec-head__link:hover::after { transform: translateX(3px); }
@media (max-width: 640px) { .sec-head { flex-direction: column; align-items: flex-start; gap: 14px; } }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 940px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card--hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card h3 { font-size: 1.03rem; letter-spacing: -.018em; line-height: 1.35; }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.62; }
.card__body { display: grid; gap: 8px; margin-top: 10px; }
.card__foot {
  margin-top: auto; padding-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 9px; border-radius: var(--pill);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.tag--venue { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.tag--oral { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.tag--first { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.tag--mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0; }

.links { display: flex; flex-wrap: wrap; gap: 6px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.link-chip:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); text-decoration: none; }
.link-chip svg { width: 13px; height: 13px; opacity: .8; }

/* paper card specifics */
.paper__title { font-size: 1.04rem; font-weight: 660; letter-spacing: -.02em; line-height: 1.34; }
.paper__authors { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.paper__authors .me { color: var(--ink); font-weight: 640; text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 2px; }
.paper__grid { display: grid; gap: 12px; margin-top: 14px; }
.paper__field { display: grid; gap: 3px; }
.paper__field dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.paper__field dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.paper__result {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; color: var(--ink-2); overflow-x: auto;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 0; }
.tl-item {
  position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px;
  padding-block: 26px; border-bottom: 1px solid var(--line);
}
.tl-item:first-child { padding-top: 10px; }
.tl-item:last-child { border-bottom: 0; }
@media (max-width: 760px) { .tl-item { grid-template-columns: 1fr; gap: 10px; } }
.tl-when { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.tl-when b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 650; }
.tl-body h3 { font-size: 1.06rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tl-body h3 .org { color: var(--accent); font-weight: 680; }
.tl-role { font-size: 14px; color: var(--ink-2); font-weight: 560; margin-top: 4px; }
.tl-scope { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }
.tl-body ul { margin-top: 12px; padding-left: 18px; display: grid; gap: 6px; }
.tl-body li { font-size: 13.8px; color: var(--ink-2); line-height: 1.6; }
.tl-body li::marker { color: var(--line-strong); }
.tl-body li strong { color: var(--ink); font-weight: 640; }

/* ---------- Filter chips (repos) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  height: 34px; padding: 0 14px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-family: var(--mono); font-size: 11px; opacity: .65; }

.repo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .repo-grid { grid-template-columns: 1fr; } }
.repo {
  display: grid; gap: 8px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.repo:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.repo[hidden] { display: none; }
.repo__name { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; letter-spacing: -.01em; min-width: 0; }
.repo__name > svg { width: 15px; height: 15px; flex: none; opacity: .55; }
.repo__name a { color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
.repo__name a:hover { color: var(--accent); text-decoration: none; }
.repo__lang { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 550; display: inline-flex; align-items: center; gap: 5px; }
.repo__lang::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.repo__desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.repo__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* ---------- Notice / callout ---------- */
.notice {
  display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13.5px; color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }
.notice__title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 680; letter-spacing: .01em; }
.notice--warn .notice__title { color: var(--warn); }

/* ---------- Prose (blog / about) ---------- */
.prose { max-width: var(--maxw-prose); font-size: 16.5px; line-height: 1.78; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 1.42rem; margin-top: 2.1em; color: var(--ink); letter-spacing: -.024em; }
.prose h3 { font-size: 1.14rem; margin-top: 1.8em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: .4em; }
.prose li::marker { color: var(--line-strong); }
.prose a { text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 1.5px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose blockquote {
  margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent-line);
  color: var(--muted); font-style: normal;
}
.prose code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.prose pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 660; color: var(--ink); background: var(--surface-2); }

/* ---------- Blog list ---------- */
.post-list { display: grid; gap: 0; }
.post-item {
  display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 24px;
  padding-block: 22px; border-bottom: 1px solid var(--line);
}
.post-item:first-child { padding-top: 6px; }
.post-item:last-child { border-bottom: 0; }
@media (max-width: 700px) { .post-item { grid-template-columns: 1fr; gap: 8px; } }
.post-item time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.post-item h3 { font-size: 1.06rem; letter-spacing: -.018em; }
.post-item h3 a { color: var(--ink); }
.post-item h3 a:hover { color: var(--accent); text-decoration: none; }
.post-item p { margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 66ch; }
.post-item__meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-family: var(--mono); }

.reading-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--accent), #7b3ff2); z-index: 120;
  transition: width .1s linear;
}

.post-header { padding-block: clamp(36px, 5vw, 60px) 28px; }
.post-header h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); letter-spacing: -.03em; max-width: 30ch; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.post-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  padding-block: 48px 36px; margin-top: 0;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-grid h4 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { font-size: 14px; color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--muted);
}
.footer-bottom .vibe { font-family: var(--mono); font-size: 11.5px; }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent-line); }
.to-top svg { width: 16px; height: 16px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600;
  padding: 10px 18px; border-radius: var(--pill); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 130;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .to-top, .toast, .reading-bar, .cta-row, .filters, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding-block: 12pt; border-top: 1px solid #ddd; }
  .card { break-inside: avoid; box-shadow: none; border-color: #ddd; }
  a { color: #000; text-decoration: underline; }
  .hero::before, .hero::after { display: none; }
}
