/*
Theme Name: Hiqjj Notebook
Theme URI: https://www.hiqjj.org/
Description: Warm notebook theme for Hiqjj: cream paper, duck-yellow accents, Memo the sticky-note mascot, project and post cards on the home page, calm single-column articles. Self-hosted Caveat accent font (OFL), no external requests.
Version: 2.0.0
Requires at least: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: hiqjj-notebook
*/

@font-face {
  font-family: "Caveat";
  src: url("assets/fonts/caveat-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
/* Metric-matched stand-in (Arial scaled to Caveat's width and line box) so text does not reflow when Caveat arrives. */
@font-face {
  font-family: "Caveat Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans");
  size-adjust: 78%;
  ascent-override: 123%;
  descent-override: 39%;
  line-gap-override: 0%;
}

:root {
  --paper: #fdf6e3;
  --paper-2: #fbecc6;
  --surface: #fffdf7;
  --surface-2: #f8efd9;
  --ink: #25313b;
  --muted: #4f5a64;
  --faint: #636d77;
  --line: #eadfc4;
  --edge: #ddcda5;
  --rule: rgba(120, 150, 170, .16);
  --duck: #ffd447;
  --duck-deep: #e8a900;
  --accent-ink: #8a5a00;
  --btn-edge: #25313b;
  --btn-shadow: #25313b;
  --code-bg: #f3e9d2;
  --pre-bg: #24282e;
  --pre-text: #ece7dc;
  --focus: #2f6fed;
  --up: #2f9e6e;
  --down: #e0714f;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hand: "Caveat", "Caveat Fallback", cursive;
  --w: 720px;
  --w-wide: 1120px;
  --nav-h: 62px;
  color-scheme: light dark;
}

/* Category / language tints: bg + text pair, both AA. */
.tint-mint     { --t-bg: #c9f1dc; --t-ink: #1b5a3f; --t-mid: #3fae7d; }
.tint-peach    { --t-bg: #ffdccd; --t-ink: #7a3518; --t-mid: #f08a63; }
.tint-lavender { --t-bg: #e4dfff; --t-ink: #45399a; --t-mid: #8a7cf0; }
.tint-sky      { --t-bg: #d2ecfc; --t-ink: #1d5376; --t-mid: #4aa6dc; }
.tint-yellow   { --t-bg: #ffe795; --t-ink: #5f4200; --t-mid: #e8a900; }
.tint-plain    { --t-bg: #f1e8d2; --t-ink: #4f5a64; --t-mid: #b9a985; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1915;
    --paper-2: #2a2216;
    --surface: #25211b;
    --surface-2: #2e2921;
    --ink: #f3ecdd;
    --muted: #cfc4ae;
    --faint: #aea28c;
    --line: #3a3329;
    --edge: #4a4134;
    --rule: rgba(255, 230, 170, .06);
    --accent-ink: #ffd447;
    --btn-edge: #ffd447;
    --btn-shadow: #9a7200;
    --code-bg: #332d24;
    --pre-bg: #14120f;
    --pre-text: #ece7dc;
    --focus: #8ab4ff;
    --up: #5fd19c;
    --down: #ff9a78;
  }
  .tint-mint     { --t-bg: #1f3a2f; --t-ink: #a6ead0; --t-mid: #5fd19c; }
  .tint-peach    { --t-bg: #45291d; --t-ink: #ffbfa6; --t-mid: #ff9a78; }
  .tint-lavender { --t-bg: #2f2a4c; --t-ink: #d3cbff; --t-mid: #a99dff; }
  .tint-sky      { --t-bg: #1b3446; --t-ink: #a8dcff; --t-mid: #6cc0f0; }
  .tint-yellow   { --t-bg: #3f3317; --t-ink: #ffdc6b; --t-mid: #e8a900; }
  .tint-plain    { --t-bg: #2e2921; --t-ink: #cfc4ae; --t-mid: #6d6250; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--duck) 55%, transparent); color: inherit; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: var(--w-wide); margin: 0 auto; padding: 0 24px; }
.screen-reader-text, .skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.hand { font-family: var(--hand); font-weight: 600; }

/* ---------- Floating pill nav ---------- */
.nav-shell {
  position: sticky; top: 12px; z-index: 30;
  padding: 0 16px; margin-top: 12px;
  margin-bottom: calc(-1 * (var(--nav-h) + 12px));
  pointer-events: none;
}
.admin-bar .nav-shell { top: 44px; }
.pill-nav {
  pointer-events: auto;
  max-width: calc(var(--w-wide) - 16px); margin: 0 auto; min-height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 8px 10px 8px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border: 1.5px solid var(--edge);
  box-shadow: 0 10px 30px -12px rgba(37, 49, 59, .22);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.mark { display: block; flex-shrink: 0; transition: transform .25s; }
.brand:hover .mark { transform: rotate(-8deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand-sub { font: 600 9.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.site-nav { flex: 1; min-width: 0; display: flex; justify-content: center; }
.nav-list { list-style: none; margin: 0; padding: 2px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-list::-webkit-scrollbar { display: none; }
.nav-list a {
  display: block; padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600;
}
.nav-list a:hover { color: var(--ink); background: color-mix(in srgb, var(--duck) 30%, transparent); }
.nav-list .current-menu-item > a { color: var(--ink); background: color-mix(in srgb, var(--duck) 45%, transparent); }
.nav-members a { color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--edge); margin-left: 4px; }
.search { position: relative; flex-shrink: 0; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 150px; height: 38px; padding: 0 14px 0 33px;
  font: 14px var(--sans); color: var(--ink);
  background: color-mix(in srgb, var(--paper) 70%, transparent); border: 1.5px solid var(--edge); border-radius: 999px;
  transition: width .2s, border-color .2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { width: 200px; outline: none; border-color: var(--duck-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--duck) 45%, transparent); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font: 700 15px/1 var(--sans); padding: 13px 20px; border-radius: 999px; text-decoration: none;
  border: 2px solid var(--btn-edge); color: var(--ink); background: transparent;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-primary { background: var(--duck); color: #25313b; box-shadow: 3px 3px 0 var(--btn-shadow); }
.btn-primary:hover { color: #25313b; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--btn-shadow); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--btn-shadow); }
.btn-ghost { border-color: var(--edge); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + 12px + 64px) 0 72px;
  background:
    radial-gradient(60% 70% at 85% 30%, color-mix(in srgb, var(--duck) 30%, transparent), transparent 70%),
    radial-gradient(45% 60% at 8% 85%, color-mix(in srgb, #ffb193 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
  border-bottom: 1.5px dashed var(--edge);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
  mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 56px; align-items: center; }
.mono-kicker { font: 600 12px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 18px; }
.hero-title { font-size: clamp(38px, 6vw, 64px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 20px; text-wrap: balance; }
.hand-word {
  font-family: var(--hand); font-weight: 600; font-size: 1.32em; letter-spacing: 0; line-height: .8;
  padding: 0 .08em; white-space: nowrap;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--duck) 85%, transparent) 58%, color-mix(in srgb, var(--duck) 85%, transparent) 88%, transparent 88%);
  display: inline-block; transform: rotate(-3deg);
}
.hero-lede { font-size: 19px; color: var(--muted); max-width: 32em; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 36px; }
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin: 0; }
.stats div { padding: 4px 28px 4px 0; margin-right: 28px; border-right: 1.5px dashed var(--edge); display: flex; flex-direction: column; }
.stats dd { order: -1; }
.stats div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stats dd { margin: 0; font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats dt { font: 600 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }

/* Candles */
.hero-side { position: relative; isolation: isolate; }
.candles { position: absolute; left: -210px; bottom: -64px; width: 540px; height: auto; opacity: .7; pointer-events: none; z-index: -1; }
.candle line { stroke-width: 2; }
.candle.up line { stroke: var(--up); }
.candle.up rect { fill: color-mix(in srgb, var(--up) 55%, transparent); stroke: var(--up); stroke-width: 1.5; }
.candle.down line { stroke: var(--down); }
.candle.down rect { fill: color-mix(in srgb, var(--down) 55%, transparent); stroke: var(--down); stroke-width: 1.5; }
.candle { transform-box: fill-box; transform-origin: 50% 100%; animation: candle-in .6s calc(var(--i) * 70ms + .2s) both cubic-bezier(.2, .8, .3, 1.2); }
.candle:last-of-type { animation: candle-in .6s 1s both, candle-pulse 2.6s 1.8s ease-in-out infinite; }
.spark { fill: none; stroke: var(--duck-deep); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s .4s ease-out forwards; }
@keyframes candle-in { from { opacity: 0; transform: scaleY(.2); } to { opacity: 1; transform: none; } }
@keyframes candle-pulse { 50% { opacity: .45; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Mascot ---------- */
.mascot-card {
  position: relative; background: var(--surface); border: 2px solid var(--btn-edge); border-radius: 24px;
  padding: 22px 22px 18px; box-shadow: 6px 6px 0 var(--btn-shadow); transform: rotate(1.2deg);
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px);
  max-width: 360px; margin-left: auto;
}
.mascot-card::before { /* tape */
  content: ""; position: absolute; top: -13px; left: 50%; width: 88px; height: 24px; transform: translateX(-50%) rotate(-4deg);
  background: color-mix(in srgb, #9be3c0 75%, transparent); border-radius: 3px;
}
.bubble {
  position: relative; margin: 6px 0 14px; padding: 12px 16px; min-height: 4.4em;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font: 600 22px/1.15 var(--hand); color: #25313b;
  background: #fff; border: 2px solid #25313b; border-radius: 18px;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -11px; width: 18px; height: 18px; background: #fff;
  border-right: 2px solid #25313b; border-bottom: 2px solid #25313b; transform: translateX(-50%) rotate(45deg);
}
.bubble.is-new { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: .4; } to { transform: none; opacity: 1; } }
.mascot { display: block; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; width: 220px; max-width: 100%; border-radius: 20px; -webkit-tap-highlight-color: transparent; }
.mascot-svg { display: block; width: 100%; height: auto; overflow: visible; }
.m-body { animation: bob 3.4s ease-in-out infinite; }
.m-shadow { transform-box: fill-box; transform-origin: center; animation: shadow 3.4s ease-in-out infinite; }
.m-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
.m-think { opacity: .35; }
.m-pencil { transform-box: view-box; transform-origin: 0 0; }
.mascot:hover .m-think, .mascot.is-thinking .m-think { opacity: 1; }
.mascot.is-thinking .m-pencil { animation: scribble .5s ease-in-out 2; }
.mascot.is-thinking .m-think { animation: think .9s ease-out; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes shadow { 50% { transform: scaleX(.88); opacity: .09; } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.1); } }
@keyframes scribble { 25% { transform: rotate(-12deg); } 75% { transform: rotate(8deg); } }
@keyframes think { 0% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }
.mascot-caption { margin: 8px 0 0; text-align: center; font-size: 13.5px; color: var(--faint); }
.mascot-caption .hand { font-size: 24px; color: var(--ink); margin-right: 6px; }
.is-mini .m-body, .is-mini .m-shadow, .is-mini .m-eyes { animation: none; }
.is-mini .m-think { display: none; }

/* ---------- Sections ---------- */
.section { padding: 72px 0 8px; }
.section-head { margin-bottom: 28px; }
.section-num { font: 600 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.section-num span { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--duck); color: #25313b; letter-spacing: .04em; margin-right: 2px; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; margin: 0; }
.section-head h2 .hand, .list-header h1 .hand { display: inline-block; font-size: 1.15em; color: var(--accent-ink); transform: rotate(-2deg); margin-left: 6px; letter-spacing: 0; font-weight: 600; }

/* ---------- Project cards ---------- */
.project-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.project { grid-column: span 2; }
.project:nth-child(-n+2) { grid-column: span 3; }
.project {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px 20px 18px; border-radius: 20px; background: var(--surface);
  border: 1.5px solid var(--edge); overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.project::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--t-mid); }
.project:hover { transform: translateY(-3px); border-color: var(--t-mid); box-shadow: 0 14px 30px -18px rgba(37, 49, 59, .45); }
.project-head { display: flex; align-items: center; gap: 8px; color: var(--t-ink); }
.project-icon { flex-shrink: 0; }
.project-name { margin: 0; font: 700 16px/1.3 var(--mono); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.project-name a { color: var(--ink); text-decoration: none; }
.project-name a:hover { text-decoration: underline; }
.project-desc { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; flex: 1; }
.project-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 13px; color: var(--faint); }
.lang { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--t-mid); }
.release { font: 600 12px/1.6 var(--mono); padding: 1px 8px; border-radius: 999px; background: var(--t-bg); color: var(--t-ink); }
.release.is-none { background: transparent; color: var(--faint); font-family: var(--sans); font-weight: 400; padding: 0; }
.project-links { display: flex; gap: 16px; margin: 4px 0 0; padding-top: 12px; border-top: 1.5px dashed var(--line); font-size: 14px; font-weight: 700; }
.project-links a { text-decoration: none; }
.project-links a:hover { text-decoration: underline; }

/* ---------- Post cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.card {
  position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--edge);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(37, 49, 59, .5); }
.card-cover { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1.5px solid var(--line); overflow: hidden; }
.cover-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s; }
.cover-img.is-diagram { object-fit: contain; padding: 14px; background: #fffdf7; }
.card:hover .cover-img { transform: scale(1.025); }
.cover-blank {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  background: repeating-linear-gradient(180deg, transparent 0 23px, var(--rule) 23px 24px), linear-gradient(135deg, var(--paper-2), var(--surface-2));
}
.cover-hand { font: 600 26px/1 var(--hand); color: var(--faint); transform: rotate(-3deg); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 22px 22px; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 13px; color: var(--faint); }
.card-title { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 750; text-wrap: balance; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.card-title a:focus-visible { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.card .pill, .card-more { position: relative; z-index: 2; }
.card-excerpt { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { align-self: flex-start; margin-top: 6px; font-weight: 700; font-size: 15px; text-decoration: none; }
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.card-featured .card-cover { aspect-ratio: auto; min-height: 320px; border-bottom: 0; border-right: 1.5px solid var(--line); }
.card-featured .card-body { padding: 32px 32px 30px; justify-content: center; gap: 12px; }
.card-featured .card-title { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; }
.card-featured .card-excerpt { font-size: 16px; -webkit-line-clamp: 4; }

/* An orphan last card spans the row instead of leaving a hole. */
.card-grid:not(.is-list) > .card:last-child:nth-child(even),
.card-grid.is-list > .card:last-child:nth-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card-grid:not(.is-list) > .card:last-child:nth-child(even) .card-cover,
.card-grid.is-list > .card:last-child:nth-child(odd) .card-cover { aspect-ratio: auto; min-height: 240px; border-bottom: 0; border-right: 1.5px solid var(--line); }
.card-grid:not(.is-list) > .card:last-child:nth-child(even) .card-body,
.card-grid.is-list > .card:last-child:nth-child(odd) .card-body { justify-content: center; padding: 24px 28px; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--t-bg, var(--surface-2)); color: var(--t-ink, var(--muted));
  font-size: 12.5px; font-weight: 700; line-height: 1.6; text-decoration: none; white-space: nowrap;
}
a.pill:hover { color: var(--t-ink); box-shadow: inset 0 0 0 1.5px var(--t-mid); }

/* Topics */
.section-topics { padding-bottom: 24px; }
.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-radius: 999px;
  background: var(--t-bg); color: var(--t-ink); font-weight: 700; font-size: 15px; text-decoration: none;
  border: 1.5px solid color-mix(in srgb, var(--t-mid) 50%, transparent); transition: transform .15s;
}
.chip:hover { color: var(--t-ink); transform: translateY(-2px) rotate(-1deg); }
.chip-count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- List pages (archive / search / 404) ---------- */
.list-page { padding-top: calc(var(--nav-h) + 12px + 48px); padding-bottom: 32px; }
.list-header { margin-bottom: 32px; }
.list-header h1 { font-size: clamp(30px, 4.6vw, 44px); letter-spacing: -0.03em; line-height: 1.12; margin: 0; font-weight: 800; }
.title-dot { display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--t-mid); margin-right: .35em; vertical-align: .08em; }
.list-desc { color: var(--muted); margin: 10px 0 0; }
.list-sub { margin-top: 40px; }
.empty { color: var(--muted); margin: 0; }
.empty-box { padding: 28px; border: 1.5px dashed var(--edge); border-radius: 20px; background: var(--surface); }
.empty-box p { margin: 0 0 8px; }
.search-inline { display: flex; gap: 8px; margin: 20px 0 12px; max-width: 440px; }
.search-inline input {
  flex: 1; min-width: 0; padding: 11px 16px; font: 16px var(--sans); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--edge); border-radius: 999px;
}
.search-inline .btn { padding: 11px 18px; }

.pagination { margin: 32px 0 0; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; border: 1.5px solid var(--edge); font-size: 14px; background: var(--surface); }
.pagination .current { color: #25313b; background: var(--duck); border-color: var(--duck-deep); }

/* ---------- Article ---------- */
.read-progress { display: none; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.has-progress .read-progress { display: block; }
.read-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--duck), var(--duck-deep)); transform: scaleX(0); transform-origin: 0 50%; }

.article-band {
  position: relative;
  padding: calc(var(--nav-h) + 12px + 52px) 0 8px;
  background:
    radial-gradient(50% 80% at 90% 0%, color-mix(in srgb, var(--duck) 22%, transparent), transparent 70%),
    linear-gradient(180deg, var(--paper-2), var(--paper));
}
.article-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 31px, var(--rule) 31px 32px);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent);
  mask-image: linear-gradient(180deg, #000 30%, transparent);
}
.article-header { position: relative; }
.article-kicker { margin: 0 0 16px; }
.article-kicker .pill { font-size: 13px; padding: 3px 12px; }
.article-title { font-size: clamp(30px, 5.2vw, 44px); line-height: 1.12; letter-spacing: -0.028em; margin: 0 0 16px; font-weight: 800; text-wrap: balance; }
.article-meta { margin: 0 0 32px; color: var(--faint); font-size: 14px; }
.article-cover { max-width: 960px; margin: 0 auto 40px; }
.article-cover img { display: block; width: 100%; border-radius: 14px; border: 1.5px solid var(--line); }

.prose { font-size: 18px; line-height: 1.75; overflow-wrap: break-word; }
.prose > * { margin-top: 0; margin-bottom: 1.25em; }
.prose h2 { font-size: 1.45em; line-height: 1.3; letter-spacing: -0.015em; margin: 2em 0 .7em; font-weight: 750; }
.prose h3 { font-size: 1.18em; line-height: 1.35; margin: 1.8em 0 .6em; font-weight: 700; }
.prose h4 { font-size: 1em; margin: 1.6em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--duck-deep); }
.prose blockquote, .prose .wp-block-quote {
  margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--duck); color: var(--muted); font-style: normal;
}
.prose hr, .prose .wp-block-separator { border: 0; border-top: 1.5px dashed var(--edge); margin: 2.5em auto; width: 100%; }
.prose img, .prose .wp-block-image img { border-radius: 12px; border: 1.5px solid var(--line); }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption, .prose .wp-element-caption { font-size: 14px; color: var(--faint); text-align: center; margin-top: 8px; }
.prose .alignwide { width: min(960px - 40px, calc(100vw - 40px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.prose .alignfull { width: 100vw; margin-left: calc(50% - 50vw); max-width: none; }
.prose .alignfull img { border-radius: 0; border-left: 0; border-right: 0; }
.prose code, .prose kbd { font: .86em var(--mono); background: var(--code-bg); padding: .15em .4em; border-radius: 5px; }
.prose pre, .prose .wp-block-code {
  font: 14.5px/1.6 var(--mono); background: var(--pre-bg); color: var(--pre-text);
  padding: 18px 20px; border-radius: 12px; overflow-x: auto; tab-size: 4;
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
.prose pre code, .prose .wp-block-code code { background: none; padding: 0; font-size: inherit; color: inherit; border-radius: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }

.article-footer { padding-top: 16px; padding-bottom: 8px; }
.project-box {
  display: flex; align-items: center; gap: 16px; margin: 8px 0 32px; padding: 18px 20px;
  border-radius: 20px; background: var(--surface); border: 2px solid var(--btn-edge); box-shadow: 5px 5px 0 var(--t-mid);
}
.project-box-mark { flex-shrink: 0; }
.project-box-text { flex: 1; min-width: 0; }
.project-box-text p { margin: 0; }
.project-box-label { font: 600 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.project-box-name { font: 700 18px/1.4 var(--mono); overflow-wrap: anywhere; }
.project-box-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.project-box .btn { flex-shrink: 0; }
.article-tags { margin-bottom: 28px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1.5px dashed var(--edge); padding-top: 24px; margin-bottom: 24px; }
.post-nav a {
  display: block; padding: 14px 16px; border: 1.5px solid var(--edge); border-radius: 14px;
  color: var(--ink); text-decoration: none; font-weight: 650; font-size: 15px; line-height: 1.4; background: var(--surface);
}
.post-nav a:hover { border-color: var(--duck-deep); }
.post-nav a span { display: block; font: 500 12px var(--mono); color: var(--faint); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.post-nav .next { text-align: right; grid-column: 2; }

/* ---------- Comments ---------- */
.comments { border-top: 1.5px dashed var(--edge); padding: 32px 0 64px; }
.comments-title, .comment-reply-title { font-size: 20px; margin: 0 0 16px; letter-spacing: -0.01em; }
.comment-reply-title small { font-size: 14px; font-weight: 400; margin-left: 8px; }
.comment-list, .comment-list .children { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list .children { padding-left: 24px; border-left: 2px solid var(--line); margin: 12px 0 0; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--faint); text-decoration: none; font-size: 13px; }
.comment-content p { margin: .4em 0; }
.reply a { font-size: 13px; }
.comment-notes, .logged-in-as { font-size: 14px; color: var(--muted); }
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; }
.comment-form .form-submit { order: 99; }
.comment-form .required { color: var(--accent-ink); }
.cf-turnstile { margin: 0 !important; min-height: 65px; }
.comment-form label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea {
  width: 100%; padding: 10px 14px; font: 16px var(--sans); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--edge); border-radius: 12px;
}
.comment-form input:focus, .comment-form textarea:focus, .search-inline input:focus {
  outline: none; border-color: var(--duck-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--duck) 45%, transparent);
}
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.comment-form-cookies-consent label { font-weight: 400; margin: 0; }
.comment-form .submit { font: 700 15px/1 var(--sans); padding: 13px 22px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1.5px dashed var(--edge); margin-top: 72px; background: linear-gradient(180deg, var(--paper), var(--paper-2)); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 28px; padding-bottom: 36px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .mascot-svg { width: 64px; flex-shrink: 0; }
.footer-line { margin: 0; font: 600 21px/1.2 var(--hand); color: var(--ink); }
.footer-copy { margin: 4px 0 0; font-size: 13px; color: var(--faint); }
.footer-links { display: flex; gap: 8px; }
.footer-links a {
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--edge); background: var(--surface);
}
.footer-links a:hover { border-color: var(--duck-deep); background: color-mix(in srgb, var(--duck) 30%, var(--surface)); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .mascot-card { margin: 0 auto; width: 100%; }
  .candles { left: -24px; bottom: -40px; width: 70%; opacity: .45; }
  .project-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project, .project:nth-child(-n+2) { grid-column: auto; }
  .card-featured, .card-grid > .card:last-child { grid-template-columns: 1fr !important; }
  .card-featured .card-cover, .card-grid > .card:last-child .card-cover { aspect-ratio: 16 / 9; min-height: 0; border-right: 0; border-bottom: 1.5px solid var(--line); }
}
@media (max-width: 760px) {
  :root { --nav-h: 102px; }
  html { scroll-padding-top: 124px; }
  body { font-size: 16px; }
  .wrap-wide { padding: 0 16px; }
  .wrap { padding: 0 18px; }
  .nav-shell { padding: 0 10px; top: 8px; margin-top: 8px; margin-bottom: calc(-1 * (var(--nav-h) + 8px)); }
  .pill-nav { flex-wrap: wrap; gap: 6px 8px; border-radius: 24px; padding: 8px 8px 6px 12px; }
  .brand { order: 1; gap: 8px; }
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 8.5px; letter-spacing: .06em; }
  .search { order: 2; margin-left: auto; }
  .search input, .search input:focus { width: 104px; height: 36px; padding-right: 8px; }
  .search input:focus { width: 128px; }
  .site-nav { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 0 -4px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav-list { padding-right: 24px; }
  .nav-list a { padding: 6px 11px; font-size: 14px; }
  .hero { padding: calc(var(--nav-h) + 8px + 36px) 0 48px; }
  .hero-title { font-size: clamp(34px, 10vw, 44px); }
  .hero-lede { font-size: 17px; }
  .stats div { padding-right: 16px; margin-right: 16px; }
  .stats dd { font-size: 30px; }
  .stats dt { font-size: 10px; letter-spacing: .04em; }
  .mascot-card { transform: none; }
  .mascot { width: 190px; }
  .section { padding-top: 56px; }
  .project-strip {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin: 0 -16px; padding: 4px 16px 14px; scroll-padding: 0 16px; scrollbar-width: thin;
  }
  .project, .project:nth-child(-n+2) { flex: 0 0 84%; scroll-snap-align: start; }
  .project:hover { transform: none; }
  .card-grid { grid-template-columns: 1fr; gap: 18px; }
  .card-featured .card-body { padding: 20px 20px 22px; }
  .card-body { padding: 16px 18px 20px; }
  .list-page { padding-top: calc(var(--nav-h) + 8px + 32px); }
  .article-band { padding-top: calc(var(--nav-h) + 8px + 32px); }
  .prose { font-size: 17px; }
  .prose pre, .prose .wp-block-code { margin-left: -18px; margin-right: -18px; border-radius: 0; border-left: 0; border-right: 0; font-size: 13.5px; }
  .project-box { flex-wrap: wrap; }
  .project-box .btn { width: 100%; justify-content: center; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Dark overrides that must come after the component rules. */
@media (prefers-color-scheme: dark) {
  .nav-list a:hover, .nav-list .current-menu-item > a { background: #3f3317; color: #ffdc6b; }
  .m-limb { stroke: #e9dfc8; }
  .m-shadow { fill: #000; opacity: .35; }
  .hand-word { background: linear-gradient(transparent 62%, rgba(232, 169, 0, .55) 62%, rgba(232, 169, 0, .55) 86%, transparent 86%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .spark { stroke-dashoffset: 0; }
}
