/* ============================================================
   SecureW2 AI Security Glossary mockup
   Single-file prototype. Tokens lifted from the in-repo SW2
   Cockpit/Sentinel design system. Dark default + light toggle.
   ============================================================ */

:root {
  /* surfaces (dark) */
  --bg: #0c0c0c;
  --bg-elevated: #17171b;
  --bg-raised: #131316;
  --bg-card: rgba(255,255,255,0.025);
  --bg-input: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.045);
  --surface-active: rgba(255,255,255,0.07);

  /* SecureW2 red */
  --accent: #c33329;
  --accent-hover: #d43e33;
  --accent-dim: rgba(195,51,41,0.12);
  --accent-glow: rgba(195,51,41,0.20);
  --accent-ghost: rgba(195,51,41,0.06);
  --accent-2: #f2994a; /* amber secondary */

  /* text */
  --text: #f7f8f8;
  --text-muted: #b4bbc8;
  --text-dim: #8a8f98;
  --text-quaternary: #62666d;

  /* borders */
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.14);
  --border-subtle: rgba(255,255,255,0.05);

  /* status */
  --success: #4cb782;

  /* grid lines */
  --grid-line: rgba(255,255,255,0.022);
  --nav-bg: rgba(12,12,12,0.72);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-full: 999px;

  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.18);
  --shadow-hover: 0 6px 16px rgba(0,0,0,0.5), 0 28px 56px rgba(0,0,0,0.4);
  --shadow-pop: 0 24px 70px rgba(0,0,0,0.7);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1240px;
}

:root {
  --bg: #fbfbfc;
  --bg-elevated: #ffffff;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --surface-hover: #f4f5f7;
  --surface-active: #eef0f3;

  --accent: #c33329;
  --accent-hover: #a82a22;
  --accent-dim: rgba(195,51,41,0.08);
  --accent-glow: rgba(195,51,41,0.14);
  --accent-ghost: rgba(195,51,41,0.05);

  --text: #14161a;
  --text-muted: #4c5462;
  --text-dim: #6b7280;
  --text-quaternary: #9aa1ac;

  --border: rgba(15,20,30,0.10);
  --border-light: rgba(15,20,30,0.16);
  --border-subtle: rgba(15,20,30,0.06);

  --grid-line: rgba(15,30,60,0.035);
  --nav-bg: rgba(251,251,252,0.78);

  --shadow-card: 0 1px 2px rgba(15,23,42,0.06), 0 8px 24px rgba(15,23,42,0.06);
  --shadow-hover: 0 8px 20px rgba(15,23,42,0.1), 0 24px 48px rgba(15,23,42,0.1);
  --shadow-pop: 0 24px 70px rgba(15,23,42,0.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* blueprint grid + radial glows behind everything */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 35%, transparent 80%);
}
body::after {
  content: '';
  position: fixed; pointer-events: none; z-index: 0;
  top: -280px; right: -160px;
  width: 760px; height: 760px; border-radius: 50%;
  filter: blur(130px); opacity: 0.7;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 62%);
}
.glow-2 {
  content: ''; position: fixed; pointer-events: none; z-index: 0;
  bottom: -340px; left: -220px;
  width: 720px; height: 720px; border-radius: 50%;
  filter: blur(140px); opacity: 0.5;
  background: radial-gradient(circle, rgba(94,106,210,0.18) 0%, transparent 62%);
}
.glow-2 { opacity: 0.35; }

.wrap { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }

::selection { background: var(--accent-dim); color: var(--text); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-quaternary); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------------- header ---------------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.03em; font-size: 16px; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(150deg, var(--accent), #8b1a1a);
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 6px 16px var(--accent-glow);
}
.brand .sub { color: var(--text-dim); font-weight: 500; font-size: 13px; letter-spacing: -0.01em; }
.brand .divider { width: 1px; height: 16px; background: var(--border-light); }
.nav-links { display: flex; gap: 4px; margin-left: 6px; }
.nav-links a { padding: 7px 11px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; font-weight: 500; transition: background .18s var(--ease), color .18s var(--ease); }
.nav-links a:hover { background: var(--surface-hover); color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-spacer { flex: 1; }
.nav-search-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-input); border: 1px solid var(--border);
  padding: 7px 10px 7px 11px; border-radius: var(--radius); color: var(--text-dim);
  font-size: 13px; min-width: 210px; transition: border-color .18s var(--ease), background .18s var(--ease);
}
.nav-search-btn:hover { border-color: var(--border-light); background: var(--surface-hover); }
.nav-search-btn .ph { flex: 1; text-align: left; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: var(--radius-xs); background: var(--surface-active); border: 1px solid var(--border); color: var(--text-dim); }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; color: var(--text-muted); border: 1px solid var(--border); background: var(--bg-input); transition: all .18s var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--border-light); background: var(--surface-hover); }
.btn-primary { background: var(--accent); color: #fff; padding: 8px 15px; border-radius: var(--radius); font-weight: 600; font-size: 13px; transition: background .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease); box-shadow: 0 6px 18px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 26px var(--accent-glow); }

/* ---------------- hero ---------------- */
.hero { padding: 60px 0 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.13em; color: var(--accent); padding: 5px 11px; border: 1px solid var(--accent-dim); border-radius: var(--radius-full); background: var(--accent-ghost); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; margin-top: 22px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; margin: 18px 0 16px; }
.hero h1 .grad { background: linear-gradient(110deg, var(--text) 30%, var(--accent) 130%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lede { font-size: 16.5px; color: var(--text-muted); max-width: 520px; line-height: 1.6; }
.hero-search { margin-top: 26px; max-width: 540px; position: relative; }
.hero-search input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 16px 16px 16px 48px; font-size: 15px; color: var(--text);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease); font-family: inherit;
}
.hero-search input::placeholder { color: var(--text-dim); }
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.hero-search .si { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.hero-search .hint { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; }
.hero-stats .s { display: flex; flex-direction: column; }
.hero-stats .n { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-stats .l { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono); }
.hero-stats .vline { width: 1px; background: var(--border); }

/* hero featured card */
.feat-card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 100% 0%, var(--accent-ghost), transparent 55%),
    var(--bg-card);
  padding: 26px; overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.feat-card:hover { transform: translateY(-3px); border-color: var(--border-light); box-shadow: var(--shadow-hover); }
.feat-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .8;
  mask-image: radial-gradient(circle at 80% 10%, #000, transparent 70%);
}
.feat-flag { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 16px; position: relative; }
.feat-flag svg { color: var(--accent-2); }
.feat-card h2 { font-size: 30px; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 12px; position: relative; }
.feat-card .def { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; position: relative; margin-bottom: 18px; }
.feat-card .meta-row { display: flex; align-items: center; gap: 14px; position: relative; margin-bottom: 18px; flex-wrap: wrap; }
.feat-card .meta-row .m { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; position: relative; }
.chip { display: inline-flex; align-items: center; line-height: 1.5; white-space: nowrap; font-size: 11.5px; padding: 4px 10px; border-radius: var(--radius-full); background: var(--surface-active); border: 1px solid var(--border); color: var(--text-muted); font-weight: 500; transition: all .15s var(--ease); }
.chip.cat { background: var(--accent-ghost); border-color: var(--accent-dim); color: var(--accent); }

/* ---- colored cover graphics (stand-in "images", inline CSS/SVG) ---- */
.cover {
  position: relative; overflow: hidden; --c: #5e6ad2;
  background:
    radial-gradient(120% 150% at 12% -10%, color-mix(in srgb, var(--c) 60%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 80%, #000) 0%, color-mix(in srgb, var(--c) 30%, var(--bg-elevated)) 100%);
}
.cover .grid-ol { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px; mask-image: radial-gradient(circle at 82% 18%, #000, transparent 78%); }
.cover .wm { position: absolute; right: -6px; bottom: -16px; color: #fff; opacity: .17; pointer-events: none; }
.cover .cv-cat { position: absolute; top: 11px; left: 12px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.30); border: 1px solid rgba(255,255,255,.22); padding: 3px 9px; border-radius: var(--radius-full); backdrop-filter: blur(5px); }
.cover .cv-corner { position: absolute; top: 11px; right: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: #fff; background: rgba(0,0,0,.30); border: 1px solid rgba(255,255,255,.22); padding: 3px 9px; border-radius: var(--radius-full); backdrop-filter: blur(5px); }
.cover .wm.wm-img img { width: 92px; height: 92px; object-fit: contain; display: block; }
.feat-card .cover .wm.wm-img img { width: 138px; height: 138px; }
.cover .cv-cat .cat-ico-img { width: 11px; height: 11px; object-fit: contain; border-radius: 3px; }
.cat .ci .cat-ico-img { width: 20px; height: 20px; object-fit: contain; }
.card .cover { height: 96px; margin: -19px -19px 14px; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.slide .cover { height: 112px; margin: -22px -22px 16px; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.feat-card .cover { height: 156px; margin: -26px -26px 20px; border-bottom: 1px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.feat-card .cover .cv-cat { color: #fff; background: rgba(0,0,0,.34); }
.feat-card .cover .cv-cat svg { color: #ffd9a0; }
.feat-card .read { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; color: var(--accent); font-weight: 600; font-size: 13.5px; position: relative; transition: gap .18s var(--ease); }
.feat-card:hover .read { gap: 11px; }

/* section heading */
.section { padding: 46px 0; position: relative; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.sec-head h3 { font-size: 25px; letter-spacing: -0.03em; font-weight: 700; }
.sec-head p { color: var(--text-dim); font-size: 14px; margin-top: 5px; max-width: 560px; }
.sec-head .label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 9px; }
.see-all { color: var(--text-muted); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: color .18s var(--ease), gap .18s var(--ease); }
.see-all:hover { color: var(--text); gap: 9px; }

/* ---------------- category bento ---------------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.cat {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-card); padding: 20px; overflow: hidden;
  transition: transform .26s var(--ease), border-color .26s var(--ease), box-shadow .26s var(--ease), background .26s var(--ease);
  display: flex; flex-direction: column; min-height: 172px; cursor: pointer;
}
.cat:hover { transform: translateY(-4px); border-color: var(--border-light); box-shadow: var(--shadow-hover); background: var(--surface-hover); }
.cat::after { content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--c, var(--accent)); transition: width .3s var(--ease); border-radius: 3px; z-index: 2; }
.cat:hover::after { width: 46px; }
.cat::before { content: ''; position: absolute; top: -46px; right: -46px; width: 130px; height: 130px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--accent)) 32%, transparent), transparent 68%); }
.cat:hover::before { opacity: 1; }
.cat .ci { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 13px; position: relative; z-index: 1;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c, var(--accent)) 34%, transparent), color-mix(in srgb, var(--c, var(--accent)) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 42%, transparent);
  color: color-mix(in srgb, var(--c, var(--accent)) 72%, #ffffff); }
.cat h4, .cat .pv, .cat .ct-tags { position: relative; z-index: 1; }
.cat h4 { font-size: 15.5px; letter-spacing: -0.02em; margin-bottom: 6px; font-weight: 650; }
.cat .pv { font-size: 12.8px; color: var(--text-dim); line-height: 1.5; flex: 1; }
.cat .ct-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }
.cat .ct-count { position: absolute; top: 18px; right: 18px; font-family: var(--mono); font-size: 11px; color: var(--text-quaternary); }
/* bento sizing: 2 big + rest */
.cat.lg { grid-column: span 6; }
.cat.md { grid-column: span 4; }
.cat.sm { grid-column: span 3; }
.cat.lg .pv { font-size: 13.5px; }

/* ---------------- carousel ---------------- */
.carousel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.car-ctrls { display: flex; align-items: center; gap: 14px; }
.car-count { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); letter-spacing: 0.04em; }
.car-count b { color: var(--text); }
.car-btns { display: flex; gap: 8px; }
.car-btn { width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted); display: grid; place-items: center; transition: all .18s var(--ease); }
.car-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-light); background: var(--surface-hover); }
.car-btn:disabled { opacity: .35; cursor: not-allowed; }
.track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide {
  scroll-snap-align: start; flex: 0 0 clamp(280px, 31%, 360px);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card);
  padding: 22px; transition: transform .26s var(--ease), border-color .26s var(--ease), box-shadow .26s var(--ease);
  position: relative; overflow: hidden;
}
.slide:hover { transform: translateY(-4px); border-color: var(--border-light); box-shadow: var(--shadow-hover); }
.slide .num { font-family: var(--mono); font-size: 12px; color: var(--text-quaternary); }
.slide h4 { font-size: 18px; letter-spacing: -0.02em; margin: 14px 0 9px; line-height: 1.18; }
.slide .def { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin-bottom: 14px; }
.slide .s-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.slide .s-read { color: var(--accent); font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; transition: gap .18s var(--ease); }
.slide:hover .s-read { gap: 8px; }

/* ---------------- explorer ---------------- */
.explorer { padding-top: 30px; }
.tabs-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 22px; }
.tabs-bar::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 14px 14px; font-size: 13.5px; font-weight: 550; color: var(--text-dim); white-space: nowrap; transition: color .18s var(--ease); display: flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text-muted); }
.tab.active { color: var(--text); }
.tab .cnt { font-family: var(--mono); font-size: 11px; color: var(--text-quaternary); padding: 1px 6px; border-radius: var(--radius-full); background: var(--surface-active); }
.tab.active .cnt { background: var(--accent-dim); color: var(--accent); }
.tab .ul { position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; transform: scaleX(0); transition: transform .22s var(--ease); }
.tab.active .ul { transform: scaleX(1); }

.exp-layout { display: grid; grid-template-columns: 232px 1fr; gap: 30px; align-items: start; }

/* sidebar */
.side { position: sticky; top: 76px; }
.side .blk { margin-bottom: 26px; }
.side .blk h5 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.tag-list { display: flex; flex-direction: column; gap: 2px; max-height: 268px; overflow-y: auto; padding-right: 4px; }
.tag-list::-webkit-scrollbar { width: 6px; }
.tag-list::-webkit-scrollbar-track { background: transparent; }
.tag-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
.tag-list::-webkit-scrollbar-thumb:hover { background: var(--text-quaternary); }
.tag-opt { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s var(--ease); font-size: 13px; color: var(--text-muted); user-select: none; }
.tag-opt:hover { background: var(--surface-hover); color: var(--text); }
.tag-opt .box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-light); flex: none; display: grid; place-items: center; transition: all .15s var(--ease); }
.tag-opt .box svg { opacity: 0; transform: scale(.5); transition: all .15s var(--ease); color: #fff; }
.tag-opt.on .box { background: var(--accent); border-color: var(--accent); }
.tag-opt.on .box svg { opacity: 1; transform: scale(1); }
.tag-opt.on { color: var(--text); }
.tag-opt .tc { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-quaternary); }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-opt { display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s var(--ease); font-size: 12.5px; color: var(--text-muted); user-select: none; }
.cat-opt:hover { background: var(--surface-hover); color: var(--text); }
.cat-opt .box { width: 15px; height: 15px; border-radius: 5px; border: 1.5px solid var(--border-light); flex: none; display: grid; place-items: center; transition: all .15s var(--ease); }
.cat-opt .box svg { opacity: 0; transform: scale(.5); transition: all .15s var(--ease); color: #fff; }
.cat-opt.on .box { background: var(--cc, var(--accent)); border-color: var(--cc, var(--accent)); }
.cat-opt.on .box svg { opacity: 1; transform: scale(1); }
.cat-opt.on { color: var(--text); font-weight: 550; }
.cat-opt .cc2 { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-quaternary); }
.azbar { display: flex; flex-wrap: wrap; gap: 3px; }
.az { width: 24px; height: 24px; border-radius: var(--radius-xs); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--text-dim); font-family: var(--mono); transition: all .14s var(--ease); }
.az:hover:not(.dis) { background: var(--surface-hover); color: var(--text); }
.az.on { background: var(--accent); color: #fff; }
.az.dis { opacity: .25; cursor: default; }

/* results toolbar */
.res-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.res-count { font-size: 13.5px; color: var(--text-dim); }
.res-count b { color: var(--text); font-variant-numeric: tabular-nums; }
.sort-wrap { display: flex; align-items: center; gap: 8px; }
.sort-wrap label { font-size: 12.5px; color: var(--text-dim); }
.sel { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 7px 28px 7px 11px; font-size: 13px; font-family: inherit; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; transition: border-color .18s var(--ease); }
.sel:hover { border-color: var(--border-light); }

.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.active-chips:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 5px 8px 5px 11px; border-radius: var(--radius-full); background: var(--accent-ghost); border: 1px solid var(--accent-dim); color: var(--text); }
.fchip .x { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; line-height: 1; font-size: 13px; background: var(--surface-active); color: var(--text-muted); transition: all .15s var(--ease); cursor: pointer; }
.fchip .x:hover { background: var(--accent); color: #fff; }
.clear-all { font-size: 12.5px; color: var(--text-dim); font-weight: 500; padding: 5px 9px; border-radius: var(--radius-sm); transition: all .15s var(--ease); }
.clear-all:hover { color: var(--text); background: var(--surface-hover); }

/* card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 16px; }
.card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-card); padding: 19px; display: flex; flex-direction: column;
  transition: transform .24s var(--ease), border-color .24s var(--ease), box-shadow .24s var(--ease);
  cursor: pointer; min-height: 186px; overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-light); box-shadow: var(--shadow-hover); }
.card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card .cat-tag { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }
.card .prod { font-size: 10px; font-family: var(--mono); color: var(--text-quaternary); border: 1px solid var(--border); padding: 2px 7px; border-radius: var(--radius-full); }
.card h4 { font-size: 16.5px; letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.2; font-weight: 650; }
.card .def { font-size: 12.8px; color: var(--text-dim); line-height: 1.55; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 3.1em; }
.card .ctags { display: flex; gap: 6px; flex-wrap: wrap; margin: 13px 0 0; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.card .foot .rt { font-size: 11.5px; color: var(--text-quaternary); display: flex; align-items: center; gap: 5px; }
.card .foot .vid { color: var(--accent-2); }
.card .arrow { color: var(--text-dim); transition: transform .2s var(--ease), color .2s var(--ease); }
.card:hover .arrow { transform: translate(3px,-3px); color: var(--accent); }

/* empty state */
.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--border-light); border-radius: var(--radius-lg); background: var(--bg-card); }
.empty .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-ghost); border: 1px solid var(--accent-dim); display: grid; place-items: center; margin: 0 auto 16px; color: var(--accent); }
.empty h4 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--text-dim); font-size: 13.5px; margin-bottom: 18px; }

