/* kuanhoong.com
   Palette: cool paper + ink navy, kingfisher teal accent.
   Type: Newsreader (headings, long reading) + Albert Sans (interface, body). */

@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/newsreader-latin-opsz-normal.woff2) format("woff2"); }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/albert-sans-latin-wght-normal.woff2) format("woff2"); }

:root {
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #151A2D;
  --ink-2: #2E3550;
  --muted: #586079;
  --line: #DCDFE7;
  --line-strong: #C3C8D5;
  --accent: #006E74;          /* text-safe teal */
  --accent-ink: #FFFFFF;
  --accent-soft: #E1F0F0;
  --focus: #3E4FB8;
  /* chart categories, validated for CVD on --paper */
  --c1: #00959C; --c2: #3E4FB8; --c3: #C27A0A; --c4: #A23F86;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
  --hero: clamp(4.25rem, 1.5rem + 11vw, 10.5rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --r-s: 6px;
  --r-m: 10px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0E1426;
  --surface: #151C33;
  --ink: #E9EBF3;
  --ink-2: #C9CDDB;
  --muted: #9CA3BB;
  --line: #262E4A;
  --line-strong: #364063;
  --accent: #46C3C6;
  --accent-ink: #0E1426;
  --accent-soft: #12303A;
  --focus: #8E9BFF;
  --c1: #0E9DA3; --c2: #6A79E6; --c3: #BD8013; --c4: #BE55A3;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1426; --surface: #151C33; --ink: #E9EBF3; --ink-2: #C9CDDB; --muted: #9CA3BB;
    --line: #262E4A; --line-strong: #364063; --accent: #46C3C6; --accent-ink: #0E1426; --accent-soft: #12303A;
    --focus: #8E9BFF; --c1: #0E9DA3; --c2: #6A79E6; --c3: #BD8013; --c4: #BE55A3;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; font-optical-sizing: auto; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3, .h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 99; border-radius: var(--r-s); }
.skip:focus { top: 1rem; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.narrow { max-width: 50rem; margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); }
.prose { max-width: 38em; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.65; }

/* links and buttons */
.link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; font-weight: 500; }
.link:hover { text-decoration-thickness: 2px; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.15rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  font: 500 var(--step--1)/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn svg, .talk-meta svg, .repo-meta svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i-out { width: .85em; height: .85em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.05em; margin-left: .15em; }
.pill-link {
  display: inline-flex; align-items: center; gap: .1rem; padding: .3rem .75rem; margin: 0 .4rem .4rem 0;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: var(--step--1); text-decoration: none; color: var(--ink);
}
.pill-link:hover { border-color: var(--accent); color: var(--accent); }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; text-decoration: none; letter-spacing: -0.01em; margin-right: auto; }
.nav { display: flex; gap: .25rem; }
.nav a { padding: .4rem .7rem; border-radius: 999px; text-decoration: none; font-size: .9375rem; color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.header-tools { display: flex; gap: .25rem; }
.theme-toggle .sun, .theme-toggle svg:last-child { display: none; }
:root[data-theme="dark"] .theme-toggle svg:first-child { display: none; }
:root[data-theme="dark"] .theme-toggle svg:last-child { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle svg:first-child { display: none; }
  :root:not([data-theme="light"]) .theme-toggle svg:last-child { display: block; }
}
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .nav { display: none; position: absolute; top: 4rem; left: 0; right: 0; flex-direction: column; padding: .75rem var(--gutter) 1.25rem; background: var(--paper); border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .5rem; font-size: 1.0625rem; border-radius: var(--r-s); }
}

/* sections rhythm */
main > section { margin-block: clamp(3.5rem, 8vw, 6.5rem); }
main > section.hero { margin-top: clamp(2rem, 5vw, 4rem); margin-bottom: 0; }
main > section.ledger-section { margin-top: clamp(1.5rem, 3vw, 2.5rem); }
main > section.page-head { margin-top: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 2.5rem; }
main > section.page-head + section { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .75rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(12rem, 24vw, 19rem); gap: clamp(1.5rem, 5vw, 4rem); align-items: end; }
.hero-pre { color: var(--muted); font-size: var(--step-0); margin-bottom: 1.25rem; }
.hero-name {
  font-size: var(--hero); line-height: .86; letter-spacing: -0.035em; font-weight: 400;
  margin: 0 0 clamp(1.25rem, 3vw, 2rem); font-variation-settings: "opsz" 72;
}
.hero-name span { display: block; }
.hero-intro { font-family: var(--serif); font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); line-height: 1.4; max-width: 30em; color: var(--ink-2); margin-bottom: 1.75rem; }
.hero-portrait img { width: 100%; aspect-ratio: 587 / 825; object-fit: cover; border-radius: 999px 999px var(--r-m) var(--r-m); background: var(--surface); }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; width: 9rem; }
}

