/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --soft: #f3f5f9;
  --soft-2: #e9edf4;
  --ink: #0d1a2d;
  --muted: #56637a;
  --faint: #8b96a8;
  --rule: #e3e7ee;
  --accent: #2f55d4;
  --accent-soft: rgba(47, 85, 212, 0.08);
  --accent-ink: #ffffff;
  --signal: #d98f00;
  --grid: rgba(13, 26, 45, 0.12);

  --font: "Geist", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --r: 10px;
  --r-lg: 16px;
  --wrap: 72rem;
  --shadow: 0 1px 2px rgba(13, 26, 45, 0.04), 0 8px 24px rgba(13, 26, 45, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111e; --soft: #111a2b; --soft-2: #17223a; --ink: #e8edf5; --muted: #9ba8bd; --faint: #6d7a90;
    --rule: #1e2a40; --accent: #87a3ff; --accent-soft: rgba(135, 163, 255, 0.12); --accent-ink: #0a111e;
    --signal: #f3b73a; --grid: rgba(232, 237, 245, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a111e; --soft: #111a2b; --soft-2: #17223a; --ink: #e8edf5; --muted: #9ba8bd; --faint: #6d7a90;
  --rule: #1e2a40; --accent: #87a3ff; --accent-soft: rgba(135, 163, 255, 0.12); --accent-ink: #0a111e;
  --signal: #f3b73a; --grid: rgba(232, 237, 245, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 0.9rem; border-radius: var(--r); }
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.brand small { display: block; color: var(--faint); font-weight: 400; font-size: 0.75rem; line-height: 1.2; }
.nav { display: flex; align-items: center; gap: 0.1rem; margin-left: auto; }
.header-tools { display: flex; align-items: center; gap: 0.4rem; }
.lang-btn {
  height: 2.25rem; min-width: 2.6rem; padding: 0 0.6rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
}
.lang-btn:hover { border-color: var(--faint); }
.i18n-pending body { visibility: hidden; }
.brand-mark { overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.nav a { color: var(--muted); font-size: 0.875rem; padding: 0.45rem 0.6rem; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--soft); font-weight: 500; }
.icon-btn {
  flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--faint); }
.menu-btn { display: none; }

@media (max-width: 1120px) {
  .menu-btn { display: grid; }
  .header-tools { margin-left: auto; }
  .nav {
    position: absolute; left: 0; right: 0; top: 4rem; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem 1.25rem 1rem; background: var(--bg); border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0.5rem; font-size: 1rem; }
  .brand small { display: none; }
}

/* ---------- Buttons, tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: 2.6rem; padding: 0 1.1rem; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 0.925rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: 0.88; border-color: var(--ink); }
.btn-sm { height: 2.1rem; padding: 0 0.85rem; font-size: 0.85rem; }
.btn[hidden] { display: none; }
.btn svg { width: 1rem; height: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.tag {
  display: inline-flex; align-items: center; height: 1.4rem; padding: 0 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; background: var(--soft); color: var(--muted); white-space: nowrap; vertical-align: 0.12em;
}
.tag-ongoing, .tag-accepted { background: var(--accent-soft); color: var(--accent); }
.tag-upcoming { background: rgba(217, 143, 0, 0.12); color: var(--signal); }
.tag-completed { background: var(--soft); color: var(--muted); }

/* ---------- Page scaffolding ---------- */
.page-head { padding: 4rem 0 2.5rem; }
.page-head .kicker { color: var(--accent); font-weight: 500; font-size: 0.9rem; margin-bottom: 0.6rem; }
.page-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; max-width: 20ch; }
.page-head p.lead { margin-top: 1rem; color: var(--muted); font-size: 1.1rem; max-width: 42rem; }
.page-head-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
@media (max-width: 860px) { .page-head-grid { grid-template-columns: 1fr; gap: 2rem; } .page-head { padding-top: 2.5rem; } }

