:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --ink: #15181d;
  --ink-2: #3c414b;
  --muted: #6a707c;
  --line: #e6e2d9;
  --accent: #0d6e6e;
  --accent-ink: #ffffff;
  --accent-soft: #e2efed;
  --gold: #a1660b;
  --shadow: 0 1px 2px rgba(20, 24, 30, .04), 0 8px 24px -12px rgba(20, 24, 30, .12);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1215; --surface: #151a1e; --surface-2: #1b2126; --ink: #eceef0; --ink-2: #c4c9cf;
    --muted: #8d949c; --line: #262d33; --accent: #5cc4b8; --accent-ink: #062523; --accent-soft: #15302e;
    --gold: #e0b062; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -16px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1215; --surface: #151a1e; --surface-2: #1b2126; --ink: #eceef0; --ink-2: #c4c9cf;
  --muted: #8d949c; --line: #262d33; --accent: #5cc4b8; --accent-ink: #062523; --accent-soft: #15302e;
  --gold: #e0b062; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -16px rgba(0,0,0,.6); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand .mono { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 500 15px/1 var(--serif); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-size: 14.5px; padding: 6px 12px; border-radius: 999px; transition: color .15s, background .15s; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--surface-2); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.lang { text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; } :root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }
.menu-btn { display: none; }

