/* Alegreya (SIL Open Font License), self-hosted */
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/assets/fonts/alegreya-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(/assets/fonts/alegreya-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url(/assets/fonts/alegreya-latin-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url(/assets/fonts/alegreya-latin-ext-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Tokens. The accent palette is the grounded labelling of an argumentation
   framework: "in" (accepted), "out" (rejected), "undec" (undecided). */
:root {
  --paper: #fcfcfa;
  --ink: #1f2a44;
  --muted: #586174;
  --rule: #d9dce1;
  --in: #1d6b57;
  --in-soft: #e3efe9;
  --out: #9a3b3b;
  --undec: #7c8390;
  --code-bg: #f1f2ef;
  --measure: 68ch;
  --step--1: 0.89rem;
  --step-0: 1.125rem;
  --step-1: 1.33rem;
  --step-2: 1.6rem;
  --step-3: 2.3rem;
}
/* Dark theme: follows the system unless the visitor picks a theme with the
   moon button (stored as data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151a22;
    --ink: #e4e7ec;
    --muted: #a3abb9;
    --rule: #2c3441;
    --in: #74c7a8;
    --in-soft: #1d3029;
    --out: #e08a85;
    --undec: #8f97a5;
    --code-bg: #1c222c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151a22;
  --ink: #e4e7ec;
  --muted: #a3abb9;
  --rule: #2c3441;
  --in: #74c7a8;
  --in-soft: #1d3029;
  --out: #e08a85;
  --undec: #8f97a5;
  --code-bg: #1c222c;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
}
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--ink); text-decoration-color: var(--in); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--in); }
:focus-visible { outline: 2px solid var(--in); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.2; font-weight: 700; margin: 0; }
h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); margin-top: 2.6rem; margin-bottom: 0.8rem; }
h3 { font-size: var(--step-1); margin-top: 1.8rem; margin-bottom: 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
main p, main li { max-width: var(--measure); }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--muted); }
small, .muted { color: var(--muted); }
sup { line-height: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 2; }
.skip:focus { left: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); }
.header-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 2rem; padding-top: 1.1rem; padding-bottom: 1rem; }
.wordmark { font-weight: 800; font-size: var(--step-1); text-decoration: none; letter-spacing: -0.005em; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.3rem; }
.site-header nav li { margin: 0; }
.site-header nav a { text-decoration: none; color: var(--muted); padding: 0.2rem 0; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--in); }
.header-row { align-items: center; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; }
.wordmark .logo { height: 3.1rem; width: auto; flex: none; color: var(--ink); }
.wordmark:hover .logo path:first-child { stroke-width: 40; }
.site-header nav { margin-left: auto; }
.controls { display: flex; align-items: center; gap: 0.35rem; }
.controls svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lang-menu { position: relative; }
.lang-menu summary, .theme-toggle { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 2.2rem; padding: 0 0.55rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: var(--step--1); cursor: pointer; list-style: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .theme-toggle:hover, .lang-menu[open] summary { color: var(--ink); border-color: var(--in); }
.lang-code { font-weight: 700; letter-spacing: 0.02em; }
.lang-list { position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 20; list-style: none; margin: 0; padding: 0.35rem; min-width: 11rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 0.6rem; box-shadow: 0 0.8rem 2rem -1rem color-mix(in srgb, var(--ink) 45%, transparent); }
.lang-list li { margin: 0; }
.lang-list a { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; border-radius: 0.4rem; text-decoration: none; color: var(--ink); }
.lang-list a:hover { background: var(--in-soft); }
.lang-list a[aria-current="true"] { font-weight: 700; color: var(--in); }
.flag { display: inline-flex; flex: none; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); line-height: 0; }
.flag svg { width: 1.3rem; height: auto; display: block; }
.lang-menu summary { gap: 0.4rem; }
.theme-toggle { display: none; width: 2.2rem; justify-content: center; padding: 0; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle .i-sun { display: none; }
.theme-toggle.is-dark { color: var(--in); border-color: var(--in); }
.theme-toggle.is-dark .i-moon { fill: currentColor; }
:lang(zh) body, body:lang(zh) { font-family: "Alegreya", "PingFang SC", "Hiragino Sans GB", "Noto Serif CJK SC", "Source Han Serif SC", "Microsoft YaHei", serif; }
.nf-alt { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--muted); }
.nf-alt h2 { font-size: var(--step-1); margin-top: 0; }
@media (max-width: 40rem) {
  .site-header nav { order: 3; width: 100%; margin-left: 0; }
  .controls { margin-left: auto; }
  .header-row { column-gap: 0.5rem; }
  .wordmark { font-size: var(--step-0); gap: 0.45rem; }
  .wordmark .logo { height: 2.6rem; }
}

main.wrap { padding-top: 2.6rem; padding-bottom: 4rem; min-height: 60vh; }
.page-intro { color: var(--muted); max-width: var(--measure); margin-top: 0.6rem; }

/* Home */
.intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (min-width: 52rem) { .intro { grid-template-columns: minmax(0, 1.55fr) minmax(16rem, 1fr); gap: 3.5rem; } }
.intro .role { font-size: var(--step-1); margin: 0.7rem 0 0.2rem; }
.intro .affil { color: var(--muted); margin-bottom: 1.6rem; }
.intro .affil a { color: var(--muted); }
.statement { font-size: var(--step-0); }
.contact { margin-top: 1.4rem; }
.contact dt { font-weight: 700; }
.contact dd { margin: 0 0 0.6rem; }
.profiles { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-top: 0.4rem; }
.profiles li { margin: 0; }
.portrait { width: 9rem; height: auto; border-radius: 4px; margin-bottom: 1.2rem; display: block; }

.af { margin: 0; }
.af svg { width: 100%; height: auto; display: block; max-width: 22rem; }
.af figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.6rem; max-width: 22rem; }
.af .node-in { fill: var(--in); stroke: var(--in); }
.af .node-out { fill: var(--paper); stroke: var(--out); }
.af .node-undec { fill: var(--paper); stroke: var(--undec); stroke-dasharray: 4 3; }
.af .lbl-in { fill: var(--paper); }
.af .lbl-out { fill: var(--out); }
.af .lbl-undec { fill: var(--undec); }
.af .edge { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.af .arrow { fill: var(--ink); }
.af text { font-family: "Alegreya", Georgia, serif; font-style: italic; font-size: 22px; text-anchor: middle; dominant-baseline: central; }
.legend { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: var(--step--1); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.legend li { margin: 0; display: inline-flex; align-items: center; gap: 0.35rem; }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; display: inline-block; border: 1.5px solid; }
.dot-in { background: var(--in); border-color: var(--in); }
.dot-out { border-color: var(--out); }
.dot-undec { border-color: var(--undec); border-style: dashed; }

.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--rule); margin: 0; max-width: none; }
.news li:last-child { border-bottom: 1px solid var(--rule); }
.news time, .news .when { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; font-size: var(--step--1); padding-top: 0.15rem; }
.news p { margin: 0; }

/* Publications */
.pub-filter { border: 0; padding: 0; margin: 1.5rem 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pub-filter legend { padding: 0; margin-bottom: 0.5rem; color: var(--muted); width: 100%; }
.pub-filter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pub-filter label { border: 1px solid var(--rule); border-radius: 999px; padding: 0.2rem 0.85rem; cursor: pointer; color: var(--muted); }
.pub-filter label .n { font-variant-numeric: lining-nums; font-size: var(--step--1); margin-left: 0.25rem; }
.pub-filter input:checked + label { border-color: var(--in); background: var(--in-soft); color: var(--ink); }
.pub-filter input:focus-visible + label { outline: 2px solid var(--in); outline-offset: 2px; }

.pub-year { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--rule); padding-top: 0.9rem; margin-top: 1.6rem; }
@media (min-width: 52rem) { .pub-year { grid-template-columns: 6rem minmax(0, 1fr); gap: 1.5rem; } }
.pub-year h2 { margin: 0 0 0.6rem; font-size: var(--step-1); font-variant-numeric: lining-nums; color: var(--muted); font-weight: 600; }
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { margin: 0 0 1.35rem; max-width: var(--measure); scroll-margin-top: 1rem; }
.pub:target { background: var(--in-soft); box-shadow: 0 0 0 0.5rem var(--in-soft); border-radius: 2px; }
.pub-title { font-weight: 700; display: block; }
.pub-authors, .pub-venue, .pub-note { display: block; }
.pub-authors strong { font-weight: 700; }
.pub-venue { color: var(--muted); }
.pub-note { color: var(--muted); font-style: italic; }
.award { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--in); font-weight: 600; }
.award::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--in); flex: none; }
.pub-links { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin-top: 0.2rem; font-size: var(--step--1); align-items: baseline; }
.pub-links details { display: contents; }
.pub-links summary { cursor: pointer; text-decoration: underline; text-decoration-color: var(--in); text-underline-offset: 0.18em; }
.pub-links pre { flex-basis: 100%; min-width: 0; max-width: 100%; }
pre { background: var(--code-bg); padding: 0.8rem 1rem; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.8rem; line-height: 1.45; border-radius: 3px; margin: 0.4rem 0; white-space: pre; }

