/* =========================================================
   Notion / Super-style portfolio theme
   ========================================================= */

:root {
  --page-width: 708px;
  --full-pad: 96px;
  --radius: 6px;
  --font: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

html.theme-dark {
  color-scheme: dark;
  --bg: #191919;
  --text: #e1e1e1;
  --text-strong: #f0f0f0;
  --text-muted: #9b9b9b;
  --text-faint: #6f6f6f;
  --border: #2f2f2f;
  --border-strong: #373737;
  --hover: rgba(255, 255, 255, .055);
  --card: #202020;
  --card-hover: #262626;
  --callout-bg: #252525;
  --code-bg: rgba(135, 131, 120, .15);
  --code-text: #ff7369;
  --nav-bg: rgba(25, 25, 25, .8);
  --spot: rgba(255, 255, 255, .06);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 60px rgba(0, 0, 0, .55);
  --accent: #529cca;
  --mark: rgba(255, 212, 0, .2);
  --underline: rgba(255, 255, 255, .25);

  --gray: #9b9b9b;   --bg-gray: #2f2f2f;   --pill-gray: #373737;   --pill-text-gray: #d4d4d4;
  --brown: #ba856f;  --bg-brown: #4a3228;  --pill-brown: #5c3b2b;  --pill-text-brown: #e6c7b8;
  --orange: #c77d48; --bg-orange: #5c3b23; --pill-orange: #854c1d; --pill-text-orange: #f5d4b8;
  --yellow: #ca9849; --bg-yellow: #564328; --pill-yellow: #89632a; --pill-text-yellow: #f3dda9;
  --green: #529e72;  --bg-green: #243d30;  --pill-green: #2b593f;  --pill-text-green: #c2e5cf;
  --blue: #5e87c9;   --bg-blue: #143a4e;   --pill-blue: #28456c;   --pill-text-blue: #c4d6f3;
  --purple: #9d68d3; --bg-purple: #3c2d49; --pill-purple: #492f64; --pill-text-purple: #e0cef2;
  --pink: #d15796;   --bg-pink: #4e2c3c;   --pill-pink: #69314c;   --pill-text-pink: #f4c9dd;
  --red: #df5452;    --bg-red: #522e2a;    --pill-red: #6e3630;    --pill-text-red: #f7cbc6;
}

html.theme-light {
  color-scheme: light;
  --bg: #ffffff;
  --text: #37352f;
  --text-strong: #191711;
  --text-muted: #787774;
  --text-faint: #a5a29c;
  --border: #ebebea;
  --border-strong: #e3e2e0;
  --hover: rgba(55, 53, 47, .06);
  --card: #ffffff;
  --card-hover: #fbfbfa;
  --callout-bg: #f7f6f3;
  --code-bg: rgba(135, 131, 120, .15);
  --code-text: #eb5757;
  --nav-bg: rgba(255, 255, 255, .82);
  --spot: rgba(35, 131, 226, .07);
  --shadow: 0 0 0 1px rgba(15, 15, 15, .06), 0 6px 18px rgba(15, 15, 15, .08);
  --shadow-lg: 0 0 0 1px rgba(15, 15, 15, .06), 0 24px 60px rgba(15, 15, 15, .2);
  --accent: #2383e2;
  --mark: rgba(255, 212, 0, .35);
  --underline: rgba(55, 53, 47, .3);

  --gray: #787774;   --bg-gray: #f1f1ef;   --pill-gray: #e3e2e0;   --pill-text-gray: #32302c;
  --brown: #9f6b53;  --bg-brown: #f4eeee;  --pill-brown: #eee0da;  --pill-text-brown: #442a1e;
  --orange: #d9730d; --bg-orange: #fbecdd; --pill-orange: #fadec9; --pill-text-orange: #49290e;
  --yellow: #cb912f; --bg-yellow: #fbf3db; --pill-yellow: #fdecc8; --pill-text-yellow: #402c1b;
  --green: #448361;  --bg-green: #edf3ec;  --pill-green: #dbeddb;  --pill-text-green: #1c3829;
  --blue: #337ea9;   --bg-blue: #e7f3f8;   --pill-blue: #d3e5ef;   --pill-text-blue: #183347;
  --purple: #9065b0; --bg-purple: #f6f3f9; --pill-purple: #e8deee; --pill-text-purple: #412454;
  --pink: #c14c8a;   --bg-pink: #faf1f5;   --pill-pink: #f5e0e9;   --pill-text-pink: #4c2337;
  --red: #d44c47;    --bg-red: #fdebec;    --pill-red: #ffe2dd;    --pill-text-red: #5d1715;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
body.search-open { overflow: hidden; }

a { color: inherit; }
img { max-width: 100%; display: block; }
svg.ico { width: 1.15em; height: 1.15em; flex: none; color: var(--text-muted); }
::selection { background: rgba(35, 131, 226, .35); }
[hidden] { display: none !important; }

/* ---------- progress bar ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #7c5cff, #2383e2, #22c55e);
  pointer-events: none;
}

/* ---------- navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
body.scrolled .navbar { border-bottom-color: var(--border); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 50px; padding: 0 14px;
}
.nav-left { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav-brand {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 4px 8px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.brand-ico { width: 18px; height: 18px; font-size: 15px; line-height: 18px; }
img.brand-ico { border-radius: 50%; object-fit: cover; }

.crumbs { display: flex; align-items: center; min-width: 0; font-size: 14px; color: var(--text-muted); }
.crumbs:empty { display: none; }
.crumbs::before { content: ''; }
.crumbs .crumb:first-child { display: none; } /* home is already the brand */
.crumbs .crumb:first-child + .crumb-sep { display: inline; }
.crumb {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 220px;
  padding: 3px 6px; border-radius: 4px; text-decoration: none; white-space: nowrap;
}
.crumb span { overflow: hidden; text-overflow: ellipsis; }
a.crumb:hover { background: var(--hover); color: var(--text); }
.crumb:last-child { color: var(--text); }
.crumb-ico { width: 16px; height: 16px; font-size: 14px; line-height: 16px; }
img.crumb-ico { border-radius: 3px; object-fit: cover; }
.crumb-sep { color: var(--text-faint); padding: 0 1px; }

.nav-right { display: flex; align-items: center; gap: 2px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: var(--radius);
  font-size: 14px; text-decoration: none; color: var(--text-muted);
  transition: color .15s, background-color .15s;
}
.nav-ico { width: 16px; height: 16px; font-size: 14px; line-height: 16px; }
.nav-brand:hover, .nav-link:hover, .theme-toggle:hover, .menu-toggle:hover { background: var(--hover); }
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-cta { color: var(--text); }
.theme-toggle, .menu-toggle {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--radius); background: none; color: var(--text-muted); cursor: pointer;
}
.theme-toggle:hover, .menu-toggle:hover { color: var(--text); }
html.theme-dark .i-moon, html.theme-light .i-sun { display: none; }
.menu-toggle { display: none; }

/* ---------- cover ---------- */
.cover {
  position: relative; height: 30vh; min-height: 180px; max-height: 280px;
  overflow: hidden; background: var(--bg-gray); display: flex;
}
.cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.cover-collage img { width: auto; flex: 1 1 auto; min-width: 0; transition: flex-grow .5s var(--ease), filter .4s; }
.cover-collage:hover img { filter: saturate(.75) brightness(.85); }
.cover-collage img:hover { flex-grow: 2.2; filter: none; }
.cover-gradient {
  background:
    radial-gradient(1200px 400px at 10% 0%, #2b1b54 0%, transparent 60%),
    linear-gradient(120deg, #0f172a, #1e1b4b 45%, #0c4a6e);
}
html.theme-light .cover-gradient {
  background:
    radial-gradient(1200px 400px at 10% 0%, #fde68a 0%, transparent 60%),
    linear-gradient(120deg, #e0e7ff, #fce7f3 45%, #cffafe);
}
.cover-gradient::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
html.theme-light .cover-gradient::after { background-image: radial-gradient(rgba(0, 0, 0, .08) 1px, transparent 1px); }
.blob {
  position: absolute; border-radius: 50%; filter: blur(50px); opacity: .7;
  animation: drift 18s ease-in-out infinite alternate;
}
.b1 { width: 340px; height: 340px; left: 8%; top: -120px; background: #7c3aed; }
.b2 { width: 280px; height: 280px; left: 48%; top: 40px; background: #0ea5e9; animation-duration: 22s; }
.b3 { width: 240px; height: 240px; right: 4%; top: -60px; background: #f43f5e; animation-duration: 26s; opacity: .5; }
html.theme-light .b1 { background: #a78bfa; }
html.theme-light .b2 { background: #67e8f9; }
html.theme-light .b3 { background: #fda4af; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 30px) scale(1.15); }
  100% { transform: translate(-40px, 10px) scale(.95); }
}

/* ---------- page ---------- */
.page { max-width: calc(var(--page-width) + 2 * 24px); margin: 0 auto; padding: 0 24px 120px; }
.page.full { max-width: none; padding-left: var(--full-pad); padding-right: var(--full-pad); }
.page-head { position: relative; padding-top: 80px; }
.page-head.has-cover { padding-top: 0; }
.page-head.has-cover.no-icon { padding-top: 40px; }

.page-icon {
  width: fit-content; margin-top: -54px; margin-bottom: 4px;
  font-size: 78px; line-height: 1.1; position: relative; z-index: 2;
  transition: transform .4s var(--ease);
}
.page-head:not(.has-cover) .page-icon { margin-top: 0; }
.page-icon:hover { transform: rotate(-8deg) scale(1.06); }
.page-icon .ico-emoji { display: block; }
.page-icon img.ico { width: 96px; height: 96px; object-fit: contain; }
.page-icon img.page-ico-img { border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); width: 112px; height: 112px; }
.page-icon img.page-ico-img[src$=".svg"] { border: 0; box-shadow: none; border-radius: 0; object-fit: contain; }
.page-title {
  margin: 8px 0 12px; font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; color: var(--text-strong);
}
.draft-pill {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 600; line-height: 18px; letter-spacing: .03em; text-transform: uppercase;
  background: var(--pill-yellow); color: var(--pill-text-yellow);
}
.draft-pill.big { font-size: 12px; line-height: 22px; padding: 0 8px; position: relative; top: -6px; }

/* ---------- blocks ---------- */
.blocks { padding-top: 4px; }
.block {
  margin: 1px 0;
  opacity: 0; transform: translateY(6px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.block.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .block { opacity: 1; transform: none; transition: none; }
  .blob { animation: none; }
}

.b-text p, .callout-body p, .toggle-body p, .b-quote p, .tl-text p { margin: 0; padding: 3px 2px; }
.b-text ul, .b-text ol, .callout-body ul, .callout-body ol, .toggle-body ul, .toggle-body ol, .b-quote ul, .b-quote ol, .tl-text ul, .tl-text ol {
  margin: 2px 0; padding-left: 26px;
}
.b-text li, .callout-body li, .toggle-body li, .b-quote li, .b-list li { padding: 3px 0; }
li::marker { color: var(--text-muted); }
.b-text a, .callout-body a, .toggle-body a, .b-quote a, .tl-text a, .b-list a, .link-desc a, .card-desc a, .db-note a {
  color: inherit; text-decoration: underline; text-decoration-color: var(--underline);
  text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s;
}
.b-text a:hover, .callout-body a:hover, .toggle-body a:hover, .b-quote a:hover, .tl-text a:hover, .b-list a:hover { text-decoration-color: currentColor; }
strong { font-weight: 600; color: var(--text-strong); }
code {
  font-family: var(--mono); font-size: .85em; padding: .15em .4em; border-radius: 4px;
  background: var(--code-bg); color: var(--code-text);
}
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }

.c-gray { color: var(--gray); } .c-brown { color: var(--brown); } .c-orange { color: var(--orange); }
.c-yellow { color: var(--yellow); } .c-green { color: var(--green); } .c-blue { color: var(--blue); }
.c-purple { color: var(--purple); } .c-pink { color: var(--pink); } .c-red { color: var(--red); }

.b-h1, .b-h2, .b-h3 { margin: 0; line-height: 1.3; padding: 3px 2px; color: var(--text-strong); }
.b-h1 { font-size: 1.875em; font-weight: 600; margin-top: 1.6em; margin-bottom: 2px; }
.b-h2 { font-size: 1.5em; font-weight: 600; margin-top: 1.3em; margin-bottom: 1px; }
.b-h3 { font-size: 1.25em; font-weight: 600; margin-top: 1em; }
.b-hline { border-bottom: 1px solid var(--border-strong); padding-bottom: 10px; margin-bottom: 8px; }
.block:first-child > .b-h1, .block:first-child > .b-h2, .block:first-child > .b-h3 { margin-top: 2px; }

.b-list { padding: 2px 2px 2px 26px; margin: 0; }
.b-divider { border: 0; border-top: 1px solid var(--border-strong); margin: 12px 0; }

/* callout */
.b-callout {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 4px 0; padding: 16px 16px 16px 12px; border-radius: 6px;
  background: var(--callout-bg); color: var(--text);
}
.b-callout.no-icon { padding: 18px 22px; border-radius: 10px; }
.b-callout.c-gray { background: var(--bg-gray); } .b-callout.c-brown { background: var(--bg-brown); }
.b-callout.c-orange { background: var(--bg-orange); } .b-callout.c-yellow { background: var(--bg-yellow); }
.b-callout.c-green { background: var(--bg-green); } .b-callout.c-blue { background: var(--bg-blue); }
.b-callout.c-purple { background: var(--bg-purple); } .b-callout.c-pink { background: var(--bg-pink); }
.b-callout.c-red { background: var(--bg-red); }
.b-callout[class*="c-"] { color: var(--text); }
.callout-ico { flex: none; width: 24px; height: 24px; font-size: 20px; line-height: 24px; text-align: center; }
.callout-body { flex: 1; min-width: 0; }

/* quote */
.b-quote { margin: 6px 0; padding: 2px 14px; border-left: 3px solid currentColor; }
.b-quote cite { display: block; margin-top: 6px; font-style: normal; font-size: 14px; color: var(--text-muted); }

/* toggle */
.b-toggle { margin: 1px 0; }
.b-toggle summary {
  list-style: none; cursor: pointer; padding: 3px 2px 3px 26px; position: relative; border-radius: 4px;
}
.b-toggle summary::-webkit-details-marker { display: none; }
.b-toggle summary::before {
  content: ''; position: absolute; left: 7px; top: 50%; margin-top: -5px;
  border: 5px solid transparent; border-left: 7px solid currentColor; border-right: 0;
  transition: transform .2s var(--ease); transform-origin: 30% 50%;
}
.b-toggle[open] summary::before { transform: rotate(90deg); }
.b-toggle summary:hover { background: var(--hover); }
.toggle-body { padding: 2px 2px 6px 26px; }

/* image + zoom */
.b-image { margin: 8px auto; }
.b-image img { width: 100%; border-radius: 8px; cursor: zoom-in; transition: transform .3s var(--ease), box-shadow .3s; }
.b-image img:hover { box-shadow: var(--shadow); }
.b-image.w-medium { max-width: 70%; margin-left: 0; }
.b-image.w-small { max-width: 45%; margin-left: 0; }
.b-image figcaption { font-size: 14px; color: var(--text-muted); padding: 6px 2px 0; }
.zoom {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 3vmin;
  background: rgba(10, 10, 10, 0); cursor: zoom-out; transition: background-color .2s;
}
.zoom img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-lg); transform: scale(.96); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
.zoom.on { background: rgba(10, 10, 10, .82); }
.zoom.on img { transform: none; opacity: 1; }

/* bookmark */
.b-bookmark {
  display: flex; margin: 6px 0; min-height: 106px; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: 6px; text-decoration: none; color: var(--text);
  transition: background-color .15s;
}
.b-bookmark:hover { background: var(--hover); }
.bm-body { flex: 4 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.bm-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; max-height: 3em; overflow: hidden; }
.bm-url { display: flex; align-items: center; gap: 6px; margin-top: auto; font-size: 12px; min-width: 0; }
.bm-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-url img { width: 16px; height: 16px; border-radius: 3px; }
.bm-img { flex: 1 1 180px; max-width: 250px; position: relative; }
.bm-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* columns */
.b-columns { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0 46px; margin: 2px 0; }
.b-col { min-width: 0; }
.b-col > .block:first-child > * { margin-top: 0; }

/* link list (Notion "link to page") */
.b-linklist { display: flex; flex-direction: column; margin: 2px 0; }
.ll-item {
  display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px;
  text-decoration: none; color: var(--text); line-height: 1.5; min-width: 0;
  transition: background-color .12s;
}
a.ll-item:hover { background: var(--hover); }
.ll-ico { width: 20px; height: 20px; font-size: 17px; line-height: 20px; text-align: center; }
img.ll-ico { border-radius: 3px; object-fit: contain; }
.ll-item > svg.ico { width: 19px; height: 19px; }
.ll-prefix { color: var(--text-muted); flex: none; }
.ll-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
a.ll-item .ll-label { text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 3px; }
a.ll-item:hover .ll-label { text-decoration-color: currentColor; }

/* database (table view) */
.b-db { margin: 6px 0 10px; }
.db-title { display: flex; align-items: center; gap: 6px; padding: 4px 2px 8px; font-weight: 600; font-size: 14px; }
.db-scroll { overflow-x: auto; border-top: 1px solid var(--border-strong); }
.db-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.db-table th {
  text-align: left; font-weight: 400; color: var(--text-muted); white-space: nowrap;
  padding: 7px 8px; border-bottom: 1px solid var(--border-strong);
}
.db-table th + th, .db-table td + td { border-left: 1px solid var(--border-strong); }
.th-ico { display: inline-block; margin-right: 6px; font-size: 12px; opacity: .8; }
.db-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-strong); vertical-align: top; }
.db-table tr { transition: background-color .12s; }
.db-table tbody tr:hover { background: var(--hover); }
.db-name { width: 40%; min-width: 220px; }
.db-name a, .db-name-in { display: flex; align-items: center; gap: 7px; font-weight: 500; text-decoration: none; color: var(--text); }
.db-name a span { border-bottom: 1px solid transparent; transition: border-color .12s; }
.db-name a:hover span:not(.draft-pill) { border-bottom-color: var(--underline); }
.db-ico { width: 18px; height: 18px; font-size: 15px; line-height: 18px; text-align: center; }
img.db-ico { border-radius: 3px; object-fit: contain; }
.db-tags { width: 22%; min-width: 140px; }
.db-tags .pill { margin: 1px 4px 1px 0; font-size: 13px; line-height: 20px; }
.db-note { color: var(--text); min-width: 180px; }

/* ---------- card family ---------- */
.ico { display: inline-block; flex: none; object-fit: contain; }
.ico-emoji { text-align: center; }
html.theme-dark img.ico-mono { filter: invert(1); }

.spot { position: relative; isolation: isolate; }
.spot::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 70%);
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.spot:hover::before { opacity: 1; }

/* links: vertical list of link cards */
.b-links { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.link-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card);
  text-decoration: none; color: var(--text);
  transition: background-color .15s, border-color .15s, transform .2s var(--ease);
}
a.link-card:hover { background: var(--card-hover); border-color: var(--border-strong); }
.link-ico { width: 20px; height: 20px; font-size: 18px; line-height: 20px; }
img.link-ico { border-radius: 4px; }
.link-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.link-desc { font-size: 13px; color: var(--text-muted); }
.link-arrow { color: var(--text-faint); transition: transform .2s var(--ease), color .2s; }
a.link-card:hover .link-arrow { transform: translate(2px, -2px); color: var(--text); }

/* cards: grid of icon cards */
.b-cards { display: grid; gap: 10px; margin: 8px 0; }
.b-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.b-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.b-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
.icon-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  text-decoration: none; color: var(--text);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.icon-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-ico { width: 36px; height: 36px; font-size: 30px; line-height: 36px; margin-bottom: 4px; }
.card-title { font-weight: 600; line-height: 1.35; }
.card-desc { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }

/* gallery: image cards */
.b-gallery { display: grid; gap: 14px; margin: 10px 0; }
.b-gallery.cols-1 { grid-template-columns: 1fr; }
.b-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.b-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.b-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-card {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border); background: var(--card);
  text-decoration: none; color: var(--text);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s;
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.gallery-cover { display: block; aspect-ratio: 16 / 10; background: var(--bg-gray); overflow: hidden; border-bottom: 1px solid var(--border); }
.gallery-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gallery-card:hover .gallery-cover img { transform: scale(1.04); }
.gallery-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.gallery-title { font-weight: 600; font-size: 14.5px; }
.gallery-desc { font-size: 13px; color: var(--text-muted); }
.gallery-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* pills / badges */
.b-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 7px; border-radius: 3px; font-size: 13.5px; line-height: 22px; white-space: nowrap;
  text-decoration: none; transition: filter .15s, transform .15s;
}
.gallery-tags .pill { font-size: 12px; line-height: 18px; padding: 0 6px; }
a.pill:hover { filter: brightness(1.15); transform: translateY(-1px); }
.pill.c-gray { background: var(--pill-gray); color: var(--pill-text-gray); }
.pill.c-brown { background: var(--pill-brown); color: var(--pill-text-brown); }
.pill.c-orange { background: var(--pill-orange); color: var(--pill-text-orange); }
.pill.c-yellow { background: var(--pill-yellow); color: var(--pill-text-yellow); }
.pill.c-green { background: var(--pill-green); color: var(--pill-text-green); }
.pill.c-blue { background: var(--pill-blue); color: var(--pill-text-blue); }
.pill.c-purple { background: var(--pill-purple); color: var(--pill-text-purple); }
.pill.c-pink { background: var(--pill-pink); color: var(--pill-text-pink); }
.pill.c-red { background: var(--pill-red); color: var(--pill-text-red); }

/* inline row of emoji links */
.b-inline { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0; padding: 0 2px; }
.inline-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); padding: 2px 0; }
a.inline-link span:last-child { text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 3px; transition: text-decoration-color .15s; }
a.inline-link:hover span:last-child { text-decoration-color: currentColor; }
.inline-ico { width: 18px; height: 18px; font-size: 16px; line-height: 18px; }

/* timeline */
.b-timeline { list-style: none; margin: 8px 0; padding: 0 0 0 22px; position: relative; }
.b-timeline::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--border-strong); border-radius: 2px; }
.b-timeline li { position: relative; padding: 6px 0 14px; }
.tl-dot {
  position: absolute; left: -22px; top: 12px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.b-timeline li:first-child .tl-dot { background: var(--accent); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.tl-title { font-weight: 600; }
.tl-date { font-family: var(--mono); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tl-sub { font-size: 14px; color: var(--text-muted); }
.tl-text { margin-top: 2px; }

/* progress */
.b-progress { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; margin: 10px 0; padding: 0 2px; }
.pr-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.pr-val { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.pr-track { height: 6px; border-radius: 6px; background: var(--bg-gray); overflow: hidden; }
.pr-bar {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #7c5cff, #2383e2);
  transition: width 1.2s var(--ease) .15s;
}
.block.in .pr-bar { width: var(--v); }

/* button */
.b-button { margin: 10px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px; overflow: hidden;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; text-decoration: none;
  transition: transform .2s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-2px); opacity: .92; }
.btn-ico { width: 18px; height: 18px; font-size: 16px; line-height: 18px; }

/* contact form */
.b-form { display: flex; flex-direction: column; gap: 12px; margin: 10px 0; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.b-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.b-form input, .b-form textarea {
  width: 100%; padding: 9px 11px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.b-form textarea { resize: vertical; min-height: 110px; }
.b-form input:focus, .b-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(35, 131, 226, .2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.b-form .btn { border: 0; cursor: pointer; font-family: inherit; }
.b-form .btn:disabled { opacity: .6; cursor: wait; }
.form-status { font-size: 14px; color: var(--text-muted); }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- search ---------- */
.search {
  position: fixed; inset: 0; z-index: 150; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px; background: rgba(0, 0, 0, .55); animation: fade .15s;
}
.search-panel {
  width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 12px; background: var(--card); box-shadow: var(--shadow-lg); animation: pop .2s var(--ease);
}
.search-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.search-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.search-bar input::-webkit-search-cancel-button { display: none; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--text-muted); }
.search-results { overflow-y: auto; padding: 6px; }
.sr { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.sr.sel, .sr:hover { background: var(--hover); }
.sr-ico { flex: none; display: grid; place-items: center; width: 22px; height: 22px; font-size: 17px; }
.sr-icon { width: 20px; height: 20px; line-height: 20px; }
img.sr-icon { border-radius: 4px; object-fit: cover; }
.sr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-title { font-weight: 500; }
.sr-snip { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-enter { color: var(--text-faint); opacity: 0; }
.sr.sel .sr-enter { opacity: 1; }
.sr-empty { padding: 24px; text-align: center; color: var(--text-muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ---------- footer ---------- */
.footer {
  margin: 0 auto; padding: 22px 16px 36px;
  text-align: center; font-size: 12.5px; color: var(--text-faint);
}
.footer a { color: var(--text-muted); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  :root { --full-pad: 48px; }
  .b-columns { gap: 0 28px; }
}
@media (max-width: 900px) {
  .b-columns { grid-template-columns: repeat(min(var(--cols), 2), minmax(0, 1fr)); gap: 12px 28px; }
}
@media (max-width: 720px) {
  :root { --full-pad: 18px; }
  .page { padding-left: 18px; padding-right: 18px; }
  .page-title { font-size: 32px; }
  .page-icon { font-size: 64px; margin-top: -42px; }
  .page-icon img.page-ico-img { width: 92px; height: 92px; }
  .b-cards.cols-3, .b-cards.cols-4, .b-gallery.cols-3, .b-gallery.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .b-progress { grid-template-columns: 1fr; }
  .cover { height: 22vh; min-height: 140px; }
  .cover-collage img:nth-child(n+4) { display: none; }
  .b-image.w-medium, .b-image.w-small { max-width: 100%; }
  .bm-img { display: none; }

  .menu-toggle { display: grid; }
  .nav-links {
    position: absolute; top: 50px; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 12px 12px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
  }
  body.menu-open .nav-links { display: flex; animation: menu-in .2s var(--ease); }
  .nav-link { padding: 10px 12px; font-size: 15px; }
  .crumb { max-width: 120px; }
  .crumbs .crumb:not(:last-child), .crumbs .crumb-sep:not(:last-of-type) { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .b-columns { grid-template-columns: minmax(0, 1fr); }
  .b-cards.cols-2, .b-cards.cols-3, .b-cards.cols-4, .b-gallery.cols-2, .b-gallery.cols-3, .b-gallery.cols-4 { grid-template-columns: 1fr; }
  .tl-head { flex-direction: column; }
  .b-callout.no-icon { padding: 14px 16px; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