/* hero */
.hero { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 48px; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 14px; letter-spacing: .01em; }
h1 { font: 500 clamp(44px, 7vw, 76px)/1.02 var(--serif); letter-spacing: -.025em; margin: 0 0 20px; }
.lede { font: 400 clamp(20px, 2.4vw, 25px)/1.4 var(--serif); color: var(--ink-2); margin: 0 0 28px; max-width: 30ch; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 500; transition: border-color .15s, transform .15s; }
.pill:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.pill-solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill-solid:hover { color: var(--bg); }
.orcid { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #a6ce39; color: #fff; font-size: 9px; font-weight: 700; }

.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.portrait { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #1d3b56)); display: grid; place-items: center; margin-bottom: 20px; }
.portrait span { color: #fff; font: 500 32px/1 var(--serif); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait:has(img) { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0; }
.stats div { background: var(--surface); padding: 14px 16px; }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font: 500 30px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.spark { margin: 20px 0 0; }
.spark figcaption { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; padding-bottom: 18px; }
.bar span { width: 100%; min-height: 3px; background: var(--accent); border-radius: 5px 5px 2px 2px; opacity: .85; }
.bar em { font-style: normal; font-size: 11px; color: var(--muted); order: -1; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.bar b { position: absolute; bottom: 0; font-weight: 500; font-size: 11px; color: var(--muted); }
.bar b::before { content: "’"; }

/* latest */
.latest { padding-bottom: 24px; }
.kicker { font: 600 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.latest-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.latest-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.latest-list time { font-size: 12.5px; color: var(--muted); }
.latest-list a, .latest-list span:not(.tag) { font-weight: 500; line-height: 1.35; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.latest-list small { color: var(--muted); }
.latest-list .tag { align-self: flex-start; }

/* sections */
.section { padding-top: 72px; padding-bottom: 24px; }
.split { display: grid; grid-template-columns: 220px 1fr; gap: 48px; }
.split > .h2 { position: sticky; top: 96px; align-self: start; }
.h2 { font: 500 32px/1.15 var(--serif); letter-spacing: -.015em; margin: 0 0 24px; }
.h3 { font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 40px 0 16px; }
.count { font: 400 18px var(--sans); color: var(--muted); vertical-align: middle; margin-left: 6px; }
.prose p { font: 400 20px/1.6 var(--serif); color: var(--ink-2); margin: 0 0 18px; max-width: 64ch; }
.prose p:first-child::first-line { color: var(--ink); }
.themes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.themes li { display: flex; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.themes .n { font: 500 14px/1.5 var(--serif); color: var(--accent); }
.themes strong { display: block; font-weight: 600; margin-bottom: 4px; }
.themes p { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.5; }

.tag { display: inline-block; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag-conference { background: var(--accent-soft); color: var(--accent); }
.tag-review { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }

.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.feat-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.feat-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.feat-card h3 { font: 500 20px/1.3 var(--serif); margin: 0 0 10px; }
.feat-card h3 a { text-decoration: none; }
.feat-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.feat-card .venue { color: var(--muted); font-size: 14px; margin: 0 0 16px; font-style: italic; }
.feat-card .cites { margin: auto 0 0; font-size: 13px; color: var(--muted); }
.feat-card .cites strong { font: 500 22px var(--serif); color: var(--ink); margin-right: 2px; }

/* publications */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.text-link { font-size: 14px; color: var(--accent); }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 12px 0; }
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 14px; max-width: 520px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 11px 0; width: 100%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13.5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.chip span { color: var(--muted); margin-left: 2px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink-2); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip.is-on span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.sr-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.year-group { display: grid; grid-template-columns: 96px 1fr; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 8px; }
.year { font: 500 28px/1 var(--serif); color: var(--muted); position: sticky; top: 210px; align-self: start; font-variant-numeric: tabular-nums; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0 0 26px; }
.pub-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.oa { color: var(--accent); font-weight: 500; }
.oa::before { content: "●"; margin-right: 4px; font-size: 9px; vertical-align: 1px; }
.cit { font-variant-numeric: tabular-nums; }
.pub-title { font: 500 19.5px/1.35 var(--serif); margin: 0 0 6px; letter-spacing: -.005em; }
.pub-title a { text-decoration: none; }
.pub-title a:hover { text-decoration: underline; }
.authors { margin: 0 0 2px; font-size: 14px; color: var(--ink-2); }
.authors strong { color: var(--ink); font-weight: 600; }
.pub .venue { margin: 0; font-size: 14px; color: var(--muted); }
.pub-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 14px; margin-top: 8px; font-size: 13.5px; }
.pub-actions a, .pub-actions .copy, .pub-actions summary { color: var(--accent); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.pub-actions a:hover, .pub-actions .copy:hover, .pub-actions summary:hover { text-decoration: underline; }
.pub-actions details { order: 10; flex-basis: 100%; }
.pub-actions summary { list-style: none; display: inline; }
.pub-actions summary::-webkit-details-marker { display: none; }
.pub-actions summary::after { content: " ↓"; }
.pub-actions details[open] summary::after { content: " ↑"; }
.pub-actions details p { margin: 10px 0 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; max-width: 72ch; }
.copy.done { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }
.code-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.code-list a { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); text-decoration: none; }
.code-list a:hover { border-color: var(--accent); color: var(--ink); }
.code-ico { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font: 600 14px ui-monospace, monospace; }
.code-list span:not(.code-ico) { font-weight: 500; line-height: 1.4; }
.code-list small { color: var(--muted); }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 0 0 32px; position: relative; }
.tl li::before { content: ""; position: absolute; left: 166px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); z-index: 1; }
.tl li::after { content: ""; position: absolute; left: 170px; top: 12px; bottom: -8px; width: 1px; background: var(--line); }
.tl li:last-child::after { display: none; }
.tl-when strong { display: block; font: 500 22px/1.2 var(--serif); }
.tl-when span { font-size: 13px; color: var(--muted); }
.tl-body { padding-left: 24px; }
.tl-body h3 { font: 500 18px/1.35 var(--serif); margin: 0 0 6px; }
.where { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.where svg { width: 15px; height: 15px; }
.tl-paper { margin: 0; font-size: 14px; color: var(--muted); }
.tl-paper a { color: var(--ink-2); }

/* cv */
.cv-grid .h3:first-child { margin-top: 0; }
.cv-block + .cv-block .h3 { margin-top: 36px; }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.cv-list .yrs { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.cv-list strong { display: block; font-weight: 600; }
.cv-list span, .cv-list small { display: block; color: var(--muted); font-size: 14.5px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: 14px; }
.tags small { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* contact */
.contact { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; padding: 40px; border-radius: 24px; background: var(--ink); color: var(--bg); }
.contact .h2 { margin-bottom: 8px; }
.contact p { margin: 0; color: color-mix(in srgb, var(--bg) 75%, transparent); max-width: 46ch; }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; padding: 12px 20px; border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.btn:hover { color: var(--accent); }
.btn-ghost { background: transparent; color: var(--bg); border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent); }
.btn-ghost:hover { color: var(--bg); border-color: var(--bg); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 48px; padding-bottom: 88px; color: var(--muted); font-size: 13.5px; }
.foot p { margin: 0; }

/* back to top */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s, visibility .2s, border-color .15s, color .15s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
main:focus { outline: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top svg { width: 20px; height: 20px; }
@media (max-width: 760px) { .to-top { width: 48px; height: 48px; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); } }
.to-top { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; }
  .hero-card { max-width: 520px; }
  .latest-list { grid-template-columns: 1fr 1fr; }
  .feat { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 0; }
  .split > .h2 { position: static; }
}
@media (max-width: 760px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .menu-btn { display: grid; }
  .nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 16px; border-radius: 10px; }
  .brand > span:last-child { display: none; }
  .top-actions { margin-left: auto; }
  .latest-list { grid-template-columns: 1fr; }
  .year-group { grid-template-columns: 1fr; gap: 8px; }
  .year { position: static; font-size: 22px; }
  .toolbar { top: 64px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .chip { flex: none; }
  .tl li { grid-template-columns: 1fr; gap: 4px; padding-left: 24px; }
  .tl li::before { left: 0; top: 10px; }
  .tl li::after { left: 4px; top: 14px; }
  .tl-body { padding-left: 0; }
  .cv-list li { grid-template-columns: 1fr; gap: 2px; }
  .contact { padding: 28px 24px; }
  .prose p { font-size: 18.5px; }
}

/* ---------- phone ergonomics ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .brand { padding: 6px 6px 6px 0; min-height: 44px; }
  .lang { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; }
  .icon-btn { width: 40px; height: 40px; }
  .hero { padding-top: 32px; padding-bottom: 24px; gap: 24px; }
  .eyebrow { font-size: 14.5px; }
  .links { gap: 8px; }
  .pill { min-height: 44px; padding: 10px 16px; font-size: 15px; }
  .hero-card { padding: 20px; border-radius: 18px; }
  .portrait { width: 88px; height: 88px; margin-bottom: 16px; }
  .stats dd { font-size: 28px; }
  .bars { height: 80px; }

  /* "Latest" becomes a swipeable row instead of four stacked cards */
  .latest-list { display: flex; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
                 margin-inline: -16px; padding: 2px 16px 6px; gap: 10px; -webkit-overflow-scrolling: touch; }
  .latest-list::-webkit-scrollbar { display: none; }
  .latest-list { scroll-padding-inline: 16px; }
  .latest-list li { flex: 0 0 78%; scroll-snap-align: start; }
  .latest-list small, .tags small { font-size: 13px; }

  .section { padding-top: 52px; }
  .h2 { font-size: 28px; margin-bottom: 18px; }
  .prose p { font-size: 18px; }
  .themes li { padding: 16px; }
  .feat-card { padding: 18px; }

  /* filter bar: not sticky on phones, it would eat a quarter of the screen */
  .toolbar { position: static; padding: 4px 0 8px; }
  .search { max-width: none; min-height: 48px; }
  .chip { min-height: 40px; padding: 8px 14px; font-size: 14px; }
  .text-link { display: inline-flex; align-items: center; min-height: 44px; }

  .pub { padding-bottom: 24px; }
  .pub-title { font-size: 19px; }
  .pub-actions { gap: 8px; margin-top: 10px; }
  .pub-actions a, .pub-actions .copy, .pub-actions summary {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); font-size: 14px; text-decoration: none !important; }
  .pub-actions summary::after { margin-left: 4px; }
  .pub-actions details[open] summary { background: var(--accent-soft); border-color: transparent; }
  .pub-actions details p { font-size: 15px; }

  .tl-paper a, .cv-list a, .code-list a { padding: 4px 0; }
  .contact-actions { width: 100%; }
  .contact-actions .btn { width: 100%; justify-content: center; min-height: 48px; align-items: center; }
  .foot { flex-direction: column; gap: 6px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (hover: none) {
  .feat-card:hover, .pill:hover { transform: none; }
}
/* tablets: the metrics card spreads across instead of leaving half the width empty */
@media (min-width: 761px) and (max-width: 980px) {
  .hero-card { max-width: none; display: grid; grid-template-columns: auto 1fr; gap: 20px 28px; align-items: center; }
  .hero-card .portrait { margin: 0; width: 120px; height: 120px; }
  .hero-card .stats { grid-template-columns: repeat(4, 1fr); }
  .hero-card .spark { grid-column: 1 / -1; margin: 0; }
}

/* ---------- apps page ---------- */
.nav a.active[data-page] { color: var(--ink); background: var(--surface-2); }
.apps-hero { padding-top: 72px; padding-bottom: 32px; }
.apps-hero .lede { max-width: 40ch; }
.app-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.app-card { display: flex; flex-direction: column; gap: 18px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.app-head { display: flex; gap: 18px; align-items: flex-start; }
.app-icon { width: 72px; height: 72px; flex: none; border-radius: 18px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); object-fit: cover; }
.app-icon-txt { display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 500 30px var(--serif); }
.app-kind { margin: 2px 0 4px; font-size: 13px; color: var(--muted); }
.app-name { font: 500 30px/1.1 var(--serif); margin: 0 0 6px; letter-spacing: -.01em; }
.app-tagline { margin: 0; font: 400 18px/1.4 var(--serif); color: var(--ink-2); }
.app-desc { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }
.app-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.app-feats li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.5; }
.app-feats li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); box-shadow: inset 0 0 0 5px var(--accent-soft), inset 0 0 0 16px var(--accent); transform: scale(.55); }
.app-meta { margin: 0; display: grid; gap: 10px; }
.app-meta div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; }
.app-meta dt { font-size: 13px; color: var(--muted); }
.app-meta dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.app-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 4px; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px 8px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.1; transition: transform .15s; }
.store-btn:hover { color: var(--bg); transform: translateY(-1px); }
.store-btn svg { width: 22px; height: 22px; }
.store-btn small { display: block; font-size: 10.5px; font-weight: 500; opacity: .75; letter-spacing: .02em; }
.store-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.store-btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.studio { padding-top: 40px; }
.studio-card { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; flex-wrap: wrap; padding: 32px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); }
.studio-text { font: 400 20px/1.5 var(--serif); margin: 0; max-width: 46ch; color: var(--ink-2); }
.stack-h { margin-top: 24px; }
.studio-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.studio .btn { background: var(--ink); color: var(--bg); }
.studio .btn:hover { color: var(--bg); opacity: .9; }
.studio .btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.studio .btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 980px) { .app-list { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .apps-hero { padding-top: 36px; padding-bottom: 20px; }
  .app-card { padding: 20px; border-radius: 18px; gap: 16px; }
  .app-icon { width: 60px; height: 60px; border-radius: 15px; }
  .app-name { font-size: 26px; }
  .app-tagline { font-size: 17px; }
  .app-meta div { grid-template-columns: 1fr; gap: 6px; }
  .app-actions .store-btn { flex: 1 1 140px; justify-content: center; }
  .app-actions .text-link { width: 100%; justify-content: center; }
  .studio-card { padding: 24px 20px; }
  .studio-text { font-size: 18px; }
  .studio-actions { width: 100%; }
  .studio-actions .btn { width: 100%; justify-content: center; min-height: 48px; align-items: center; }
}