/* CSS-only filters: hide what does not match the checked category */
.pub-list:has(#f-journal:checked) .pub:not([data-cat="journal"]),
.pub-list:has(#f-conference:checked) .pub:not([data-cat="conference"]),
.pub-list:has(#f-workshop:checked) .pub:not([data-cat="workshop"]),
.pub-list:has(#f-other:checked) .pub:not([data-cat="other"]),
.pub-list:has(#f-journal:checked) .pub-year:not([data-cats~="journal"]),
.pub-list:has(#f-conference:checked) .pub-year:not([data-cats~="conference"]),
.pub-list:has(#f-workshop:checked) .pub-year:not([data-cats~="workshop"]),
.pub-list:has(#f-other:checked) .pub-year:not([data-cats~="other"]) { display: none; }

/* Generic content */
.prose h2:first-child { margin-top: 0; }
.entries { list-style: none; padding: 0; }
.entries li { margin-bottom: 0.7rem; }
.period { color: var(--muted); font-variant-numeric: lining-nums; }
dl.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem 1.5rem; max-width: var(--measure); }
@media (min-width: 40rem) { dl.facts { grid-template-columns: 9rem minmax(0, 1fr); } }
dl.facts dt { color: var(--muted); font-variant-numeric: lining-nums; }
dl.facts dd { margin: 0 0 0.6rem; }
.button { display: inline-block; border: 1px solid var(--in); padding: 0.35rem 1rem; border-radius: 3px; text-decoration: none; font-weight: 600; }
.button:hover { background: var(--in-soft); color: var(--ink); }

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--step--1); padding: 1.5rem 0 2.5rem; }
.site-footer p { margin: 0 0 0.3rem; }

@media (max-width: 40rem) {
  :root { --step-3: 1.95rem; --step-2: 1.4rem; }
  .news li { grid-template-columns: 4.5rem minmax(0, 1fr); }
}
@media print {
  .site-header nav, .controls, .pub-filter, .pub-links, .skip { display: none; }
  body { background: #fff; color: #000; }
}
.katex { font-size: 1em; }

/* ------------------------------------------------------------------
   Motion layer, after luciolacava.me, translated to argumentation:
   aurora, live status dot, streaming bio with a live topics panel,
   reading progress, reveal on scroll, section counters, back to top.
   Everything is readable without JavaScript and without motion.
   ------------------------------------------------------------------ */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Aurora: three soft blobs in the labelling colours, drifting slowly */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; opacity: 0.55; }
.aurora .a1 { width: 900px; height: 700px; left: -260px; top: -380px; background: radial-gradient(closest-side, color-mix(in srgb, var(--in) 16%, transparent), transparent); }
.aurora .a2 { width: 620px; height: 620px; right: -220px; top: 60px; background: radial-gradient(closest-side, color-mix(in srgb, var(--out) 13%, transparent), transparent); }
.aurora .a3 { width: 720px; height: 720px; left: 30%; top: 55vh; background: radial-gradient(closest-side, color-mix(in srgb, var(--undec) 12%, transparent), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora span { opacity: 0.8; } }
:root[data-theme="dark"] .aurora span { opacity: 0.8; }

/* Argumentation framework in the background: visible at the sides, faint behind the text */
.af-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.9;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 14%, rgba(0,0,0,.28) 30%, rgba(0,0,0,.28) 70%, #000 86%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 14%, rgba(0,0,0,.28) 30%, rgba(0,0,0,.28) 70%, #000 86%, #000 100%); }
@media (max-width: 52rem) { .af-bg { opacity: 0.3; -webkit-mask-image: none; mask-image: none; } }
html:not(.js) .af-bg { display: none; }

/* Reading progress */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--in), var(--out)); }
.reduced .progress, html:not(.js) .progress { display: none; }

/* Hero */
.hero { padding-top: 1.2rem; position: relative; }
.hero-logo { display: block; width: 11rem; margin: 0 0 1.4rem; }
.hero-logo img { display: block; width: 100%; height: auto; }
@media (min-width: 52rem) { .hero-logo { position: absolute; right: 0; top: 1.2rem; width: 13.5rem; margin: 0; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-logo { background: #fff; border-radius: 10px; padding: 0.5rem 0.7rem; } }
:root[data-theme="dark"] .hero-logo { background: #fff; border-radius: 10px; padding: 0.5rem 0.7rem; }
.badge { display: inline-flex; align-items: center; gap: 0.55rem; border: 1px solid color-mix(in srgb, var(--in) 35%, var(--rule)); background: color-mix(in srgb, var(--in-soft) 70%, transparent); border-radius: 999px; padding: 0.2rem 0.9rem; font-size: var(--step--1); color: var(--ink); margin-bottom: 1.6rem; }
.pulse-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--in); display: inline-block; flex: none; }
.hero-name { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.hero-name .portrait { width: 7rem; height: 7rem; border-radius: 50%; object-fit: cover; margin: 0; box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--rule); }
.hero h1 { font-size: clamp(2.6rem, 7.5vw, 4.9rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; }
.name-node { display: inline-block; width: 0.17em; height: 0.17em; border-radius: 50%; background: var(--in); margin-left: 0.06em; vertical-align: baseline; }
.hero-meta { color: var(--muted); margin: 1rem 0 1.3rem; font-variant-numeric: lining-nums; }
.hero-meta a { color: var(--muted); }
.hero-meta span { margin: 0 0.35rem; opacity: 0.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 8px; padding: 0.3rem 0.95rem; text-decoration: none; background: color-mix(in srgb, var(--paper) 85%, transparent); transition: border-color 0.2s, transform 0.2s; }
.chip:hover { border-color: var(--in); color: var(--ink); transform: translateY(-1px); }
.chip-strong { border-color: color-mix(in srgb, var(--in) 50%, var(--rule)); background: var(--in-soft); }

/* Console with the streaming bio */
.console { margin-top: 2.6rem; border: 1px solid var(--rule); border-radius: 14px; background: color-mix(in srgb, var(--paper) 90%, transparent); box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--ink) 45%, transparent); overflow: hidden; }
.console-bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1.1rem; border-bottom: 1px solid var(--rule); font-size: var(--step--1); color: var(--muted); }
.console-dots { display: inline-flex; gap: 0.3rem; }
.console-dots i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--rule); display: block; }
.console-title { flex: 1; font-variant-numeric: lining-nums tabular-nums; }
.console-title span[aria-hidden] { margin: 0 0.25rem; opacity: 0.6; }
.live { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid color-mix(in srgb, var(--in) 40%, var(--rule)); border-radius: 999px; padding: 0 0.6rem; color: var(--in); }
.live .pulse-dot { width: 0.4rem; height: 0.4rem; }
.console-body { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .console-body { grid-template-columns: minmax(0, 1.7fr) minmax(15rem, 1fr); } }
.bio { padding: 1.2rem 1.4rem 1.3rem; }
.bio p { max-width: none; }
.bio p:last-child { margin-bottom: 0; }
.caret { display: inline-block; width: 0.5em; height: 1.05em; margin-left: 1px; vertical-align: -0.15em; background: var(--in); }
.caret.done { animation: blink 1.05s steps(1) infinite; }
.bio mark { background: color-mix(in srgb, var(--in) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 0.12em; box-shadow: 0 1px 0 var(--in); }
.topics { padding: 1.2rem 1.4rem; border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--in-soft) 35%, transparent); }
@media (min-width: 52rem) { .topics { border-top: 0; border-left: 1px solid var(--rule); } }
.topics-title { color: var(--muted); font-size: var(--step--1); margin-bottom: 0.8rem; }
.topics-title span { margin: 0 0.25rem; opacity: 0.6; }
.bars { list-style: none; padding: 0; margin: 0 0 0.9rem; }
.bars li, .bar-btn { display: grid; grid-template-columns: 7.4rem minmax(0, 1fr) 2.4rem; align-items: center; gap: 0.6rem; margin: 0 0 0.2rem; padding: 0.2rem 0.4rem; border-radius: 6px; font-size: var(--step--1); max-width: none; position: relative; }
.bars li:has(.bar-btn) { display: block; padding: 0; }
.bar-btn { width: 100%; margin: 0; font: inherit; font-size: var(--step--1); color: inherit; text-align: left; background: none; border: 0; cursor: pointer; transition: background-color 0.2s; }
.bar-btn:hover { background: color-mix(in srgb, var(--in-soft) 80%, transparent); }
.bar-btn[aria-pressed="true"] { background: var(--in-soft); box-shadow: inset 2px 0 0 var(--in); }
.bar-btn[aria-pressed="true"] .bar-name { font-weight: 700; }
.bar { height: 4px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: calc(var(--v) * 100% / 0.4); max-width: 100%; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--in) 55%, transparent), var(--in)); transition: width 0.25s ease-out; }
.bar-val { text-align: right; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.topics-note { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.45; }
.topics-more { font-size: var(--step--1); margin: 0.6rem 0 0; min-height: 1.5em; }
html:not(.js) .js-only { display: none; }

/* Sections with counters */
.block { margin-top: 4.2rem; }
.block-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 1.2rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.7rem; margin-bottom: 1.4rem; }
.block-head h2 { margin: 0; font-size: clamp(1.7rem, 3.6vw, 2.3rem); letter-spacing: -0.015em; }
.counter { color: var(--muted); font-size: var(--step--1); font-variant-numeric: lining-nums tabular-nums; }
.more { font-size: var(--step--1); white-space: nowrap; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { border: 1px solid var(--rule); border-radius: 12px; padding: 1.2rem 1.3rem 1.1rem; margin: 0; max-width: none; background: color-mix(in srgb, var(--paper) 88%, transparent); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; position: relative; }
.card:hover { border-color: color-mix(in srgb, var(--in) 45%, var(--rule)); transform: translateY(-3px); box-shadow: 0 14px 30px -24px color-mix(in srgb, var(--ink) 55%, transparent); }
.card h3 { margin: 0.8rem 0 0.4rem; font-size: var(--step-1); }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }
.card-icon { width: 2.6rem; height: 2.6rem; padding: 0.35rem; border-radius: 10px; background: var(--in-soft); }
.ic-in { fill: var(--in); }
.ic-out { fill: none; stroke: var(--out); stroke-width: 2; }
.ic-undec { fill: none; stroke: var(--undec); stroke-width: 2; stroke-dasharray: 3 2.5; }
.ic-edge { stroke: var(--ink); stroke-width: 1.8; fill: none; }
.ic-dash { stroke: var(--in); stroke-width: 1.8; fill: none; stroke-dasharray: 3 3; }
.ic-ring { fill: none; stroke: var(--in); stroke-width: 1.8; opacity: 0.7; }
.ic-core { fill: var(--in); }