/* ledger chart */
.ledger-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.ledger-head h2 { margin: 0; }
.ledger { position: relative; margin: 0; border-top: 1px solid var(--ink); padding-top: 1.25rem; }
.ledger-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: .25rem; }
.ledger-plot { display: flex; gap: clamp(.6rem, 1.6vw, 1.4rem); min-width: 40rem; }
.ledger-year { flex: var(--n) 0 0; min-width: 3.1rem; }
.ledger-year.empty { flex: .6 0 0; }
.ledger-track { height: clamp(6rem, 13vw, 9.5rem); display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-strong); }
.ledger.compact .ledger-track { height: 5.5rem; }
.bar { flex: 1 1 0; min-width: 3px; max-width: 12px; height: 100%; display: flex; align-items: flex-end; cursor: pointer; --bar: var(--c1); }
.bar.c2 { --bar: var(--c2); } .bar.c3 { --bar: var(--c3); } .bar.c4 { --bar: var(--c4); }
.bar::before { content: ""; display: block; width: 100%; height: var(--h); border-radius: 4px 4px 0 0; background: var(--bar); }
.bar:hover::before { filter: brightness(1.15); }
.ledger-plot:has(.bar:hover) .bar:not(:hover) { opacity: .45; }
.ledger-label { display: grid; gap: 0; white-space: nowrap; font-size: var(--step--1); padding-top: .4rem; font-variant-numeric: tabular-nums; }
.ledger figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 1rem; font-size: var(--step--1); color: var(--muted); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.legend li { display: inline-flex; align-items: center; gap: .45rem; }
.swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; background: var(--c1); flex: none; }
.swatch.c2 { background: var(--c2); } .swatch.c3 { background: var(--c3); } .swatch.c4 { background: var(--c4); }
.tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 19rem; padding: .65rem .8rem; border-radius: var(--r-s);
  background: var(--ink); color: var(--paper); font-size: var(--step--1); line-height: 1.4; box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.tip strong { display: block; font-weight: 600; margin-bottom: .2rem; }
.tip span { display: block; opacity: .8; }

/* about */
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.recognition { margin: 0; border-top: 1px solid var(--line); align-self: start; }
.recognition div { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.recognition dt { font-weight: 600; }
.recognition dd { margin: 0; color: var(--muted); font-size: var(--step--1); }

/* feature */
.feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.feature-media img { border-radius: var(--r-m); aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.muted-head { font-family: var(--sans); font-size: var(--step--1); font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: .5rem; }
.feature-title { font-family: var(--serif); font-size: var(--step-3); line-height: 1.15; margin-bottom: .5rem; }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } }

/* lists on home */
.post-list, .mini-videos, .community-list { list-style: none; }
.post-list li + li { border-top: 1px solid var(--line); }
.post-list a { display: grid; gap: .15rem; padding: .85rem 0; text-decoration: none; }
.post-title { font-weight: 500; line-height: 1.35; }
.post-list a:hover .post-title, .mini-videos a:hover .post-title { color: var(--accent); }
.post-list .muted, .mini-videos .muted { font-size: var(--step--1); }
.mini-videos li + li { margin-top: 1rem; }
.mini-videos a { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; align-items: start; text-decoration: none; }
.mini-videos img { border-radius: var(--r-s); aspect-ratio: 16 / 9; object-fit: cover; }
.mini-videos a > span { display: grid; gap: .2rem; }
.community-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 2.5rem; border-top: 1px solid var(--ink); }
.community-list li { padding-top: 1.1rem; }
.community-name { font-family: var(--serif); font-size: var(--step-1); line-height: 1.25; margin-bottom: .35rem; }

/* photo strip */
.photo-strip .strip { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(15rem, 30vw, 24rem); gap: .75rem; overflow-x: auto; padding: 0 max(var(--gutter), calc((100% - var(--wrap)) / 2)) .75rem; scroll-padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2)); scroll-snap-type: x mandatory; scrollbar-width: thin; }
.photo-strip figure { margin: 0; scroll-snap-align: start; }
.photo-strip img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; border-radius: var(--r-s); }
.photo-strip figcaption { font-size: var(--step--1); color: var(--muted); padding-top: .4rem; }
.photo-strip .wrap { margin-top: .75rem; }

.invite { border-top: 1px solid var(--ink); padding-top: 2rem; }
.invite h2 { max-width: 20em; }
.invite .prose { margin-bottom: 1.5rem; }

/* page heads */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem 3rem; border-bottom: 1px solid var(--ink); padding-bottom: 2rem; }
.page-head > div:first-child { max-width: 44rem; }
.page-head h1 { margin-bottom: .4em; }
.lede { font-family: var(--serif); font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); margin: 0; }
.stats { display: flex; gap: 2rem; margin: 0; }
.stats dt { font-size: var(--step--1); color: var(--muted); }
.stats dd { margin: 0; font-family: var(--serif); font-size: var(--step-3); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }

/* filters */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 2rem 0 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); font: 500 var(--step--1)/1.2 var(--sans); cursor: pointer; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.search input { font: inherit; font-size: var(--step--1); padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); width: min(19rem, 70vw); }
.count { margin: 0 0 0 auto; font-size: var(--step--1); }
[data-hidden] { display: none !important; }
.empty-state { padding: 2rem 0; color: var(--muted); }

/* talks */
.ledger.compact { border-top: 0; padding-top: .5rem; }
main > section.ledger-wrap { margin-block: 2rem 0; }
.ledger-wrap + section .filters { margin-top: 2.5rem; }
.year-group { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; border-top: 1px solid var(--line-strong); padding-top: 1rem; margin-top: 1.5rem; }
.year { font-size: var(--step-3); position: sticky; top: 5rem; align-self: start; margin: 0; font-variant-numeric: lining-nums; }
.talk { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: 1rem; padding: 0 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.year-group > div > .talk:last-child { border-bottom: 0; }
.talk:target { background: var(--accent-soft); box-shadow: 0 0 0 .75rem var(--accent-soft); border-radius: 2px; }
.talk-when { display: flex; align-self: start; align-items: center; gap: .45rem; margin: .3rem 0 0; font-size: var(--step--1); color: var(--muted); }
.talk h3 { font-size: var(--step-1); line-height: 1.3; margin-bottom: .25rem; }
.talk-event { margin-bottom: .35rem; color: var(--ink-2); }
.talk-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; font-size: var(--step--1); margin-bottom: .5rem; }
.talk-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.talk-meta svg { width: 1rem; height: 1rem; }
.talk-desc summary { cursor: pointer; font-size: var(--step--1); color: var(--accent); font-weight: 500; width: fit-content; }
.talk-desc p { max-width: 42em; margin: .5rem 0 .75rem; color: var(--ink-2); }
.talk-img { width: 12rem; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-s); }
.talk-links { margin: .6rem 0 0; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 0; }
.tags li { font-size: .8125rem; padding: .15rem .55rem; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
@media (max-width: 760px) {
  .year-group { grid-template-columns: 1fr; }
  .year { position: static; }
  .talk { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .talk-img { grid-column: 2; width: 100%; max-width: 22rem; }
}

/* writing */
.article-list { list-style: none; border-top: 1px solid var(--line); }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list a { display: block; padding: 1.5rem 0; text-decoration: none; }
.article-meta { display: flex; gap: 1rem; font-size: var(--step--1); margin-bottom: .35rem; }
.article-title { font-size: var(--step-2); margin-bottom: .4rem; }
.article-list a:hover .article-title { color: var(--accent); }
.article-list p:last-child { color: var(--ink-2); margin: 0; max-width: 40em; }
.article-list + p { margin-top: 2rem; }

/* videos */
.video-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 2.5rem 1.75rem; margin-bottom: 2.5rem; }
.video-thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r-m); overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 16 / 9; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.video-thumb svg { position: absolute; inset: 50% auto auto 50%; width: 3.25rem; height: 3.25rem; transform: translate(-50%, -50%); }
.video-thumb svg circle { fill: rgb(0 0 0 / .55); stroke: #fff; stroke-width: 1.5; }
.video-thumb svg path { fill: #fff; }
.video-thumb:hover svg circle { fill: var(--accent); stroke: var(--accent); }
.video-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta { display: flex; gap: 1rem; font-size: var(--step--1); margin: .8rem 0 .25rem; }
.video-title { font-size: var(--step-1); line-height: 1.3; margin-bottom: .35rem; }
.video-desc { color: var(--ink-2); font-size: .9375rem; }

/* podcast */
.platforms { list-style: none; display: flex; flex-wrap: wrap; }
.episodes { list-style: none; }
.episodes > li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.ep-num { font-family: var(--serif); font-size: var(--step-4); line-height: 1; color: var(--muted); font-variant-numeric: lining-nums; margin: 0; }
.ep-title { font-size: var(--step-2); margin-bottom: .3rem; }
.ep-guest { font-weight: 500; color: var(--ink-2); margin-bottom: .5rem; }

/* training */
.programmes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: 0 3rem; }
.programmes > li { border-top: 1px solid var(--line-strong); padding: 1.5rem 0 2rem; }
.programmes > li.has-img { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 3rem; }
.programmes > li.has-img > img { grid-column: 2; grid-row: 1 / span 6; border-radius: var(--r-m); aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 760px) { .programmes > li.has-img { grid-template-columns: 1fr; } .programmes > li.has-img > img { grid-column: 1; grid-row: auto; margin-top: 1rem; } }
.prog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.prog-title { font-size: var(--step-2); }
.duration { white-space: nowrap; color: var(--muted); font-size: var(--step--1); }
.programmes .tags { margin-bottom: .75rem; }
.delivered { font-size: var(--step--1); }

/* certs */
.cert-groups { columns: 2 26rem; column-gap: 3.5rem; }
.cert-groups > section { break-inside: avoid; margin-bottom: 2.5rem; }
.cert-groups h2 { font-size: var(--step-2); border-bottom: 1px solid var(--ink); padding-bottom: .5rem; }
.cert-groups h2 .muted { font-family: var(--sans); font-size: var(--step-0); }
.cert-list { list-style: none; }
.cert-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.cert-name { font-weight: 500; grid-column: 1; }
.cert-list li > .muted:not(.cert-date) { grid-column: 1; font-size: var(--step--1); }
.cert-date { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: var(--step--1); white-space: nowrap; }

/* repos */
.repo-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }
.repo-grid a { display: flex; flex-direction: column; height: 100%; padding: 1.25rem 1.35rem; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-decoration: none; }
.repo-grid a:hover { border-color: var(--accent); }
.repo-name { font-family: var(--sans); font-size: var(--step-1); font-weight: 600; letter-spacing: 0; }
.repo-grid p { color: var(--ink-2); font-size: .9375rem; }
.repo-meta { display: flex; gap: 1rem; margin: auto 0 0; font-size: var(--step--1); }
.repo-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.repo-meta svg { width: 1rem; height: 1rem; }

