:root {
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --page: #fbfbfc; --surface: #ffffff; --subtle: #f3f5f8; --header: rgba(251,251,252,.88);
  --ink: #16202b; --ink-soft: #2c3743; --muted: #5b6572; --faint: #8a939e;
  --line: #dde2e8; --line-strong: #c3cbd4;
  --accent: #0f6cbd; --accent-hover: #0c5a9e; --accent-soft: #ebf3fc; --accent-line: #b9d6f2; --accent-ink: #0c5a9e;
  --btn: #0f6cbd; --btn-hover: #0c5a9e; --btn-ink: #ffffff;
  --lab: #8a5300; --lab-soft: #fff6e3; --lab-line: #ebd09b;
  --success: #1a7f37; --shadow: 0 1px 2px rgba(22,32,43,.04);
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0e1318; --surface: #151b22; --subtle: #1b222b; --header: rgba(14,19,24,.86);
    --ink: #e6edf3; --ink-soft: #cdd6df; --muted: #9aa6b2; --faint: #6f7b87;
    --line: #27303a; --line-strong: #3a4450;
    --accent: #58a6ee; --accent-hover: #7cb9f2; --accent-soft: #122536; --accent-line: #214a70; --accent-ink: #8cc3f5;
    --btn: #2f7fcb; --btn-hover: #3b8cd8; --btn-ink: #ffffff;
    --lab: #e2b265; --lab-soft: #251d10; --lab-line: #5a4522;
    --success: #3fb950; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0e1318; --surface: #151b22; --subtle: #1b222b; --header: rgba(14,19,24,.86);
  --ink: #e6edf3; --ink-soft: #cdd6df; --muted: #9aa6b2; --faint: #6f7b87;
  --line: #27303a; --line-strong: #3a4450;
  --accent: #58a6ee; --accent-hover: #7cb9f2; --accent-soft: #122536; --accent-line: #214a70; --accent-ink: #8cc3f5;
  --btn: #2f7fcb; --btn-hover: #3b8cd8; --btn-ink: #ffffff;
  --lab: #e2b265; --lab-soft: #251d10; --lab-line: #5a4522;
  --success: #3fb950; --shadow: none;
  color-scheme: dark;
}
html { scroll-behavior: smooth; scroll-padding-top: calc(5rem + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font-sans); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100%; display: flex; flex-direction: column; transition: background-color .2s, color .2s; }
h1,h2,h3,p,ul,ol,dl,dd,figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }
img { max-width: 100%; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
[hidden] { display: none !important; }
.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; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: calc(1rem + env(safe-area-inset-top, 0px)); z-index: 60; background: var(--surface); padding: .5rem .75rem; border-radius: 6px; border: 1px solid var(--line); }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 640px) { .container { padding: 0 2rem; } }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--header); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4rem; }
.brand { font-weight: 600; letter-spacing: -.01em; }
.header-right { display: flex; align-items: center; gap: .25rem; }
.nav-desktop { display: none; }
.nav-desktop ul { display: flex; gap: .25rem; }
.nav-link { display: block; padding: .5rem .75rem; border-radius: 6px; color: var(--muted); font-size: .9375rem; transition: background-color .15s, color .15s; }
.nav-link:hover { background: var(--subtle); color: var(--ink); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--subtle); }
.theme-btn { border-color: var(--line); margin-left: .5rem; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
.menu-btn { margin-right: -.5rem; }
.mobile-nav { display: none; border-bottom: 1px solid var(--line); background: var(--surface); }
.mobile-nav.open { display: block; }
.mobile-nav ul { padding: .5rem 1.25rem; }
.mobile-nav a { display: block; padding: .75rem .5rem; border-radius: 6px; }
.mobile-nav a:hover { background: var(--subtle); }
@media (min-width: 768px) { .nav-desktop { display: block; } .menu-btn, .mobile-nav, .mobile-nav.open { display: none; } }

main { flex: 1; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 6px; font-size: .9375rem; font-weight: 500; padding: .625rem 1rem; transition: background-color .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-text { padding: .625rem .25rem; color: var(--muted); }
.btn-text:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.hero { padding: 3.5rem 0; }
.hero-grid { display: grid; gap: 3rem; align-items: start; }
.hero h1 { font-size: 2.5rem; line-height: 1.05; letter-spacing: -.025em; font-weight: 600; }
.hero-headline { margin-top: 1.25rem; font-size: 1.25rem; font-weight: 500; }
.hero-areas { margin-top: .25rem; font-size: 1.125rem; color: var(--muted); }
.hero-summary { margin-top: 1.5rem; max-width: 36rem; font-size: 1.0625rem; color: var(--muted); }
.facts { margin-top: 2rem; max-width: 36rem; display: grid; gap: .75rem 2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; font-size: .9375rem; }
.facts dt { font-size: .875rem; color: var(--muted); }
.facts dd { font-weight: 500; }
.cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
@media (min-width: 640px) { .hero { padding: 5rem 0; } .hero h1 { font-size: 3.75rem; } .hero-headline { font-size: 1.5rem; } .hero-areas { font-size: 1.25rem; } .facts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .hero { padding: 6rem 0; } .hero-grid { grid-template-columns: 7fr 5fr; } .focus { margin-top: .5rem; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.focus { padding: 1.25rem; }
@media (min-width: 640px) { .focus { padding: 1.5rem; } }
.focus h2 { font-size: .9375rem; font-weight: 600; }
.focus > p { margin-top: .25rem; font-size: .875rem; color: var(--muted); }
.path { margin-top: 1.25rem; }
.path li { position: relative; display: flex; gap: 1rem; padding-bottom: 1rem; }
.path li:last-child { padding-bottom: 0; }
.path .rail { position: absolute; left: 7px; top: 1.25rem; bottom: 0; width: 0; border-left: 1px solid var(--accent-line); }
.path .rail.goal { border-left-style: dashed; border-color: var(--line-strong); }
.path .dot { position: relative; margin-top: .25rem; width: 15px; height: 15px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); }
.path .dot.current { background: var(--accent); }
.path .dot.goal { border-style: dashed; border-color: var(--line-strong); }
.path .state { display: block; font-size: .75rem; font-weight: 500; color: var(--accent-ink); }
.path .state.goal { color: var(--faint); }
.path .label { display: block; font-size: .9375rem; }
.path .label.goal { color: var(--muted); }

/* Sections */
.section { border-top: 1px solid var(--line); padding: 4rem 0; }
.section-grid { display: grid; gap: 2rem; }
.section h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.015em; }
.section-intro { margin-top: .5rem; max-width: 24rem; font-size: .95rem; color: var(--muted); }
.section-body { min-width: 0; }
@media (min-width: 640px) { .section { padding: 5rem 0; } }
@media (min-width: 1024px) { .section-grid { grid-template-columns: 4fr 8fr; gap: 3rem; } }

.prose p { max-width: 42rem; font-size: 1.0625rem; line-height: 1.75; color: var(--ink-soft); }
.prose p + p { margin-top: 1rem; }
.sub-h { margin-top: 2.5rem; font-size: .9375rem; font-weight: 600; }
.sub-p { margin-top: .25rem; font-size: .875rem; color: var(--muted); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { display: inline-flex; align-items: center; gap: .375rem; border: 1px solid var(--line); background: var(--subtle); color: var(--ink); border-radius: 6px; padding: .25rem .625rem; font-size: .8125rem; line-height: 1.25rem; }
.tag.professional { background: var(--surface); border-color: var(--line-strong); }
.tag.lab { background: var(--lab-soft); border-color: var(--lab-line); color: var(--lab); }
.tag.learning { background: transparent; border-style: dashed; border-color: var(--line-strong); color: var(--muted); }
.tag .pdot, .swatch .pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.tag .note { color: var(--faint); }
.mt-3 { margin-top: .75rem; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .75rem 1rem; margin-bottom: 2rem; }
.legend li { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--muted); }
.swatch { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1rem; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); }
.swatch.lab { background: var(--lab-soft); border-color: var(--lab-line); }
.swatch.learning { background: transparent; border-style: dashed; }

.skill-groups { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skill-row { display: grid; gap: .75rem; padding: 1.25rem 0; }
.skill-row + .skill-row { border-top: 1px solid var(--line); }
.skill-row dt { font-weight: 500; }
.skill-row .labonly { display: block; margin-top: .125rem; font-size: .875rem; font-weight: 400; color: var(--lab); }
@media (min-width: 640px) { .skill-row { grid-template-columns: 12rem 1fr; gap: 1.5rem; } }

/* Experience */
.job { padding: 1.25rem; }
@media (min-width: 640px) { .job { padding: 1.75rem; } }
.job-head { display: flex; flex-direction: column; gap: .25rem; }
@media (min-width: 640px) { .job-head { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 1.5rem; } }
.job h3 { font-size: 1.125rem; font-weight: 600; }
.job .company { font-size: .9375rem; color: var(--muted); }
.job .dates { font-size: .875rem; color: var(--muted); flex-shrink: 0; }
.duties { margin-top: 1.25rem; display: grid; gap: .5rem 2rem; font-size: .9375rem; color: var(--ink-soft); }
.duties li { display: flex; gap: .625rem; }
.duties li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); margin-top: .6rem; flex-shrink: 0; }
@media (min-width: 640px) { .duties { grid-template-columns: 1fr 1fr; } }
.job .tags { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* Projects list */
.plist { overflow: hidden; }
.prow { position: relative; padding: 1.25rem; transition: background-color .15s; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow:hover { background: var(--subtle); }
@media (min-width: 640px) { .prow { padding: 1.5rem; } }
.prow-top { display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 640px) { .prow-top { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 1.5rem; } }
.pcat { font-size: .875rem; color: var(--muted); }
.prow h3 { margin-top: .125rem; font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.prow h3 a::after { content: ""; position: absolute; inset: 0; }
.prow:hover h3 a { color: var(--accent-ink); }
.pdesc { margin-top: .75rem; max-width: 42rem; font-size: .9375rem; color: var(--muted); }
.prow-bottom { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 640px) { .prow-bottom { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
.view { flex-shrink: 0; font-size: .875rem; font-weight: 500; color: var(--accent-ink); }
.prow:hover .view { text-decoration: underline; }
.fineprint { margin-top: 1rem; font-size: .875rem; color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: .5rem; flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: .375rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .125rem .625rem; font-size: .75rem; font-weight: 500; line-height: 1.25rem; white-space: nowrap; }
.badge .sdot { width: 6px; height: 6px; border-radius: 50%; }
.badge.origin-pro { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.badge.origin-lab { background: var(--lab-soft); border-color: var(--lab-line); color: var(--lab); }
.badge.maturity { border-style: dashed; border-color: var(--line-strong); color: var(--muted); background: transparent; }

/* Contact */
.contact-list > div { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.25rem; }
.contact-list > div + div { border-top: 1px solid var(--line); }
.contact-list dt { width: 6rem; font-size: .875rem; color: var(--muted); }
.contact-list a { font-size: 1.125rem; font-weight: 500; color: var(--accent-ink); overflow-wrap: anywhere; }
@media (min-width: 640px) { .contact-list > div { flex-direction: row; align-items: center; gap: 1.5rem; } }
.muted { color: var(--muted); }

/* Photo */
.photo { width: 7rem; height: 7rem; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); display: block; background: var(--subtle); margin-bottom: 1.75rem; }

/* Contact links (row = card + optional square action) */
.clinks { display: grid; gap: .625rem; }
.crow { display: flex; gap: .625rem; align-items: stretch; }
.ccard { flex: 1; min-width: 0; display: flex; align-items: center; gap: 1rem; padding: .875rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.ccard:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.ccard.primary { border-color: var(--accent-line); }
.ccard[aria-disabled="true"] { cursor: default; opacity: .7; }
.ccard[aria-disabled="true"]:hover { border-color: var(--line); background: var(--surface); }
.cicon { width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent-ink); }
.ctext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ctitle { font-weight: 600; color: var(--ink); line-height: 1.35; }
.csub { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.csub.value { font-size: .9375rem; color: var(--ink); }
.ctrail { color: var(--accent-ink); flex-shrink: 0; display: flex; }
.cicon svg { width: 26px; height: 26px; }
.csquare svg { width: 20px; height: 20px; }
@media (max-width: 400px) { .ccard { gap: .75rem; padding: .875rem .75rem; } .cicon { width: 2rem; } }
.csquare { width: 3.25rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--accent-ink); cursor: pointer; font: inherit; transition: border-color .15s, background-color .15s; }
.csquare:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.csquare.done { color: var(--success); }
.csquare[disabled] { cursor: default; opacity: .5; }
.csquare[disabled]:hover { border-color: var(--line); background: var(--surface); }
button.btn { border: 0; cursor: pointer; font-family: inherit; }
.toast { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: 22rem; background: var(--ink); color: var(--page); border-radius: 8px; padding: .75rem 1rem; font-size: .875rem; box-shadow: 0 6px 24px rgba(0,0,0,.18); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; font-size: .875rem; color: var(--muted); }

/* Project page */
.phead { background: var(--surface); border-bottom: 1px solid var(--line); }
.phead .container { padding-top: 2.5rem; padding-bottom: 2.5rem; }
@media (min-width: 640px) { .phead .container { padding-top: 3.5rem; padding-bottom: 3.5rem; } }
.crumbs { display: flex; flex-wrap: wrap; gap: .375rem; font-size: .875rem; color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.phead h1 { margin-top: 1rem; max-width: 48rem; font-size: 1.875rem; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
@media (min-width: 640px) { .phead h1 { font-size: 2.5rem; } }
.phead .lead { margin-top: 1rem; max-width: 42rem; font-size: 1.0625rem; color: var(--muted); }
.phead .badges { margin-top: 1.5rem; }
.pgrid { margin-top: 2.5rem; padding-bottom: 5rem; display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .pgrid { grid-template-columns: 3fr 9fr; gap: 3rem; } .aside-inner { position: sticky; top: calc(6rem + env(safe-area-inset-top, 0px)); } }
.aside-inner > * + * { margin-top: 2rem; }
.aside-h { font-size: .875rem; font-weight: 600; }
.toc { display: none; }
@media (min-width: 1024px) { .toc { display: block; } }
.toc ol { margin-top: .75rem; border-left: 1px solid var(--line); font-size: .875rem; }
.toc li + li { margin-top: .375rem; }
.toc a { display: block; margin-left: -1px; padding-left: .75rem; border-left: 1px solid transparent; color: var(--muted); }
.toc a:hover { border-color: var(--ink); color: var(--ink); }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; font-size: .875rem; }
@media (min-width: 1024px) { .meta { grid-template-columns: 1fr; } }
.meta dt { color: var(--muted); }
.links { margin-top: .5rem; font-size: .875rem; }
.links li + li { margin-top: .375rem; }
.article { min-width: 0; overflow-wrap: break-word; color: var(--ink-soft); line-height: 1.75; }
.article section { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.article section:first-child { padding-top: 0; }
.article section:last-of-type { border-bottom: 0; }
.article h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.article p { margin: 1rem 0; max-width: 68ch; }
.article .blist { margin: 1rem 0; max-width: 68ch; padding-left: 1.25rem; }
.article ul.blist { list-style: disc; }
.article ol.blist { list-style: decimal; }
.article .blist li { padding-left: .25rem; }
.article .blist li + li { margin-top: .5rem; }
.article .blist li::marker { color: var(--faint); }
.callout { margin: 1.25rem 0; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 8px; padding: .75rem 1rem; }
.callout.example, .callout.warning { border-color: var(--lab-line); background: var(--lab-soft); }
.callout strong { display: block; font-weight: 500; color: var(--ink); }
.callout p { margin: 0; font-size: .9375rem; }
.kv { margin: 1.25rem 0; }
.kv > div { display: grid; gap: .25rem; padding: .75rem 1rem; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv dt { font-size: .875rem; font-weight: 500; color: var(--ink); }
.kv dd { font-size: .9375rem; color: var(--muted); }
@media (min-width: 640px) { .kv > div { grid-template-columns: 11rem 1fr; gap: 1rem; } }
.placeholder { margin: 1rem 0; border: 1px dashed var(--line-strong); border-radius: 8px; padding: .75rem 1rem; font-size: .9375rem; color: var(--muted); }
figure.block { margin: 1.5rem 0; }
figcaption { margin-top: .5rem; font-size: .875rem; color: var(--muted); }
.code { border: 1px solid var(--line); background: var(--subtle); border-radius: 8px; overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: .25rem .5rem .25rem 1rem; font-size: .75rem; color: var(--muted); }
.copy { background: none; border: 0; font: inherit; color: var(--muted); padding: .25rem .5rem; border-radius: 4px; cursor: pointer; }
.copy:hover { background: var(--surface); color: var(--ink); }
.code pre { margin: 0; overflow-x: auto; padding: 1rem; font-size: .8125rem; line-height: 1.6rem; color: var(--ink); }
@media (min-width: 640px) { .code pre { font-size: .875rem; } }
.flow-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--subtle); border-radius: 8px; padding: 1rem; }
.flow { display: flex; flex-direction: column; }
.flow li { display: flex; flex-direction: column; align-items: center; }
.node { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: .75rem .875rem; line-height: 1.35; }
.node b { display: block; font-size: .9375rem; font-weight: 500; color: var(--ink); }
.node span { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--muted); }
.arrow { margin: .375rem 0; width: 20px; height: 20px; color: var(--faint); flex-shrink: 0; }
@media (min-width: 1024px) {
  .flow { flex-direction: row; }
  .flow li { flex: 1; min-width: 8.5rem; flex-direction: row; align-items: stretch; }
  .node { flex: 1; min-width: 0; }
  .arrow { margin: 0 .25rem; transform: rotate(-90deg); align-self: center; }
}
.gallery { display: grid; gap: 1.5rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery img { width: 100%; border: 1px solid var(--line); border-radius: 8px; display: block; }
.back { margin-top: 2.5rem; font-size: .875rem; font-weight: 500; color: var(--accent-ink); }
.back:hover { text-decoration: underline; }

/* Documentation blocks: markdown and inline images */
.md h3 { margin: 1.5rem 0 .5rem; font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.md h4 { margin: 1.25rem 0 .5rem; font-size: .9375rem; font-weight: 600; color: var(--ink); }
.md code { font-size: .875em; background: var(--subtle); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .3rem; }
.md pre { margin: 1rem 0; overflow-x: auto; padding: 1rem; border: 1px solid var(--line); background: var(--subtle); border-radius: 8px; font-size: .8125rem; line-height: 1.6rem; color: var(--ink); }
.md pre code { border: 0; background: none; padding: 0; font-size: inherit; }
.md a, .article p a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.md blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--line-strong); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.md strong { color: var(--ink); font-weight: 600; }
figure.block img.doc-img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; display: block; }
.gallery figure, figure.block a.zoom { display: block; }
.preview-bar { position: sticky; top: calc(4rem + env(safe-area-inset-top, 0px)); z-index: 30; background: var(--lab-soft); border-bottom: 1px solid var(--lab-line); color: var(--lab); font-size: .875rem; }
.preview-bar .container { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; padding-top: .5rem; padding-bottom: .5rem; }

/* Language switch: flags */
.lang-switch { display: inline-flex; align-items: center; gap: .25rem; margin-left: .5rem; }
.lang-flag { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 6px; border: 1px solid transparent; }
.lang-flag .flag { width: 1.5rem; height: auto; aspect-ratio: 8 / 5; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); display: block; }
.lang-flag[aria-current] { border-color: var(--accent-line); background: var(--accent-soft); }
a.lang-flag { opacity: .6; transition: opacity .15s, background-color .15s; }
a.lang-flag:hover, a.lang-flag:focus-visible { opacity: 1; background: var(--subtle); }
@media (max-width: 400px) { .lang-flag { width: 2.25rem; } .lang-switch { margin-left: 0; gap: 0; } }
