@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/source-sans-3-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/source-sans-3-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #101114;
  --bg-2: #17181c;
  --card: #1a1b20;
  --line: #2a2c33;
  --text: #f2f3f5;
  --muted: #9a9ea8;
  --red: #e2231a;
  --header-h: 64px;
  --r-btn: 9px;
  --r-tag: 6px;
  --font-display: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --surface-hover: #1f2127;
  --line-strong: #3a3d46;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  background: var(--bg-2); color: var(--muted);
  font-family: var(--font-mono); font-size: 11px; line-height: 1; font-weight: 600;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(23, 24, 28, 0.92);
  backdrop-filter: blur(12px);
}
.header-inner {
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.header-lead {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  transition: left 0.36s cubic-bezier(0.22, 1, 0.36, 1), transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-header.is-expanded .header-lead {
  left: max(24px, calc(50% - 620px + 24px));
  transform: translate(0, -50%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; }
.brand-cube {
  width: 22px; height: 22px;
  background: var(--red);
  border-radius: 4px;
  transform: rotate(12deg);
  box-shadow: 4px 4px 0 #8a140f;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-kicker {
  display: none;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.brand-name { font-family: var(--font-display); font-size: 18px; font-weight: 800; }

.header-actions {
  display: flex; align-items: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.site-header.is-expanded .header-actions,
.site-header:focus-within .header-actions {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.25s ease 0.12s, visibility 0s;
}

.cmd-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 8px 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-btn);
  background: var(--bg-2); color: var(--muted);
  font-size: 14px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cmd-trigger:hover, .cmd-trigger:focus-visible {
  border-color: var(--line-strong); color: var(--text); background: var(--surface-hover);
}
.cmd-trigger svg { width: 16px; height: 16px; }
.header-search { width: 168px; }
.cmd-trigger-label { flex: 1; text-align: left; }

.view { padding: calc(var(--header-h) + 28px) 0 64px; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.page-head p { margin-top: 6px; color: var(--muted); max-width: 46ch; }

.browser {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.side-label {
  margin: 0 12px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cat-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.cat-link svg { width: 16px; height: 16px; }
.cat-link:hover { color: var(--text); background: var(--surface-hover); }
.cat-link.is-active {
  color: var(--text);
  background: #241416;
  box-shadow: inset 0 0 0 1px rgba(226, 35, 26, 0.55);
}
.cat-name { flex: 1; min-width: 0; }
.cat-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 42px;
  margin-bottom: 8px;
}
.count { color: var(--muted); font-size: 14px; font-weight: 600; }
.tool-search {
  display: flex; align-items: center; gap: 8px;
  width: min(240px, 100%);
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg-2);
  color: var(--muted);
}
.tool-search:focus-within { border-color: var(--line-strong); color: var(--text); }
.tool-search svg { width: 15px; height: 15px; }
.tool-search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
}
.tool-search input::placeholder { color: #6b6f7a; }
.tool-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.list { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.row:hover { background: var(--surface-hover); }
.thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid; place-items: center;
}
.swatch { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.row-title { display: block; font-weight: 700; line-height: 1.25; }
.row-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.empty {
  padding: 48px 8px;
  color: var(--muted);
  text-align: center;
}
.empty strong { display: block; margin-bottom: 4px; color: var(--text); }

.recipe-back {
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 14px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.recipe-back:hover { color: var(--text); }
.recipe-kicker { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.recipe h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.03em;
}
.recipe-lead { margin-top: 8px; color: var(--muted); }
.recipe-note, .recipe-notes {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.wool-line { margin-top: 14px; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  height: 24px; padding: 0 8px;
  border-radius: var(--r-tag);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center;
}
.bench-wrap { margin-top: 18px; }
.bench-wrap h3 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bench {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #141518;
}
.craft-grid {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  gap: 4px;
}
.slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 3px;
  background: #3a3d44;
  box-shadow: inset 3px 3px 0 #1a1c20, inset -2px -2px 0 #5a5e68;
  color: var(--text);
}
.slot.is-empty { box-shadow: inset 3px 3px 0 #1a1c20, inset -2px -2px 0 #4a4e56; }
.slot-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}
.slot-mark.is-result { font-size: 9px; letter-spacing: -0.02em; }
.slot-wool {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(255, 255, 255, 0.28);
}
.slot-count {
  position: absolute;
  right: 4px;
  bottom: 1px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 1px 1px 0 #000, -1px 0 0 #000;
}
.craft-arrow {
  width: 22px;
  height: 22px;
  flex: none;
  background: var(--muted);
  clip-path: polygon(0 30%, 55% 30%, 55% 0, 100% 50%, 55% 100%, 55% 70%, 0 70%);
}
.craft-out { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 72px; }
.out-name { max-width: 120px; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.2; }
.ingredients { margin-top: 10px; color: var(--muted); font-size: 14px; }
.ingredients strong { color: var(--text); font-weight: 700; }

.search-layer { position: fixed; inset: 0; z-index: 89; }
.search-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.search-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.search-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 4px;
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 8px; height: 48px; color: var(--muted); }
.search-field svg { width: 18px; height: 18px; }
.search-field input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none; font-size: 16px;
}
.search-field input::placeholder { color: #6b6f7a; }
.search-esc {
  display: none;
  height: 28px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-2); color: var(--muted); cursor: pointer;
  font-family: var(--font-mono); font-size: 12px;
}
.search-results { flex: 1; overflow-y: auto; padding: 6px 8px 16px; }
.cmd-group { padding: 6px 0 4px; }
.cmd-group + .cmd-group { border-top: 1px solid var(--line); margin-top: 4px; }
.cmd-group h3 {
  padding: 6px 10px 4px;
  color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.cmd-row {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px;
  width: 100%; min-height: 44px; padding: 6px 10px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer; text-align: left;
}
.cmd-row.is-active { background: var(--surface-hover); }
.cmd-ic {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--red);
}
.cmd-ic svg { width: 16px; height: 16px; }
.cmd-title { font-weight: 600; font-size: 15px; }
.cmd-sub { color: var(--muted); font-size: 13px; }
.cmd-empty { padding: 36px 16px; color: var(--muted); text-align: center; }
.cmd-empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.cmd-foot {
  display: none; align-items: center; gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.cmd-foot-hint { margin-left: auto; }

@media (min-width: 720px) and (hover: hover) {
  .search-panel {
    inset: 10vh auto auto 50%;
    translate: -50% 0;
    width: min(640px, calc(100vw - 32px));
    max-height: 72vh;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
  }
  .search-back { display: none; }
  .search-esc { display: inline-flex; }
  .search-bar { padding: 6px 10px; }
  .cmd-foot { display: flex; }
}

@media (max-width: 720px), (hover: none) {
  .header-inner { justify-content: space-between; }
  .header-lead { position: static; transform: none; }
  .site-header.is-expanded .header-lead { left: auto; transform: none; }
  .brand-kicker { display: block; }
  .header-actions { opacity: 1; visibility: visible; pointer-events: auto; }
  .header-search { width: auto; }
  .header-search .cmd-trigger-label,
  .header-search kbd { display: none; }
  .browser { grid-template-columns: 1fr; gap: 16px; }
  #cat-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .cat-link { width: auto; white-space: nowrap; }
  .container { width: min(1120px, calc(100% - 24px)); }
}