/* gallery */
.gallery-grid { list-style: none; columns: 3 18rem; column-gap: 1rem; }
.gallery-grid li { break-inside: avoid; margin-bottom: 1.25rem; }
.gallery-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--r-m); overflow: hidden; }
.gallery-btn img { width: 100%; }
.gallery-grid p { font-size: var(--step--1); margin: .45rem 0 0; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(8 10 20 / .9); }
.lightbox figure { margin: 0; height: 100%; display: grid; place-items: center; align-content: center; gap: .75rem; padding: 4rem 4.5rem; }
.lightbox img { max-height: calc(100vh - 9rem); width: auto; border-radius: var(--r-s); }
.lightbox figcaption { color: #E9EBF3; font-size: var(--step--1); }
.lightbox .icon-btn { position: fixed; color: #fff; background: rgb(255 255 255 / .1); }
.lb-close { top: 1rem; right: 1rem; } .lb-prev { left: 1rem; top: 50%; } .lb-next { right: 1rem; top: 50%; }

/* CV */
.cv { max-width: 60rem; margin-left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); }
.cv-section { margin-bottom: 3rem; }
.cv-section > h2 { font-size: var(--step-2); border-bottom: 1px solid var(--ink); padding-bottom: .5rem; margin-bottom: 1.25rem; }
.cv-list { list-style: none; }
.cv-entry { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.cv-entry:last-child { border-bottom: 0; }
.cv-date { color: var(--muted); font-size: var(--step--1); margin: .2rem 0 0; font-variant-numeric: tabular-nums; }
.cv-entry h3 { font-size: var(--step-1); font-family: var(--sans); font-weight: 600; letter-spacing: 0; margin-bottom: .15rem; }
.cv-org { margin-bottom: .5rem; }
.cv-entry p:not(.cv-date):not(.cv-org) { color: var(--ink-2); max-width: 44em; }
.skills { margin: 0; display: grid; gap: 1rem; }
.skills > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; }
.skills dt { font-weight: 600; } .skills dd { margin: 0; } .skills .tags { margin: 0; }
.plain { list-style: none; } .plain li { padding: .3rem 0; }
.cv-two { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; }
@media (max-width: 700px) { .cv-entry, .skills > div, .cv-two { grid-template-columns: 1fr; gap: .25rem; } .cv-two { gap: 0; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 6rem; padding: 3rem 0 2rem; font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-name { font-family: var(--serif); font-size: var(--step-1); margin-bottom: .25rem; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem 1.5rem; align-content: start; }
.footer-links a { text-decoration: none; color: var(--ink-2); width: fit-content; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-base { margin-top: 2.5rem; font-size: var(--step--1); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-name span { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-name span + span { animation-delay: .08s; }
  .ledger-section .bar::before { transform-origin: bottom; animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.25s + var(--d, 0) * 1ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(.18em); } }
  @keyframes grow { from { transform: scaleY(0); } }
}

@media print {
  .site-header, .site-footer, .no-print, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main > section { margin-block: 1rem; }
  .cv, .wrap { width: 100%; max-width: none; margin: 0; }
  .cv-entry { break-inside: avoid; }
  a { text-decoration: none; }
}
