/* ==========================================================================
   Nikhil Mourya · portfolio
   "夕暮れの村", a dusk village: night indigo, washi-white type, one lantern-gold
   accent, vermilion only for seals and the torii. Each season (html[data-season])
   swaps a single secondary colour and the painting in the hero. No framework.
   ========================================================================== */

:root {
  /* palette: every colour on the site (CSS and canvases) comes from these */
  --bg: #0e0d0f;              /* 墨, sumi ink: the page is ink on dark paper */
  --bg-1: #151417;
  --bg-2: #1c1b1f;
  --fg: #f1ebdd;              /* 胡粉, washi white */
  --fg-rgb: 241, 235, 221;
  --w-rgb: 236, 228, 210;     /* hairlines and washes */
  --hi-rgb: 255, 246, 226;
  --accent: #e4ad62;          /* 提灯, lantern gold: the headline word, live dots, key numbers */
  --accent-rgb: 228, 173, 98;
  --accent-ink: #1a1206;      /* text on the accent */
  --accent-2: #e4ad62;
  --accent-2-rgb: 228, 173, 98;
  --accent-3: #8fa6c2;        /* 藍鼠, indigo grey, the rare second state: swapped, refused, rejected */
  --accent-3-rgb: 143, 166, 194;
  --shu: #d4553b;             /* 朱, vermilion: seals and the torii only */
  --shu-rgb: 212, 85, 59;
  --portrait-lo: 12, 14, 30;  /* woodblock print: indigo ink, mids, washi */
  --portrait-mid: 104, 104, 134;
  --portrait-hi: 246, 236, 214;
  --season: #e0673e;          /* set per season below */
  --season-rgb: 224, 103, 62;

  --fg-2: rgba(var(--fg-rgb), 0.64);
  --fg-3: rgba(var(--fg-rgb), 0.42);
  --fg-4: rgba(var(--fg-rgb), 0.22);
  --line: rgba(var(--w-rgb), 0.07);
  --line-2: rgba(var(--w-rgb), 0.11);
  --line-3: rgba(var(--w-rgb), 0.2);

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', Georgia, serif;
  --brush: 'Yuji Syuku', 'Shippori Mincho', serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max: 1160px;
  --pad: 32px;
  --r: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: dark;
}
[data-season="spring"] { --season: #f1b3c2; --season-rgb: 241, 179, 194; }
[data-season="summer"] { --season: #c8e07a; --season-rgb: 200, 224, 122; }
[data-season="autumn"] { --season: #e0673e; --season-rgb: 224, 103, 62; }
[data-season="winter"] { --season: #cfdcec; --season-rgb: 207, 220, 236; }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* grain: a whisper of texture so the graphite does not read as a flat screen colour */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.98  0 0 0 0 0.94  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
strong { font-weight: 500; color: var(--fg); }
code { font: 400 0.86em var(--mono); color: var(--fg); background: var(--bg-2); border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--bg);
  font: 500 13px/1 var(--sans); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- primitives ---------- */
.wrap { position: relative; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.dim { color: var(--fg-3); }
.accent { color: var(--accent); }

.led {
  display: inline-block; flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
  animation: led 2.6s ease-in-out infinite;
}
@keyframes led { 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.04); } }

.cursor {
  display: inline-block;
  width: 0.08em; height: 0.82em;
  margin-left: 0.08em;
  vertical-align: -0.06em;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.viz__label { font: 400 11px/1.4 var(--mono); color: var(--fg-3); }

.tag { display: inline-flex; align-items: center; gap: 12px; font: 400 13px/1 var(--mono); color: var(--fg-2); }
.tag span { color: var(--accent); }
.tag span::after { content: ''; display: inline-block; width: 18px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--line-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 500 15px/1 var(--sans);
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn span { transition: transform 0.2s var(--ease); }
.btn:hover span { transform: translate(2px, -1px); }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border-color: var(--line-3); color: var(--fg); background: rgba(var(--w-rgb), 0.02); }
.btn--ghost:hover { border-color: var(--fg-3); background: rgba(var(--w-rgb), 0.05); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn--lg { height: 54px; padding: 0 24px; font-size: 16px; }
.btn.is-copied { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.4); }

.textlink {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 14px/1 var(--sans);
  color: var(--fg-2);
  padding: 6px 0;
  transition: color 0.2s;
}
.textlink:hover { color: var(--accent); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills li {
  font: 400 12px/1 var(--mono);
  color: var(--fg-2);
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
}

/* ---------- section scaffolding ---------- */
.section { position: relative; padding: 112px 0; }

/* Axon: a hairline divider with a travelling pulse */
.axon {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--max) - 2 * var(--pad), 100% - 2 * var(--pad));
  height: 1px;
  background: var(--line-2);
}
.axon::before, .axon::after {
  content: ''; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-3);
}
.axon::before { left: 0; }
.axon::after { right: 0; }
.axon i {
  position: absolute; top: -1px; left: 0; width: 72px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent));
  opacity: 0;
}
.section.is-lit .axon i { animation: axon 4.2s var(--ease) infinite; }
@keyframes axon {
  0% { left: 0; opacity: 0; }
  10%, 70% { opacity: 1; }
  82%, 100% { left: calc(100% - 72px); opacity: 0; }
}

.shead { display: grid; gap: 20px; margin-bottom: 56px; max-width: 780px; }
.shead__title {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 450;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.shead__desc { max-width: 38em; color: var(--fg-2); font-size: 17px; }

[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav { position: fixed; top: 16px; left: 0; right: 0; z-index: 80; padding: 0 16px; pointer-events: none; }
.nav__capsule {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: fit-content; max-width: 100%; margin: 0 auto;
  height: 50px; padding: 0 7px 0 16px;
  border-radius: 999px;
  background: rgba(16, 16, 15, 0.6);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.9);
  transition: background-color 0.3s;
}
.nav.is-scrolled .nav__capsule { background: rgba(13, 13, 12, 0.85); }
.brand { display: inline-flex; align-items: center; gap: 10px; padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--line-2); font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.brand__mark { width: 18px; height: 18px; }
.brand__mark path { stroke: var(--fg-4); stroke-width: 1.2; fill: none; }
.brand__mark circle { fill: var(--bg); stroke: var(--fg-2); stroke-width: 1.2; }
.brand__mark .core { fill: var(--accent); stroke: var(--accent); }
.nav__links { display: flex; gap: 2px; }
.nav__links a { padding: 8px 13px; border-radius: 999px; font-size: 14px; color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.nav__links a:hover { color: var(--fg); }
.nav__links a.is-active { color: var(--fg); background: rgba(var(--w-rgb), 0.06); }
.nav__status {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 13px; margin-left: 2px;
  border-radius: 999px; border: 1px solid var(--line);
  font: 400 12px/1 var(--mono); color: var(--fg-3);
}
.nav__status b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.nav__toggle { display: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; }
.nav__toggle span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--fg); transition: transform 0.3s var(--ease); }
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 21px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-3px) rotate(-45deg); }
.mobile-menu {
  pointer-events: auto;
  max-width: 420px; margin: 10px auto 0; padding: 8px;
  border-radius: 18px; border: 1px solid var(--line-2);
  background: rgba(13, 13, 12, 0.95);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.mobile-menu a { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; font-size: 20px; letter-spacing: -0.02em; }
.mobile-menu a:hover { background: rgba(var(--w-rgb), 0.05); }
.mobile-menu a span { font: 400 11px/1 var(--mono); color: var(--accent); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 136px 0 56px;
  overflow: hidden;
  isolation: isolate;
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 48px; align-items: center; }

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 14px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(16, 16, 15, 0.7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 500;
  margin-bottom: 32px;
  transition: border-color 0.2s;
}
.status-pill:hover { border-color: var(--line-3); }
.status-pill__sep { width: 1px; height: 13px; background: var(--line-3); }
.status-pill__dim { color: var(--fg-3); font-weight: 400; }

.hero__title {
  font-size: clamp(38px, 3.9vw, 56px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; white-space: nowrap; }
.hero__key { color: var(--accent); }
.hero__prompt { margin-bottom: 18px; font: 400 14px/1.4 var(--mono); color: var(--fg-3); }
.hero__prompt .p { color: var(--accent); margin-right: 4px; }
.hero__prompt .s { color: rgba(var(--accent-rgb), 0.75); }
.hero__name { color: var(--fg); }
.tk-new { animation: tkIn 0.5s var(--ease); }
@keyframes tkIn { from { color: var(--accent); } }
.hero__gen { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 18px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); cursor: help; }
.hero__gen b { font-weight: 500; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.hero__gen span { white-space: nowrap; }
.hero__gen i { font-style: normal; color: var(--fg-4); }

.hero__lede { margin-top: 22px; max-width: 34em; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.65; color: var(--fg-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Portrait */
.portrait {
  justify-self: end;
  width: 100%; max-width: 240px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}
.portrait__bar, .portrait__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  height: 36px; padding: 0 14px;
  font: 400 11px/1 var(--mono); color: var(--fg-2);
}
.portrait__bar { border-bottom: 1px solid var(--line); }
.portrait__bar > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.portrait__foot { border-top: 1px solid var(--line); color: var(--fg-3); }
.portrait__foot { gap: 8px; padding: 0 12px; font-size: 10.5px; white-space: nowrap; }
.portrait__img { position: relative; aspect-ratio: 4 / 5; background: #080807; }
.portrait__img canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.portrait__img::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 42%, transparent 68%, rgba(8, 8, 7, 0.3));
}
.loss { display: inline-flex; align-items: center; gap: 6px; }
.loss svg { flex: none; width: 38px; height: 14px; }
.loss path { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.loss b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }

/* Facts row */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 80px; padding-top: 22px;
  border-top: 1px solid var(--line-2);
}
.facts > div { padding-right: 20px; }
.facts dt { font: 400 11px/1 var(--mono); color: var(--fg-3); margin-bottom: 8px; }
.facts dd { font-size: 15px; color: var(--fg-2); line-height: 1.45; }
.facts a { color: var(--fg); border-bottom: 1px solid var(--line-3); transition: color 0.2s, border-color 0.2s; }
.facts a:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   About
   ========================================================================== */
.about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.about__text > p { font-size: 17px; line-height: 1.7; color: var(--fg-2); max-width: 36em; }
.about__text > p + p { margin-top: 18px; }
.about__text > p:first-child { font-size: 21px; line-height: 1.55; color: var(--fg); letter-spacing: -0.012em; }
.stack { margin-top: 40px; border-top: 1px solid var(--line); }
.stack__row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.stack__k { font: 400 12px/1.4 var(--mono); color: var(--fg-3); }

.info { border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-1); }
.info__bar { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 400 12px/1 var(--mono); color: var(--fg-2); }
.info__bar .p { color: var(--accent); }
.info dl { padding: 6px 16px 10px; font: 400 13px/1.4 var(--mono); }
.info dl div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.info dl div:last-child { border-bottom: 0; }
.info dt { color: var(--fg-3); }
.info dd { color: var(--fg); }
.info dd a:hover { color: var(--accent); }
.info .ok { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }

/* ==========================================================================
   Experience
   ========================================================================== */
.timeline { position: relative; border-top: 1px solid var(--line-2); }
.role { position: relative; display: grid; grid-template-columns: 140px 1fr; gap: 32px; padding: 36px 0; border-bottom: 1px solid var(--line); }
.role__dot { position: absolute; left: 110px; top: 44px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-3); background: var(--bg); transition: border-color 0.4s; }
.role.is-in .role__dot { border-color: var(--accent); }
.role__dot.is-live { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
.role__when { font: 400 13px/1.9 var(--mono); color: var(--fg-3); }
.role__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.role h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.2; }
.role h3 a { transition: color 0.2s; }
.role h3 a span { color: var(--fg-4); font-size: 0.7em; transition: color 0.2s; }
.role h3 a:hover, .role h3 a:hover span { color: var(--accent); }
.role__title { font: 400 13px/1.4 var(--mono); color: var(--fg-3); }
.role__text { margin-top: 12px; color: var(--fg-2); max-width: 44em; }
.role__points { margin-top: 14px; display: grid; gap: 8px; color: var(--fg-2); max-width: 46em; }
.role__points li { position: relative; padding-left: 20px; }
.role__points li::before { content: ''; position: absolute; left: 0; top: 0.8em; width: 8px; height: 1px; background: var(--fg-4); }
.role__nums { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 22px; }
.role__nums b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.role__nums span { font-size: 13px; color: var(--fg-3); }

.honors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; }
.honor { padding-top: 18px; border-top: 1px solid var(--line-2); }
.honor__k { font: 400 12px/1 var(--mono); color: var(--fg-3); }
.honor b { display: block; margin-top: 10px; font-size: 17px; font-weight: 500; letter-spacing: -0.015em; }
.honor > span:last-child { display: block; margin-top: 4px; font-size: 14px; color: var(--fg-3); }

/* ==========================================================================
   Projects
   ========================================================================== */
.feature {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  margin-bottom: 20px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(var(--w-rgb), 0.02), rgba(var(--w-rgb), 0.008));
  overflow: hidden;
}
.feature__info { padding: 36px 40px 34px; display: flex; flex-direction: column; }
.feature--flip .feature__info { order: 2; }
.feature__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.feature__kicker { font: 400 12px/1 var(--mono); color: var(--accent); }
.feature__meta { display: inline-flex; gap: 14px; font: 400 12px/1 var(--mono); color: var(--fg-3); }
.feature__meta a { transition: color 0.2s; }
.feature__meta a:hover { color: var(--fg); }
.feature__meta b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.feature__name { margin-top: 16px; font-size: clamp(28px, 2.8vw, 36px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.feature__tagline { margin-top: 12px; font-size: 17px; line-height: 1.45; color: var(--fg); max-width: 28em; }
.feature__text { margin-top: 12px; font-size: 15px; color: var(--fg-2); max-width: 38em; }
.feature__credit { margin-top: 10px; font-size: 13.5px; color: var(--fg-3); }
.feature__credit a { color: var(--fg-2); border-bottom: 1px solid var(--line-3); }
.feature__credit a:hover { color: var(--accent); border-color: var(--accent); }
.feature__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; padding-top: 26px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics > div { padding: 16px 16px 14px 0; }
.metrics > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.metrics dd { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics .is-hot dd { color: var(--accent); }
.metrics dt { margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: var(--fg-3); }

.feature__viz {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 24px 26px;
  border-left: 1px solid var(--line);
  background: var(--shippo) 0 0 / 28px 28px, rgba(0, 0, 0, 0.25);
}
.feature--flip .feature__viz { border-left: 0; border-right: 1px solid var(--line); }
.viz__head { display: flex; justify-content: space-between; align-items: center; }
.viz__live { display: inline-flex; align-items: center; gap: 8px; font: 400 11px/1 var(--mono); color: var(--fg-3); }

/* KV simulator */
.kv-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; aspect-ratio: 1; width: 100%; max-width: 270px; margin: auto; }
/* split panel: compact live KV block on top, real recording below */
.feature__viz--split { gap: 18px; }
.kv-mini { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; align-items: center; }
.kv-mini .kv-grid { max-width: 148px; gap: 3px; margin: 0; }
.kv-mini .kv-cell { border-radius: 2px; }
.kv-status.kv-status--stack { display: grid; gap: 6px; padding: 0; border: 0; justify-content: start; }
.kv-note { margin-top: 6px; font: 400 12px/1.5 var(--sans); color: var(--fg-3); }
.demo { margin: 0; border-radius: 10px; border: 1px solid var(--line-2); overflow: hidden; background: #080807; }
.demo__bar { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border-bottom: 1px solid var(--line); font: 400 11px/1 var(--mono); color: var(--fg-3); }
.demo__dots { display: inline-flex; gap: 5px; }
.demo__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(var(--w-rgb), 0.12); }
.demo__url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo__bar a { color: var(--fg-3); transition: color 0.2s; }
.demo__bar a:hover { color: var(--accent); }
.demo__video { display: block; width: 100%; height: auto; aspect-ratio: 900 / 510; background: #080807; }
.kv-cell { border-radius: 3px; border: 1px solid var(--line-2); transition: background-color 0.35s, border-color 0.35s; }
.kv-cell[data-s] { border-color: transparent; }
.kv-cell[data-s="0"] { background: var(--accent); }
.kv-cell[data-s="1"] { background: rgba(var(--accent-rgb), 0.45); }
.kv-cell[data-s="2"] { background: rgba(var(--fg-rgb), 0.8); }
.kv-cell[data-s="3"] { background: rgba(var(--fg-rgb), 0.3); }
.kv-cell.is-new { animation: blockIn 0.5s var(--ease); }
.kv-cell.is-freed { animation: blockOut 0.6s var(--ease); }
.kv-cell.is-swapped { animation: blockSwap 0.7s var(--ease); }
@keyframes blockIn { from { transform: scale(0.5); } to { transform: none; } }
@keyframes blockOut { from { background: rgba(var(--fg-rgb), 0.4); } to { background: transparent; } }
@keyframes blockSwap { from { background: var(--accent-3); } to { background: transparent; } }
.kv-status {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  padding-top: 12px; border-top: 1px solid var(--line);
  font: 400 11px/1.4 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums;
}
.kv-status b { font-weight: 400; color: var(--fg); }
.kv-status .swap b { color: var(--accent-3); }

/* diamond graph */
.graph { width: 100%; max-width: 300px; margin: auto; }
.feature__viz--split .graph { max-width: 190px; margin: -6px auto -10px; }
.feature__viz--split .term pre { padding: 9px 12px; font-size: 11px; line-height: 1.7; }
.graph .edge { stroke: var(--line-3); stroke-width: 1.2; fill: none; }
.graph .node rect { fill: var(--bg-1); stroke: var(--line-3); }
.graph .node text { fill: var(--fg); font: 500 13px var(--mono); }
.graph .node .op { fill: var(--fg-3); font-size: 10px; font-weight: 400; }
.graph .node--x rect { stroke: var(--accent); }
.graph .grad { fill: var(--accent); }
.graph .acc { font: 500 11px var(--mono); fill: var(--accent); }
.graph .side { font: 400 10px var(--mono); fill: var(--fg-4); }

.term { border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); }
.term pre { padding: 12px 14px; overflow-x: auto; font: 400 11.5px/1.85 var(--mono); color: var(--fg-2); }
.term .p { color: var(--accent); }
.term .c { color: var(--fg); }
.term .ok { color: var(--accent); }
.term .m { color: var(--fg-4); }
.term__line { opacity: 0; transition: opacity 0.4s; }
.is-in .term__line { opacity: 1; }
.is-in .term__line:nth-child(2) { transition-delay: 0.6s; }
.is-in .term__line:nth-child(3) { transition-delay: 1.2s; }
.is-in .term__line:nth-child(4) { transition-delay: 1.8s; }


/* index lists: more work + writing */
.index { margin-top: 88px; }
.index__caption { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.index__caption h3 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; }
.index ul { border-top: 1px solid var(--line-2); }
.writing__intro { margin-bottom: 28px; color: var(--fg-2); max-width: 40em; }

/* ==========================================================================
   Contact + footer
   ========================================================================== */
.contact { padding-bottom: 96px; }
.contact__title {
  margin-top: 24px;
  font-size: clamp(38px, 5.6vw, 76px); font-weight: 500; line-height: 1.02; letter-spacing: -0.045em;
  max-width: 12em;
  text-wrap: balance;
}
.contact__lede { margin-top: 26px; max-width: 34em; font-size: 18px; color: var(--fg-2); }
.mail { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.footer { border-top: 1px solid var(--line); }
/* contact links as one paragraph, then the ending reads like a sign-off, not a sitemap */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.elsewhere { max-width: 40em; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line-2); font-size: 19px; line-height: 1.7; letter-spacing: -0.01em; color: var(--fg-2); }
.elsewhere .social b { font-weight: 500; color: var(--fg); border-bottom: 1px solid rgba(var(--accent-rgb), 0.45); transition: color 0.2s, border-color 0.2s; }
.elsewhere .social:hover b { color: var(--accent); border-color: var(--accent); }
.outro { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 56px; align-items: end; padding: 64px 0 40px; }
.outro__note { max-width: 26em; padding-bottom: 14px; font-size: 16px; line-height: 1.6; color: var(--fg-2); }
.outro__note span { display: block; margin-top: 4px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; padding: 18px 0 34px; border-top: 1px solid var(--line); font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.footer__inner > * + *:not([hidden])::before { content: '·'; margin: 0 12px; color: var(--fg-4); }
.footer__inner .eos { color: var(--accent); }
.footer__inner a, .footer__inner button { color: var(--fg-2); transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ==========================================================================
   Additions: token hover, highlights, contributions, lab, palette, footer map
   ========================================================================== */

/* hero phrase that splits into tokens on hover */
.tok { position: relative; cursor: help; border-bottom: 1px dashed var(--line-3); outline: none; }
.tok .t { position: relative; padding: 0 1px; border-radius: 3px; transition: background-color 0.25s; }
.tok.is-split .t:nth-child(odd) { background: rgba(var(--accent-rgb), 0.16); }
.tok.is-split .t:nth-child(even) { background: rgba(var(--fg-rgb), 0.1); }
.tok__tip {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 5;
  padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2);
  font: 400 11px/1 var(--mono); color: var(--fg-2); white-space: nowrap;
  opacity: 0; transform: translateY(-3px); transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.tok__tip b { color: var(--accent); font-weight: 400; }
.tok.is-split .tok__tip { opacity: 1; transform: none; }

.tzdiff { display: block; margin-top: 3px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.facts dd b { font-weight: 400; font-variant-numeric: tabular-nums; }

/* ask this page */
.ask { margin-top: 72px; }
.ask__note { max-width: 30em; font-size: 13px; color: var(--fg-3); text-align: right; }
.ask__form {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(var(--w-rgb), 0.02);
  transition: border-color 0.2s;
}
.ask__form:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.ask__prompt { font: 400 16px/1 var(--mono); color: var(--accent); }
.ask__form input { flex: 1; min-width: 0; height: 38px; background: none; border: 0; outline: none; color: var(--fg); font: 400 15px/1 var(--sans); }
.ask__form input::placeholder { color: var(--fg-4); }
.ask__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask__chips button {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2);
  font: 400 12px/1 var(--mono); color: var(--fg-3); transition: color 0.2s, border-color 0.2s;
}
.ask__chips button:hover { color: var(--fg); border-color: var(--line-3); }
.ask__chips button.is-trick { border-style: dashed; }
.ask__lineage { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; margin-top: 16px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.ask__lineage > span { grid-row: span 2; color: var(--fg-4); }
.ask__lineage a { width: fit-content; }
.ask__lineage a { color: var(--fg-3); transition: color 0.2s; }
.ask__lineage a b { font-weight: 500; color: var(--accent); }
.ask__lineage a:hover { color: var(--fg); }
.ask__out { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.ask__answer { font-size: 19px; line-height: 1.5; letter-spacing: -0.01em; color: var(--fg); max-width: 44em; min-height: 1.5em; }
.ask.is-refusing .ask__answer { color: var(--accent-3); }
.ask__src { margin-top: 8px; font-size: 13px; color: var(--fg-3); }
.ask__jump { color: var(--accent); font: inherit; }
.ask__jump:hover { text-decoration: underline; text-underline-offset: 3px; }
.ask__why { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 28px; margin-top: 20px; }
.ask__track { position: relative; height: 6px; border-radius: 6px; background: rgba(var(--w-rgb), 0.06); }
.ask__track i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--accent); transition: width 0.6s var(--ease), background-color 0.3s; }
.ask.is-refusing .ask__track i { background: var(--accent-3); }
.ask__mark { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--fg-2); }
.ask__meter p { margin-top: 10px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.ask__meter b { font-weight: 500; color: var(--fg); }
.ask__hits { display: grid; gap: 2px; }
.ask__hits button {
  display: grid; grid-template-columns: 44px 120px minmax(0, 1fr); gap: 12px; align-items: baseline; width: 100%;
  padding: 6px 8px; border-radius: 8px; text-align: left; font: 400 12px/1.4 var(--mono); color: var(--fg-3);
  transition: background-color 0.2s, color 0.2s;
}
.ask__hits button:hover { background: rgba(var(--w-rgb), 0.04); color: var(--fg-2); }
.ask__score { color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.ask__where { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask__snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); font-size: 13px; }
.ask__none { font: 400 12px/1.5 var(--mono); color: var(--fg-3); padding: 6px 8px; }
.is-cited { animation: cited 2.2s var(--ease); border-radius: 10px; }
@keyframes cited { 0%, 60% { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.8); } 100% { box-shadow: 0 0 0 2px transparent; } }

/* highlights */
.highlights { margin-top: 72px; }
.hl { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--fg); }
.hl b { font-weight: 500; font-variant-numeric: tabular-nums; }
.hl em { flex: none; font: 400 12px/1 var(--mono); font-style: normal; color: var(--fg-3); }
a.hl { transition: color 0.2s; }
a.hl:hover { color: var(--accent); }
a.hl:hover em { color: var(--fg-2); }

/* contributions */
.contrib { margin-top: 22px; }
.contrib__total { margin: -4px 0 16px; font-size: 14px; color: var(--fg-3); }
.contrib__total b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; margin-right: 6px; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: var(--accent); transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.contrib__scroll { overflow-x: auto; padding-bottom: 6px; }
.contrib__svg { display: block; min-width: 720px; width: 100%; height: auto; }
.contrib__svg text { font: 400 9px var(--mono); fill: var(--fg-4); }
.contrib__svg rect { rx: 2px; }
.contrib__legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; font: 400 11px/1 var(--mono); color: var(--fg-4); }
.contrib__legend i { width: 10px; height: 10px; border-radius: 2px; }
[data-l="0"] { background: rgba(var(--w-rgb), 0.05); fill: rgba(var(--w-rgb), 0.05); }
[data-l="1"] { background: rgba(var(--accent-rgb), 0.25); fill: rgba(var(--accent-rgb), 0.25); }
[data-l="2"] { background: rgba(var(--accent-rgb), 0.45); fill: rgba(var(--accent-rgb), 0.45); }
[data-l="3"] { background: rgba(var(--accent-rgb), 0.7); fill: rgba(var(--accent-rgb), 0.7); }
[data-l="4"] { background: var(--accent); fill: var(--accent); }


/* lab */
.lab__note { font-size: 14px; color: var(--fg-3); }
.lab__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.toy { display: flex; flex-direction: column; }
.toy__stage {
  position: relative; height: 210px; padding: 18px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--shippo) 0 0 / 28px 28px, rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  overflow: hidden;
}
.toy__stage--canvas { padding: 0; }
.toy__stage canvas { width: 100%; height: 100%; }
.toy__readout { position: absolute; left: 12px; bottom: 10px; font: 400 11px/1 var(--mono); color: var(--fg-3); font-variant-numeric: tabular-nums; }
.toy__ctrl { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; min-height: 38px; }
.toy__ctrl label { flex: 1; display: grid; gap: 6px; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.toy__ctrl label b { font-weight: 400; color: var(--fg); margin-left: 6px; }
.toy__ctrl--static { font: 400 11px/1 var(--mono); color: var(--fg-4); }
.toy h4 { margin-top: 14px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.toy > p { margin-top: 4px; font-size: 14px; color: var(--fg-3); line-height: 1.5; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line-3); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-3); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--fg); border: 0; transition: background-color 0.2s; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--fg); border: 0; }
input[type="range"]:hover::-webkit-slider-thumb { background: var(--accent); }

.toy__prompt { font: 400 13px/1.5 var(--mono); color: var(--fg-2); }
.toy__blank { color: var(--accent); border-bottom: 1px dashed rgba(var(--accent-rgb), 0.5); transition: color 0.2s; }
.toy__bars { display: grid; gap: 5px; }
.bar { display: grid; grid-template-columns: 110px 1fr 38px; gap: 8px; align-items: center; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.bar__track { height: 6px; border-radius: 6px; background: rgba(var(--w-rgb), 0.05); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 6px; background: var(--fg-3); transition: width 0.3s var(--ease), background-color 0.2s; }
.bar.is-top .bar__fill { background: var(--accent); }
.bar.is-picked { color: var(--fg); }
.bar b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; }

.toy__sent { display: flex; flex-wrap: wrap; gap: 6px; font: 400 14px/1 var(--mono); }
.toy__sent span {
  padding: 7px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--fg-2);
  cursor: default; transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.toy__sent span.is-q { border-color: var(--accent); color: var(--fg); }
.toy__sent span.is-masked { opacity: 0.3; }
.toy__hint { font: 400 11px/1.4 var(--mono); color: var(--fg-4); min-height: 16px; }

/* nav palette trigger */
.nav__cmd { display: inline-flex; gap: 3px; align-items: center; height: 34px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); transition: border-color 0.2s; }
.nav__cmd:hover { border-color: var(--line-3); }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--bg-2); font: 400 10px/1 var(--mono); color: var(--fg-2); }
.mobile-menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 12px; font-size: 20px; letter-spacing: -0.02em; color: var(--fg-2); text-align: left; }
.mobile-menu button span { font: 400 11px/1 var(--mono); color: var(--accent); }

/* command palette */
.cmdk { position: fixed; inset: 0; z-index: 150; display: grid; place-items: start center; padding: 14vh 16px 16px; }
.cmdk[hidden] { display: none; }
.cmdk__backdrop { position: absolute; inset: 0; background: rgba(5, 5, 4, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade 0.15s; }
.cmdk__panel {
  position: relative; width: 100%; max-width: 600px;
  border-radius: 16px; border: 1px solid var(--line-2); background: rgba(16, 16, 15, 0.96);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden; animation: pop 0.18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.99); } }
.cmdk__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line); font: 400 16px/1 var(--mono); color: var(--accent); }
.cmdk__input input { flex: 1; height: 100%; background: none; border: 0; outline: none; color: var(--fg); font: 400 15px/1 var(--sans); }
.cmdk__input input::placeholder { color: var(--fg-4); }
.cmdk__list { max-height: min(52vh, 420px); overflow-y: auto; padding: 6px; }
.cmdk__group { padding: 10px 10px 6px; font: 400 11px/1 var(--mono); color: var(--fg-4); }
.cmdk__item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 9px; font-size: 14.5px; color: var(--fg-2); cursor: pointer; }
.cmdk__item small { font: 400 11px/1 var(--mono); color: var(--fg-4); white-space: nowrap; }
.cmdk__item[aria-selected="true"] { background: rgba(var(--w-rgb), 0.06); color: var(--fg); }
.cmdk__item[aria-selected="true"] small { color: var(--accent); }
.cmdk__empty { padding: 28px 12px; text-align: center; font-size: 14px; color: var(--fg-3); }
.cmdk__foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font: 400 11px/1 var(--mono); color: var(--fg-4); }
.cmdk__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* contact time line */
.contact__time { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; font: 400 13px/1.4 var(--mono); color: var(--fg-3); }
.contact__time b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }

/* binary cursor trail (assets/js/trail.js); below the palette, above the page */
.cursor-trail { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 95; }

/* quote row after Writing: same hairline language as the lists above */
.quote {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: baseline;
  margin-top: 88px; padding: 26px 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
}
.quote__mark { font-size: 34px; line-height: 0.5; color: var(--accent); transform: translateY(9px); }
.quote__text {
  margin: 0; max-width: 40em;
  font-size: 20px; font-weight: 400; line-height: 1.45; letter-spacing: -0.015em; color: var(--fg);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.quote__by { display: inline-flex; align-items: center; gap: 12px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); white-space: nowrap; }
[data-quote-by] { display: inline-block; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.quote__by .mine { color: var(--accent); }
.quote__next {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--fg-3);
  font: 400 11px/1 var(--mono);
  transition: color 0.2s, border-color 0.2s;
}
.quote__next span { display: inline-block; transition: transform 0.4s var(--ease); }
.quote__next:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }
.quote__next:hover span { transform: rotate(180deg); }
.quote.is-swapping .quote__text, .quote.is-swapping [data-quote-by] { opacity: 0; transform: translateY(4px); }

/* signature: writes itself when the footer comes into view */
.sig { display: block; width: 260px; height: auto; overflow: visible; margin: -18px 0 -8px -6px; }
.sig__text { font-family: 'Mrs Saint Delafield', cursive; font-size: 66px; fill: var(--fg); stroke: var(--fg); stroke-width: 0.6; }
.sig__pen { transition: width 2.4s cubic-bezier(0.45, 0.05, 0.25, 1); }
.sig__flourish { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; opacity: 0.85; transition: stroke-dashoffset 0.9s var(--ease) 2.2s; }
.sig.is-signed .sig__pen { width: 330px; }
.sig.is-signed .sig__flourish { stroke-dashoffset: 0; }
.no-js .sig__pen { width: 330px; }
.visits b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* footer sitemap */
.footer__cmd { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/1 var(--mono); }
.footer__cmd:hover { color: var(--fg); }
.footer__cmd .on-kbd { display: inline-flex; align-items: center; gap: 6px; }
.footer__cmd .on-touch { display: none; }
@media (hover: none) { .footer__cmd .on-kbd { display: none; } .footer__cmd .on-touch { display: inline; } }

/* ==========================================================================
   Reach (quiet) + showcase: speculative decoding
   ========================================================================== */
.facts__sub { display: block; margin-top: 3px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.writing__stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 56px; padding: 22px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.writing__stats span { display: flex; flex-direction: column; gap: 8px; padding-right: 20px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.writing__stats span + span { padding-left: 24px; border-left: 1px solid var(--line); }
.writing__stats b { font-family: var(--sans); font-size: 26px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; color: var(--fg); font-variant-numeric: tabular-nums; }
.writing__stats span:nth-child(2) b { color: var(--accent); }
.textlink__meta { color: var(--fg-3); font-weight: 400; }
.textlink:hover .textlink__meta { color: inherit; }

/* speculative decoding */
.spec {
  margin-bottom: 20px; padding: 26px 28px 22px;
  border-radius: 16px; border: 1px solid var(--line-2);
  background: var(--shippo) 0 0 / 28px 28px, rgba(0, 0, 0, 0.22);
}
.spec__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.spec__head h4 { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.spec__tag { font: 400 11px/1 var(--mono); color: var(--accent); }
.spec__head p { margin-top: 6px; max-width: 46em; font-size: 14.5px; line-height: 1.55; color: var(--fg-3); }
.spec__head p b { color: var(--fg); font-weight: 500; }
.spec__out {
  min-height: 92px; margin: 22px 0 18px; padding: 16px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 400 17px/2 var(--mono); color: var(--fg-2);
  display: flex; flex-wrap: wrap; align-content: flex-start; white-space: pre;
}
.tk { border-radius: 4px; transition: background-color 0.2s, color 0.2s, opacity 0.25s; }
.tk.is-draft { color: var(--fg-3); background: rgba(var(--w-rgb), 0.05); outline: 1px dashed var(--line-3); outline-offset: -1px; }
.tk.is-ok { color: var(--accent-ink); background: var(--accent); }
.tk.is-bad { color: var(--accent-3); background: rgba(var(--accent-3-rgb), 0.12); text-decoration: line-through; }
.tk.is-dropped { opacity: 0.2; }
.tk.is-fix { color: var(--bg); background: var(--fg); }
.tk.is-free { color: var(--fg); box-shadow: inset 0 -2px 0 rgba(var(--accent-rgb), 0.7); border-radius: 0; }
.tk.is-target { color: var(--fg-2); }
.spec__bottom { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px 40px; align-items: end; }
.spec__ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.spec__ctrl label { display: grid; gap: 6px; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.spec__ctrl label b { font-weight: 400; color: var(--fg); margin-left: 6px; }
.spec__stats { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid var(--line); }
.spec__stats div { padding: 0 14px; border-right: 1px solid var(--line); }
.spec__stats dt { font: 400 10.5px/1.3 var(--mono); color: var(--fg-3); min-height: 28px; }
.spec__stats dd { margin-top: 6px; font-size: 22px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.spec__stats div:last-child dd { color: var(--accent); }
.spec__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; font: 400 11px/1 var(--mono); color: var(--fg-3); }
.spec__legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px; border-radius: 3px; }
.k-draft::before { outline: 1px dashed var(--line-3); outline-offset: -1px; background: rgba(var(--w-rgb), 0.05); }
.k-ok::before { background: var(--accent); }
.k-bad::before { background: rgba(var(--accent-3-rgb), 0.55); }
.k-fix::before { background: var(--fg); }

/* ==========================================================================
   Writing: latest row + private publishing panel (assets/js/publish.js)
   ========================================================================== */
.writing__links { display: inline-flex; align-items: center; gap: 18px; }
.writing__add {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px dashed rgba(var(--accent-rgb), 0.45); color: var(--accent);
  font: 400 12px/1 var(--mono); transition: background-color 0.2s, border-color 0.2s;
}
.writing__add:hover { background: rgba(var(--accent-rgb), 0.08); border-style: solid; }
.writing__add[hidden] { display: none; }

.latest { margin: 0 0 48px; }
.latest__row {
  position: relative;
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto 20px; gap: 24px; align-items: baseline;
  padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
}
.latest__row::before {
  content: ''; position: absolute; inset: -1px -16px; border-radius: 10px;
  background: rgba(var(--w-rgb), 0.03); opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.latest__row:hover::before { opacity: 1; }
.latest__k { display: inline-flex; align-items: center; gap: 8px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); white-space: nowrap; }
.latest__k b { font-weight: 400; color: var(--accent); }
.latest__k i { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-4); }
.latest__main { display: grid; gap: 6px; }
.latest__t { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; transition: color 0.2s; }
.latest__note { font-size: 15px; line-height: 1.55; color: var(--fg-2); max-width: 44em; }
.latest__where { font: 400 12px/1.4 var(--mono); color: var(--fg-3); white-space: nowrap; }
.latest__go { color: var(--fg-4); justify-self: end; transition: color 0.2s, transform 0.2s var(--ease); }
.latest__row:hover .latest__t, .latest__row:hover .latest__go { color: var(--accent); }
.latest__row:hover .latest__go { transform: translate(2px, -2px); }

.publish {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; margin: auto; overflow: auto;
  border-radius: 16px; border: 1px solid var(--line-2);
  background: rgba(16, 16, 15, 0.97); color: var(--fg);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}
.publish[open] { animation: pop 0.18s var(--ease); }
.publish::backdrop { background: rgba(5, 5, 4, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.publish__panel { display: grid; }
.publish__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.publish__head h2 { margin-top: 6px; font-size: 21px; font-weight: 500; letter-spacing: -0.02em; }
.publish__k { font: 400 11px/1.3 var(--mono); color: var(--fg-3); }
.publish__x { padding: 4px; }
.publish__body { display: grid; gap: 14px; padding: 20px 22px 6px; }
.publish__body[hidden] { display: none; }
.publish__hint { margin-top: -4px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field { display: grid; gap: 7px; }
.field[hidden] { display: none; }
.field > span { font: 400 11px/1 var(--mono); color: var(--fg-3); }
.field em { font-style: normal; color: var(--fg-4); margin-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: rgba(var(--w-rgb), 0.025); color: var(--fg);
  font: 400 15px/1.4 var(--sans); outline: none; transition: border-color 0.2s, background-color 0.2s;
  color-scheme: dark;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-4); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--w-rgb), 0.04); }
.field select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.publish__list { margin: 14px 22px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.publish__list ul { margin-top: 8px; display: grid; }
.publish__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.publish__list li.is-editing .publish__item b { color: var(--accent); }
.publish__item { display: grid; gap: 2px; min-width: 0; }
.publish__item b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.publish__item small { font: 400 11px/1.3 var(--mono); color: var(--fg-3); }
.publish__list button { padding: 5px 9px; border-radius: 7px; font: 400 11px/1 var(--mono); color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.publish__list button:hover { color: var(--fg); background: rgba(var(--w-rgb), 0.05); }
.publish__list button[data-armed="1"] { color: var(--accent-3); }
.publish__foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 22px 20px; margin-top: 12px; border-top: 1px solid var(--line); }
.publish__foot [hidden] { display: none; }
.publish__msg { flex: 1; min-width: 0; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.publish__msg[data-kind="ok"] { color: var(--accent); }
.publish__msg[data-kind="err"] { color: var(--accent-3); }
.publish button:disabled { opacity: 0.5; cursor: progress; }

/* ==========================================================================
   Chapters: counts on the tags, git-log highlights, the "Right now" strip,
   the Work index and the Writing library
   ========================================================================== */
.tag__n { font-style: normal; color: var(--fg-3); }
.tag__n b { font-weight: 400; color: var(--fg-2); }
.tag__n::before { content: '·'; margin-right: 12px; color: var(--fg-4); }

/* highlights, as a git log */
.hl__cmd { font: 400 12px/1 var(--mono); color: var(--fg-4); }
.gitlog { border-top: 1px solid var(--line-2); }
.gitlog li[data-more] { display: none; }
.gitlog.is-all li[data-more] { display: block; animation: logIn 0.45s var(--ease) both; }
@keyframes logIn { from { opacity: 0; transform: translateY(-4px); } }
.hl__hash { padding: 0; border: 0; background: none; font: 400 12px/1 var(--mono); color: var(--accent); letter-spacing: 0.02em; }
.hl__msg i { margin-right: 4px; font: 400 12.5px/1 var(--mono); font-style: normal; color: var(--fg-3); }
.gitlog__more, .shelf__more {
  margin-top: 14px; padding: 8px 13px; border-radius: 999px;
  border: 1px dashed var(--line-3); font: 400 12px/1 var(--mono); color: var(--fg-3);
  transition: color 0.2s, border-color 0.2s;
}
.gitlog__more:hover, .shelf__more:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.5); }

/* right now */
.now { margin-top: 88px; }
.now__note { font: 400 12px/1 var(--mono); color: var(--fg-3); }
.now__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.now__cell { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 20px 22px 22px 0; }
.now__cell + .now__cell { padding-left: 22px; border-left: 1px solid var(--line); }
.now__cell[hidden] { display: none; }
.now__k { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.now__k b { font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.now__v { font-size: 16px; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; color: var(--fg); overflow-wrap: anywhere; transition: color 0.2s; }
.now__sub { font-size: 13.5px; color: var(--fg-3); }
a.now__cell:hover .now__v { color: var(--accent); }
.now__song { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.now__art { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.now__songmeta { display: grid; gap: 2px; min-width: 0; }
.now__songmeta > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now__status { display: inline-flex; align-items: center; }
#spotify.is-live .now__status { color: var(--accent); }

/* filter chips, shared by Work and Writing */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2);
  font: 400 12.5px/1 var(--mono); color: var(--fg-3); white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.chips button i { font-style: normal; color: var(--fg-4); transition: color 0.2s; }
.chips button:hover { color: var(--fg); border-color: var(--line-3); }
.chips button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chips button[aria-pressed="true"] i { color: rgba(23, 18, 10, 0.55); }

/* work: one index, rows open in place */
.works .chips { margin-bottom: 16px; }
.wx__list { border-top: 1px solid var(--line-2); }
.wx { border-bottom: 1px solid var(--line); }
.wx[hidden] { display: none; }
.wx__row { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr) auto 14px; gap: 24px; align-items: baseline; width: 100%; padding: 18px 0; text-align: left; }
.wx__row::before { content: ''; position: absolute; inset: -1px -16px; border-radius: 10px; background: rgba(var(--w-rgb), 0.03); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.wx__row:hover::before { opacity: 1; }
.wx__name { font-size: 17px; font-weight: 500; letter-spacing: -0.015em; transition: color 0.2s; }
.wx__row:hover .wx__name, .wx.is-open .wx__name { color: var(--accent); }
.wx__q { font-size: 15px; line-height: 1.5; color: var(--fg-2); }
.wx__stat { font: 400 12px/1.4 var(--mono); color: var(--fg-3); text-align: right; white-space: nowrap; }
.wx__chev { position: relative; width: 12px; height: 12px; align-self: center; justify-self: end; }
.wx__chev::before, .wx__chev::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--fg-3); transition: transform 0.35s var(--ease), background-color 0.2s; }
.wx__chev::after { transform: rotate(90deg); }
.wx.is-open .wx__chev::after { transform: rotate(0deg); }
.wx__row:hover .wx__chev::before, .wx__row:hover .wx__chev::after { background: var(--accent); }
.wx__body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.4s var(--ease), visibility 0s 0.4s; }
.wx.is-open .wx__body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.4s var(--ease); }
.wx__inner { min-height: 0; overflow: hidden; padding-left: 224px; }
.wx__text { max-width: 46em; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.wx__meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font: 400 12px/1.5 var(--mono); color: var(--fg-3); }
.wx__cat { color: var(--accent); }
.wx__links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 20px; }

/* writing: the library */
.lib__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; margin-bottom: 26px; }
.lib__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lib__search, .lib__sort {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); transition: border-color 0.2s;
}
.lib__search { font: 400 13px/1 var(--mono); color: var(--accent); }
.lib__search:focus-within, .lib__sort:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.lib__search input { width: 140px; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font: 400 13.5px/1 var(--sans); }
.lib__search input::placeholder { color: var(--fg-4); }
.lib__sortk { font: 400 12px/1 var(--mono); color: var(--fg-4); }
.lib__sort select { appearance: none; -webkit-appearance: none; background: none; border: 0; outline: none; color: var(--fg); font: 400 12.5px/1 var(--mono); cursor: pointer; }
.lib__sort option { background: var(--bg-2); color: var(--fg); }
.shelf + .shelf { margin-top: 36px; }
.shelf__h { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.shelf__h .series__meta { font: 400 12px/1 var(--mono); color: var(--fg-3); white-space: nowrap; }
.shelf.is-flat { border-top: 1px solid var(--line-2); }
.art { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 64px 132px 14px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--fg-2); transition: color 0.2s; }
.is-flat .art { grid-template-columns: 52px minmax(0, 1fr) 150px 64px 132px 14px; }
.art::before { content: ''; position: absolute; inset: -1px -16px; border-radius: 10px; background: rgba(var(--w-rgb), 0.03); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.art:hover { color: var(--fg); }
.art:hover::before { opacity: 1; }
.art__n { font: 400 11px/1 var(--mono); color: var(--fg-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art:hover .art__n { color: var(--accent); }
.art__t { line-height: 1.4; }
.art__flag { display: inline-block; margin-left: 10px; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-2); font: 400 10.5px/1 var(--mono); font-style: normal; color: var(--fg-3); vertical-align: 2px; white-space: nowrap; }
.art__flag.is-new { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.45); }
.art__s { font: 400 12px/1.3 var(--mono); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art__d { font: 400 12px/1 var(--mono); color: var(--fg-3); white-space: nowrap; text-align: right; }
.art__v { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 10px; align-items: center; }
.art__v i { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.8) calc(var(--w) * 100%), rgba(var(--w-rgb), 0.06) 0); }
.art__v b { font: 400 11.5px/1 var(--mono); color: var(--fg-3); text-align: right; font-variant-numeric: tabular-nums; }
.art__go { justify-self: end; color: var(--fg-4); transition: color 0.2s, transform 0.2s var(--ease); }
.art:hover .art__go { color: var(--accent); transform: translate(2px, -2px); }
.lib__empty { padding: 28px 0; border-top: 1px solid var(--line-2); color: var(--fg-3); }
.lib__empty button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.lib__foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ==========================================================================
   The playful layer (assets/js/fun.js)
   ========================================================================== */
/* precision slider under the portrait */
.quant { display: grid; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.quant__k { display: flex; justify-content: space-between; font: 400 10.5px/1 var(--mono); color: var(--fg-3); }
.quant__k b { font-weight: 400; color: var(--accent); }
.quant input { height: 14px; }
.quant__note { font: 400 10.5px/1.35 var(--mono); color: var(--fg-3); min-height: 14px; }

/* temperature dial over the About paragraphs */
.temp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 22px; }
.temp__k { font: 400 12px/1 var(--mono); color: var(--fg-3); }
.temp__opts { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.temp__opts button { display: inline-flex; align-items: baseline; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font: 400 12px/28px var(--mono); color: var(--fg-3); transition: color 0.2s, background-color 0.2s; }
.temp__opts button small { font-size: 10.5px; color: var(--fg-4); transition: color 0.2s; }
.temp__opts button:hover { color: var(--fg); }
.temp__opts button[aria-checked="true"] { background: rgba(var(--w-rgb), 0.07); color: var(--fg); }
.temp__opts button[aria-checked="true"] small { color: var(--accent); }
[data-temp-p] { transition: opacity 0.22s var(--ease), filter 0.22s var(--ease); }
[data-temp-p].is-resampling { opacity: 0; filter: blur(3px); }

/* reading meter in the nav: chapters in the KV cache + tokens decoded */
.nav__status { cursor: help; }
.kvm { display: inline-flex; gap: 2px; }
.kvm i { width: 5px; height: 9px; border-radius: 1px; border: 1px solid var(--line-3); transition: background-color 0.4s, border-color 0.4s; }
.kvm i.is-on { background: var(--accent); border-color: var(--accent); }
.kvm i.is-hit { animation: kvHit 0.7s var(--ease); }
@keyframes kvHit { 0% { background: var(--fg); border-color: var(--fg); } }
.nav__tok b { display: inline-block; min-width: 4ch; text-align: right; font-weight: 400; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.kv-sum { color: var(--fg-3); }


/* lab: tokenizer */
.tokz { margin-top: 20px; padding: 24px 28px 22px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--shippo) 0 0 / 28px 28px, rgba(0, 0, 0, 0.22); }
.tokz__head h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.tokz__head p { margin-top: 6px; max-width: 48em; font-size: 14.5px; line-height: 1.55; color: var(--fg-3); }
.tokz__in { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 0 14px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(var(--w-rgb), 0.02); font: 400 16px/1 var(--mono); color: var(--accent); transition: border-color 0.2s; }
.tokz__in:focus-within { border-color: rgba(var(--accent-rgb), 0.5); }
.tokz__in input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; color: var(--fg); font: 400 15px/1 var(--sans); }
.tokz__out { display: flex; flex-wrap: wrap; gap: 3px; min-height: 40px; margin: 16px 0 14px; font: 400 15px/1.9 var(--mono); white-space: pre; }
.tokz__out span { padding: 0 3px; border-radius: 4px; color: var(--fg); }
.tokz__out span:nth-child(odd) { background: rgba(var(--accent-rgb), 0.18); }
.tokz__out span:nth-child(even) { background: rgba(var(--w-rgb), 0.08); }
.tokz__out i { font-style: normal; color: var(--fg-4); }
.tokz__stats { display: flex; flex-wrap: wrap; gap: 6px 22px; font: 400 12px/1.4 var(--mono); color: var(--fg-3); }
.tokz__stats b { font-weight: 400; color: var(--fg); font-variant-numeric: tabular-nums; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 160; transform: translate(-50%, 12px);
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(16, 16, 15, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 400 12.5px/1.3 var(--mono); color: var(--fg-2); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast b { font-weight: 500; color: var(--accent); }

/* backtick terminal */
.tx {
  position: fixed; left: 50%; bottom: 24px; z-index: 155; transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px)); border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(12, 12, 11, 0.97); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  font: 400 13px/1.6 var(--mono); color: var(--fg-2); animation: pop 0.18s var(--ease);
}
.tx[hidden] { display: none; }
.tx__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.tx__bar span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); }
.tx__out { max-height: min(46vh, 340px); overflow-y: auto; padding: 12px 14px 4px; }
.tx__l { overflow-wrap: anywhere; }
.tx__l + .tx__l { margin-top: 4px; }
.tx__l b { font-weight: 500; color: var(--fg); }
.tx__l a { color: var(--fg); border-bottom: 1px solid var(--line-3); }
.tx__l a:hover { color: var(--accent); }
.tx__l.is-err { color: var(--accent-3); }
.tx__l.is-ok { color: var(--accent); }
.tx__dim { color: var(--fg-3); }
.tx__p { color: var(--accent); }
.tx__in { display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px; }
.tx__in input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--fg); font: inherit; }

/* Konami: debug mode outlines every chapter and labels what it costs */
.debug main > section { outline: 1px dashed rgba(var(--accent-rgb), 0.55); outline-offset: -1px; }
.debug main > section::after {
  content: attr(data-debug); position: absolute; top: 8px; right: 8px; z-index: 5;
  padding: 4px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  font: 400 11px/1.2 var(--mono);
}
.debug .wrap { outline: 1px dotted rgba(var(--w-rgb), 0.18); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1040px) {
  .nav__status { display: none; }
  .wx__row { grid-template-columns: 170px minmax(0, 1fr) 14px; }
  .wx__stat { display: none; }
  .wx__inner { padding-left: 194px; }
  .art, .is-flat .art { grid-template-columns: 44px minmax(0, 1fr) 64px 110px 14px; }
  .art__s { display: none; }
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__title { font-size: clamp(40px, 6.4vw, 60px); }
  .portrait { justify-self: start; }
  .feature { grid-template-columns: 1fr; }
  .feature--flip .feature__info { order: 0; }
  .feature__viz, .feature--flip .feature__viz { border: 0; border-top: 1px solid var(--line); }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .info { max-width: 520px; }
    .lab__grid { grid-template-columns: 1fr 1fr; }
  .spec__bottom { grid-template-columns: 1fr; }
  }

@media (max-width: 880px) {
  .nav__links, .nav__status, .nav__cmd { display: none; }
  .nav__toggle { display: inline-block; }
  .nav__capsule { width: 100%; justify-content: space-between; padding: 0 6px 0 14px; }
  .brand { border-right: 0; }
  .role { grid-template-columns: 1fr; gap: 8px; padding: 30px 0 30px 24px; }
  .role__dot { left: 0; top: 38px; }
  .honors { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 680px) {
  .elsewhere { font-size: 17px; margin-top: 56px; }
  .outro { grid-template-columns: 1fr; gap: 8px; padding-top: 48px; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 7px; }
  .footer__inner > * + *:not([hidden])::before { display: none; }
  .tokz { padding: 22px 18px 18px; }
  .temp__opts button small { display: none; }
  .wx__row { grid-template-columns: minmax(0, 1fr) 14px; gap: 6px 12px; }
  .wx__q { grid-column: 1; }
  .wx__chev { grid-column: 2; grid-row: 1; }
  .wx__inner { padding-left: 0; }
  .art, .is-flat .art { grid-template-columns: 34px minmax(0, 1fr) 40px 14px; gap: 10px; }
  .art__d { display: none; }
  .art__v { grid-template-columns: 1fr; }
  .art__v i { display: none; }
  .lib__tools { width: 100%; }
  .lib__search { flex: 1; }
  .lib__search input { width: 100%; }
  .hl { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .hl em, .hl__cmd { display: none; }
  .now__cell, .now__cell + .now__cell { padding: 18px 0; border-left: 0; }
  .now__cell + .now__cell { border-top: 1px solid var(--line); }
  .shelf__h { flex-direction: column; gap: 6px; }
  :root { --pad: 20px; }
  .section { padding: 88px 0; }
  .shead { margin-bottom: 40px; }
  .hero { padding-top: 112px; }
  .hero__title { font-size: clamp(34px, 10vw, 48px); }
  .hero__title .line { white-space: normal; }
  .portrait { max-width: 210px; }
  .loss > span { display: none; }
  .status-pill { white-space: nowrap; font-size: 12px; gap: 8px; padding: 0 12px 0 10px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 20px 0; margin-top: 56px; }
  .feature__info { padding: 28px 22px; }
  .feature__viz { padding: 20px 18px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .metrics > div:nth-child(2) { padding-left: 0; border-left: 0; }
  .stack__row { grid-template-columns: 1fr; gap: 10px; }
  .mail .btn { flex: 1 1 100%; justify-content: space-between; }
  .mail .btn--lg { font-size: 14px; }
  .lab__grid { grid-template-columns: 1fr; }
  .ask__note { text-align: left; }
  .ask__lineage { grid-template-columns: 1fr; }
  .ask__lineage > span { grid-row: auto; }
  .ask .index__caption { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ask__why { grid-template-columns: 1fr; gap: 16px; }
  .ask__hits button { grid-template-columns: 40px minmax(0, 1fr); }
  .ask__snip { display: none; }
  .ask__answer { font-size: 17px; }
  .writing__stats { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .latest__row { grid-template-columns: minmax(0, 1fr) 20px; gap: 8px 12px; }
  .latest__k, .latest__main, .latest__where { grid-column: 1; }
  .latest__go { grid-column: 2; grid-row: 1; }
  .writing .index__caption { flex-wrap: wrap; }
  .writing__stats span:nth-child(3) { padding-left: 0; border-left: 0; }
  .writing__stats b { font-size: 22px; }
  .sig { width: 220px; }
  .spec { padding: 22px 18px 18px; }
  .spec__head { flex-direction: column; gap: 14px; }
  .spec__out { font-size: 15px; }
  .spec__ctrl { grid-template-columns: 1fr; }
  .spec__stats { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .hl { font-size: 14.5px; }
    .cmdk { padding-top: 10vh; }
  .quote { grid-template-columns: auto 1fr; margin-top: 64px; }
  .quote__by { grid-column: 2; white-space: normal; }
  .quote__text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   夕暮れの村: the Japan layer. Hero painting (assets/js/scene.js), seasons
   (season.js), sound (ambience.js), seals, the hanging scroll and the ending.
   ========================================================================== */
:root {
  --shippo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' stroke='rgb(236,228,210)' stroke-opacity='0.05'%3E%3Ccircle cx='0' cy='0' r='14'/%3E%3Ccircle cx='28' cy='0' r='14'/%3E%3Ccircle cx='0' cy='28' r='14'/%3E%3Ccircle cx='28' cy='28' r='14'/%3E%3Ccircle cx='14' cy='14' r='14'/%3E%3C/svg%3E");
  --emblem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M12.3 21.0 L8.0 18.6 L12.8 18.2 L18.6 18.8 L13.8 12.5 L11.6 7.2 L16.4 10.3 L21.8 16.1 L22.2 7.0 L24.0 1.0 L25.8 7.0 L26.2 16.1 L31.6 10.3 L36.4 7.2 L34.2 12.5 L29.4 18.8 L35.2 18.2 L40.0 18.6 L35.7 21.0 L30.2 23.0 L31.0 25.0 L33.1 27.2 L30.0 26.5 L24.0 28.3 L18.0 26.5 L14.9 27.2 L17.0 25.0 L17.8 23.0Z M24 28 L25 45 L23 45Z'/%3E%3C/svg%3E");
}
[data-season="spring"] { --emblem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath transform='translate(24 24) rotate(0) translate(0 -12) scale(9)' d='M0 1 C-0.5 0.6 -0.78 -0.3 -0.46 -0.9 Q-0.2 -1.06 0 -0.7 Q0.2 -1.06 0.46 -0.9 C0.78 -0.3 0.5 0.6 0 1Z'/%3E%3Cpath transform='translate(24 24) rotate(72) translate(0 -12) scale(9)' d='M0 1 C-0.5 0.6 -0.78 -0.3 -0.46 -0.9 Q-0.2 -1.06 0 -0.7 Q0.2 -1.06 0.46 -0.9 C0.78 -0.3 0.5 0.6 0 1Z'/%3E%3Cpath transform='translate(24 24) rotate(144) translate(0 -12) scale(9)' d='M0 1 C-0.5 0.6 -0.78 -0.3 -0.46 -0.9 Q-0.2 -1.06 0 -0.7 Q0.2 -1.06 0.46 -0.9 C0.78 -0.3 0.5 0.6 0 1Z'/%3E%3Cpath transform='translate(24 24) rotate(216) translate(0 -12) scale(9)' d='M0 1 C-0.5 0.6 -0.78 -0.3 -0.46 -0.9 Q-0.2 -1.06 0 -0.7 Q0.2 -1.06 0.46 -0.9 C0.78 -0.3 0.5 0.6 0 1Z'/%3E%3Cpath transform='translate(24 24) rotate(288) translate(0 -12) scale(9)' d='M0 1 C-0.5 0.6 -0.78 -0.3 -0.46 -0.9 Q-0.2 -1.06 0 -0.7 Q0.2 -1.06 0.46 -0.9 C0.78 -0.3 0.5 0.6 0 1Z'/%3E%3C/svg%3E"); }
[data-season="summer"] { --emblem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='2.6'%3E%3Cpath d='M4 40 A20 20 0 0 1 44 40'/%3E%3Cpath d='M10 40 A14 14 0 0 1 38 40'/%3E%3Cpath d='M16 40 A8 8 0 0 1 32 40'/%3E%3Ccircle cx='24' cy='40' r='3' fill='black' stroke='none'/%3E%3C/svg%3E"); }
[data-season="autumn"] { --emblem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M12.3 21.0 L8.0 18.6 L12.8 18.2 L18.6 18.8 L13.8 12.5 L11.6 7.2 L16.4 10.3 L21.8 16.1 L22.2 7.0 L24.0 1.0 L25.8 7.0 L26.2 16.1 L31.6 10.3 L36.4 7.2 L34.2 12.5 L29.4 18.8 L35.2 18.2 L40.0 18.6 L35.7 21.0 L30.2 23.0 L31.0 25.0 L33.1 27.2 L30.0 26.5 L24.0 28.3 L18.0 26.5 L14.9 27.2 L17.0 25.0 L17.8 23.0Z M24 28 L25 45 L23 45Z'/%3E%3C/svg%3E"); }
[data-season="winter"] { --emblem: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' stroke='black' stroke-width='2.4' stroke-linecap='round' fill='none'%3E%3Cline x1='24' y1='24' x2='44.0' y2='24.0'/%3E%3Cline x1='35.0' y1='24.0' x2='38.9' y2='19.4'/%3E%3Cline x1='35.0' y1='24.0' x2='38.9' y2='28.6'/%3E%3Cline x1='40.0' y1='24.0' x2='42.6' y2='20.9'/%3E%3Cline x1='40.0' y1='24.0' x2='42.6' y2='27.1'/%3E%3Cline x1='24' y1='24' x2='34.0' y2='41.3'/%3E%3Cline x1='29.5' y1='33.5' x2='35.4' y2='34.6'/%3E%3Cline x1='29.5' y1='33.5' x2='27.4' y2='39.2'/%3E%3Cline x1='32.0' y1='37.9' x2='35.9' y2='38.6'/%3E%3Cline x1='32.0' y1='37.9' x2='30.6' y2='41.6'/%3E%3Cline x1='24' y1='24' x2='14.0' y2='41.3'/%3E%3Cline x1='18.5' y1='33.5' x2='20.6' y2='39.2'/%3E%3Cline x1='18.5' y1='33.5' x2='12.6' y2='34.6'/%3E%3Cline x1='16.0' y1='37.9' x2='17.4' y2='41.6'/%3E%3Cline x1='16.0' y1='37.9' x2='12.1' y2='38.6'/%3E%3Cline x1='24' y1='24' x2='4.0' y2='24.0'/%3E%3Cline x1='13.0' y1='24.0' x2='9.1' y2='28.6'/%3E%3Cline x1='13.0' y1='24.0' x2='9.1' y2='19.4'/%3E%3Cline x1='8.0' y1='24.0' x2='5.4' y2='27.1'/%3E%3Cline x1='8.0' y1='24.0' x2='5.4' y2='20.9'/%3E%3Cline x1='24' y1='24' x2='14.0' y2='6.7'/%3E%3Cline x1='18.5' y1='14.5' x2='12.6' y2='13.4'/%3E%3Cline x1='18.5' y1='14.5' x2='20.6' y2='8.8'/%3E%3Cline x1='16.0' y1='10.1' x2='12.1' y2='9.4'/%3E%3Cline x1='16.0' y1='10.1' x2='17.4' y2='6.4'/%3E%3Cline x1='24' y1='24' x2='34.0' y2='6.7'/%3E%3Cline x1='29.5' y1='14.5' x2='27.4' y2='8.8'/%3E%3Cline x1='29.5' y1='14.5' x2='35.4' y2='13.4'/%3E%3Cline x1='32.0' y1='10.1' x2='30.6' y2='6.4'/%3E%3Cline x1='32.0' y1='10.1' x2='35.9' y2='9.4'/%3E%3C/svg%3E"); }

/* the hero's night indigo settles into ink as you read, and back toward night for the ending */
html { background: linear-gradient(180deg, #0e1020 0, #0e1020 100vh, var(--bg) calc(100vh + 900px), var(--bg) calc(100% - 1200px), #0b0c14 100%) var(--bg); }
body { background: transparent; }
.inkwash { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
/* season colour glides instead of blinking */
@property --season { syntax: '<color>'; inherits: true; initial-value: #e0673e; }
:root { transition: --season 1.2s ease; }
.drift { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 3; }

/* type: mincho for everything that is a title, Geist for reading, mono for the machine */
.hero__title, .shead__title, .contact__title, .feature__name, .index__caption h3, .role h3,
.quote__text, .pond__t, .spec__head h4, .tokz__head h4, .toy h4, .latest__t, .shelf__h, .publish__head h2, .about__text > p:first-child, .wx__name {
  font-family: var(--serif); letter-spacing: -0.005em;
}
.shead__title { font-weight: 500; line-height: 1.22; font-size: clamp(30px, 3.6vw, 46px); }
.shead__title .dim { color: rgba(var(--fg-rgb), 0.46); }
.contact__title { font-weight: 500; line-height: 1.16; letter-spacing: -0.01em; }
.feature__name { font-weight: 600; letter-spacing: 0; }
.index__caption h3, .role h3 { font-weight: 600; letter-spacing: 0; }
.wx__name { font-weight: 600; font-size: 18px; }
.about__text > p:first-child { font-size: 22px; line-height: 1.6; letter-spacing: 0; }
.quote__text { font-size: 22px; line-height: 1.55; }
.quote__mark { font-family: var(--serif); color: var(--shu); }

/* seals: 判子, the only place vermilion shows up besides the torii */
.seal {
  display: inline-grid; place-items: center; flex: none;
  background: var(--shu); color: #fbefe0;
  font: 700 14px/1 var(--serif);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px rgba(251, 239, 224, 0.5), inset 0 0 0 3px var(--shu);
}
.tag { gap: 14px; }
.tag .seal { width: 28px; height: 28px; color: #fbefe0; transform: rotate(-4deg); }
.tag .seal::after { display: none; }
.tag__jp { font: 500 13px/1 var(--serif); font-style: normal; color: var(--fg-3); letter-spacing: 0.12em; }
.tag__jp::before { content: ''; display: inline-block; width: 18px; height: 1px; margin-right: 12px; vertical-align: middle; background: var(--line-3); }

/* each chapter has its kanji brushed faintly down the right edge */
.section[data-kanji]::before {
  content: attr(data-kanji);
  position: absolute; top: 88px; right: max(8px, calc((100vw - var(--max)) / 2 - 56px));
  font: 400 clamp(110px, 12vw, 200px)/1 var(--brush);
  color: rgba(var(--fg-rgb), 0.05);
  pointer-events: none; user-select: none;
}

/* chapter divider: a hairline with the season's crest in the middle */
.axon { background: linear-gradient(90deg, transparent, var(--line-3) 18%, var(--line-3) 82%, transparent); }
.axon::before { left: 50%; top: -12px; width: 44px; height: 24px; border: 0; border-radius: 0; transform: translateX(-50%); background: var(--bg); }
.axon::after {
  left: 50%; right: auto; top: -9px; width: 18px; height: 18px; border: 0; border-radius: 0; transform: translateX(-50%);
  background: var(--season);
  -webkit-mask: var(--emblem) center / contain no-repeat; mask: var(--emblem) center / contain no-repeat;
  opacity: 0.85; transition: background-color 0.6s;
}
.axon i { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.9)); }

/* textures: 七宝 (shippō) where there used to be a dot grid */
.feature__viz { background: var(--shippo) 0 0 / 28px 28px, rgba(0, 0, 0, 0.22); }
.toy__stage, .spec, .tokz { background: var(--shippo) 0 0 / 28px 28px, rgba(0, 0, 0, 0.2); }
.feature { background: linear-gradient(180deg, rgba(var(--w-rgb), 0.025), rgba(var(--w-rgb), 0.008)); }

/* nav: a lintel of washi-indigo glass, a crest, chapter kanji, lanterns for the reading meter */
.nav__capsule {
  position: relative; height: 52px; gap: 4px; border-radius: 14px;
  background: rgba(14, 16, 32, 0.52); border-color: rgba(var(--w-rgb), 0.1);
  box-shadow: 0 14px 34px -20px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(var(--accent-rgb), 0.12);
}
.nav__capsule::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.55) 20%, rgba(var(--accent-rgb), 0.55) 80%, transparent);
}
.nav.is-scrolled .nav__capsule { background: rgba(12, 14, 26, 0.88); }
.brand { gap: 10px; padding-right: 14px; font: 600 15px/1 var(--serif); letter-spacing: 0.01em; border-right-color: rgba(var(--w-rgb), 0.1); }
.brand__mark { width: 22px; height: 22px; transition: transform 0.6s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-12deg); }
.brand__mark .ring { fill: rgba(var(--shu-rgb), 0.08); stroke: var(--accent); stroke-width: 1; }
.brand__mark .torii * { fill: var(--shu); stroke: none; }
.nav__links { gap: 0; }
.nav__links a {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 11px; border-radius: 8px; background: none !important;
  font-size: 14px; color: var(--fg-3); transition: color 0.25s;
}
.nav__links a i { font: 500 12px/1 var(--serif); font-style: normal; color: rgba(var(--fg-rgb), 0.3); transition: color 0.25s; }
.nav__links a:hover, .nav__links a:hover i { color: var(--fg); }
.nav__links a.is-active { color: var(--fg); }
.nav__links a.is-active i { color: var(--shu); }
.nav__links a::after {
  content: ''; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px 1px rgba(var(--accent-rgb), 0.7);
  opacity: 0; transform: scale(0.4); transition: opacity 0.3s, transform 0.3s var(--ease);
}
.nav__links a.is-active::after { opacity: 1; transform: none; }

.nav__icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 9px; margin-left: 2px;
  border-radius: 9px; border: 1px solid rgba(var(--w-rgb), 0.08);
  font: 500 14px/1 var(--serif); color: var(--fg-2);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.nav__icon:hover { border-color: var(--line-3); color: var(--fg); }
.nav__season span { color: var(--season); transition: color 0.6s; }
.snd { display: none; align-items: flex-end; gap: 2px; height: 11px; }
.snd i { width: 2px; height: 100%; border-radius: 1px; background: var(--accent); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.snd i:nth-child(2) { animation-delay: -0.4s; }
.snd i:nth-child(3) { animation-delay: -0.75s; }
.nav__sound.is-on { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.08); color: var(--accent); }
.nav__sound.is-on .snd { display: inline-flex; }
.mobile-menu button[aria-pressed="true"] span { color: var(--fg); }

/* reading meter: one paper lantern per chapter, lit once it is in the cache */
.nav__status { height: 34px; padding: 0 11px; gap: 9px; border-radius: 9px; border-color: rgba(var(--w-rgb), 0.08); }
.kvm { gap: 4px; align-items: center; }
.kvm i {
  position: relative; width: 7px; height: 10px; border: 0; border-radius: 45% / 40%;
  background: rgba(var(--w-rgb), 0.12);
  box-shadow: inset 0 1.5px 0 rgba(8, 8, 16, 0.9), inset 0 -1.5px 0 rgba(8, 8, 16, 0.9);
  transition: background-color 0.5s, box-shadow 0.5s;
}
.kvm i.is-on {
  background: radial-gradient(ellipse at 50% 50%, #ffd9a0, #e07a3e 60%, #b8402c);
  box-shadow: inset 0 1.5px 0 rgba(8, 8, 16, 0.9), inset 0 -1.5px 0 rgba(8, 8, 16, 0.9), 0 0 7px rgba(255, 160, 80, 0.55);
}
.kvm i.is-hit { animation: kvLit 0.8s var(--ease); }
@keyframes kvLit { 0% { box-shadow: inset 0 1.5px 0 rgba(8, 8, 16, 0.9), inset 0 -1.5px 0 rgba(8, 8, 16, 0.9), 0 0 14px 3px rgba(255, 190, 110, 0.9); } }
.nav__tok { font-size: 11px; color: var(--fg-4); }
.nav__tok b { min-width: 3ch; color: var(--fg-3); }
.nav__cmd { height: 34px; padding: 0 8px; border-radius: 9px; border-color: rgba(var(--w-rgb), 0.08); }
.nav__cmd kbd { background: rgba(var(--w-rgb), 0.04); border-color: rgba(var(--w-rgb), 0.1); }
.nav__toggle { border-radius: 10px; }
.mobile-menu { border-radius: 16px; background: rgba(12, 14, 26, 0.96); }
.mobile-menu a { font-family: var(--serif); letter-spacing: 0; }
.mobile-menu a span, .mobile-menu button span { font: 500 13px/1 var(--serif); color: var(--shu); }

/* ---------- hero: the painting ---------- */
.hero { padding: 132px 0 40px; }
.hero__scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 11, 26, 0.6) 0%, rgba(10, 11, 26, 0.34) 36%, rgba(10, 11, 26, 0) 60%),
    linear-gradient(180deg, rgba(12, 14, 25, 0) 64%, rgba(12, 14, 25, 0.6) 86%, #0e1020 100%);
}
.hero__grid { grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: start; }
.hero__copy { max-width: 680px; text-shadow: 0 1px 22px rgba(8, 9, 22, 0.55); }
.hero__title { font-weight: 600; font-size: clamp(40px, 4.4vw, 66px); line-height: 1.12; letter-spacing: -0.012em; }
.hero__prompt { color: rgba(var(--fg-rgb), 0.55); }
.hero__gen { color: rgba(var(--fg-rgb), 0.52); }
.hero__lede { color: rgba(var(--fg-rgb), 0.8); }
.status-pill { background: rgba(12, 14, 30, 0.5); }
.btn--ghost { background: rgba(12, 14, 30, 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero__jp { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 6px; }
.hero__kana {
  writing-mode: vertical-rl;
  font: 500 clamp(20px, 1.8vw, 28px)/1 var(--serif); letter-spacing: 0.32em;
  color: rgba(var(--fg-rgb), 0.9); text-shadow: 0 0 22px rgba(10, 10, 26, 0.7);
}
.seal--name { width: 30px; padding: 7px 0; font-size: 13px; line-height: 1.2; transform: rotate(-3deg); }
.facts { border-top-color: rgba(var(--w-rgb), 0.16); }
.facts dd { color: rgba(var(--fg-rgb), 0.78); }
.facts dt { color: rgba(var(--fg-rgb), 0.5); }

.season {
  display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding: 3px;
  border-radius: 999px; border: 1px solid rgba(var(--w-rgb), 0.16);
  background: rgba(12, 14, 30, 0.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.season button { width: 30px; height: 30px; border-radius: 50%; font: 500 14px/1 var(--serif); color: rgba(var(--fg-rgb), 0.55); transition: color 0.2s, background-color 0.3s; }
.season button:hover { color: var(--fg); }
.season button[aria-pressed="true"] { color: var(--bg); background: var(--season); }

/* ---------- the portrait, hung as a scroll (掛軸) ---------- */
.about__side { display: grid; gap: 40px; }
/* --u is how far it has unrolled (0 rolled up, 1 open), set from the page scroll in scene.js */
.portrait.scroll {
  position: relative; justify-self: center; width: 100%; max-width: 252px; margin-top: 30px;
  padding: 0; border: 0; border-radius: 0; overflow: visible; background: none; box-shadow: none;
  transform-origin: 50% -30px;
}
.scroll__paper {
  padding: 16px 13px 14px; border-radius: 2px;
  background: var(--shippo) 0 0 / 22px 22px, linear-gradient(180deg, #1c2244, #141831);
  box-shadow: 0 34px 60px -28px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(var(--accent-rgb), 0.16);
  clip-path: inset(0 0 calc((1 - var(--u, 1)) * 100%) 0);
  transform: skewX(var(--skew, 0rad)); transform-origin: 50% 0;
}
.scroll__end {
  position: absolute; left: 0; right: 0; bottom: -7px; height: 12px; z-index: 2;
  transform: translate(var(--lag, 0px), calc((var(--u, 1) - 1) * (var(--hpx, 0px) - 16px)));
  cursor: grab; touch-action: none;
}
.scroll__end::before { content: ''; position: absolute; inset: -14px -16px; }
.scroll__end.is-held { cursor: grabbing; }
/* the paper still wound round the bottom rod: thick when rolled up, a sliver when open */
.scroll__roll {
  position: absolute; left: 2px; right: 2px; bottom: 9px;
  height: calc(3px + (1 - var(--u, 1)) * 11px); border-radius: 5px;
  background: linear-gradient(180deg, #11152b, #2a3260 45%, #161a34);
  box-shadow: 0 -1px 0 rgba(var(--accent-rgb), 0.18) inset;
}
/* the string, and the brass nail it hangs from: the nail is the pivot, so it never moves */
.portrait.scroll::before { content: ''; position: absolute; left: 50%; top: -31px; width: 84px; height: 30px; transform: translateX(-50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 30' fill='none' stroke='rgb(214,190,150)' stroke-opacity='0.7' stroke-width='1.2'%3E%3Cpath d='M4 30 L40 3 L76 30'/%3E%3C/svg%3E") center / contain no-repeat; }
.portrait.scroll::after {
  content: ''; position: absolute; left: 50%; top: -35px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c9, #d9a95a 40%, #6b4a1c 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6), 1px 3px 6px rgba(0, 0, 0, 0.35);
}
.scroll__rod { position: absolute; left: -9px; right: -9px; top: -6px; height: 10px; border-radius: 5px; background: linear-gradient(180deg, #6a4428, #2b170b); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55); }
.scroll__rod--end { top: 0; height: 12px; }
.scroll__rod::before, .scroll__rod::after { content: ''; position: absolute; top: -1px; bottom: -1px; width: 7px; border-radius: 3px; background: linear-gradient(180deg, #e9c27f, #8a6328); }
.scroll__rod::before { left: -3px; }
.scroll__rod::after { right: -3px; }
.portrait.scroll .portrait__bar, .portrait.scroll .portrait__foot, .portrait.scroll .quant { background: rgba(10, 11, 24, 0.7); }
.portrait.scroll .portrait__bar { border: 1px solid var(--line); border-bottom: 0; }
.portrait.scroll .portrait__img::after { display: none; }
.portrait.scroll .portrait__img { cursor: crosshair; background: #f2e9d6; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.portrait.scroll .portrait__foot { border: 1px solid var(--line); }
.portrait.scroll .quant { border: 1px solid var(--line); border-top: 0; }

/* ---------- the ending: the village again, later that night ---------- */
.footer { position: relative; border-top: 0; }
.footer__scene { position: relative; height: clamp(380px, 48vw, 680px); -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 94%, transparent); mask-image: linear-gradient(180deg, transparent, #000 16%, #000 94%, transparent); }
.footer__scene canvas { width: 100%; height: 100%; }
.outro { padding-top: 24px; }
.footer__inner .eos { color: var(--shu); }

@media (max-width: 1040px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 1200px) {
  .nav__links a i { display: none; }
}
@media (max-width: 880px) {
  .nav__icon { display: none; }
  .nav__season { display: inline-flex; margin-left: auto; margin-right: 4px; }
}
@media (max-width: 680px) {
  .hero__jp { display: none; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__title { font-size: clamp(31px, 8.8vw, 46px); }
  .hero__title .line { text-wrap: balance; }
  .hero__veil { background: linear-gradient(180deg, rgba(10, 11, 26, 0.5) 0%, rgba(10, 11, 26, 0.25) 45%, rgba(12, 14, 25, 0.55) 78%, #0e1020 100%); }
  .section[data-kanji]::before { top: 70px; font-size: 96px; right: 6px; }
  .portrait.scroll { max-width: 230px; }
}


/* ==========================================================================
   The middle of the walk: a torii path, ema plaques, shoji, bound books,
   brushed headings, and the koi (fun.js). Physics and shoji in japan.js.
   ========================================================================== */

/* brushed headings: a stroke of vermilion is painted under each chapter title as it arrives */
.shead__title { position: relative; }
.shead__title::after {
  content: ''; position: absolute; left: -6px; bottom: -18px; width: min(460px, 72%); height: 16px; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--shu-rgb), 0.85), rgba(var(--shu-rgb), 0.55) 70%, rgba(var(--shu-rgb), 0.2));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='white' stroke-linecap='round'%3E%3Cpath d='M40 10 C120 8 200 8 280 10' stroke-width='0.9'/%3E%3Cpath d='M120 14 C170 13 220 13 270 14' stroke-width='0.7'/%3E%3Cpath d='M20 16 C60 15 90 15 140 16' stroke-width='0.6'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C40 7 120 5 210 6 C250 6 282 7 296 9 C300 11 298 14 293 15 C230 17 150 18 80 19 C40 20 14 20 5 18 C1 17 0 15 3 13Z'/%3E%3Cpath d='M30 9 C90 6 170 6 250 7' stroke='black' stroke-opacity='0' /%3E%3C/svg%3E") center / 100% 100% no-repeat;
  -webkit-mask-composite: xor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='white' stroke-linecap='round'%3E%3Cpath d='M40 10 C120 8 200 8 280 10' stroke-width='0.9'/%3E%3Cpath d='M120 14 C170 13 220 13 270 14' stroke-width='0.7'/%3E%3Cpath d='M20 16 C60 15 90 15 140 16' stroke-width='0.6'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat exclude, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C40 7 120 5 210 6 C250 6 282 7 296 9 C300 11 298 14 293 15 C230 17 150 18 80 19 C40 20 14 20 5 18 C1 17 0 15 3 13Z'/%3E%3Cpath d='M30 9 C90 6 170 6 250 7' stroke='black' stroke-opacity='0' /%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0); transition: clip-path 1.2s cubic-bezier(0.6, 0.05, 0.25, 1) 0.35s;
}
.shead.is-in .shead__title::after { clip-path: inset(0 0 0 0); }
.shead { margin-bottom: 72px; }

/* ---------- 道: the path through the gates ---------- */
.timeline { border-top: 0; }
.timeline::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 52px; width: 36px; pointer-events: none;
  background: radial-gradient(ellipse 13px 6px at 50% 50%, rgba(var(--w-rgb), 0.09) 96%, transparent) 0 0 / 36px 30px repeat-y;
  -webkit-mask: linear-gradient(transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(transparent, #000 8%, #000 92%, transparent);
}
.role { grid-template-columns: 140px 1fr; border-bottom: 0; padding: 30px 0 46px; }
.role__gate { position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; padding-top: 4px; }
.gate { width: 104px; height: auto; overflow: visible; opacity: 0.32; transform: scale(0.86); transform-origin: 50% 100%; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.gate .v { fill: var(--shu); }
.gate .k { fill: #17121a; stroke: rgba(var(--shu-rgb), 0.5); stroke-width: 0.6; }
.role.is-in .gate { opacity: 1; transform: none; }
.toro { position: absolute; left: calc(50% + 58px); top: 52px; width: 18px; height: auto; }
.toro * { fill: #565b6c; }
.toro .fire { fill: #1b1c26; transition: fill 0.8s 0.5s; }
.role.is-in .toro .fire { fill: #ffcf7a; filter: drop-shadow(0 0 4px rgba(255, 180, 90, 0.95)); }
.role.is-live.is-in .toro .fire { animation: flame 2.4s ease-in-out infinite; }
@keyframes flame { 50% { fill: #ffb560; } }
.role__when { font: 500 12px/1.3 var(--mono); color: var(--fg-2); letter-spacing: 0.04em; text-align: center; }
.role.is-in .role__when { color: var(--accent); }

/* ---------- 匠: the rest of the work, as ema on a rack ---------- */
.works { --ema-h: 300px; }
.wx__list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 58px 22px; padding-top: 40px; border-top: 0;
  background: linear-gradient(180deg, #5a3a22 0, #3a2414 8px, rgba(0, 0, 0, 0.35) 8px, transparent 14px) 0 0 / 100% calc(var(--ema-h) + 58px) repeat-y;
}
.wx { position: relative; border: 0; perspective: 1000px; transform-origin: 50% -32px; }
.wx::before { content: ''; position: absolute; left: 50%; top: -32px; width: 2px; height: 34px; margin-left: -1px; background: #c8402e; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3); z-index: 1; }
.ema { position: relative; display: grid; height: var(--ema-h); transform-style: preserve-3d; transition: transform 0.75s var(--ease); }
.wx.is-open .ema { transform: rotateY(180deg); }
.wx__row, .wx__body {
  grid-area: 1 / 1; height: var(--ema-h); -webkit-backface-visibility: hidden; backface-visibility: hidden;
  clip-path: polygon(0 17%, 50% 0, 100% 17%, 100% 100%, 0 100%);
  background:
    repeating-linear-gradient(92deg, rgba(90, 55, 25, 0.1) 0 1px, transparent 1px 7px, rgba(90, 55, 25, 0.06) 7px 8px, transparent 8px 17px),
    radial-gradient(ellipse at 30% 20%, rgba(255, 236, 200, 0.35), transparent 60%),
    linear-gradient(180deg, #c49a68, #a87d4f);
}
.wx__row {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 62px 20px 18px; text-align: center; color: #23170d;
  box-shadow: inset 0 0 0 1px rgba(60, 35, 15, 0.35);
}
.wx__row::before { content: ''; position: static; inset: auto; display: block; width: 7px; height: 7px; margin: -36px auto 16px; border-radius: 50%; background: #2a1a0e; opacity: 1; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8); }
.wx__name { font: 700 21px/1.15 var(--serif); color: #1f140b; letter-spacing: 0; }
.wx__row:hover .wx__name, .wx.is-open .wx__name { color: #8f2a19; }
.wx__q { font: 500 14.5px/1.55 var(--serif); color: #3b2a1b; text-wrap: balance; }
.wx__stat { display: block !important; margin-top: auto; font: 400 11px/1.3 var(--mono); color: rgba(45, 28, 12, 0.7); text-align: center; white-space: normal; }
.wx__chev { display: block; position: static; width: auto; height: auto; font: 400 10.5px/1 var(--mono); color: rgba(45, 28, 12, 0.5); }
.wx__chev::before, .wx__chev::after { display: none; }
.wx__row:hover .wx__chev { color: #8f2a19; }
.wx__body {
  display: block; visibility: hidden; transform: rotateY(180deg); padding: 50px 20px 16px; overflow: auto;
  transition: visibility 0s 0.38s; cursor: pointer;
  background:
    repeating-linear-gradient(92deg, rgba(90, 55, 25, 0.08) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #d4b182, #b88d5c);
}
.wx.is-open .wx__body { visibility: visible; transition: visibility 0s 0.2s; }
.wx__inner { padding-left: 0 !important; overflow: visible; }
.wx__text { font-size: 13.5px; line-height: 1.6; color: #2b1d12; }
.wx__meta { color: rgba(45, 28, 12, 0.72); font-size: 11px; }
.wx__cat { color: #9a2f1c; }
.wx__links .textlink { color: #2b1d12; font-size: 13px; }
.wx__links .textlink:hover { color: #9a2f1c; }
.works .chips { margin-bottom: 8px; }

/* ---------- 遊: shoji screens, lit from inside, that slide open ---------- */
.has-shoji { position: relative; overflow: hidden; }
.shoji { position: absolute; inset: 0; z-index: 4; display: flex; pointer-events: auto; }
.shoji i {
  flex: 1; position: relative;
  background:
    linear-gradient(90deg, #2a1c12 0 3px, transparent 3px calc(100% - 3px), #2a1c12 calc(100% - 3px)),
    linear-gradient(180deg, #2a1c12 0 3px, transparent 3px calc(100% - 3px), #2a1c12 calc(100% - 3px)),
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(42, 28, 18, 0.9) calc(25% - 1px) 25%),
    repeating-linear-gradient(180deg, transparent 0 33px, rgba(42, 28, 18, 0.9) 33px 35px),
    rgba(255, 214, 160, 0.16);
  -webkit-backdrop-filter: blur(5px) brightness(1.15); backdrop-filter: blur(5px) brightness(1.15);
  box-shadow: inset 0 0 40px rgba(255, 190, 120, 0.12);
  transition: transform 1.1s cubic-bezier(0.65, 0, 0.25, 1);
}
.shoji i:first-child { border-right: 1px solid rgba(0, 0, 0, 0.5); }
.shoji.is-open { pointer-events: none; }
.shoji.is-open i:first-child { transform: translateX(-101%); }
.shoji.is-open i:last-child { transform: translateX(101%); }

/* ---------- 書: each series a stitched book, the latest one a letter ---------- */
/* each series opens like a page of calligraphy: a tanzaku strip with its number, the title, a brushed rule */
.lib__list { counter-reset: shelf; }
.shelf { counter-increment: shelf; }
.shelf__h {
  position: relative; align-items: end; min-height: 74px; padding: 6px 0 18px 58px; margin-bottom: 6px;
  border: 0; border-radius: 0; background: none; box-shadow: none;
}
.shelf__h::before {
  content: attr(data-num); position: absolute; left: 4px; top: -4px; width: 30px; height: 70px;
  display: grid; place-items: center; writing-mode: vertical-rl;
  font: 600 15px/1 var(--serif); color: #2a1f16;
  background: linear-gradient(180deg, #efe4cc, #e2d3b2); border-radius: 1px;
  box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(0, 0, 0, 0.08), inset 0 3px 0 rgba(var(--shu-rgb), 0.85);
  transform: rotate(-2deg); transform-origin: 50% 0;
}
.shelf__h::after {
  content: ''; position: absolute; left: 50px; right: 0; bottom: 0; height: 9px; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--w-rgb), 0.38), rgba(var(--w-rgb), 0.12) 60%, transparent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C40 7 120 5 210 6 C250 6 282 7 296 9 C300 11 298 14 293 15 C230 17 150 18 80 19 C40 20 14 20 5 18 C1 17 0 15 3 13Z'/%3E%3Cpath d='M30 9 C90 6 170 6 250 7' stroke='black' stroke-opacity='0' /%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 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C40 7 120 5 210 6 C250 6 282 7 296 9 C300 11 298 14 293 15 C230 17 150 18 80 19 C40 20 14 20 5 18 C1 17 0 15 3 13Z'/%3E%3Cpath d='M30 9 C90 6 170 6 250 7' stroke='black' stroke-opacity='0' /%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.shelf__h .series__title {
  display: inline; padding: 0; border-radius: 0; background: none; box-shadow: none;
  font: 600 26px/1.15 var(--serif); color: var(--fg); letter-spacing: 0;
}
.shelf__h .series__meta { color: var(--fg-3); padding-bottom: 4px; }
.shelf + .shelf { margin-top: 64px; }
.latest__row {
  grid-template-columns: 120px minmax(0, 1fr) auto 20px; padding: 24px 26px; border: 0; border-radius: 3px; color: #22180f;
  background:
    linear-gradient(225deg, #0c0e19 0 16px, #d9c9a6 16px 17px, #e7d9ba 17px 26px, transparent 26px),
    repeating-linear-gradient(0deg, rgba(120, 95, 60, 0.05) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, #f2e8d3, #e6d8b8);
  box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.9);
}
.latest__row::before { display: none; }
.latest__row::after {
  content: '新'; position: absolute; right: 54px; bottom: 16px; width: 30px; height: 30px; display: grid; place-items: center;
  background: rgba(196, 64, 44, 0.9); color: #f6ecdb; font: 700 15px/1 var(--serif); border-radius: 3px; transform: rotate(-6deg);
  box-shadow: inset 0 0 0 1.5px rgba(246, 236, 219, 0.5), inset 0 0 0 3px rgba(196, 64, 44, 0.9);
}
.latest__k { color: rgba(40, 28, 16, 0.65); }
.latest__k b { color: #9a2f1c; }
.latest__t { font-family: var(--serif); color: #1d140b; }
.latest__note { color: #43331f; }
.latest__where { color: rgba(40, 28, 16, 0.6); }
.latest__go { color: rgba(40, 28, 16, 0.5); }
.latest__row:hover .latest__t, .latest__row:hover .latest__go { color: #9a2f1c; }

/* ---------- 縁: the koi pond (koi.js) ---------- */
.pond { position: relative; width: 100vw; max-width: none; margin: 72px 0 0 calc(50% - 50vw); }
.pond canvas {
  display: block; width: 100%; height: clamp(240px, 24vw, 360px); cursor: pointer; touch-action: manipulation; background: #141b14;
  -webkit-mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent), linear-gradient(180deg, transparent, #000 9%, #000 91%, transparent);
  mask-composite: intersect;
}
.pond__cap { display: grid; gap: 6px; max-width: var(--max); margin: 12px auto 0; padding: 0 var(--pad); }
.pond__k { font: 500 13px/1.3 var(--serif); color: var(--shu); }
.pond__k span { font: 400 12px/1.3 var(--mono); color: var(--fg-3); }
.pond__t { font-size: 19px; font-weight: 500; line-height: 1.4; }
@media (max-width: 680px) { .pond canvas { height: 260px; } .pond__t { font-size: 17px; } }

/* the clock: in daylight the hero sky is paler, so the left veil does more work */
[data-tod="day"] .hero__veil { background: linear-gradient(90deg, rgba(10, 11, 26, 0.72) 0%, rgba(10, 11, 26, 0.45) 40%, rgba(10, 11, 26, 0) 66%), linear-gradient(180deg, rgba(12, 14, 25, 0.15) 0, rgba(12, 14, 25, 0) 30%, rgba(12, 14, 25, 0) 64%, rgba(12, 14, 25, 0.6) 86%, #0e1020 100%); }

@media (max-width: 880px) {
  .role { grid-template-columns: 84px 1fr; gap: 18px; padding: 26px 0 36px; }
  .gate { width: 70px; }
  .toro { display: none; }
  .timeline::before { left: 24px; }
}
@media (max-width: 680px) {
  .works { --ema-h: 270px; }
  .wx__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 52px 14px; }
  .wx__row { padding: 54px 12px 14px; gap: 8px; }
  .wx__name { font-size: 17px; }
  .wx__q { font-size: 13px; }
  .wx__body { padding: 44px 12px 12px; }
  .wx__text { font-size: 12.5px; }
  .latest__row { grid-template-columns: minmax(0, 1fr) 20px; padding: 20px 18px 52px; }
  .latest__row::after { right: 18px; bottom: 14px; }
  .shead__title::after { bottom: -14px; height: 12px; }
}
@media (max-width: 420px) {
  .works { --ema-h: 250px; }
  .wx__list { gap: 48px 12px; }
  .wx__row { padding: 50px 10px 12px; }
  .wx__name { font-size: 15.5px; }
  .wx__q { font-size: 12px; line-height: 1.5; }
  .wx__stat { font-size: 10px; }
  .wx__body { padding: 40px 10px 10px; }
  .wx__text { font-size: 11.5px; line-height: 1.5; }
  .wx__meta { display: none; }
}

/* ==========================================================================
   Skills as a dojo name board, the info box as a meishi, and the two
   flagship projects as folding screens (byobu) that open as you reach them.
   ========================================================================== */

/* ---------- 名札掛: each skill a wooden plaque on a rail ---------- */
.stack { margin-top: 44px; border-top: 0; }
.stack__row { grid-template-columns: 96px 1fr; align-items: start; gap: 18px; padding: 0 0 18px; border-bottom: 0; }
.stack__k {
  justify-self: start; margin-top: 16px; padding: 6px 9px; border-radius: 2px;
  background: linear-gradient(180deg, #1d1612, #110d0a); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
  font: 500 11px/1.2 var(--mono); color: var(--accent); letter-spacing: 0.04em;
}
.pills {
  gap: 16px 7px; padding: 12px 6px 0;
  background: linear-gradient(180deg, #5a3a22 0, #3a2414 6px, rgba(0, 0, 0, 0.35) 6px, transparent 11px) 0 0 / 100% 140px repeat-y;
}
.pills li {
  position: relative; height: 112px; padding: 12px 9px 10px; border: 0; border-radius: 1px;
  writing-mode: vertical-rl; text-orientation: mixed;
  font: 600 14px/1.3 var(--serif); letter-spacing: 0.04em; color: #23170d;
  background:
    repeating-linear-gradient(180deg, rgba(90, 55, 25, 0.1) 0 1px, transparent 1px 9px),
    linear-gradient(90deg, #b88d5c, #cfa877 45%, #b48756);
  box-shadow: 0 8px 12px -8px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(60, 35, 15, 0.4);
  transform: rotate(calc(var(--tilt, 0deg) + var(--swing, 0rad))); transform-origin: 50% -9px;
  transition: box-shadow 0.35s;
}
.pills li:nth-child(3n + 1) { --tilt: -1deg; }
.pills li:nth-child(3n + 2) { --tilt: 0.8deg; }
.pills li::before { content: ''; position: absolute; left: 50%; top: -9px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #c9a35e; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); }
.pills li[data-used] { cursor: help; }
.pills li[data-used]::after {
  content: 'used in ' attr(data-used); position: absolute; left: 50%; top: calc(100% + 8px); z-index: 6;
  writing-mode: horizontal-tb; width: max-content; max-width: 220px; padding: 7px 10px;
  background: #efe4cc; color: #2a1f16; border-radius: 1px; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(var(--shu-rgb), 0.85);
  font: 400 11.5px/1.4 var(--mono); letter-spacing: 0;
  opacity: 0; transform: translate(-50%, -4px); pointer-events: none; transition: opacity 0.2s, transform 0.25s var(--ease);
}
.pills li[data-used]:hover, .pills li[data-used]:focus-visible, .pills li.is-shown { transform: rotate(var(--swing, 0rad)) translateY(-3px); box-shadow: 0 14px 18px -10px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(60, 35, 15, 0.4); z-index: 5; }
.pills li[data-used]:hover::after, .pills li[data-used]:focus-visible::after, .pills li.is-shown::after { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 名刺: the info box as a business card ---------- */
.info {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px;
  border: 0; border-radius: 3px; color: #1d1610;
  background:
    repeating-linear-gradient(115deg, rgba(120, 95, 60, 0.035) 0 1px, transparent 1px 6px),
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    linear-gradient(180deg, #f3eadb, #e9dcc3);
  box-shadow: 0 30px 50px -28px rgba(0, 0, 0, 0.95), 0 2px 0 rgba(0, 0, 0, 0.3);
}
.info[data-reveal] { transform: translate(36px, 28px) rotate(7deg); transition: opacity 0.9s var(--ease), transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); transition-delay: var(--d, 0s); }
.info[data-reveal].is-in { transform: rotate(-1.2deg); }
.info__bar { grid-column: 1 / -1; border-bottom: 1px solid rgba(60, 40, 20, 0.15); color: #2a1f16; font: 600 13px/1 var(--serif); }
.info__bar .dim { font: 400 11px/1 var(--mono); color: rgba(40, 28, 16, 0.5); }
.info dl { grid-column: 1; }
.info dl div { border-bottom: 1px dashed rgba(60, 40, 20, 0.16); }
.info dt { color: rgba(40, 28, 16, 0.5); }
.info dd { color: #1d1610; }
.info dd a:hover { color: #9a2f1c; }
.info .ok { color: #9a2f1c; }
.info .ok .led { background: #c4402c; box-shadow: none; }
.meishi__side { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 16px 16px 4px; border-left: 1px solid rgba(60, 40, 20, 0.12); }
.meishi__name { writing-mode: vertical-rl; font: 600 20px/1 var(--serif); letter-spacing: 0.32em; color: #1d1610; }

/* ---------- 屏風: flagship projects as folding screens ---------- */
.feature {
  gap: 7px; border: 0; border-radius: 0; background: none; overflow: visible; perspective: 1800px;
  margin-bottom: 56px;
}
.feature__info, .feature__viz {
  position: relative; border-radius: 2px;
  border: 7px solid #15100c; outline: 1px solid rgba(var(--accent-rgb), 0.35); outline-offset: -5px;
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.95);
  transition: transform 1.5s cubic-bezier(0.25, 0.8, 0.2, 1), filter 1.5s;
}
.feature__info {
  background:
    var(--shippo) 0 0 / 28px 28px,
    radial-gradient(ellipse at 0% 0%, rgba(var(--accent-rgb), 0.08), transparent 55%),
    linear-gradient(180deg, #141830, #0f1224);
}
.feature__viz { border-left: 7px solid #15100c !important; }
.feature--flip .feature__viz { border-right: 7px solid #15100c !important; }
/* the gold cloud bands (suyari-gasumi) along the top and bottom of every panel */
.feature__info::before, .feature__viz::before, .feature__info::after, .feature__viz::after {
  content: ''; position: absolute; left: 0; right: 0; height: 26px; pointer-events: none; z-index: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.18) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(180deg, #e6c27a, #b98f45);
  opacity: 0.85;
}
.feature__info::before, .feature__viz::before { top: 0; clip-path: polygon(0 0, 100% 0, 100% 40%, 82% 40%, 78% 85%, 46% 85%, 42% 55%, 18% 55%, 14% 100%, 0 100%); }
.feature__info::after, .feature__viz::after { bottom: 0; clip-path: polygon(0 100%, 100% 100%, 100% 20%, 88% 20%, 84% 60%, 58% 60%, 54% 0, 30% 0, 26% 45%, 0 45%); }
.feature__info { padding-top: 48px; padding-bottom: 46px; }
.feature__viz { padding-top: 40px; padding-bottom: 42px; }
.feature__info > *, .feature__viz > * { position: relative; z-index: 1; }
/* folded until it arrives, then each panel swings open on its hinge */
.feature[data-reveal] { opacity: 1; transform: none; }
.feature .feature__info { transform-origin: 100% 50%; transform: rotateY(62deg); filter: brightness(0.45); }
.feature .feature__viz { transform-origin: 0% 50%; transform: rotateY(-62deg); filter: brightness(0.45); transition-delay: 0.12s; }
.feature--flip .feature__info { transform-origin: 0% 50%; transform: rotateY(-62deg); }
.feature--flip .feature__viz { transform-origin: 100% 50%; transform: rotateY(62deg); }
.feature.is-in .feature__info, .feature.is-in .feature__viz { transform: none; filter: none; }
.no-js .feature .feature__info, .no-js .feature .feature__viz { transform: none; filter: none; }
/* hinges */
.feature__viz .hinge, .feature__info .hinge { display: none; }
.kv-cell { border-radius: 2px; }
.kv-cell[data-s] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.3); }
.graph .node rect { fill: rgba(var(--shu-rgb), 0.12); stroke: rgba(var(--shu-rgb), 0.7); }
.graph .node--x rect { fill: rgba(var(--shu-rgb), 0.85); stroke: var(--shu); }
.graph .node--x text { fill: #fbefe0; }

@media (max-width: 1040px) {
  .feature .feature__info, .feature .feature__viz, .feature--flip .feature__info, .feature--flip .feature__viz { transform-origin: 50% 0; transform: rotateX(-50deg); }
  .feature__viz, .feature--flip .feature__viz { border: 7px solid #15100c !important; }
}
@media (max-width: 680px) {
  .stack__row { grid-template-columns: 1fr; gap: 6px; }
  .stack__k { margin-top: 0; }
  .pills li { height: 100px; font-size: 12px; }
  .pills { background-size: 100% 128px; }
}
@media (prefers-reduced-motion: reduce) {
  .feature .feature__info, .feature .feature__viz { transform: none !important; filter: none !important; }
  .info[data-reveal] { transform: rotate(-1.2deg); }
}

/* ==========================================================================
   Quieter: the headline settles in like ink instead of typing itself out,
   no status pill, and text tabs instead of chips.
   ========================================================================== */
.hero__title .line {
  opacity: 0; transform: translateY(14px); filter: blur(10px);
  animation: inkIn 1.4s cubic-bezier(0.2, 0.7, 0.1, 1) forwards; animation-delay: calc(0.25s + var(--i, 0) * 0.22s);
}
@keyframes inkIn { to { opacity: 1; transform: none; filter: none; } }
.hero__lede { margin-top: 26px; max-width: 30em; opacity: 0; animation: inkIn 1.4s cubic-bezier(0.2, 0.7, 0.1, 1) 0.95s forwards; }
.hero__actions { opacity: 0; animation: inkIn 1.2s cubic-bezier(0.2, 0.7, 0.1, 1) 1.15s forwards; }

/* hero facts: serif labels, no typewriter */
.facts dt { font: 500 12px/1 var(--serif); letter-spacing: 0.1em; text-transform: lowercase; color: rgba(var(--fg-rgb), 0.5); }
.facts__sub, .tzdiff { font-family: var(--serif); font-size: 13px; }

/* filters: text tabs with a brushed underline, not capsules */
.chips { gap: 4px 22px; }
.chips button { height: auto; padding: 6px 0 9px; border: 0; border-radius: 0; background: none !important; position: relative; font: 500 15px/1 var(--serif); color: var(--fg-3); }
.chips button i { font: 400 11px/1 var(--mono); color: var(--fg-4); }
.chips button:hover { color: var(--fg); border: 0; }
.chips button[aria-pressed="true"] { color: var(--fg); }
.chips button[aria-pressed="true"] i { color: var(--accent); }
.chips button::after { content: ''; position: absolute; left: -2px; right: -2px; bottom: 0; height: 3px; border-radius: 3px; background: var(--shu); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.45s var(--ease); }
.chips button[aria-pressed="true"]::after { transform: scaleX(1); }

/* ask: suggestions as plain prompts */
.ask__chips { gap: 6px 22px; }
.ask__chips button { padding: 4px 0; border: 0; border-radius: 0; font: 400 15px/1.3 var(--serif); color: var(--fg-3); }
.ask__chips button::before { content: '› '; color: var(--accent); }
.ask__chips button:hover { color: var(--fg); }
.ask__chips button.is-trick { font-style: italic; }

/* small flags in writing: a word in vermilion, no outline */
.art__flag { border: 0; padding: 0; margin-left: 12px; font: 600 12px/1 var(--serif); color: var(--fg-3); }
.art__flag.is-new { color: var(--shu); }

/* elsewhere: festival lanterns on a rope, each painted with its place's crest */
.elsewhere { display: block; max-width: none; margin-top: 72px; padding-top: 34px; border-top: 1px solid var(--line-2); }
.elsewhere__k { display: flex; align-items: baseline; gap: 12px; font: 600 22px/1 var(--serif); color: var(--shu); letter-spacing: 0.12em; }
.elsewhere__k small { font: 400 12px/1 var(--serif); letter-spacing: 0.2em; color: var(--fg-3); }
.lanterns { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); justify-items: center; margin-top: 26px; padding-top: 4px; }
.lanterns::before { content: ''; position: absolute; left: -2%; right: -2%; top: 0; height: 40px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M0 4 Q50 40 100 4' fill='none' stroke='%23463020' stroke-width='2.4' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; pointer-events: none; }
.lanterns .social { display: grid; justify-items: center; gap: 14px; min-width: 0; color: var(--fg-2); }
.lanterns .social:nth-child(1), .lanterns .social:nth-child(5) { --drop: 10px; }
.lanterns .social:nth-child(2), .lanterns .social:nth-child(4) { --drop: 19px; }
.lanterns .social:nth-child(3) { --drop: 22px; }
.lamp { position: relative; display: grid; justify-items: center; padding-top: calc(var(--drop, 10px) + 18px); transform-origin: 50% var(--drop, 10px); transform: rotate(var(--swing, 0rad)); }
.lamp::before { content: ''; position: absolute; left: 50%; top: var(--drop, 10px); width: 1.5px; height: 18px; margin-left: -0.75px; background: #2a1e14; }
.lamp__body {
  position: relative; display: grid; place-items: center; width: 70px; height: 86px; border-radius: 46% / 40%;
  color: #1a1410;
  background:
    repeating-linear-gradient(180deg, rgba(60, 30, 10, 0.12) 0 1px, transparent 1px 9px),
    radial-gradient(ellipse at 50% 45%, #fff3d6 0%, #efd9ad 55%, #c7a874 100%);
  box-shadow: 0 0 26px rgba(255, 180, 100, 0.28), inset 0 -8px 14px rgba(120, 70, 20, 0.25);
  filter: brightness(0.82) saturate(0.9);
  transition: filter 0.4s, box-shadow 0.4s;
}
.lanterns .social:nth-child(odd) .lamp__body {
  color: #fbefe0;
  background:
    repeating-linear-gradient(180deg, rgba(40, 0, 0, 0.16) 0 1px, transparent 1px 9px),
    radial-gradient(ellipse at 50% 45%, #f28a62 0%, #cf4a2e 55%, #8e2a1b 100%);
  box-shadow: 0 0 26px rgba(255, 120, 70, 0.3), inset 0 -8px 14px rgba(60, 10, 0, 0.3);
}
.lamp__body::before, .lamp__body::after { content: ''; position: absolute; left: 50%; width: 38px; height: 8px; margin-left: -19px; border-radius: 2px; background: #17110d; box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.15); }
.lamp__body::before { top: -3px; }
.lamp__body::after { bottom: -3px; }
.lamp__body svg { width: 30px; height: 30px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.2)); }
.lamp__body b { font: 700 30px/1 var(--serif); }
.lanterns .social:hover .lamp__body, .lanterns .social:focus-visible .lamp__body { filter: brightness(1.12) saturate(1.05); box-shadow: 0 0 60px 6px rgba(255, 170, 90, 0.5), inset 0 -8px 14px rgba(120, 70, 20, 0.2); }
.social__h { max-width: 100%; font: 500 15px/1.2 var(--serif); text-align: center; overflow-wrap: anywhere; transition: color 0.2s; }
.lanterns .social:hover .social__h { color: var(--fg); }
@media (max-width: 680px) {
  .lamp__body { width: 54px; height: 66px; }
  .lamp__body svg { width: 24px; height: 24px; }
  .lamp__body b { font-size: 24px; }
  .social__h { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title .line, .hero__lede, .hero__actions { opacity: 1; transform: none; filter: none; animation: none; }
}

/* ==========================================================================
   The last of the old site, brought into the village, quietly.
   ========================================================================== */

/* nav: an ensō in washi white, brushed again on hover */
.brand__mark { width: 24px; height: 24px; }
.brand__mark .enso { fill: none; stroke: rgba(var(--fg-rgb), 0.92); stroke-linecap: round; }
.brand__mark .enso path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.brand:hover .brand__mark { transform: none; }
.brand:hover .brand__mark .enso path { animation: ensoBrush 1s cubic-bezier(0.6, 0.05, 0.3, 1); }
@keyframes ensoBrush { from { stroke-dashoffset: 1; } }

/* highlights: plain lines, a small paper strip marking each one */
.gitlog { border-top: 1px solid var(--line-2); }
.hl { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 18px; padding: 15px 0; font: 400 17px/1.45 var(--serif); }
.hl::before { content: ''; width: 6px; height: 22px; align-self: center; border-radius: 1px; background: linear-gradient(180deg, #efe4cc, #d9c7a4); box-shadow: inset 0 2px 0 rgba(var(--shu-rgb), 0.9); transform: rotate(-3deg); }
.gitlog li:nth-child(even) .hl::before { background: linear-gradient(180deg, #e6a493, #c9735e); box-shadow: inset 0 2px 0 rgba(255, 240, 220, 0.6); transform: rotate(2deg); }
.hl b { font-weight: 600; color: var(--accent); }
.hl em { font: 400 13px/1 var(--serif); color: var(--fg-3); }
.gitlog__more, .shelf__more { border: 0; padding: 8px 0; border-radius: 0; font: 500 15px/1 var(--serif); color: var(--fg-3); }
.gitlog__more:hover, .shelf__more:hover { color: var(--accent); border: 0; }
.gitlog__more span { font: 400 12px/1 var(--serif); color: var(--fg-4); }

/* right now: serif, and the year of commits as brush dots */
.now__note { font: 400 13px/1 var(--serif); }
.now__k { font: 400 13px/1.3 var(--serif); }
.now__v { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.now__sub { font-family: var(--serif); }
.contrib__total { font-family: var(--serif); font-size: 15px; }
.contrib__svg rect { rx: 50%; }
.contrib__svg text { font-family: var(--serif); font-size: 10px; }
.contrib__legend { font-family: var(--serif); font-size: 12px; }
.contrib__legend i { border-radius: 50%; }
[data-l="0"] { background: rgba(var(--w-rgb), 0.06); fill: rgba(var(--w-rgb), 0.06); }
[data-l="1"] { background: rgba(var(--fg-rgb), 0.24); fill: rgba(var(--fg-rgb), 0.24); }
[data-l="2"] { background: rgba(var(--fg-rgb), 0.46); fill: rgba(var(--fg-rgb), 0.46); }
[data-l="3"] { background: rgba(var(--accent-rgb), 0.75); fill: rgba(var(--accent-rgb), 0.75); }
[data-l="4"] { background: var(--accent); fill: var(--accent); }

/* writing: serif rows on ruled paper, views as a thin ink line */
.writing__stats span { font: 400 13px/1.4 var(--serif); }
.writing__stats b { font-family: var(--serif); font-weight: 600; }
.art { font-family: var(--serif); font-size: 16px; }
.art__n, .art__d, .art__s { font: 400 13px/1 var(--serif); }
.art__v i { height: 1px; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.9) calc(var(--w) * 100%), rgba(var(--w-rgb), 0.08) 0); }
.art__v b { font: 400 13px/1 var(--serif); }
.lib__search, .lib__sort { height: 34px; padding: 0 2px; border: 0; border-bottom: 1px solid var(--line-3); border-radius: 0; }
.lib__search input, .lib__sort select { font: 400 15px/1 var(--serif); }
.lib__sortk { font: 400 13px/1 var(--serif); }

/* ask: write on a line, not into a box */
.ask__form { padding: 4px 0; border: 0; border-bottom: 1px solid var(--line-3); border-radius: 0; background: none; }
.ask__form:focus-within { border-color: var(--accent); }
.ask__form input { font: 400 18px/1 var(--serif); }
.ask__form .btn { height: auto; padding: 6px 2px; border: 0; background: none; color: var(--accent); font: 600 16px/1 var(--serif); }
.ask__form .btn:hover { color: var(--fg); background: none; }
.ask__note { font-family: var(--serif); font-size: 14px; }
.ask__answer { font-family: var(--serif); }

/* ⌘K, the terminal and toasts wear the nav's lintel */
.cmdk__panel, .tx, .toast { background: rgba(16, 15, 20, 0.96); border-color: rgba(var(--w-rgb), 0.1); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(var(--accent-rgb), 0.35); }
.cmdk__panel { border-radius: 14px; }
.cmdk__input input, .cmdk__item { font-family: var(--serif); }
.cmdk__item { font-size: 16px; }
.cmdk__group { font-family: var(--serif); font-size: 12px; letter-spacing: 0.08em; }
.cmdk__item small, .cmdk__foot { font-family: var(--serif); }
.tx { border-radius: 12px; }
.toast { font-family: var(--serif); font-size: 14px; }

/* the sign-off: a seal and a name; one quiet line under it */
.outro { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px 48px; }
.signoff { display: flex; align-items: center; gap: 18px; }
.signoff .seal--name { width: 34px; padding: 8px 0; font-size: 15px; }
.signoff__name { font: 600 30px/1 var(--serif); letter-spacing: 0.01em; }
.outro__note { padding-bottom: 0; font-family: var(--serif); }
.footer__inner { font: 400 13px/1.4 var(--serif); }
.footer__inner > * + *:not([hidden])::before { color: var(--fg-4); }

/* seasons and sound, readable without Japanese: symbols, with the English name on hover */
.season button { position: relative; display: grid; place-items: center; color: rgba(var(--fg-rgb), 0.6); }
.season button svg { width: 16px; height: 16px; }
.season button[aria-pressed="true"] { color: var(--bg); }
.season__label {
  position: absolute; right: calc(100% + 12px); top: 50%; padding: 5px 9px; border-radius: 3px; white-space: nowrap;
  background: rgba(14, 13, 18, 0.92); box-shadow: inset 0 0 0 1px rgba(var(--w-rgb), 0.12);
  font: 500 13px/1 var(--serif); color: var(--fg); text-shadow: none;
  opacity: 0; transform: translate(6px, -50%); pointer-events: none; transition: opacity 0.2s, transform 0.25s var(--ease);
}
.season__label i { font-style: normal; color: var(--fg-3); margin-left: 4px; }
.season button:hover .season__label, .season button:focus-visible .season__label { opacity: 1; transform: translate(0, -50%); }
.season__cap { font: 400 11px/1 var(--serif); letter-spacing: 0.18em; color: rgba(var(--fg-rgb), 0.55); text-shadow: 0 1px 10px rgba(8, 9, 22, 0.8); }
.nav__season { color: var(--season); }
.nav__season span { display: grid; place-items: center; }
.nav__season svg { width: 16px; height: 16px; }
.nav__spk { width: 17px; height: 17px; }
.nav__sound.is-on .nav__spk-off { display: none; }

/* phones: the business card stacks (name across the top), slides in from inside the screen,
   and the lanterns let their crests speak for them */
@media (max-width: 680px) {
  .info { grid-template-columns: minmax(0, 1fr); max-width: 100%; }
  .info[data-reveal] { transform: translateY(24px) rotate(3deg); }
  .info dl { grid-row: 3; }
  .info dl div { grid-template-columns: 76px minmax(0, 1fr); }
  .info dd { overflow-wrap: anywhere; }
  .meishi__side { grid-column: 1; grid-row: 2; flex-direction: row; justify-content: space-between; padding: 12px 16px; border-left: 0; border-bottom: 1px solid rgba(60, 40, 20, 0.12); }
  .meishi__name { writing-mode: horizontal-tb; font-size: 17px; letter-spacing: 0.24em; }
  .meishi__side .seal--name { writing-mode: horizontal-tb; width: auto; padding: 6px 8px; }
  .meishi__side .seal--name br { display: none; }
  .lanterns .social__h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lanterns .social { gap: 0; }
}
html { overflow-x: clip; }

/* the hero, pared back: headline, one line, two buttons */
.hero__lede { max-width: 48em; font-size: clamp(15px, 1.15vw, 17px); color: rgba(var(--fg-rgb), 0.72); }
.hero__lede a { color: var(--fg); border-bottom: 1px solid rgba(var(--accent-rgb), 0.5); transition: color 0.2s, border-color 0.2s; }
.hero__lede a:hover { color: var(--accent); border-color: var(--accent); }

/* the nav's clock: the time where I am, in place of the reading lanterns */
.nav__time { gap: 8px; cursor: default; font: 500 14px/1 var(--serif); color: var(--fg-3); }
.nav__time .nav__city { letter-spacing: 0.04em; }
.nav__time b { font: 600 14px/1 var(--serif); color: var(--fg); font-variant-numeric: tabular-nums; }

/* nav: liquid glass, the way macOS draws it. A see-through capsule that blurs and
   saturates what is behind it, a bright rim, and a sheen that leans toward the cursor */
.nav__capsule {
  --mx: 30%; --my: -40%;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03) 60%, rgba(255, 255, 255, 0.05)),
    rgba(22, 22, 34, 0.2);
  -webkit-backdrop-filter: blur(24px) saturate(185%) brightness(1.06);
  backdrop-filter: blur(24px) saturate(185%) brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    inset -1px 0 0 rgba(255, 255, 255, 0.06),
    0 12px 32px -12px rgba(0, 0, 0, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.25);
  transition: background-color 0.4s, box-shadow 0.4s;
}
.nav__capsule::before {
  left: 0; right: 0; top: 0; bottom: 0; height: auto; border-radius: inherit;
  background: radial-gradient(90% 140% at var(--mx) var(--my), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 55%);
  mix-blend-mode: screen; transition: background-position 0.3s;
}
.nav.is-scrolled .nav__capsule {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 60%, rgba(255, 255, 255, 0.05)),
    rgba(18, 17, 26, 0.5);
}
.nav__capsule > * { position: relative; z-index: 1; }
.brand { border-right-color: rgba(255, 255, 255, 0.12); }
.nav__icon, .nav__status, .nav__cmd {
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.nav__icon:hover, .nav__cmd:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); }
.nav__cmd kbd { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.nav__links a { border-radius: 999px; }
.nav__links a:hover { background: rgba(255, 255, 255, 0.06) !important; }
.nav__toggle { border-radius: 999px; border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); }
.mobile-menu {
  border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)), rgba(18, 17, 26, 0.55);
  -webkit-backdrop-filter: blur(28px) saturate(185%); backdrop-filter: blur(28px) saturate(185%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 20px 40px -16px rgba(0, 0, 0, 0.6);
}
@media (prefers-reduced-transparency: reduce) {
  .nav__capsule, .mobile-menu { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(18, 17, 26, 0.94); }
}

/* writing: one series at a time, so the tabs and the book sit close together */
.lib__bar { margin-bottom: 30px; }
.shelf + .shelf { margin-top: 48px; }

/* lab: tabs over one room at a time */
.lab__tabs { margin-bottom: 22px; }
.lab > [role="tabpanel"][hidden] { display: none; }
.lab__grid, .tokz { margin-top: 0; }

/* hero: the name large, the two lines under it a step smaller */
.hero__title .hero__sub { font-size: 0.6em; line-height: 1.25; font-weight: 500; color: rgba(var(--fg-rgb), 0.9); }
.hero__title .hero__sub:nth-child(2) { margin-top: 0.35em; }
@media (max-width: 680px) { .hero__title .hero__sub { font-size: 0.62em; } }

/* hero arrangement: the words sit up in the open sky on the left, the vertical
   name level with them, and the two lines small enough to stay off Fuji */
@media (min-width: 681px) {
  .hero { justify-content: flex-start; padding-top: clamp(150px, 22vh, 250px); }
  .hero__title { font-size: clamp(44px, 4.6vw, 72px); }
  .hero__title .hero__sub { font-size: 0.44em; line-height: 1.4; letter-spacing: 0.005em; }
  .hero__title .hero__sub:nth-child(2) { margin-top: 0.7em; }
  .hero__actions { margin-top: 30px; }
  .hero__jp { padding-top: 0; }
}

/* 道: the winding path is painted by sando.js; the straight stones are the fallback */
.timeline:has(> .sando)::before { content: none; }
.sando {
  position: absolute; top: 0; pointer-events: none;
  -webkit-mask: linear-gradient(#000 calc(var(--p, 0px) - 120px), transparent var(--p, 0px)); mask: linear-gradient(#000 calc(var(--p, 0px) - 120px), transparent var(--p, 0px));
}
/* the roles sit on the bends: every other one steps out to the right */
.timeline { --sway: clamp(130px, 19vw, 290px); }
.timeline > li.role:nth-of-type(even) { margin-left: var(--sway); }
.timeline > li.role:nth-of-type(odd):not(:last-of-type) { padding-bottom: 84px; }
@media (max-width: 880px) {
  .timeline { --sway: 44px; }
  .timeline > li.role:nth-of-type(odd):not(:last-of-type) { padding-bottom: 44px; }
}
@media (max-width: 680px) { .timeline { --sway: 30px; } }
