/* Wabi-Sabi — antjanus.com redesign 069
   Unbleached paper, sumi ink, bengara clay, moss, and kintsugi gold.
   Irregularity is deliberate but bounded: text is never distorted, only edges and frames. */

/* ---------- Primitives ---------- */
:root {
  --kinari-100: #f7f2e9;
  --kinari-200: #f1ebe0;
  --kinari-300: #e8dfd0;
  --kinari-400: #d8ccb7;
  --sumi-900: #1c1916;
  --sumi-850: #221e1a;
  --sumi-800: #2a2521;
  --sumi-700: #3b342e;
  --ash-600: #675e56;
  --ash-400: #a89c8c;
  --bengara-600: #9b4a26;
  --bengara-300: #e0916a;
  --moss-600: #51603c;
  --moss-300: #a7b68a;
  --aizome-600: #34506b; /* the old brand slate-blue, read as faded indigo dye */
  --aizome-300: #9db6d2;
  --kin-700: #7f621a;
  --kin-500: #b8913a;
  --kin-300: #d9b460;

  --font-display: "Shippori Mincho B1", "Hiragino Mincho ProN", Georgia, serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-hand: "Klee One", "Segoe Print", cursive;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --wobble-a: 18px 26px 14px 30px / 28px 14px 24px 18px;
  --wobble-b: 26px 12px 30px 16px / 14px 28px 16px 26px;
  --wobble-c: 40px 14px 36px 18px / 20px 38px 16px 34px;
  --pebble: 58% 42% 55% 45% / 48% 56% 44% 52%;

  /* ---------- Semantic (light) ---------- */
  --paper: var(--kinari-200);
  --paper-sunk: var(--kinari-300);
  --surface: var(--kinari-100);
  --ink: var(--sumi-800);
  --ink-body: var(--sumi-700);
  --ink-muted: var(--ash-600);
  --line: #cbbfa9;
  --line-strong: #8f8475;
  --clay: var(--bengara-600);
  --moss: var(--moss-600);
  --indigo: var(--aizome-600);
  --gold-text: var(--kin-700);
  --gold-deco: var(--kin-500);
  --tint-moss: #e2e3d0;
  --tint-clay: #efdccd;
  --tint-gold: #eee0bf;
  --tint-indigo: #dfe2e3;
  --grain-opacity: 0.55;
  --img-filter: sepia(0.16) saturate(0.84) contrast(0.97);
  --panel: var(--sumi-850);
  --panel-ink: #ece4d6;
  --panel-muted: #b9ad9c;
  --code-bg: #24201c;
  --code-ink: #e9e0d0;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: var(--sumi-900);
  --paper-sunk: #15120f;
  --surface: #25211d;
  --ink: #efe7da;
  --ink-body: #d9cfc0;
  --ink-muted: #ab9f8f;
  --line: #3d362f;
  --line-strong: #6c6156;
  --clay: var(--bengara-300);
  --moss: var(--moss-300);
  --indigo: var(--aizome-300);
  --gold-text: var(--kin-300);
  --gold-deco: #c9a34c;
  --tint-moss: #262a1f;
  --tint-clay: #33241c;
  --tint-gold: #2f2818;
  --tint-indigo: #1f2630;
  --grain-opacity: 0.3;
  --img-filter: sepia(0.14) saturate(0.8) brightness(0.9);
  --panel: #0f0d0b;
  --panel-ink: #efe7da;
  --panel-muted: #ab9f8f;
  --code-bg: #11100e;
  --code-ink: #e9e0d0;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--sumi-900);
    --paper-sunk: #15120f;
    --surface: #25211d;
    --ink: #efe7da;
    --ink-body: #d9cfc0;
    --ink-muted: #ab9f8f;
    --line: #3d362f;
    --line-strong: #6c6156;
    --clay: var(--bengara-300);
    --moss: var(--moss-300);
    --indigo: var(--aizome-300);
    --gold-text: var(--kin-300);
    --gold-deco: #c9a34c;
    --tint-moss: #262a1f;
    --tint-clay: #33241c;
    --tint-gold: #2f2818;
    --tint-indigo: #1f2630;
    --grain-opacity: 0.3;
    --img-filter: sepia(0.14) saturate(0.8) brightness(0.9);
    --panel: #0f0d0b;
    --panel-ink: #efe7da;
    --panel-muted: #ab9f8f;
    --code-bg: #11100e;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background-color: var(--paper);
  /* washi fiber photo if generated; otherwise tea stains + procedural fibers below */
  background-image:
    url("assets/washi-paper.jpg"),
    radial-gradient(ellipse 40% 30% at 8% 4%, color-mix(in srgb, var(--gold-deco) 9%, transparent), transparent 70%),
    radial-gradient(ellipse 35% 28% at 96% 38%, color-mix(in srgb, var(--clay) 6%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 30% at 20% 92%, color-mix(in srgb, var(--moss) 6%, transparent), transparent 70%);
  background-size: 1024px 1024px, auto, auto, auto;
  background-blend-mode: multiply, normal, normal, normal;
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
body { position: relative; }
body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .34 0 0 0 0 .25 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .09' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .42 0 0 0 0 .3 0 0 0 .22 -.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::before { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; } }
body > * { position: relative; z-index: 1; }

img { max-width: 100%; display: block; height: auto; }
a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--clay); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--gold-deco) 40%, transparent); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 700; margin: 0 0 .5em; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 2.2rem + 3.2vw, 4.75rem); line-height: 1.08; }
h2 { font-size: clamp(1.85rem, 1.5rem + 1.6vw, 2.75rem); line-height: 1.15; }
h3 { font-size: 1.35rem; line-height: 1.3; }
p { margin: 0 0 1.1em; }
code, kbd, pre { font-family: var(--font-mono); }
.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; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 56px); }