/* ---------------- command palette ---------------- */
.cmd-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); display: none; align-items: flex-start; justify-content: center; padding-top: 14vh; opacity: 0; transition: opacity .16s var(--ease); }
.cmd-overlay { background: rgba(20,24,32,0.32); }
.cmd-overlay.open { display: flex; opacity: 1; }
.cmd {
  width: min(620px, 92vw); background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); overflow: hidden;
  transform: translateY(-8px) scale(.98); transition: transform .18s var(--ease); display: flex; flex-direction: column; max-height: 64vh;
}
.cmd-overlay.open .cmd { transform: translateY(0) scale(1); }
.cmd-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cmd-in svg { color: var(--text-dim); flex: none; }
.cmd-in input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; font-family: inherit; }
.cmd-in input::placeholder { color: var(--text-dim); }
.cmd-in .esc { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); border: 1px solid var(--border); padding: 2px 6px; border-radius: var(--radius-xs); }
.cmd-results { overflow-y: auto; padding: 8px; }
.cmd-grouplbl { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-quaternary); padding: 10px 12px 6px; }
.cmd-item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: var(--radius); cursor: pointer; }
.cmd-item .ci2 { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-ghost); border: 1px solid var(--accent-dim); display: grid; place-items: center; color: var(--accent); flex: none; }
.cmd-item .tt { font-size: 14px; font-weight: 550; }
.cmd-item .dd { font-size: 12px; color: var(--text-dim); }
.cmd-item .cc { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--text-quaternary); }
.cmd-item.sel, .cmd-item:hover { background: var(--surface-hover); }
.cmd-item.sel .ci2 { background: var(--accent); color: #fff; border-color: var(--accent); }
.cmd-empty { padding: 36px; text-align: center; color: var(--text-dim); font-size: 13.5px; }
.cmd-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-quaternary); font-size: 11.5px; }
.cmd-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- footer ---------------- */
footer { border-top: 1px solid var(--border-subtle); margin-top: 50px; padding: 30px 0; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--text-dim); font-size: 12.5px; }
.mock-banner { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--accent-2); border: 1px solid var(--accent-dim); background: var(--accent-ghost); padding: 4px 10px; border-radius: var(--radius-full); }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feat-card { order: -1; }
  .exp-layout { grid-template-columns: 1fr; }
  .side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 24px; }
  .cat.lg, .cat.md, .cat.sm { grid-column: span 6; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .cat.lg, .cat.md, .cat.sm { grid-column: span 12; }
  .side { grid-template-columns: 1fr; }
  .nav-search-btn { min-width: 0; }
  .nav-search-btn .ph, .nav-search-btn .kbd { display: none; }
  .hero-stats { gap: 16px; }
}
.fade-in { animation: fade .4s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }