/* antjanus.com — 047 Keyboard-First / Command Palette
   Colorway: "Slate & Cream" — cream alpha keys, slate (#364f6a) modifiers, a burnt-orange Enter key. */

:root {
  --cream-50: #fbf8f2;
  --cream-100: #f3eee4;
  --cream-200: #e8e1d3;
  --cream-300: #d6cdbb;
  --cream-400: #b9ae98;
  --charcoal-900: #1d2025;
  --charcoal-700: #3a3f47;
  --grey-600: #575c64;
  --slate-500: #364f6a;
  --slate-600: #2a3f54;
  --slate-400: #4a6d8c;
  --slate-200: #c9d5e2;
  --orange-600: #ad4119;
  --orange-700: #8a3213;
  --orange-300: #f08a5d;
  --gold-700: #8a5a06;
  --gold-300: #d4a853;
  --green-700: #2d6a4c;
  --green-300: #6cc79a;

  --ground: var(--cream-100);
  --surface: var(--cream-50);
  --surface-2: var(--cream-200);
  --line: var(--cream-300);
  --line-strong: var(--cream-400);
  --ink: var(--charcoal-900);
  --ink-2: var(--charcoal-700);
  --dim: var(--grey-600);
  --mod: var(--slate-500);
  --mod-top: #405c7a;
  --mod-edge: var(--slate-600);
  --mod-ink: #f3eee4;
  --mod-dim: #c7d3e0;
  --ico: var(--slate-500);
  --accent: var(--orange-600);
  --accent-edge: var(--orange-700);
  --accent-ink: #fffaf3;
  --accent-soft: #f6dccd;
  --gold: var(--gold-700);
  --ok: var(--green-700);
  --focus: #1f6feb;
  --key-top: #fffdf8;
  --key-shine: rgba(255, 255, 255, 0.75);
  --shadow: 0 1px 0 rgba(29, 32, 37, 0.04), 0 12px 32px -12px rgba(29, 32, 37, 0.22);
  --shadow-lg: 0 40px 80px -20px rgba(20, 22, 26, 0.45), 0 0 0 1px rgba(20, 22, 26, 0.08);
  --code-bg: #20242b;
  --code-ink: #e6e1d6;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 10px;
  --radius-lg: 16px;
  --gutter: clamp(16px, 3vw, 40px);
  --maxw: 1320px;
  --topbar-h: 64px;
  --hint-h: 48px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #15181c;
    --surface: #1c2026;
    --surface-2: #252a32;
    --line: #313843;
    --line-strong: #46505d;
    --ink: #eee9df;
    --ink-2: #d2ccc0;
    --dim: #a6adb7;
    --mod: #3d5876;
    --mod-top: #47658a;
    --mod-edge: #243549;
    --mod-ink: #eef2f7;
    --mod-dim: #b9c8d9;
    --ico: #9fb7d3;
    --accent: var(--orange-300);
    --accent-edge: #b8582d;
    --accent-ink: #1d1208;
    --accent-soft: #3a261d;
    --gold: var(--gold-300);
    --ok: var(--green-300);
    --focus: #7cb2ff;
    --key-top: #2a3039;
    --key-shine: rgba(255, 255, 255, 0.06);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --code-bg: #101317;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #15181c;
  --surface: #1c2026;
  --surface-2: #252a32;
  --line: #313843;
  --line-strong: #46505d;
  --ink: #eee9df;
  --ink-2: #d2ccc0;
  --dim: #a6adb7;
  --mod: #3d5876;
  --mod-top: #47658a;
  --mod-edge: #243549;
  --mod-ink: #eef2f7;
  --mod-dim: #b9c8d9;
  --ico: #9fb7d3;
  --accent: var(--orange-300);
  --accent-edge: #b8582d;
  --accent-ink: #1d1208;
  --accent-soft: #3a261d;
  --gold: var(--gold-300);
  --ok: var(--green-300);
  --focus: #7cb2ff;
  --key-top: #2a3039;
  --key-shine: rgba(255, 255, 255, 0.06);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --code-bg: #101317;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: calc(var(--hint-h) + 8px);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--font-cond); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }

/* ---------- keycaps ---------- */
kbd, .kbd {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.2em;
  min-width: 1.85em; height: 1.85em; padding: 0 0.45em;
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; line-height: 1;
  color: var(--ink);
  background: linear-gradient(var(--key-top), var(--surface));
  border: 1px solid var(--line-strong); border-bottom-width: 3px; border-radius: 6px;
  box-shadow: inset 0 1px 0 var(--key-shine);
  white-space: nowrap; vertical-align: middle;
  transition: transform 90ms ease, border-bottom-width 90ms ease;
}
kbd.mod, .kbd.mod { background: linear-gradient(var(--mod-top), var(--mod)); color: var(--mod-ink); border-color: var(--mod-edge); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
kbd.acc, .kbd.acc { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); box-shadow: none; }
kbd.is-down { transform: translateY(2px); border-bottom-width: 1px; }
.chord { display: inline-flex; align-items: center; gap: 4px; }
.chord .then { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
html.sk-off .sk { display: none !important; }
@media (hover: none) and (pointer: coarse), (max-width: 700px) { .hint { display: none !important; } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); height: var(--topbar-h); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand svg { width: 38px; height: 38px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word b { font-family: var(--font-cond); font-size: 1.125rem; color: var(--ink); letter-spacing: .01em; }
.brand-word span { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
.trigger {
  flex: 1 1 360px; max-width: 460px; min-width: 0; height: 44px;
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  background: var(--ground); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--dim); cursor: pointer; text-align: left;
}
.trigger:hover { border-color: var(--mod); color: var(--ink); }
.trigger svg { flex-shrink: 0; }
.trigger .t-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px;
  text-decoration: none; color: var(--ink-2); border-radius: 8px; font-size: 1rem; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 8px 8px 0 0; }
.nav a kbd { font-size: 0.8125rem; height: 1.7em; min-width: 1.6em; }
.nav .chord { opacity: .9; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
.subnav { display: none; }
@media (max-width: 1180px) { .nav .chord { display: none; } }
@media (max-width: 900px) {
  .nav { display: none; }
  .trigger { max-width: none; }
  .brand-word { display: none; }
  .subnav {
    display: flex; gap: 4px; overflow-x: auto; padding: 0 var(--gutter) 8px; scrollbar-width: none;
    max-width: 100%;
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex-shrink: 0; min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); font-size: 0.9375rem; color: var(--ink-2); }
  .subnav a[aria-current="page"] { background: var(--mod); color: var(--mod-ink); border-color: var(--mod-edge); }
}

/* ---------- hint bar (bottom status line) ---------- */
.hintbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: var(--hint-h);
  background: var(--mod-edge); color: var(--mod-ink);
  border-top: 1px solid rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 22px; padding: 0 var(--gutter);
  font-size: 0.875rem; overflow: hidden;
}
.hintbar .hb-group { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hintbar kbd { background: linear-gradient(var(--mod-top), var(--mod)); color: var(--mod-ink); border-color: #16222f; box-shadow: inset 0 1px 0 rgba(255,255,255,.14); }
.hintbar kbd.acc { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.hintbar .hb-sep { flex: 1; }
.hintbar .hb-mode { font-family: var(--font-mono); color: var(--mod-dim); }
.hintbar .hb-pending { font-family: var(--font-mono); color: var(--gold-300); min-width: 7ch; }
.hintbar button { background: none; border: 0; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px; border-radius: 6px; }
.hintbar button:hover { background: rgba(255,255,255,.08); }
.hb-progress { font-family: var(--font-mono); color: var(--mod-dim); }
@media (max-width: 1100px) { .hintbar .hb-opt { display: none; } }
.fab { display: none; }
@media (hover: none) and (pointer: coarse), (max-width: 700px) {
  .hintbar { display: none; }
  body { padding-bottom: 88px; }
  .fab {
    display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 45; align-items: center; gap: 10px;
    min-height: 52px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid var(--accent-edge);
    background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow); cursor: pointer;
  }
}

/* ---------- section scaffolding ---------- */
.page-head { padding: clamp(40px, 6vw, 80px) 0 28px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin: 14px 0 16px; letter-spacing: -0.02em; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); color: var(--ink-2); max-width: 62ch; line-height: 1.55; }
.section { padding: 36px 0; }
.group-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.group-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.group-head .count { font-family: var(--font-mono); font-size: 0.875rem; color: var(--dim); }
.group-head .more { margin-left: auto; font-size: 0.9375rem; font-weight: 500; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; color: var(--ink); }
.group-head .more:hover { color: var(--accent); }
.group-head p.sub { flex-basis: 100%; color: var(--dim); font-size: 1rem; }

/* ---------- result rows (the core list unit) ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 14px 14px; margin: 0 -14px; border-radius: 10px; text-decoration: none; color: inherit;
  border: 1px solid transparent;
}
.row:hover { background: var(--surface); border-color: var(--line); }
.row:focus-visible { outline: none; background: var(--surface); border-color: var(--mod); box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.row:focus-visible .row-enter { opacity: 1; }
.row-idx { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); width: 2.2ch; text-align: right; }
.row-thumb { width: 104px; aspect-ratio: 16/10; border-radius: 7px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb.glyph { display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 1.125rem; color: var(--ico); background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.row-lead { display: flex; align-items: center; gap: 14px; }
.row-body { min-width: 0; }
.row-title { font-size: 1.125rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.row-desc { color: var(--ink-2); font-size: 1rem; margin-top: 4px; max-width: 72ch; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
.row-side { display: flex; align-items: center; gap: 10px; }
.row-enter { opacity: 0; transition: opacity 120ms; }
.row:hover .row-enter { opacity: .8; }
.tag { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
.tag::before { content: "#"; opacity: .7; }
.badge { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; padding: 2px 8px; border-radius: 5px; border: 1px solid currentColor; line-height: 1.5; }
.badge.new { color: var(--accent); }
.badge.upd { color: var(--gold); }
.badge.ok { color: var(--ok); }
@media (max-width: 700px) {
  .row { grid-template-columns: 1fr; gap: 10px; }
  .row-idx { display: none; }
  .row-thumb { width: 88px; }
  .row-side { display: none; }
  .row-desc { font-size: 1rem; }
}

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.panel.slate { background: var(--mod-edge); color: var(--mod-ink); border-color: #16222f; }
.panel.slate h2, .panel.slate h3 { color: #fff; }
.panel.slate .dim, .panel.slate p.sub { color: var(--mod-dim); }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 10px;
  font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-bottom-width: 3px; transition: transform 90ms, border-bottom-width 90ms;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(2px); border-bottom-width: 1px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary kbd { background: rgba(0,0,0,.14); color: inherit; border-color: rgba(0,0,0,.25); box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 4px; border-bottom-width: 1px; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--dim); border-bottom-width: 1px; }
.btn.quiet:hover { color: var(--ink); background: var(--surface-2); }
.panel.slate .btn:not(.primary) { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.2); }

/* ---------- launcher (home hero + patterns index) ---------- */
.launcher {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.launcher-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 64px; border-bottom: 1px solid var(--line); }
.launcher-input input { flex: 1; min-width: 0; background: transparent; border: 0; font-size: 1.25rem; color: var(--ink); height: 100%; }
.launcher-input input::placeholder { color: var(--dim); }
.launcher-input input:focus-visible { outline: none; }
.launcher-input:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
.launcher-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 420px; }
.launcher-list { border-right: 1px solid var(--line); padding: 8px; overflow-y: auto; max-height: 560px; }
.l-group { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding: 14px 12px 6px; }
.l-item {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--ink); min-height: 48px;
}
.l-item .l-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ico); font-family: var(--font-mono); font-weight: 600; font-size: 0.875rem; }
.l-item .l-title { font-weight: 500; line-height: 1.3; min-width: 0; }
.l-item .l-sub { display: block; font-size: 0.875rem; color: var(--dim); font-weight: 400; }
.l-item:hover, .l-item.is-active { background: var(--surface-2); }
.l-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.l-item:focus-visible { outline-offset: -3px; }
.launcher-detail { padding: 22px; display: flex; flex-direction: column; gap: 16px; background: var(--ground); min-width: 0; }
.launcher-detail .d-media { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface-2); border: 1px solid var(--line); }
.launcher-detail .d-media img { width: 100%; height: 100%; object-fit: cover; }
.launcher-detail .pat-thumb { aspect-ratio: 16/8; }
.launcher-detail h3 { font-size: 1.5rem; }
.launcher-detail .d-desc { color: var(--ink-2); }
.d-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.9375rem; }
.d-kv dt { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.d-kv dd { margin: 0; color: var(--ink); }
.launcher-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--dim); background: var(--surface); }
.launcher-foot span { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 860px) {
  .launcher-body { grid-template-columns: 1fr; }
  .launcher-list { border-right: 0; max-height: none; }
  .launcher-detail { display: none; }
  .launcher-foot .hint { display: none; }
}

/* ---------- home ---------- */
.hero { padding: clamp(36px, 6vw, 72px) 0 40px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.75rem); line-height: 1.02; letter-spacing: -0.025em; margin: 18px 0 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.stat-keys { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0; }
.stat-key {
  display: flex; flex-direction: column; justify-content: space-between; min-width: 118px; padding: 12px 14px 10px;
  border: 1px solid var(--line-strong); border-bottom-width: 5px; border-radius: 10px; background: linear-gradient(var(--key-top), var(--surface));
}
.stat-key b { font-family: var(--font-mono); font-size: 1.75rem; color: var(--ink); line-height: 1.1; }
.stat-key span { font-size: 0.875rem; color: var(--dim); }
.stat-key.mod { background: linear-gradient(var(--mod-top), var(--mod)); border-color: var(--mod-edge); }
.stat-key.mod b { color: #fff; } .stat-key.mod span { color: var(--mod-dim); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-portrait { display: none; }
@media (max-width: 860px) {
  .hero-portrait { display: block; margin: 0 0 22px; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; border: 1px solid var(--line-strong); }
  .hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 30%; }
}

.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; }
@media (max-width: 980px) { .three { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.linklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 2px; }
.linklist a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.linklist a:hover { background: var(--surface-2); }
.linklist .dim { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; }
.panel.slate .linklist a { color: #fff; }
.panel.slate .linklist a:hover { background: rgba(255,255,255,.08); }

.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
@media (max-width: 1100px) { .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .action-grid { grid-template-columns: 1fr; } }
.action {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom-width: 4px; transition: transform 90ms, border-bottom-width 90ms;
}
.action:hover { border-color: var(--mod); }
.action:active { transform: translateY(3px); border-bottom-width: 1px; }
.action .a-top { display: flex; justify-content: space-between; align-items: center; }
.action h3 { font-size: 1.25rem; }
.action .a-type { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.action .a-tech { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); margin-top: auto; }

/* ---------- filter bar ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 0; position: sticky; top: var(--topbar-h); z-index: 20; background: var(--ground); border-bottom: 1px solid var(--line); }
.filter-input { flex: 1 1 320px; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 10px 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; min-width: 0; }
.filter-input:focus-within { border-color: var(--mod); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.filter-input input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.0625rem; height: 100%; color: var(--ink); }
.filter-input input::placeholder { color: var(--dim); }
.filter-input input:focus-visible { outline: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 0.9375rem; font-weight: 500;
}
.chip kbd { height: 1.6em; min-width: 1.6em; font-size: 0.8125rem; }
.chip:hover { border-color: var(--mod); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--mod); color: var(--mod-ink); border-color: var(--mod-edge); }
.chip[aria-pressed="true"] .dim { color: var(--mod-dim); }
.chip[aria-pressed="true"] kbd { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(0,0,0,.3); box-shadow: none; }
@media (hover: none) and (pointer: coarse) { .chip { padding: 0 14px; } }
.result-line { display: flex; gap: 14px; align-items: center; font-family: var(--font-mono); font-size: 0.875rem; color: var(--dim); padding: 12px 0 4px; min-height: 44px; flex-wrap: wrap; }
.result-line button { background: none; border: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font: inherit; min-height: 44px; padding: 0 6px; }
.result-line select { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; min-height: 40px; padding: 0 8px; color: var(--ink); font-family: var(--font-sans); font-size: 0.9375rem; }
.result-line .spacer { flex: 1; }
.empty { display: none; padding: 40px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 14px; margin: 16px 0; }
.empty.is-shown { display: block; }
.empty h3 { font-size: 1.375rem; margin-bottom: 6px; }
.empty p { color: var(--dim); margin-bottom: 14px; }
.year-head { font-family: var(--font-mono); font-size: 0.875rem; color: var(--dim); padding: 22px 0 6px; display: flex; align-items: center; gap: 12px; }
.year-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
[hidden] { display: none !important; }

/* ---------- shelf cards (featured) ---------- */
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 980px) { .shelf { grid-template-columns: 1fr; } }
.shelf-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-bottom-width: 4px; }
.shelf-card:hover { border-color: var(--mod); }
.shelf-card .s-img { aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.shelf-card .s-img img { width: 100%; height: 100%; object-fit: cover; }
.shelf-card .s-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.shelf-card h3 { font-size: 1.3125rem; line-height: 1.2; }
.shelf-card .s-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }

/* ---------- stories ---------- */
.stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .stories { grid-template-columns: 1fr; } }
.story { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.story:hover { border-color: var(--mod); }
.story .st-img { aspect-ratio: 3/2; overflow: hidden; background: var(--mod-edge); position: relative; }
.story .st-img img { width: 100%; height: 100%; object-fit: cover; }
.story .st-part { position: absolute; left: 12px; top: 12px; }
.story .st-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.story h3 { font-size: 1.375rem; }
.story .st-cta { margin-top: auto; font-weight: 600; color: var(--accent); display: inline-flex; gap: 8px; align-items: center; }
.soon { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
@media (max-width: 800px) { .soon { grid-template-columns: 1fr; } }
.soon > div { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 16px 18px; color: var(--dim); }
.soon b { color: var(--ink-2); display: block; }
.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); padding: 14px 16px; border-radius: 12px; }

/* ---------- projects ---------- */
.jumpbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0; position: sticky; top: var(--topbar-h); z-index: 20; background: var(--ground); border-bottom: 1px solid var(--line); }
.jumpbar a { text-decoration: none; }
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; overflow: hidden; padding: 0; }
.feature .f-body { padding: clamp(22px, 3vw, 40px); display: flex; flex-direction: column; gap: 16px; }
.feature .f-img { background: #0c1f33; min-height: 320px; }
.feature .f-img img { width: 100%; height: 100%; object-fit: cover; }
.feature h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
@media (max-width: 900px) { .feature { grid-template-columns: 1fr; } .feature .f-img { min-height: 220px; } }
.statrow { display: flex; gap: 10px; flex-wrap: wrap; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 16px; }
.proj { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.proj:hover { border-color: var(--mod); }
.proj .p-img { aspect-ratio: 16/10; background: #16181c; overflow: hidden; border-bottom: 1px solid var(--line); }
.proj .p-img img { width: 100%; height: 100%; object-fit: cover; }
.proj .p-img.glyph { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); color: var(--ico); font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; }
.proj .p-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.proj h3 { font-size: 1.25rem; }
.proj .p-tech { margin-top: auto; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
.stars { font-family: var(--font-mono); font-size: 0.875rem; color: var(--gold); white-space: nowrap; }

/* ---------- about ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(36px, 5vw, 64px) 0 20px; }
.portrait { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 4/5; border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow-lg); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.portrait figcaption span { background: rgba(20,22,26,.78); color: #f3eee4; font-family: var(--font-mono); font-size: 0.8125rem; padding: 6px 10px; border-radius: 6px; }
@media (max-width: 900px) { .about-hero { grid-template-columns: 1fr; } .portrait { aspect-ratio: 1/1; max-width: 460px; } }
.keyrow { display: flex; gap: 6px; margin: 18px 0 8px; }
.keyrow .career-key {
  flex: var(--w) 1 0; min-width: 0; min-height: 76px; padding: 10px; border-radius: 9px;
  display: flex; flex-direction: column; justify-content: space-between; text-decoration: none;
  background: linear-gradient(var(--key-top), var(--surface)); border: 1px solid var(--line-strong); border-bottom-width: 5px; color: var(--ink);
}
.keyrow .career-key b { font-size: 0.9375rem; line-height: 1.2; overflow-wrap: anywhere; }
.keyrow .career-key span { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
.keyrow .career-key.now { background: var(--accent); border-color: var(--accent-edge); color: var(--accent-ink); }
.keyrow .career-key.now span { color: var(--accent-ink); opacity: .9; }
@media (max-width: 900px) { .keyrow { flex-wrap: wrap; } .keyrow .career-key { flex: 1 1 calc(50% - 6px); min-height: 64px; } }
.phases { display: grid; gap: 0; margin-top: 18px; border-left: 2px solid var(--line-strong); }
.phase { position: relative; padding: 4px 0 28px 28px; }
.phase::before { content: ""; position: absolute; left: -8px; top: 10px; width: 14px; height: 14px; border-radius: 4px; background: var(--surface); border: 2px solid var(--mod); }
.phase.now::before { background: var(--accent); border-color: var(--accent-edge); }
.phase h3 { font-size: 1.5rem; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.phase h3 .mono { font-size: 0.875rem; color: var(--dim); font-weight: 400; }
.phase p { max-width: 70ch; margin-top: 6px; }
.roles { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.roles li { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.roles li b { color: var(--ink); }
.roles .mono { font-size: 0.8125rem; color: var(--dim); }
.bullets { margin: 10px 0 0; padding-left: 1.2em; max-width: 72ch; }
.bullets li { margin: 6px 0; }
.principles { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.principles li { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); font-size: 1.1875rem; font-style: italic; color: #fff; }
.cap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
@media (max-width: 800px) { .cap-grid { grid-template-columns: 1fr; } }
.cap { padding: 18px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); }
.cap h3 { font-size: 1.25rem; margin-bottom: 6px; }
.cap p { color: var(--mod-dim); }
.cap .keys { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cap .keys span { font-family: var(--font-mono); font-size: 0.8125rem; padding: 6px 9px; border-radius: 6px; background: linear-gradient(#4c6a8c, #3d5876); border: 1px solid #16222f; border-bottom-width: 3px; color: #fff; }
.beyond { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: stretch; }
.beyond .b-photo { border-radius: 16px; overflow: hidden; min-height: 320px; background: var(--surface-2); }
.beyond .b-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .beyond { grid-template-columns: 1fr; } }
.defs { display: grid; gap: 14px; }
.defs div { padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.defs b { display: block; color: var(--ink); font-size: 1.125rem; margin-bottom: 2px; }

/* ---------- article ---------- */
.a-layout { display: grid; grid-template-columns: 240px minmax(0, 720px) 240px; gap: 48px; justify-content: center; }
.a-toc, .a-actions { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; }
.rail-title { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 10px; }
.toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc-list a { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 8px 8px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.3; min-height: 44px; }
.toc-list a:hover { background: var(--surface); color: var(--ink); }
.toc-list a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.toc-list a[aria-current="true"] kbd { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); }
.act-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.act-list a, .act-list button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; text-align: left; }
.act-list a:hover, .act-list button:hover { background: var(--surface); color: var(--ink); }
.a-head { padding: clamp(32px, 5vw, 64px) 0 28px; max-width: 900px; margin: 0 auto; }
.a-head h1 { font-size: clamp(2.3rem, 5.4vw, 4.25rem); letter-spacing: -0.025em; margin: 16px 0; line-height: 1.04; }
.a-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--font-mono); font-size: 0.875rem; color: var(--dim); margin-top: 18px; }
.a-meta a { color: var(--ink); }
.a-banner { max-width: 1000px; margin: 0 auto 40px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.a-banner img { width: 100%; height: auto; }
.mobile-toc { display: none; }
.prose { font-size: 1.125rem; line-height: 1.75; color: var(--ink-2); min-width: 0; }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-top: 2.2em; display: flex; gap: 12px; align-items: center; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose h2 kbd { font-size: 0.8125rem; }
.prose a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }
.prose code { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose strong { color: var(--ink); }
.callout { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 14px 18px; background: var(--surface); font-size: 1.0625rem; }
.callout .c-label { display: inline-flex; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.callout.why { border-left-color: var(--mod); }
.callout.why .c-label { color: var(--mod); }
:root[data-theme="dark"] .callout.why .c-label { color: var(--mod-dim); }
.callout.q { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.q .c-label { color: var(--accent); }
.callout.note { border-left-color: var(--gold); }
.callout.note .c-label { color: var(--gold); }
.callout.skill { border-left-color: var(--ok); }
.callout.skill .c-label { color: var(--ok); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .callout.why .c-label { color: var(--mod-dim); } }
.code { margin-left: -40px; margin-right: -40px; border-radius: 12px; overflow: hidden; background: var(--code-bg); border: 1px solid #0b0d10; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08); color: #b9b3a7; font-family: var(--font-mono); font-size: 0.8125rem; }
.code-head button { display: inline-flex; gap: 8px; align-items: center; background: none; border: 1px solid rgba(255,255,255,.18); color: #e6e1d6; border-radius: 7px; min-height: 36px; padding: 0 10px; cursor: pointer; font-family: var(--font-mono); font-size: 0.8125rem; }
.code-head button:hover { background: rgba(255,255,255,.08); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--code-ink); font-family: var(--font-mono); font-size: 0.9375rem; line-height: 1.6; tab-size: 2; }
.code pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.tk-k { color: #f0a070; } .tk-s { color: #a8d38c; } .tk-c { color: #8c96a3; font-style: italic; } .tk-t { color: #8cc4f0; } .tk-f { color: #e7cf7d; }
@media (max-width: 1280px) { .a-layout { grid-template-columns: 220px minmax(0, 720px); } .a-actions { display: none; } }
@media (max-width: 1000px) {
  .a-layout { grid-template-columns: minmax(0, 1fr); }
  .a-toc { display: none; }
  .mobile-toc { display: block; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .mobile-toc summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; padding: 0 16px; font-family: var(--font-mono); font-size: 0.875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
  .mobile-toc .toc-list { padding: 0 8px 10px; }
  .code { margin-left: 0; margin-right: 0; }
}
.after { max-width: 720px; margin: 48px auto 0; display: grid; gap: 24px; }
.tags-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tags-row a { font-family: var(--font-mono); font-size: 0.875rem; text-decoration: none; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--line-strong); color: var(--ink-2); min-height: 36px; display: inline-flex; align-items: center; }
.share { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.newsletter-form input[type="email"] { flex: 1 1 220px; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); min-width: 0; }
.panel.slate .newsletter-form input[type="email"] { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.panel.slate .newsletter-form input::placeholder { color: var(--mod-dim); }
.form-msg { margin-top: 10px; font-size: 1rem; min-height: 1.5em; }
.form-msg.err { color: var(--accent); }
.panel.slate .form-msg.err { color: #ffb08a; }
.progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 60; width: 0; }

/* ---------- patterns ---------- */
.explainer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
@media (max-width: 860px) { .explainer { grid-template-columns: 1fr; } }
.explainer div { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.explainer b { display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 1.125rem; margin-bottom: 4px; }
.pat-thumb { position: relative; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 18px; }
.pat-thumb .pt { width: 100%; height: 100%; }
.pt-data { background: linear-gradient(90deg, transparent 0 0) ; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background-color: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pt-data i { background: var(--surface); position: relative; }
.pt-data i::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 18%; height: calc(var(--h) * 1%); background: var(--mod); border-radius: 3px 3px 0 0; opacity: .85; }
.pt-layout { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; }
.pt-layout i { background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; }
.pt-layout i:first-child { grid-row: span 2; background: color-mix(in srgb, var(--mod) 25%, var(--surface)); }
.pt-interaction { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; }
.pt-interaction i { width: 70%; height: 22%; border-radius: 8px; border: 1px solid var(--line-strong); border-bottom-width: 4px; background: var(--surface-2); }
.pt-interaction i:nth-child(2) { background: var(--accent); border-color: var(--accent-edge); width: 50%; }
.pt-forms { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.pt-forms i { height: 18%; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); }
.pt-forms i:last-child { width: 40%; background: var(--mod); border-color: var(--mod-edge); }
.pt-color { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pt-color i { border-radius: 6px; }
.pt-color i:nth-child(1) { background: var(--slate-600); } .pt-color i:nth-child(2) { background: var(--slate-400); } .pt-color i:nth-child(3) { background: var(--cream-300); } .pt-color i:nth-child(4) { background: var(--gold-300); } .pt-color i:nth-child(5) { background: var(--orange-600); }
.pat-list-item .l-ico { font-size: 0.8125rem; }
.pat-good { margin: 0; padding-left: 1.2em; }
.pat-card-grid { display: none; }

/* pattern detail */
.pd-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: end; padding: clamp(28px, 5vw, 56px) 0 24px; }
@media (max-width: 900px) { .pd-top { grid-template-columns: 1fr; gap: 20px; } }
.backlink { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); font-weight: 500; min-height: 44px; }
.usecases { columns: 2; column-gap: 28px; padding-left: 1.2em; margin: 10px 0 0; }
@media (max-width: 600px) { .usecases { columns: 1; } }
.panes { border: 1px solid var(--line-strong); border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.panes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--ground); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; border: 1px solid transparent; border-radius: 9px; background: none; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.tab kbd { height: 1.6em; min-width: 1.6em; }
.tab:hover { background: var(--surface); }
.tab[aria-selected="true"] { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.panes-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panes-actions .btn { min-height: 44px; font-size: 0.9375rem; }
.pane { padding: 24px; }
.pane pre { margin: 0; overflow-x: auto; font-family: var(--font-mono); font-size: 0.9375rem; line-height: 1.6; background: var(--code-bg); color: var(--code-ink); padding: 16px 18px; border-radius: 10px; }
.pane .note { margin-bottom: 14px; color: var(--ink-2); font-size: 1rem; }
.prompt-text { font-size: 1.0625rem; max-width: 72ch; }
.prompt-text p + p { margin-top: 1em; }
.stage { background: var(--ground); border-radius: 12px; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); }
.stage .cap { background: none; border: 0; padding: 0; margin: 0 0 10px; color: var(--dim); font-size: 0.9375rem; }
.hss-strip { display: grid; gap: 1px; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; grid-template-columns: 1fr; }
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 42rem) { .hss-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; border: 0; font: inherit; color: inherit; }
button.hss-tile { cursor: pointer; min-height: 88px; }
button.hss-tile:hover { background: var(--surface-2); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--mod) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--mod); }
.hss-label { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); overflow-wrap: anywhere; }
.hss-fig { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.15; }
.hss-fig.missing { color: var(--dim); font-weight: 400; }
.hss-unit { font-size: 0.875rem; color: var(--dim); }
.dl-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.dl-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dl-list li:first-child { border-top: 0; }
.dl-status { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); }
.dl-status.done { color: var(--ok); } .dl-status.failed { color: var(--accent); }
.dl-note { margin-top: 10px; font-size: 0.9375rem; color: var(--dim); }

/* ---------- footer ---------- */
.footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--surface); padding: 48px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr; gap: 32px; }
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h2 { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer ul a { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 40px; text-decoration: none; color: var(--ink-2); font-size: 1rem; }
.footer ul a:hover { color: var(--accent); }
.footer ul kbd { font-size: 0.8125rem; height: 1.6em; }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.9375rem; color: var(--dim); }

/* ---------- dialogs: palette + shortcut sheet ---------- */
dialog { border: 0; padding: 0; background: transparent; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(18, 20, 24, 0.5); backdrop-filter: blur(3px); }
.palette { position: fixed; inset: 10vh 0 auto 0; margin: 0 auto; width: min(720px, calc(100vw - 24px)); }
.palette-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 64px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.palette-input input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.1875rem; color: var(--ink); height: 100%; }
.palette-input input:focus-visible { outline: none; }
.palette-input .scope { font-family: var(--font-mono); font-size: 0.8125rem; padding: 4px 8px; border-radius: 6px; background: var(--mod); color: var(--mod-ink); }
.palette-list { overflow-y: auto; padding: 6px 8px 10px; flex: 1; overscroll-behavior: contain; }
.p-group { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); padding: 12px 10px 4px; }
.p-item { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 9px; cursor: pointer; min-height: 48px; color: var(--ink); }
.p-item .p-type { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); text-transform: uppercase; }
.p-item .p-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item .p-sub { display: block; font-size: 0.875rem; color: var(--dim); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item mark { background: none; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.p-item[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.p-item .p-keys { display: flex; gap: 4px; align-items: center; }
.p-empty { padding: 36px 20px; text-align: center; color: var(--dim); }
.p-empty b { display: block; color: var(--ink); font-size: 1.125rem; margin-bottom: 6px; }
.palette-foot { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--dim); background: var(--ground); flex-shrink: 0; }
.palette-foot span { display: inline-flex; align-items: center; gap: 6px; }
.palette-foot .grow { flex: 1; }
@media (max-width: 700px) { .palette { inset: 12px 0 auto 0; } .palette-box { max-height: calc(100vh - 24px); } .palette-foot .hint, .p-item .p-keys { display: none; } .p-item { grid-template-columns: 52px minmax(0,1fr); } }

.sheet { position: fixed; inset: 6vh 0 auto 0; margin: 0 auto; width: min(1080px, calc(100vw - 24px)); }
.sheet-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; padding: 24px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sheet-head h2 { font-size: 1.75rem; }
.keyboard { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-strong); margin-bottom: 22px; }
.kb-row { display: flex; gap: 6px; }
.kb-row span {
  flex: var(--u, 1) 1 0; min-width: 0; height: 60px; line-height: 1.2; display: flex; flex-direction: column; justify-content: space-between; padding: 5px 7px;
  border-radius: 7px; background: linear-gradient(var(--key-top), var(--surface)); border: 1px solid var(--line-strong); border-bottom-width: 4px;
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--dim); overflow: hidden;
}
.kb-row span.m { background: linear-gradient(var(--mod-top), var(--mod)); color: var(--mod-dim); border-color: var(--mod-edge); }
.kb-row span.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-edge); font-weight: 600; }
.kb-row span b { font-weight: 600; }
.kb-row span small { font-family: var(--font-sans); font-size: 0.8125rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .keyboard { display: none; } }
.sheet-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .sheet-cols { grid-template-columns: 1fr; } }
.sheet-cols h3 { font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 8px; }
.sheet-cols dl { margin: 0; display: grid; gap: 6px; }
.sheet-cols dl div { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.sheet-cols dd { margin: 0; display: flex; gap: 4px; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; background: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; cursor: pointer; color: var(--ink); }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 150ms; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 150ms; }
.switch[aria-checked="true"] .track { background: var(--ok); }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }
.toast { position: fixed; left: 50%; bottom: calc(var(--hint-h) + 16px); transform: translate(-50%, 20px); opacity: 0; z-index: 80; background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 10px; font-weight: 500; pointer-events: none; transition: opacity 150ms, transform 150ms; }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 700px) { .toast { bottom: 84px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}

/* narrow-screen refinements */
.backlink { margin-top: 20px; }
@media (max-width: 700px) {
  .filterbar, .jumpbar { position: static; }
  .filterbar .chips, .jumpbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .filterbar .chips { width: 100%; }
  .chip { flex-shrink: 0; }
}