.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-alt { background: var(--soft); border-top: 0 !important; }
.section-alt + .section { border-top: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.sec-head h2, .h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.sec-head p { color: var(--muted); max-width: 38rem; margin-top: 0.4rem; }
.more { font-size: 0.925rem; font-weight: 500; white-space: nowrap; }
.h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.prose p { max-width: 44rem; }
.prose p + p { margin-top: 1rem; }

/* ---------- Figures ---------- */
.fig { background: var(--soft); border-radius: var(--r-lg); overflow: hidden; }
.section-alt .fig, .role-projects .fig { background: var(--bg); }
.fig svg { display: block; width: 100%; height: auto; }
.fig-caption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.ln { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.faint { stroke: var(--faint); opacity: 0.75; }
.acc { stroke: var(--accent); }
.sig { stroke: var(--signal); }
.thin { stroke-width: 1; }
.strong { stroke-width: 2.4; }
.dash { stroke-dasharray: 4 5; }
.arrow { marker-end: url(#arrowhead); }
.fill-bg { fill: var(--bg); }
.fill-soft { fill: var(--soft-2); }
.fill-acc { fill: var(--accent); }
.fill-sig { fill: var(--signal); }
.fill-ink { fill: var(--ink); }
.beam { fill: var(--accent); opacity: 0.1; stroke: none; }
.band { fill: var(--signal); opacity: 0.13; }
.cap text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.lbl { fill: var(--ink); font-size: 13px; font-weight: 500; font-family: var(--font); }
.stop-acc { stop-color: var(--accent); }
.marker-fill { fill: var(--ink); }

/* ---------- Home ---------- */
.hero { padding: 4.5rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.hero-role { color: var(--muted); font-weight: 500; }
.hero h1 { margin-top: 0.75rem; font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.2rem); line-height: 1; letter-spacing: -0.04em; font-weight: 600; }
.hero .lead { margin-top: 1.4rem; font-size: 1.2rem; color: var(--muted); max-width: 34rem; }
.hero .actions { margin-top: 2rem; }
.hero-visual { position: relative; }
.hero-visual .fig { border-radius: 24px; }
.portrait {
  position: absolute; left: -1.5rem; bottom: -1.5rem; width: 9rem; height: 9rem; border-radius: 50%;
  border: 6px solid var(--bg); overflow: hidden; background: var(--soft-2); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--accent); font-weight: 600; font-size: 2rem; letter-spacing: 0.02em;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .hero { padding-top: 2.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .portrait { width: 6.5rem; height: 6.5rem; left: 1rem; bottom: -1.75rem; font-size: 1.5rem; }
}

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; margin-top: 3.5rem; }
.facts > div { background: var(--bg); padding: 1.1rem 1.25rem; }
.facts dt { color: var(--faint); font-size: 0.8rem; }
.facts dd { font-weight: 500; font-size: 0.95rem; line-height: 1.4; margin-top: 0.15rem; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tracks { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.25rem; }
.track { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.75rem; background: var(--bg); display: flex; flex-direction: column; gap: 0.9rem; }
.track-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.track-primary .muted, .track-primary .track-list li { color: color-mix(in srgb, var(--bg) 72%, var(--ink)); }
.track-primary .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.track-label { font-size: 0.85rem; font-weight: 500; color: var(--accent); }
.track-primary .track-label { color: color-mix(in srgb, var(--accent) 60%, var(--bg)); }
.track h3 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.track-list li { padding-left: 1rem; position: relative; font-size: 0.95rem; color: var(--muted); }
.track-list li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.track .actions { margin-top: auto; padding-top: 0.5rem; }
@media (max-width: 860px) { .tracks { grid-template-columns: 1fr; } }

.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.theme-card { color: var(--ink); display: flex; flex-direction: column; gap: 0.75rem; }
.theme-card:hover { text-decoration: none; }
.theme-card:hover .fig { outline: 2px solid var(--accent-soft); }
.theme-card h3 { font-size: 1rem; font-weight: 600; }
.theme-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
@media (max-width: 860px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .theme-grid { grid-template-columns: 1fr; } }

.cta { border-radius: 24px; background: var(--ink); color: var(--bg); padding: 2.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.cta p { color: color-mix(in srgb, var(--bg) 70%, var(--ink)); margin-top: 0.3rem; }
.cta .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* ---------- Cards / rows ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.35rem; background: var(--bg); }
.card h3 { font-size: 1rem; font-weight: 600; }
.card p { color: var(--muted); font-size: 0.925rem; margin-top: 0.35rem; line-height: 1.55; }
.card-num { width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 0.9rem; }
.card-num svg { width: 1.05rem; height: 1.05rem; }

.rows > li { padding: 1.15rem 0; border-top: 1px solid var(--rule); }
.rows > li:last-child { border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; }
.row-title { font-weight: 600; line-height: 1.4; }
.row-side { color: var(--faint); font-size: 0.875rem; text-align: right; font-variant-numeric: tabular-nums; }
.row-sub { color: var(--muted); font-size: 0.95rem; grid-column: 1 / -1; }
.row-note { color: var(--faint); font-size: 0.85rem; grid-column: 1 / -1; margin-top: 0.15rem; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } .row-side { text-align: left; } }

.two-col { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; }
.two-col > h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; position: sticky; top: 5.5rem; align-self: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: 1rem; } .two-col > h2 { position: static; } }

/* ---------- Research page ---------- */
.theme-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding: 3rem 0; border-top: 1px solid var(--rule); }
.theme-row:nth-child(even) .fig { order: 2; }
.theme-row:first-child { border-top: 0; padding-top: 0; }
.theme-row h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.theme-row > div > p { color: var(--muted); margin-top: 0.6rem; }
.mini-pubs { margin-top: 1.25rem; display: grid; gap: 0.6rem; }
.mini-pubs li { font-size: 0.9rem; line-height: 1.45; padding-left: 0.9rem; border-left: 2px solid var(--rule); }
.mini-pubs li span { display: block; color: var(--faint); font-size: 0.8rem; }
@media (max-width: 860px) { .theme-row { grid-template-columns: 1fr; gap: 1.5rem; } .theme-row:nth-child(even) .fig { order: 0; } }

.demo { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.scope-frame { position: relative; aspect-ratio: 1; border-radius: var(--r-lg); background: var(--soft); overflow: hidden; }
#constellation { width: 100%; height: 100%; display: block; }
.axis { position: absolute; font-size: 0.7rem; color: var(--faint); font-style: italic; }
.axis-i { right: 0.5rem; top: calc(50% + 0.15rem); }
.axis-q { left: calc(50% + 0.35rem); top: 0.3rem; }
.scope-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center; margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.scope-controls output { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3.9rem; text-align: right; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.25rem; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--rule); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--rule); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--signal); border: 2px solid var(--bg); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--signal); border: 2px solid var(--bg); }
@media (max-width: 760px) { .demo { grid-template-columns: 1fr; } .demo .scope { max-width: 18rem; } }

/* ---------- Publications ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.search { flex: 1 1 18rem; display: flex; align-items: center; gap: 0.55rem; height: 2.75rem; padding: 0 0.9rem; border-radius: var(--r); border: 1px solid var(--rule); background: var(--bg); color: var(--faint); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { height: 2.1rem; padding: 0 0.8rem; border-radius: 999px; cursor: pointer; border: 1px solid var(--rule); background: var(--bg); color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 500; }
.chip:hover { color: var(--ink); border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { opacity: 0.6; margin-left: 0.3rem; font-variant-numeric: tabular-nums; }
.result-note { min-height: 1.3rem; margin: 1rem 0 0.25rem; color: var(--faint); font-size: 0.85rem; }
.pub-stats { display: flex; gap: 2rem; flex-wrap: wrap; }
.pub-stats div { font-size: 0.85rem; color: var(--muted); }
.pub-stats b { display: block; font-size: 1.6rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.year-group { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.year-group > h3 { font-size: 1.1rem; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; position: sticky; top: 5.5rem; align-self: start; }
.pub + .pub { margin-top: 1.4rem; }
.pub-title { font-size: 1.02rem; font-weight: 600; line-height: 1.45; }
.pub-title .tag { margin-left: 0.4rem; }
.pub-authors { margin-top: 0.25rem; color: var(--muted); font-size: 0.9rem; }
.pub-authors .me { color: var(--ink); font-weight: 600; }
.pub-venue { color: var(--muted); font-size: 0.9rem; }
.pub-venue em { color: var(--ink); }
.pub-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; margin-top: 0.45rem; font-size: 0.85rem; }
.pub-kind { color: var(--faint); }
.link-btn { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent); }
.link-btn:hover { text-decoration: underline; text-underline-offset: 0.2em; }
mark { background: rgba(217, 143, 0, 0.22); color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 600px) { .year-group { grid-template-columns: 1fr; gap: 0.75rem; } .year-group > h3 { position: static; } }

/* ---------- Consultancy ---------- */
.role { border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; }
.role + .role { margin-top: 1rem; }
.role-head { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 1.1rem; align-items: start; padding: 1.5rem; }
.role-logo { width: 3rem; height: 3rem; border-radius: 12px; background: var(--soft-2); display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: var(--ink); letter-spacing: 0.02em; }
.role-title { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.role-client { color: var(--accent); font-weight: 500; }
.role-summary { color: var(--muted); margin-top: 0.4rem; font-size: 0.95rem; max-width: 44rem; }
.role-period { color: var(--faint); font-size: 0.875rem; white-space: nowrap; }
.role-toggle { margin-top: 0.9rem; }
.role-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.role-toggle svg { transition: transform 0.15s; }
@media (prefers-reduced-motion: reduce) { .role-toggle svg { transition: none; } }
.role-projects { border-top: 1px solid var(--rule); background: var(--soft); padding: 1.25rem 1.5rem 1.5rem; }
.role-projects[hidden] { display: none; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.9rem; }
.proj-card { display: flex; flex-direction: column; border-radius: var(--r); background: var(--bg); border: 1px solid var(--rule); overflow: hidden; color: var(--ink); }
.proj-card:hover { text-decoration: none; border-color: var(--accent); }
.proj-card .fig { border-radius: 0; }
.proj-card-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.proj-card-body h4 { font-size: 1rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.proj-card-body p { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.proj-card-body .open { margin-top: auto; padding-top: 0.4rem; color: var(--accent); font-size: 0.85rem; font-weight: 500; }
@media (max-width: 600px) { .role-head { grid-template-columns: 2.5rem minmax(0, 1fr); } .role-logo { width: 2.5rem; height: 2.5rem; } .role-period { grid-column: 2; } }

/* ---------- Project page ---------- */
.crumbs { font-size: 0.875rem; color: var(--faint); display: flex; gap: 0.4rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.meta-grid > div { background: var(--bg); padding: 1rem 1.2rem; }
.meta-grid dt { color: var(--faint); font-size: 0.8rem; }
.meta-grid dd { font-weight: 500; font-size: 0.95rem; margin-top: 0.1rem; }
.check-list li { position: relative; padding: 0.55rem 0 0.55rem 1.9rem; border-bottom: 1px solid var(--rule); }
.check-list li::before { content: ""; position: absolute; left: 0.2rem; top: 0.85rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--accent-soft); }
.check-list li::after { content: ""; position: absolute; left: 0.5rem; top: 1.1rem; width: 0.35rem; height: 0.2rem; border-left: 1.8px solid var(--accent); border-bottom: 1.8px solid var(--accent); transform: rotate(-45deg); }
.pill-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pill-list li { padding: 0.3rem 0.8rem; border-radius: 999px; background: var(--soft); font-size: 0.875rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.about-photo { aspect-ratio: 4 / 5; border-radius: var(--r-lg); background: var(--soft); overflow: hidden; display: grid; place-items: center; position: sticky; top: 5.5rem; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.big-mono { font-size: 4.5rem; font-weight: 600; letter-spacing: -0.04em; color: var(--accent); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } .about-photo { position: static; max-width: 16rem; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.gallery figure img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); width: 100%; }
.gallery figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.contact-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.contact-card .label { color: var(--faint); font-size: 0.85rem; }
.contact-card .value { font-size: 1.1rem; font-weight: 500; overflow-wrap: anywhere; }
.contact-card .actions { margin-top: 0.75rem; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.form { display: grid; gap: 0.9rem; max-width: 40rem; }
.form label { display: grid; gap: 0.35rem; font-size: 0.875rem; font-weight: 500; }
.form input, .form select, .form textarea {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 0.65rem 0.8rem; width: 100%;
}
.form textarea { min-height: 9rem; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.profile-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.profile-list a { display: inline-flex; align-items: center; height: 2.2rem; padding: 0 0.95rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); font-size: 0.9rem; }
.profile-list a:hover { border-color: var(--faint); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 3rem 0 2rem; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 2rem; }
.footer-grid h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.7rem; }
.footer-grid li + li { margin-top: 0.35rem; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--faint); font-size: 0.825rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 0.55rem 1rem; border-radius: var(--r); font-size: 0.85rem; z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.empty { padding: 1.25rem; border: 1px dashed var(--rule); border-radius: var(--r); color: var(--muted); font-size: 0.925rem; }
.notfound { min-height: 60vh; display: grid; align-content: center; gap: 1rem; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }
.news-card { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; color: var(--ink); background: var(--bg); }
.news-card:hover { text-decoration: none; border-color: var(--accent); }
.news-media { aspect-ratio: 16 / 10; background: var(--soft); overflow: hidden; display: grid; place-items: center; }
.news-media .fig { border-radius: 0; width: 100%; background: transparent; }
.news-media img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 1rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.news-body h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.news-body p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.news-body .open { margin-top: auto; padding-top: 0.4rem; color: var(--accent); font-size: 0.85rem; font-weight: 500; }
.news-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; color: var(--faint); font-size: 0.8rem; }
.post { max-width: 46rem; }
.post-title { margin-top: 1rem; font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); line-height: 1.12; letter-spacing: -0.03em; font-weight: 600; }
.post .news-meta { margin-top: 0.9rem; }
.post .lead { margin-top: 1rem; color: var(--muted); font-size: 1.1rem; }
.post-media { margin: 2rem 0; border-radius: var(--r-lg); overflow: hidden; background: var(--soft); }
.post-media .fig { border-radius: 0; }
.post-media img { width: 100%; height: auto; }
.post-body p { font-size: 1.02rem; line-height: 1.75; }

/* ---------- Photos ---------- */
.portrait.has-img { background: var(--bg); }
.about-photo { max-width: 16rem; }
.about-photo.has-img { aspect-ratio: 1; }
.gallery { grid-template-columns: repeat(auto-fill, minmax(12rem, 16rem)); }
.gallery figure img { aspect-ratio: 1; }

/* ---------- Narrow header ---------- */
@media (max-width: 1120px) {
  .header-inner { gap: 0.75rem; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand > span:last-child { min-width: 0; overflow: hidden; }
  .brand > span:last-child > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) {
  .brand { font-size: 0.9rem; }
  .header-tools { gap: 0.3rem; }
  .lang-btn { min-width: 2.25rem; padding: 0 0.45rem; }
}