.contact-block .contact { margin-top: 0; }
.contact-block h2 { margin-top: 0; }

/* Back to top */
.to-top { display: none; }
.js .to-top { display: flex; position: fixed; right: 1.2rem; bottom: 1.2rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; align-items: center; justify-content: center; border: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 85%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 15; }
.js .to-top.shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  @keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--in) 45%, transparent); } 50% { opacity: 0.55; box-shadow: 0 0 0 5px transparent; } }
  @keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(40px, -30px); } }
  @keyframes drift2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-50px, 40px); } }
  .pulse-dot { animation: pulse 2.2s ease-in-out infinite; }
  .aurora .a1 { animation: drift 22s ease-in-out infinite; }
  .aurora .a2 { animation: drift2 26s ease-in-out infinite; }
  .aurora .a3 { animation: drift 30s ease-in-out infinite reverse; }

  /* reveal on scroll (only when the script is running) */
  .js [data-reveal] { transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1); transition-delay: var(--stagger, 0ms); }
  .js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(16px); }

  .js .card[data-reveal].is-in:hover { transform: translateY(-3px); transition-delay: 0ms; }
}

/* Argumentation Designer feature */
.tool { display: grid; gap: 1.5rem 2.2rem; align-items: center; margin: 3.2rem 0 1rem; padding: 1.6rem 1.7rem; border: 1px solid var(--rule); border-left: 4px solid var(--in); border-radius: 14px; background: color-mix(in srgb, var(--in-soft) 55%, var(--paper)); }
@media (min-width: 52rem) { .tool { grid-template-columns: 1.25fr 1fr; } }
.tool h2 { margin: 0 0 0.5rem; font-size: var(--step-2); }
.tool p { margin: 0 0 0.9rem; max-width: 60ch; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0 !important; }
.tool-fig { margin: 0; display: grid; gap: 0.6rem; }
.tool-graph { width: 100%; height: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.tool-graph text { font-family: "Alegreya", Georgia, serif; font-style: italic; font-size: 15px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.tg-att { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.tg-att-head { fill: var(--muted); }
.tg-sup { stroke: var(--in); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.tg-sup-head { fill: var(--in); }
.tg-in { fill: var(--in-soft); stroke: var(--in); stroke-width: 2; }
.tg-out { fill: var(--paper); stroke: var(--out); stroke-width: 2; }
.tool-code { margin: 0; font-size: 0.78rem; border: 1px solid var(--rule); }
.tool-code-label { display: block; color: var(--muted); font-family: "Alegreya", Georgia, serif; font-size: 0.8rem; margin-bottom: -0.6rem; }