/* ---------- Header ---------- */
.site-head { padding-block: 1.1rem; }
.head-row { display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.enso { width: 52px; height: 52px; flex-shrink: 0; }
.enso .ring { fill: none; stroke: var(--ink); stroke-width: 6.5; stroke-linecap: round; filter: url(#rough); }
.enso .tail { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: .6; filter: url(#rough); }
.enso text { font-family: var(--font-display); font-weight: 800; font-size: 25px; fill: var(--clay); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: .01em; }
.brand-sub { font-family: var(--font-hand); font-size: .875rem; color: var(--ink-muted); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav a { display: inline-block; padding: .55rem .8rem; color: var(--ink-body); text-decoration: none; font-size: 1.0625rem; border-radius: var(--wobble-a); position: relative; }
.site-nav a:hover { color: var(--clay); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .25rem; height: 6px;
  background: var(--clay);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 C20 2 35 6 52 4 S85 2 98 4.5' stroke='black' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5 C20 2 35 6 52 4 S85 2 98 4.5' stroke='black' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.nav-ai { font-weight: 600; white-space: nowrap; }
.nav-ai::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; border-radius: var(--pebble); background: var(--gold-deco); vertical-align: .12em; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-deco) 25%, transparent); }

.search { display: flex; align-items: center; border-bottom: 1.5px solid var(--line-strong); }
.search input { background: transparent; border: 0; color: var(--ink); font: inherit; font-size: 1rem; padding: .4rem .25rem; width: 8.5rem; }
.search input::placeholder { color: var(--ink-muted); }
.search input:focus-visible { outline: none; }
.search:focus-within { border-color: var(--clay); box-shadow: 0 2px 0 var(--clay); }
.search button { background: none; border: 0; color: var(--ink-muted); font: inherit; font-size: .9375rem; cursor: pointer; padding: .5rem; min-height: 44px; }
.search button:hover { color: var(--clay); }

.theme-btn, .menu-btn {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .4rem .85rem;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); border-radius: var(--wobble-b);
  font: 500 .9375rem var(--font-body); cursor: pointer; transition: background .15s, border-color .15s;
}
.theme-btn:hover, .menu-btn:hover { border-color: var(--clay); color: var(--clay); }
.theme-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 1020px) {
  .head-row { flex-wrap: wrap; gap: .75rem; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .site-nav { display: none; order: 5; width: 100%; flex-direction: column; align-items: stretch; margin: 0; padding: 1rem 0 .5rem; border-top: 1px dashed var(--line-strong); }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { display: block; font-size: 1.25rem; padding: .7rem .25rem; font-family: var(--font-display); }
  .site-nav a[aria-current="page"]::after { left: .25rem; right: auto; width: 5rem; }
  .search input { width: 100%; }
  .search { width: 100%; }
}
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .theme-btn .label { display: none; }
}

/* ---------- Kintsugi crack divider ---------- */
.crack {
  height: 22px; width: 100%; margin-block: clamp(2.5rem, 5vw, 4.5rem);
  background: linear-gradient(90deg, transparent, var(--gold-deco) 8%, var(--gold-deco) 92%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 22' preserveAspectRatio='none'%3E%3Cpath d='M0 11 L48 10 L90 13 L131 8 L176 12 L214 9 L240 14 L281 10 L330 11 L352 6 L371 11 L420 12 L466 9 L505 13 L547 10 L590 11 L612 16 L640 11 L688 9 L731 12 L770 8 L812 11 L858 13 L902 9 L950 11 L1000 10' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='M352 6 L366 1 M612 16 L626 21 M240 14 L231 20 M770 8 L784 3' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 22' preserveAspectRatio='none'%3E%3Cpath d='M0 11 L48 10 L90 13 L131 8 L176 12 L214 9 L240 14 L281 10 L330 11 L352 6 L371 11 L420 12 L466 9 L505 13 L547 10 L590 11 L612 16 L640 11 L688 9 L731 12 L770 8 L812 11 L858 13 L902 9 L950 11 L1000 10' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='M352 6 L366 1 M612 16 L626 21 M240 14 L231 20 M770 8 L784 3' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.crack.short { max-width: 420px; margin-block: 2rem; }

/* ---------- Asymmetric section scaffold (fukinsei) ---------- */
.sect { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 0 clamp(1.5rem, 4vw, 4rem); }
.sect-margin { padding-top: .6rem; }
.sect-no { font-family: var(--font-hand); font-size: 1rem; color: var(--clay); display: block; }
.sect-word { font-family: var(--font-display); font-size: 1rem; color: var(--ink-muted); display: block; margin-top: .2rem; }
.sect-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.sect-head h2 { margin: 0; }
.sect-head p { margin: .35rem 0 0; color: var(--ink-muted); max-width: 52ch; }
.more-link { font-family: var(--font-hand); font-size: 1.0625rem; white-space: nowrap; }
@media (max-width: 820px) {
  .sect { grid-template-columns: 1fr; }
  .sect-margin { display: flex; gap: .75rem; align-items: baseline; padding: 0 0 .25rem; }
  .sect-word { margin: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.4rem;
  font: 600 1.0625rem var(--font-body); text-decoration: none; cursor: pointer; border: 0;
  background: var(--ink); color: var(--paper); border-radius: var(--wobble-a);
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--clay); color: var(--paper); }
:root[data-theme="dark"] .btn:hover { color: var(--sumi-900); }
.btn:active { transform: translateY(1px); }
.btn-quiet { font-weight: 600; color: var(--ink); text-decoration-color: var(--clay); text-decoration-thickness: 2px; min-height: 44px; display: inline-flex; align-items: center; }
.btn-soft { color: var(--ink-muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; font-family: var(--font-hand); font-size: 1.0625rem; }
.btn-soft:hover { text-decoration: underline; }
.btn-line { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.btn-line:hover { background: var(--surface); color: var(--clay); border-color: var(--clay); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; }

/* ---------- Hand-drawn frames ---------- */
.brushed { position: relative; }
.brushed::after {
  content: ""; position: absolute; inset: 0; border: 1.5px solid color-mix(in srgb, var(--ink) 55%, transparent);
  border-radius: inherit; filter: url(#rough); pointer-events: none;
}
.torn {
  clip-path: polygon(0.5% 1.2%, 8% 0%, 17% 1%, 26% 0.2%, 38% 1.4%, 49% 0.3%, 61% 1.1%, 72% 0%, 84% 1.3%, 93% 0.4%, 100% 1.5%, 99.3% 12%, 100% 25%, 99.2% 39%, 100% 52%, 99.4% 66%, 100% 79%, 99.1% 91%, 99.6% 99.2%, 91% 100%, 80% 98.9%, 68% 100%, 57% 99%, 45% 100%, 33% 98.8%, 22% 99.9%, 11% 98.9%, 1% 99.6%, 0% 88%, 0.8% 76%, 0% 63%, 0.7% 50%, 0% 37%, 0.9% 24%, 0% 12%);
}
.photo { background: var(--paper-sunk); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; filter: var(--img-filter); }

/* ---------- Pebble stats ---------- */
.stones { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; list-style: none; padding: 0; margin: 0; }
.stone {
  width: 8.2rem; aspect-ratio: 1 / 0.86; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: var(--surface); border-radius: var(--pebble); box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--ink) 6%, transparent), 0 1px 0 var(--line);
  border: 1.5px solid var(--line);
}
.stone:nth-child(2) { border-radius: 46% 54% 42% 58% / 56% 44% 58% 42%; transform: translateY(.6rem); }
.stone:nth-child(3) { border-radius: 52% 48% 60% 40% / 42% 58% 46% 54%; }
.stone b { font-family: var(--font-display); font-size: 2rem; color: var(--ink); line-height: 1; }
.stone span { font-size: .875rem; color: var(--ink-muted); margin-top: .3rem; }

/* ---------- Tags & chips ---------- */
.tags { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.tag {
  display: inline-block; font: .875rem var(--font-mono); padding: .2rem .6rem; color: var(--ink-body);
  background: color-mix(in srgb, var(--paper-sunk) 70%, transparent); border: 1px solid var(--line); border-radius: var(--wobble-b);
  text-decoration: none;
}
a.tag:hover { border-color: var(--clay); color: var(--clay); }
.meta { font: .875rem var(--font-mono); color: var(--ink-muted); letter-spacing: .02em; }
.badge { font: 600 .8125rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: .12rem .5rem; border-radius: 4px 7px 5px 8px; }
.badge-new { background: var(--clay); color: var(--kinari-100); }
:root[data-theme="dark"] .badge-new { color: var(--sumi-900); }
.badge-upd { border: 1.5px solid var(--gold-deco); color: var(--gold-text); }

/* ---------- Cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column; background: var(--surface);
  border-radius: var(--wobble-a); padding: 1rem 1rem 1.35rem; transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 12px 24px -18px color-mix(in srgb, var(--sumi-900) 45%, transparent);
}
.card:nth-child(3n+2) { border-radius: var(--wobble-b); }
.card:nth-child(3n) { border-radius: var(--wobble-c); }
.card .photo { aspect-ratio: 16 / 10; margin-bottom: 1rem; border-radius: 6px; }
.card h3 { font-size: 1.3rem; margin: .35rem 0 .45rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h3 a:hover { color: var(--clay); }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--clay); outline-offset: 3px; }
.card h3 a:focus-visible { outline: none; }
.card p { font-size: 1.0625rem; margin: 0 0 .8rem; color: var(--ink-body); }
.card > p:not(.meta):not(.part), .card.row p:not(.meta) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.card .tags { margin-top: auto; position: relative; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover { transform: rotate(-0.4deg) translateY(-3px); }
  .card:nth-child(even):hover { transform: rotate(0.4deg) translateY(-3px); }
}

.stagger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 1.75rem; align-items: start; }
.stagger > :nth-child(3n+2) { margin-top: 3.5rem; }
.stagger > :nth-child(3n) { margin-top: 1.25rem; }
@media (max-width: 1000px) { .stagger { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stagger > :nth-child(n) { margin-top: 0; } .stagger > :nth-child(even) { margin-top: 2rem; } }
@media (max-width: 620px) { .stagger { grid-template-columns: 1fr; } .stagger > :nth-child(n) { margin-top: 0; } }

/* Placeholder art when a post has no image: a single ensō on sunk paper */
.noimg { display: grid; place-items: center; aspect-ratio: 16 / 10; margin-bottom: 1rem; border-radius: 6px; background: var(--paper-sunk); color: var(--ink-muted); }
.noimg svg { width: 38%; height: auto; opacity: .7; }
.noimg path { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; filter: url(#rough); }

/* ---------- Ledger (list rows) ---------- */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ledger li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .25rem 1.5rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); position: relative; }
.ledger li:nth-child(odd) { border-bottom-style: dashed; }
.ledger .meta { padding-top: .35rem; }
.ledger h3 { font-size: 1.25rem; margin: 0 0 .25rem; }
.ledger h3 a { color: var(--ink); text-decoration: none; }
.ledger h3 a:hover { color: var(--clay); text-decoration: underline; }
.ledger p { margin: 0; font-size: 1.0625rem; }
.ledger .coll { font-family: var(--font-hand); font-size: .9375rem; color: var(--moss); }
@media (max-width: 620px) { .ledger li { grid-template-columns: 1fr; } }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2rem clamp(2rem, 5vw, 5rem); align-items: center; padding-block: clamp(2rem, 5vw, 4.5rem) 1rem; }
.page-hero .eyebrow { font-family: var(--font-hand); color: var(--clay); font-size: 1.125rem; margin: 0 0 .5rem; }
.page-hero .lede { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.45rem); line-height: 1.55; color: var(--ink-body); max-width: 40ch; }
.page-hero .photo { aspect-ratio: 4 / 3; transform: rotate(1.2deg); }
.page-hero .caption { font-family: var(--font-hand); color: var(--ink-muted); font-size: .9375rem; margin-top: .6rem; text-align: right; }
@media (max-width: 820px) { .page-hero { grid-template-columns: 1fr; } .page-hero .photo { transform: none; } }

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2rem clamp(2rem, 6vw, 6rem); align-items: center; padding-block: clamp(2rem, 6vw, 5rem) 1rem; position: relative; }
.hero-text { position: relative; }
.hero-enso { position: absolute; left: -6%; top: -18%; width: min(560px, 90%); aspect-ratio: 1; z-index: -1; pointer-events: none;
  background: url("assets/enso-brush.png") center / contain no-repeat; }
.hero-enso svg { width: 100%; height: 100%; }
.hero-enso path { fill: none; stroke: color-mix(in srgb, var(--clay) 16%, transparent); stroke-width: 26; stroke-linecap: round; filter: url(#rough-heavy); }
.hero h1 { max-width: 13ch; }
.hero .sub { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.4rem); line-height: 1.55; max-width: 36ch; margin-bottom: 2rem; }
.hero-photo { position: relative; }
.hero-photo .photo { aspect-ratio: 4 / 5; transform: rotate(-1.6deg); }
.hero-photo .photo img { object-position: 28% 30%; }
.hero-photo .caption { font-family: var(--font-hand); color: var(--ink-muted); font-size: 1rem; margin-top: .9rem; padding-left: 1rem; }
.hero-photo .seal { position: absolute; right: -10px; bottom: 3.2rem; }
.hero .stones { margin: 0 0 2.2rem; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; }
  .hero-photo .photo { aspect-ratio: 4 / 3.4; }
}

.seal {
  display: grid; place-items: center; width: 64px; height: 64px; background: var(--bengara-600); color: #f7ecdf;
  font: 800 1.25rem/1 var(--font-display); border-radius: 6px 9px 5px 11px; transform: rotate(6deg);
  box-shadow: inset 0 0 0 3px #f7ecdf66; filter: url(#rough);
}

/* ---------- Home: start here ---------- */
.start { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.75rem; }
.start .card.big .photo { aspect-ratio: 16 / 9; }
.start .card.big h3 { font-size: 1.75rem; }
.start .col { display: grid; gap: 1.75rem; }
.start .card.row { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 1rem; }
.start .card.row .photo { aspect-ratio: 1; margin: 0; align-self: start; }
.card .kind { font-family: var(--font-hand); color: var(--moss); font-size: 1rem; }
@media (max-width: 860px) { .start { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .start .card.row { grid-template-columns: 1fr; } .start .card.row .photo { aspect-ratio: 16/10; } }

.garden { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 860px) { .garden { grid-template-columns: 1fr; } }

.experiments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.experiments li { position: relative; padding: 1.4rem 1.25rem 1.3rem; border-left: 3px solid var(--moss); background: linear-gradient(90deg, var(--tint-moss), transparent 85%); border-radius: 2px 18px 18px 2px; }
.experiments li:nth-child(2) { border-color: var(--indigo); background: linear-gradient(90deg, var(--tint-indigo), transparent 85%); }
.experiments li:nth-child(3) { border-color: var(--gold-deco); background: linear-gradient(90deg, var(--tint-gold), transparent 85%); }
.experiments li:nth-child(4) { border-color: var(--clay); background: linear-gradient(90deg, var(--tint-clay), transparent 85%); }
.experiments h3 { font-size: 1.2rem; margin: .2rem 0 .4rem; }
.experiments h3 a { color: var(--ink); text-decoration: none; }
.experiments h3 a::before { content: ""; position: absolute; inset: 0; }
.experiments h3 a:hover { color: var(--clay); }
.experiments p { font-size: 1.0625rem; margin: 0 0 .6rem; }
.experiments .type { font-family: var(--font-hand); font-size: .9375rem; color: var(--ink-muted); }
@media (max-width: 1000px) { .experiments { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .experiments { grid-template-columns: 1fr; } }

.trio { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 1.5rem; align-items: stretch; }
.trio > div { padding: 1.6rem; border-radius: var(--wobble-c); background: var(--surface); }
.trio h3 { font-size: 1.2rem; }
.trio ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.trio li a { font-weight: 600; }
.trio li span { display: block; font-size: 1rem; color: var(--ink-muted); }
@media (max-width: 900px) { .trio { grid-template-columns: 1fr; } }

.panel { background: var(--panel); color: var(--panel-ink); border-radius: var(--wobble-c); position: relative; overflow: hidden; }
.panel h2, .panel h3 { color: var(--panel-ink); }
.panel p { color: var(--panel-ink); }
.panel .muted { color: var(--panel-muted); }
.panel a:not(.btn) { color: var(--kin-300); }
.panel .btn { background: var(--kinari-200); color: var(--sumi-900); }
.panel .btn:hover { background: var(--kin-300); color: var(--sumi-900); }
.trio > .panel { background: var(--panel); }
.panel::before { content: ""; position: absolute; right: -70px; bottom: -80px; width: 170px; height: 170px; border-radius: 50%; border: 10px solid color-mix(in srgb, var(--kin-300) 30%, transparent); border-left-color: transparent; transform: rotate(20deg); filter: url(#rough-heavy); pointer-events: none; }

/* ---------- Footer ---------- */
.site-foot { margin-top: clamp(4rem, 8vw, 7rem); padding-bottom: 2rem; background: linear-gradient(transparent, var(--paper-sunk) 120px); }
.site-foot .mountains { height: 90px; background: url("assets/ink-mountains.png") center bottom / cover no-repeat; }
.site-foot .mountains svg { width: 100%; height: 100%; }
.site-foot .mountains path { fill: color-mix(in srgb, var(--ink) 7%, transparent); }
.site-foot .mountains path + path { fill: color-mix(in srgb, var(--ink) 11%, transparent); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.5fr; gap: 2.5rem; padding-top: 2.5rem; }
.foot-grid h2 { font-size: 1.1rem; font-family: var(--font-hand); color: var(--clay); font-weight: 600; margin-bottom: .8rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.foot-grid ul a { color: var(--ink-body); text-decoration: none; display: inline-block; padding: .2rem 0; }
.foot-grid ul a:hover { color: var(--clay); text-decoration: underline; }
.foot-blurb { color: var(--ink-muted); max-width: 30ch; margin-top: 1rem; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.25rem; font-size: 1rem; color: var(--ink-muted); }
.foot-bottom .hand { font-family: var(--font-hand); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Forms (newsletter) ---------- */
.nl-form { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.nl-form input[type="email"] {
  flex: 1 1 12rem; min-height: 48px; padding: .6rem .9rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--wobble-b);
}
.nl-form input[type="email"]:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.nl-form .btn { min-height: 48px; }
.nl-status { flex-basis: 100%; margin: .25rem 0 0; font-size: 1rem; min-height: 1.5em; }
.nl-status.is-error { color: var(--clay); }
.nl-status.is-success { color: var(--moss); }
.nl-check { flex-basis: 100%; display: flex; gap: .5rem; align-items: flex-start; font-size: 1rem; color: var(--ink-muted); }
.nl-check input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--clay); }

/* ---------- Pills / filter row ---------- */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .35rem 1rem; font: 500 1rem var(--font-body);
  background: transparent; color: var(--ink-body); border: 1.5px solid var(--line-strong); border-radius: var(--wobble-a); cursor: pointer; text-decoration: none;
}
.pill:hover { border-color: var(--clay); color: var(--clay); }
.pill[aria-pressed="true"], .pill.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill .n { font: .875rem var(--font-mono); opacity: .8; }
.jump { position: sticky; top: 0; z-index: 20; padding-block: .75rem; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px dashed var(--line-strong); }
.jump .wrap { display: flex; align-items: center; gap: 1rem; overflow-x: auto; }
.jump .lbl { font-family: var(--font-hand); color: var(--ink-muted); white-space: nowrap; }
.jump .pills { flex-wrap: nowrap; }
.jump .pill { white-space: nowrap; }

/* ---------- Projects ---------- */
.featured-proj { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 4vw, 3.5rem); align-items: center; padding: clamp(1.25rem, 3vw, 2.5rem); }
.featured-proj .photo { aspect-ratio: 16 / 10; border-radius: 4px; }
.featured-proj .stones .stone { background: color-mix(in srgb, var(--kinari-100) 8%, transparent); border-color: #ffffff2a; }
.featured-proj .stones .stone b { color: var(--panel-ink); }
.featured-proj .stones .stone span { color: var(--panel-muted); }
@media (max-width: 860px) { .featured-proj { grid-template-columns: 1fr; } }

.oss { display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.oss-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.oss-item:nth-child(even) .photo-wrap { order: 2; }
.oss-item:nth-child(even) .photo { transform: rotate(1deg); }
.oss-item .photo { aspect-ratio: 16 / 10; transform: rotate(-.8deg); background: #1d1a17; }
.oss-item .photo img { object-fit: contain; }
.oss-item h3 { font-size: 1.6rem; }
.oss-item h3 a { color: var(--ink); }
.oss-item .stat-line { font: .9375rem var(--font-mono); color: var(--ink-muted); margin-bottom: .8rem; }
@media (max-width: 820px) { .oss-item { grid-template-columns: 1fr; } .oss-item:nth-child(even) .photo-wrap { order: 0; } }

.compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.compact li { position: relative; padding: 1.2rem 1.25rem; background: var(--surface); border-radius: var(--wobble-b); }
.compact li:nth-child(odd) { border-radius: var(--wobble-a); }
.compact h3 { font-size: 1.15rem; margin: 0 0 .35rem; }
.compact h3 a { color: var(--ink); text-decoration: none; }
.compact h3 a::before { content: ""; position: absolute; inset: 0; }
.compact h3 a:hover { color: var(--clay); }
.compact p { font-size: 1.0625rem; margin: 0 0 .6rem; }
.compact .stars { font: .9375rem var(--font-mono); color: var(--gold-text); }

.side-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.75rem 1.5rem; }
.side-grid .card .photo { background: #1d1a17; }
.side-grid .card .photo img { object-fit: contain; }

/* ---------- About ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem clamp(2rem, 5vw, 5rem); align-items: end; padding-block: clamp(2rem, 5vw, 4.5rem) 0; }
.about-hero .photo { aspect-ratio: 4 / 5; transform: rotate(-1deg); }
.about-hero .photo img { object-position: center 30%; }
@media (max-width: 820px) { .about-hero { grid-template-columns: 1fr; } .about-hero .photo { max-width: 380px; aspect-ratio: 1; } }

.career-bar { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 1.5rem 0 2rem; padding: 0; border: 1.5px solid var(--line-strong); border-radius: var(--wobble-b); overflow: hidden; }
.career-bar li { flex: var(--w, 1) 1 8rem; padding: .7rem .8rem; border-right: 1px dashed var(--line-strong); font-size: 1rem; background: var(--surface); }
.career-bar li:nth-child(odd) { background: var(--paper-sunk); }
.career-bar li:first-child { background: var(--tint-clay); }
.career-bar b { display: block; font-family: var(--font-display); color: var(--ink); }
.career-bar span { font: .875rem var(--font-mono); color: var(--ink-muted); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 2rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: .45rem; top: .5rem; bottom: .5rem; width: 3px; background: var(--gold-deco); border-radius: 3px; filter: url(#rough); }
.timeline > li { position: relative; padding-bottom: 2.2rem; }
.timeline > li::before { content: ""; position: absolute; left: -2rem; top: .45rem; width: 1.05rem; height: 1.05rem; background: var(--paper); border: 3px solid var(--clay); border-radius: var(--pebble); }
.timeline h3 { margin: 0; font-size: 1.4rem; }
.timeline .period { font: .9375rem var(--font-mono); color: var(--ink-muted); }
.timeline ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.timeline ul li { margin-bottom: .35rem; }

details.disclose > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary .when-open { display: none; }
details.disclose[open] > summary .when-open { display: inline; }
details.disclose[open] > summary .when-closed { display: none; }

.principles { padding: clamp(1.75rem, 4vw, 3.5rem); }
.principles > ol { list-style: none; counter-reset: p; margin: 1.5rem 0; padding: 0; display: grid; gap: 1.1rem; }
.principles > ol > li { counter-increment: p; display: grid; grid-template-columns: 3rem 1fr; align-items: baseline; font-family: var(--font-display); font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); line-height: 1.35; font-style: italic; }
.principles > ol > li::before { content: counter(p, decimal); font: 1.1rem var(--font-hand); color: var(--kin-300); font-style: normal; }

.beyond { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 4rem); align-items: center; }
.beyond .photo { aspect-ratio: 4 / 3; transform: rotate(1deg); }
.beyond dl { margin: 0; display: grid; gap: 1.2rem; }
.beyond dt { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: 1.2rem; }
.beyond dd { margin: .15rem 0 0; }
@media (max-width: 820px) { .beyond { grid-template-columns: 1fr; } }

.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2.5rem; margin-top: 2rem; }
.caps h3 { font-size: 1.3rem; margin-bottom: .2rem; }
.caps p { color: var(--panel-muted); margin-bottom: .7rem; }
.caps .tags .tag { background: #ffffff10; border-color: #ffffff30; color: var(--panel-ink); }
@media (max-width: 760px) { .caps { grid-template-columns: 1fr; } }

/* ---------- Article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 4px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--clay); z-index: 60; }
.progress-pct { position: fixed; bottom: .75rem; right: .75rem; z-index: 60; font: .8125rem var(--font-mono); color: var(--ink-muted); background: var(--surface); padding: .1rem .45rem; border-radius: 6px; border: 1px solid var(--line); }
.art-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 4.5rem); align-items: center; padding-block: clamp(1.5rem, 4vw, 3.5rem) 1rem; }
.art-hero .crumb { font-family: var(--font-hand); font-size: 1.0625rem; }
.art-hero h1 { font-size: clamp(2.3rem, 1.9rem + 2.4vw, 3.9rem); margin-top: .5rem; }
.art-hero .desc { font-size: 1.3rem; color: var(--ink-body); }
.art-hero .photo { aspect-ratio: 16 / 10; transform: rotate(-1deg); }
@media (max-width: 860px) { .art-hero { grid-template-columns: 1fr; } }

.art-layout { display: grid; grid-template-columns: 190px minmax(0, 660px) minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-top: 2rem; }
.toc { position: sticky; top: 1.5rem; }
.toc h2 { font: 600 1.05rem var(--font-hand); color: var(--clay); margin-bottom: .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: .35rem 0 .35rem 1rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--ink-muted); text-decoration: none; font-size: 1rem; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--clay); font-weight: 600; }
.toc-mobile { display: none; margin: 1rem 0 0; border: 1.5px solid var(--line-strong); border-radius: var(--wobble-b); padding: .5rem 1rem; background: var(--surface); }
.toc-mobile summary { cursor: pointer; font-family: var(--font-hand); color: var(--clay); min-height: 44px; display: flex; align-items: center; font-size: 1.0625rem; }
.toc-mobile ol { margin: .25rem 0 .5rem; padding-left: 1.25rem; }
.toc-mobile li { padding: .25rem 0; }
.margin-notes { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }
.margin-note { font-family: var(--font-hand); color: var(--ink-muted); font-size: 1rem; line-height: 1.5; padding-left: 1rem; border-left: 2px dotted var(--gold-deco); }
.margin-note b { color: var(--ink); font-weight: 600; }
@media (max-width: 1260px) { .art-layout { grid-template-columns: 190px minmax(0, 1fr); } .margin-notes { display: none; } }
@media (max-width: 900px) { .art-layout { grid-template-columns: 1fr; } .toc { display: none; } .toc-mobile { display: block; } }

.prose { font-size: 1.1875rem; line-height: 1.75; color: var(--ink-body); min-width: 0; }
.prose > * + * { margin-top: 1.2em; }
.prose p { margin: 0; }
.prose h2 { font-size: clamp(1.7rem, 1.45rem + 1vw, 2.2rem); margin: 2.4em 0 .5em; padding-top: .3em; position: relative; }
.prose h2::before { content: ""; position: absolute; left: 0; top: -.4em; width: 3.5rem; height: 10px; background: var(--gold-deco);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6 L14 5 L22 7 L31 3 L40 6 L50 5 L59 6' stroke='black' stroke-width='2.2' fill='none'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6 L14 5 L22 7 L31 3 L40 6 L50 5 L59 6' stroke='black' stroke-width='2.2' fill='none'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.prose ol, .prose ul { padding-left: 1.4rem; }
.prose li + li { margin-top: .35rem; }
.prose li::marker { color: var(--clay); font-family: var(--font-hand); }
.prose :not(pre) > code { font-size: .88em; background: var(--paper-sunk); padding: .1em .35em; border-radius: 4px 6px 4px 7px; color: var(--ink); }
.prose em { font-style: italic; }

.call { position: relative; padding: 1.1rem 1.3rem 1.15rem 1.4rem; border-radius: 3px 18px 18px 3px; font-size: 1.0625rem; line-height: 1.65; }
.call .call-label { display: block; font-family: var(--font-hand); font-weight: 600; font-size: 1.0625rem; margin-bottom: .2rem; }
.call p { margin: 0; }
.call-why { background: var(--tint-moss); border-left: 4px solid var(--moss); }
.call-why .call-label { color: var(--moss); }
.call-q { background: var(--tint-clay); border-left: 4px solid var(--clay); }
.call-q .call-label { color: var(--clay); }
.call-note { background: var(--tint-gold); border-left: 4px solid var(--gold-deco); }
.call-note .call-label { color: var(--gold-text); }
.call-skill { background: var(--tint-indigo); border-left: 4px solid var(--indigo); }
.call-skill .call-label { color: var(--indigo); }

.code { margin-inline: clamp(-2.5rem, -3vw, 0rem); background: var(--code-bg); color: var(--code-ink); border-radius: 10px 16px 9px 18px; overflow: hidden; box-shadow: 0 16px 30px -24px #000; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: .35rem .5rem .35rem 1.1rem; border-bottom: 1px dashed #ffffff26; }
.code-head .lang { font: 600 .8125rem var(--font-mono); letter-spacing: .1em; color: #d9b460; }
.copy { font: 500 .875rem var(--font-body); color: #e9e0d0; background: #ffffff10; border: 1px solid #ffffff30; border-radius: 6px 9px 6px 10px; min-height: 36px; min-width: 44px; padding: .25rem .8rem; cursor: pointer; }
.copy:hover { background: #ffffff22; }
.copy:focus-visible { outline-color: #d9b460; }
.code pre { margin: 0; padding: 1.1rem 1.25rem 1.3rem; overflow-x: auto; font-size: .9375rem; line-height: 1.65; tab-size: 2; }
.code .tk-c { color: #9c9383; font-style: italic; }
.code .tk-s { color: #b7c48f; }
.code .tk-k { color: #e7a07b; }
.code .tk-t { color: #d9b460; }
.code .tk-n { color: #a9c1db; }
@media (max-width: 900px) { .code { margin-inline: 0; } }

.filed { margin-top: 3rem; display: flex; gap: .75rem 1rem; align-items: center; flex-wrap: wrap; }
.filed .hand { font-family: var(--font-hand); color: var(--ink-muted); }
.share-zone { margin-top: 3rem; padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--paper-sunk); border-radius: var(--wobble-c); display: grid; grid-template-columns: 1fr 1.3fr; gap: 2rem 3rem; }
.share-zone h2 { font-size: 1.5rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
@media (max-width: 760px) { .share-zone { grid-template-columns: 1fr; } }
.series-note { margin-top: 1.5rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-size: 1rem; color: var(--ink-muted); }

/* ---------- AI page ---------- */
.consult { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding: 1.4rem 1.75rem; }
.consult p { margin: 0; font-size: 1.2rem; font-family: var(--font-display); }
.ai-lead { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: center; margin-bottom: 2.5rem; }
.ai-lead .photo { aspect-ratio: 16 / 10; transform: rotate(-.8deg); }
.ai-lead h3 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); }
.ai-lead h3 a { color: var(--ink); text-decoration: none; }
.ai-lead h3 a:hover { color: var(--clay); }
@media (max-width: 820px) { .ai-lead { grid-template-columns: 1fr; } }
.thumb-ledger li { grid-template-columns: 8.5rem minmax(0, 1fr) 150px; }
.thumb-ledger .th { width: 150px; aspect-ratio: 16 / 10; border-radius: 4px; }
@media (max-width: 760px) { .thumb-ledger li { grid-template-columns: minmax(0, 1fr) 110px; } .thumb-ledger .meta { grid-column: 1 / -1; } .thumb-ledger .th { width: 110px; } }

.stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
.story .photo { aspect-ratio: 3 / 2; }
.story .part { font-family: var(--font-hand); color: var(--clay); font-size: 1rem; }
.story-soon { opacity: .75; border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; }
.original { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 1.3rem; margin-bottom: 2rem; }
.original .seal { width: 52px; height: 52px; font-size: 1rem; flex-shrink: 0; }
@media (max-width: 900px) { .stories { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stories { grid-template-columns: 1fr; } }

/* ---------- Writing page ---------- */
.two-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem; }
.two-lists h3 { font-size: 1.45rem; margin-bottom: .2rem; }
.two-lists .hint { color: var(--ink-muted); font-size: 1.0625rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .two-lists { grid-template-columns: 1fr; } }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .6rem .8rem; list-style: none; margin: 0; padding: 0; align-items: baseline; }
.tag-cloud a { text-decoration: none; color: var(--ink-body); font-family: var(--font-display); }
.tag-cloud a:hover { color: var(--clay); text-decoration: underline; }
.tag-cloud small { font: .875rem var(--font-mono); color: var(--ink-muted); }
.series-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 2rem; align-items: center; padding: clamp(1.25rem, 3vw, 2.25rem); }
.series-box .photo { aspect-ratio: 3/2; border-radius: 4px; }
.series-dots { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0; }
.series-dots li { width: 1.1rem; height: 1.1rem; border-radius: var(--pebble); background: var(--kin-300); }
.series-dots li.soon { background: transparent; border: 2px dashed var(--panel-muted); }
@media (max-width: 760px) { .series-box { grid-template-columns: 1fr; } }

/* ---------- Patterns ---------- */
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.three-ways li { padding: 1.2rem 1.3rem; background: var(--surface); border-radius: var(--wobble-b); }
.three-ways b { display: block; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
.three-ways p { margin: .3rem 0 0; font-size: 1.0625rem; }
.ways-foot { font-size: 1.0625rem; color: var(--ink-muted); max-width: 80ch; }
@media (max-width: 820px) { .three-ways { grid-template-columns: 1fr; } }

.ptools { display: grid; gap: 1rem; margin-bottom: 1.75rem; }
.psearch { display: flex; align-items: center; gap: .5rem; border: 1.5px solid var(--line-strong); border-radius: var(--wobble-a); background: var(--surface); padding: 0 1rem; }
.psearch:focus-within { border-color: var(--clay); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 25%, transparent); }
.psearch input { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.0625rem; min-height: 52px; min-width: 0; }
.psearch input:focus-visible { outline: none; }
.psearch input::placeholder { color: var(--ink-muted); }
.pbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; }
.pcount { font-family: var(--font-hand); font-size: 1.125rem; color: var(--ink); }
.linkish { background: none; border: 0; color: var(--indigo); font: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 .4rem; }
.linkish:hover { color: var(--clay); }
.sort select { font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--wobble-b); padding: .5rem .75rem; min-height: 44px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1.75rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.pcard { position: relative; background: var(--surface); border-radius: var(--wobble-a); padding: .85rem .85rem 1.2rem; display: flex; flex-direction: column; }
.pcard:nth-child(even) { border-radius: var(--wobble-b); }
.pcard:has(h2 a:focus-visible) { outline: 3px solid var(--clay); outline-offset: 3px; }
.pcard h2 a:focus-visible { outline: none; }
.pthumb { height: 150px; border-radius: 6px; background: var(--paper-sunk); margin-bottom: .9rem; overflow: hidden; position: relative; display: grid; place-items: center; }
.pthumb svg { width: 72%; height: 70%; }
.pthumb .s { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pthumb .f { fill: var(--line); }
.pthumb .a { fill: var(--clay); opacity: .8; }
.pthumb .g { fill: var(--gold-deco); opacity: .8; }
.pthumb .m { fill: var(--moss); opacity: .75; }
.prow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cat { font-family: var(--font-hand); color: var(--moss); font-size: 1rem; }
.pcard h2 { font-size: 1.25rem; margin: .35rem 0 .35rem; }
.pcard h2 a { color: var(--ink); text-decoration: none; }
.pcard h2 a::before { content: ""; position: absolute; inset: 0; }
.pcard h2 a:hover { color: var(--clay); }
.pcard p { font-size: 1rem; margin: 0 0 .6rem; line-height: 1.55; }
.pcard .good { font-size: 1rem; color: var(--ink-muted); }
.pcard .good b { color: var(--ink); font-weight: 600; }
.pcard .tags { margin-top: auto; position: relative; }
.pempty { text-align: center; padding: 3rem 1rem; border: 1.5px dashed var(--line-strong); border-radius: var(--wobble-c); }
.pempty svg { width: 90px; height: 90px; margin: 0 auto 1rem; display: block; }
.pempty path { fill: none; stroke: var(--ink-muted); stroke-width: 4; stroke-linecap: round; filter: url(#rough); }
.pempty h2 { font-size: 1.5rem; }

.pat-head { max-width: 900px; padding-block: 2rem 1rem; }
.back { font-family: var(--font-hand); font-size: 1.0625rem; display: inline-flex; min-height: 44px; align-items: center; }
.pat-head .lede { font-size: 1.25rem; line-height: 1.6; }
.reach h2 { font: 600 1.05rem var(--font-hand); color: var(--clay); }
.reach ul { columns: 2; column-gap: 2.5rem; padding-left: 1.2rem; margin: .5rem 0 1.25rem; }
.reach li { margin-bottom: .35rem; break-inside: avoid; }
@media (max-width: 620px) { .reach ul { columns: 1; } }

.panes { border: 1.5px solid var(--line-strong); border-radius: 12px 20px 12px 22px; background: var(--surface); overflow: hidden; margin-top: 1.5rem; }
.panes-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .75rem; border-bottom: 1px dashed var(--line-strong); background: var(--paper-sunk); }
.panes-tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.panes-tabs [role="tab"] { font: 500 1rem var(--font-body); background: none; border: 0; color: var(--ink-muted); padding: .4rem .85rem; min-height: 44px; border-radius: 8px 12px 8px 12px; cursor: pointer; }
.panes-tabs [role="tab"]:hover { color: var(--ink); }
.panes-tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--clay); }
.panes-actions { display: flex; gap: .5rem; }
.panes-actions button { font: 500 .9375rem var(--font-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 8px 12px 8px 12px; padding: .35rem .8rem; min-height: 44px; cursor: pointer; }
.panes-actions button:hover { border-color: var(--clay); color: var(--clay); }
.panes-actions button[hidden] { display: none; }
.pane { padding: clamp(1rem, 3vw, 2rem); }
.pane pre { margin: 0; overflow-x: auto; font-size: .9375rem; line-height: 1.6; background: var(--code-bg); color: var(--code-ink); padding: 1.1rem 1.25rem; border-radius: 8px; }
.pane .pane-note { font-size: 1rem; color: var(--ink-muted); margin-bottom: 1rem; }
.prompt-text { max-width: 70ch; font-size: 1.0625rem; }
.prompt-text p { margin-bottom: 1em; }

/* Hairline stat strip — the demo pattern, living in this page's palette */
.hss-caption { font-family: var(--font-hand); color: var(--ink-muted); font-size: 1rem; margin: 0 0 .6rem; }
.hss-strip { display: grid; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); } }
.hss-tile { background: var(--surface); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; text-align: left; font: inherit; color: inherit; border: 0; }
.hss-label { font: 500 .8125rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); overflow-wrap: anywhere; }
.hss-fig { font: 700 1.6rem var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hss-fig.none { color: var(--ink-muted); opacity: .7; }
.hss-sub { font-size: .9375rem; color: var(--ink-muted); }
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: color-mix(in srgb, var(--clay) 7%, var(--surface)); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--clay) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--clay); }
button.hss-tile:focus-visible { outline-offset: -4px; }
.hss-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
.hss-list li[hidden] { display: none; }
.hss-list .st { font: .875rem var(--font-mono); color: var(--ink-muted); white-space: nowrap; }
.hss-status { margin-top: .75rem; font-size: 1rem; color: var(--ink-body); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover { transform: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .ink-in { animation: inkIn .9s ease-out both; }
  @keyframes inkIn { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
}

/* ---------- Small additions ---------- */
.tag-cloud .w1 { font-size: 1.0625rem; }
.tag-cloud .w2 { font-size: 1.3rem; }
.tag-cloud .w3 { font-size: 1.65rem; font-weight: 700; }
.career-bar .cw1 { --w: 1; } .career-bar .cw2 { --w: 2; } .career-bar .cw3 { --w: 3; } .career-bar .cw5 { --w: 5; }
.more-title { font-size: 1.45rem; margin: 3rem 0 1rem; }
.big-title { font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.5rem); }
.spacer { margin-top: 2rem; }
.hand-eyebrow { font-family: var(--font-hand); color: var(--clay); font-size: 1.125rem; margin: 0 0 .25rem; }
.about-hero .lede { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.45rem); line-height: 1.55; color: var(--ink); }
.about-stones { margin-top: 2rem; }
.hero-photo, .page-hero figure, .about-hero figure, .art-hero figure, .beyond figure { margin: 0; }
@media (max-width: 1020px) {
  .theme-btn { margin-left: auto; }
  .menu-btn { margin-left: 0; }
}

@media (max-width: 520px) {
  .stones { gap: .6rem; }
  .stone { width: 6.6rem; }
  .stone b { font-size: 1.6rem; }
  .stone span { font-size: .8125rem; }
}

.featured-proj .stone { width: 6.9rem; }
.featured-proj .stone b { font-size: 1.75rem; }
.pat-head .prow { margin-top: .5rem; }
.meta time { white-space: nowrap; }

.prose-fig { margin: 1.8em 0; }
.prose-fig img { display: block; width: 100%; height: auto; }
.prose blockquote.call { margin-inline: 0; }
.prose .call p + p { margin-top: .7em; }
.prose code { overflow-wrap: anywhere; }
.prose > * + p { margin-top: 1.2em; }
