/* =====================================================================
   VTskills. macOS glass direction, cool blues palette.
   Tokens first, then surfaces, then each section, then the detail view.
   ===================================================================== */

:root {
  /* palette chosen by the user: cool blues */
  --canvas: #f2f5fa;
  --canvas-deep: #e6edf8;
  --panel: rgba(255, 255, 255, 0.56);
  --panel-strong: rgba(255, 255, 255, 0.78);
  --accent: #2f7cf6;
  --accent-hover: #1f6ae0;
  --accent-deep: #1656c2;
  --accent-muted: rgba(47, 124, 246, 0.12);
  --accent-glow: rgba(47, 124, 246, 0.32);
  --text-primary: #0d1b2e;
  --text-secondary: #55627a;
  --text-tertiary: #7b879b;
  --border: rgba(47, 124, 246, 0.16);
  --border-strong: rgba(47, 124, 246, 0.34);
  --highlight: rgba(255, 255, 255, 0.9);

  /* glass */
  --blur: 22px;
  --radius: 24px;
  --radius-sm: 16px;
  --radius-xs: 11px;
  --shadow-card: 0 1px 2px rgba(13, 27, 46, 0.04), 0 14px 44px -14px rgba(13, 27, 46, 0.14);
  --shadow-float: 0 2px 6px rgba(13, 27, 46, 0.05), 0 34px 90px -24px rgba(47, 124, 246, 0.26);
  --shadow-hover: 0 2px 4px rgba(13, 27, 46, 0.05), 0 24px 60px -18px rgba(47, 124, 246, 0.28);

  /* motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 180ms;
  --t-med: 320ms;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "IBM Plex Mono", "Cascadia Code", Consolas, monospace;

  /* layout */
  --max: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
  --nav-h: 64px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden; overflow-x: clip;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  animation: pageIn 700ms var(--ease) both;
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
code, kbd, pre, .mono { font-family: var(--mono); }
code { font-size: 0.92em; background: var(--accent-muted); color: var(--accent-deep); padding: 0.1em 0.42em; border-radius: 7px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  transform: translateY(-160%); transition: transform var(--t-fast) var(--ease);
  padding: 10px 16px; background: var(--accent); color: #fff; border-radius: 12px; font-weight: 600;
}
.skip:focus { transform: none; }

.ic { width: 1em; height: 1em; flex: none; }
[data-icon] { display: inline-flex; line-height: 0; }

/* ---------- ambient environment (one fixed layer, 60s+ cycles) ---------- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, var(--canvas-deep) 0%, transparent 60%);
}
.glow {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; will-change: transform;
  animation: drift 84s var(--ease-soft) infinite alternate;
}
.glow-a { width: 62vw; height: 62vw; left: -16vw; top: -22vw; background: radial-gradient(circle, rgba(95, 158, 255, 0.34), transparent 70%); animation-delay: -20s; }
.glow-b { width: 56vw; height: 56vw; right: -18vw; top: 26vh; background: radial-gradient(circle, rgba(160, 196, 255, 0.36), transparent 70%); animation-duration: 96s; animation-delay: -47s; }
.glow-c { width: 46vw; height: 46vw; left: 20vw; bottom: -26vw; background: radial-gradient(circle, rgba(47, 124, 246, 0.16), transparent 70%); animation-duration: 110s; animation-delay: -63s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.08); }
  100% { transform: translate3d(-4vw, 8vh, 0) scale(0.96); }
}

/* ---------- glass surfaces ---------- */
.glass, .glass-strong {
  position: relative;
  background: var(--panel);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.glass-strong { background: var(--panel-strong); box-shadow: var(--shadow-float); }
.glass::before, .glass-strong::before {
  /* light hitting the top edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, var(--highlight) 0%, rgba(255, 255, 255, 0) 38%);
  opacity: 0.55;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}

/* ---------- type scale ---------- */
.display {
  font-size: clamp(38px, 6.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.032em;
  font-weight: 620;
  max-width: 26ch;
  margin-inline: auto;
  background: linear-gradient(180deg, var(--text-primary) 30%, #2a3c5c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 0.08em;
}
h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -0.026em; font-weight: 600; max-width: 24ch; }
h3 { font-size: 19px; letter-spacing: -0.012em; font-weight: 600; }
.kicker {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); display: inline-block; }
.nowrap { white-space: nowrap; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-secondary); max-width: 58ch; margin-inline: auto; line-height: 1.55; }
.section-lede { color: var(--text-secondary); max-width: 58ch; font-size: 17px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; border-radius: 15px; font-weight: 590; font-size: 15px; letter-spacing: -0.005em;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  border: 1px solid transparent; white-space: nowrap;
}
.btn .ic { font-size: 17px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #4b90ff 0%, var(--accent) 55%, var(--accent-hover) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(22, 86, 194, 0.3), 0 10px 26px -10px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 4px rgba(22, 86, 194, 0.3), 0 16px 34px -10px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-glass {
  background: var(--panel-strong); border-color: var(--border);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-card);
}
.btn-glass:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-hover); }
.btn-ghost { color: var(--accent-deep); border-color: var(--border-strong); background: transparent; }
.btn-ghost:hover { background: var(--accent-muted); transform: translateY(-1px); }
.btn.is-done { color: #0f7a4a; }
@media (pointer: coarse) { .btn, .seg-btn, .chip, .nav-search, .hold, .icon-btn { min-height: 44px; } }

.kbd {
  font-size: 11px; line-height: 1; padding: 5px 7px; border-radius: 7px; color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--border); box-shadow: 0 1px 0 rgba(13, 27, 46, 0.06);
  letter-spacing: 0.02em; white-space: nowrap;
}

/* ---------- nav ---------- */
.nav { position: fixed; top: 14px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 0 var(--gutter); pointer-events: none; }
.nav-inner {
  pointer-events: auto;
  width: min(var(--max), 100%); height: var(--nav-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 0 12px 0 18px; border-radius: 22px;
  transition: box-shadow var(--t-med) var(--ease), background-color var(--t-med) var(--ease);
}
.nav.is-scrolled .nav-inner { background: var(--panel-strong); box-shadow: var(--shadow-float); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 640; letter-spacing: -0.02em; font-size: 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-content: center; gap: 3.5px;
  background: linear-gradient(135deg, #4d93ff, #2063d6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 16px -6px var(--accent-glow);
}
.brand-mark i { display: block; height: 2.5px; border-radius: 2px; background: #fff; width: 14px; }
.brand-mark i:nth-child(2) { width: 14px; }
.brand-mark i:nth-child(3) { width: 9px; }
.nav-links { display: flex; justify-content: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 520; color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text-primary); background: rgba(255, 255, 255, 0.6); }
.nav-search {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 10px 8px 12px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.55); border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-search:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.85); transform: translateY(-1px); }
.nav-search .ic { font-size: 16px; }

/* ---------- layout ---------- */
.view { width: 100%; }
.section { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; padding-block: clamp(64px, 9vw, 120px) 0; }
.section-head { display: grid; gap: 14px; margin-bottom: 40px; }

/* ---------- hero ---------- */
.hero {
  position: relative; text-align: center;
  padding: calc(var(--nav-h) + 96px) var(--gutter) 24px;
  width: min(var(--max), 100%); margin-inline: auto;
}
.hero-inner { position: relative; z-index: 1; display: grid; gap: 22px; justify-items: center; }

/* the signature: a glass lens hanging behind the search palette */
.lens { position: absolute; left: 50%; top: 44%; width: min(720px, 92vw); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; }
.lens > span { position: absolute; inset: 0; border-radius: 50%; }
.lens-disc {
  inset: 12%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.05) 46%, transparent 60%),
    conic-gradient(from 210deg, rgba(120, 175, 255, 0.2), rgba(255, 255, 255, 0.06), rgba(47, 124, 246, 0.16), rgba(255, 255, 255, 0.05), rgba(120, 175, 255, 0.2));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), inset 0 -30px 60px -30px rgba(47, 124, 246, 0.25), 0 40px 120px -40px var(--accent-glow);
  animation: lensSpin 120s linear infinite, lensBob 9s var(--ease-soft) infinite alternate;
}
.lens-ring { border: 1px solid rgba(47, 124, 246, 0.16); }
.lens-ring-1 { inset: 0; animation: lensBob 11s var(--ease-soft) -4s infinite alternate-reverse; }
.lens-ring-2 { inset: 6%; border-color: rgba(255, 255, 255, 0.7); animation: lensBob 13s var(--ease-soft) -7s infinite alternate; }
.lens-highlight {
  inset: 12%; background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), transparent 45%);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%, #000 62%, transparent 63%);
  mask: radial-gradient(circle, transparent 60%, #000 61%, #000 62%, transparent 63%);
}
@keyframes lensSpin { to { transform: rotate(360deg); } }
@keyframes lensBob { from { translate: 0 -8px; } to { translate: 0 8px; } }

/* search palette */
.palette { position: relative; width: min(680px, 100%); margin-top: 10px; z-index: 5; }
.palette-field {
  display: flex; align-items: center; gap: 14px; padding: 8px 12px 8px 20px; border-radius: 22px; height: 66px;
  transition: box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.palette-field:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 4px var(--accent-muted), var(--shadow-float); }
.palette-icon { color: var(--text-secondary); font-size: 20px; }
.palette-field input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 18px; letter-spacing: -0.01em;
}
.palette-field input::placeholder { color: var(--text-tertiary); }
.palette-field input::-webkit-search-cancel-button { display: none; }
.palette-clear { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-secondary); transition: background-color var(--t-fast) var(--ease); }
.palette-clear:hover { background: var(--accent-muted); }
.palette-kbd { font-size: 11.5px; padding: 7px 9px; }
.palette-results {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; text-align: left;
  padding: 8px; border-radius: 20px; max-height: 420px; overflow: auto;
  animation: popIn 260ms var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.99); } to { opacity: 1; transform: none; } }
.pr-item {
  display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px;
  cursor: pointer; transition: background-color var(--t-fast) var(--ease);
}
.pr-item:hover, .pr-item.is-sel { background: var(--accent-muted); }
.pr-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--border); color: var(--accent-deep); font-size: 18px; }
.pr-name { font-weight: 590; font-size: 15px; letter-spacing: -0.01em; }
.pr-name mark { background: none; color: var(--accent-deep); }
.pr-meta { font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pr-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; color: var(--accent-deep); font-weight: 560; font-size: 14px; border-radius: 13px; cursor: pointer; }
.pr-more:hover, .pr-more.is-sel { background: var(--accent-muted); }
.pr-empty { padding: 20px; color: var(--text-secondary); text-align: center; font-size: 14.5px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: min(680px, 100%); margin-top: 6px; }
.stat { padding: 18px 20px; border-radius: 20px; display: grid; gap: 4px; text-align: left; }
.stat-n { font-size: clamp(24px, 3vw, 32px); font-weight: 560; letter-spacing: -0.03em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 13px; color: var(--text-secondary); }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.cat-card {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center;
  padding: 16px 18px; border-radius: 20px; cursor: pointer; width: 100%; text-align: left;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.cat-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted), var(--shadow-card); }
.cat-ic {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; color: var(--accent-deep);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
  border: 1px solid var(--border); box-shadow: inset 0 1px 0 #fff;
  transition: transform var(--t-med) var(--ease);
}
.cat-card:hover .cat-ic { transform: scale(1.06) rotate(-3deg); }
.cat-card > span:last-child { min-width: 0; }
.cat-name { display: block; font-weight: 600; font-size: 15px; letter-spacing: -0.012em; }
.cat-count { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.cat-count b { font-weight: 560; color: var(--text-primary); }

/* self-drawing trace between sections */
.trace { width: min(var(--max), 100% - 2 * var(--gutter)); margin: 56px auto -20px; height: 80px; overflow: visible; }
.trace path { fill: none; stroke: var(--accent); stroke-width: 1.25; stroke-linecap: round; opacity: 0.55; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* ---------- library ---------- */
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.lib-head .kicker { margin-bottom: 12px; }
.lib-count { color: var(--text-secondary); font-size: 13px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

.filters { position: sticky; top: calc(var(--nav-h) + 22px); z-index: 20; padding: 12px 14px; border-radius: 22px; display: grid; gap: 10px; margin-bottom: 22px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: rgba(13, 27, 46, 0.05); border: 1px solid rgba(13, 27, 46, 0.04); }
.seg-btn {
  padding: 7px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 560; color: var(--text-secondary);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.seg-btn.is-on { color: var(--text-primary); background: #fff; box-shadow: 0 1px 3px rgba(13, 27, 46, 0.1); }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; padding: 8px 34px 8px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7); font-size: 13.5px; font-weight: 540; color: var(--text-primary); cursor: pointer;
}
.select-chev { position: absolute; right: 11px; pointer-events: none; color: var(--text-secondary); font-size: 15px; }
.active-query {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-radius: 12px; font-size: 13.5px;
  background: var(--accent-muted); color: var(--accent-deep); font-weight: 560; margin-left: auto; max-width: 100%;
}
.active-query span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.active-query button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; }
.active-query button:hover { background: rgba(47, 124, 246, 0.16); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 13px; font-weight: 540; color: var(--text-secondary); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.55);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chip .ic { font-size: 15px; }
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.is-on { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.chip .n { font-family: var(--mono); font-size: 11px; opacity: 0.7; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.skill-li { opacity: 0; transform: translateY(14px); }
.skill-li.in { animation: rise 640ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.skill-card {
  display: grid; grid-template-rows: auto 1fr auto; gap: 12px; height: 100%; padding: 20px 20px 16px; border-radius: 22px;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.sc-top { display: flex; align-items: center; gap: 10px; }
.sc-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; color: var(--accent-deep); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--border); }
.sc-cat { font-size: 12px; color: var(--text-secondary); letter-spacing: 0.02em; }
.sc-name { font-weight: 600; font-size: 16.5px; letter-spacing: -0.014em; line-height: 1.25; word-break: break-word; }
.sc-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(13, 27, 46, 0.06); font-size: 12.5px; color: var(--text-secondary); }
.sc-foot .files { display: inline-flex; align-items: center; gap: 5px; }
.sc-foot .files .ic { font-size: 14px; }

.tier {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
}
.tier .ic { font-size: 13px; }
.tier-S { background: linear-gradient(180deg, #ffe9a8, #ffd766); color: #6b4a00; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.tier-A { background: var(--accent-muted); color: var(--accent-deep); }
.tier-B { background: rgba(13, 27, 46, 0.07); color: var(--text-secondary); }
.sc-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.compat {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 11.5px; font-weight: 560; letter-spacing: 0.01em; white-space: nowrap;
}
.compat .ic { font-size: 13px; }
.compat-any { background: rgba(34, 192, 122, 0.12); color: #0f6b44; }
.compat-claude { background: rgba(13, 27, 46, 0.07); color: var(--text-secondary); }
.use-compat h4 { display: inline-flex; align-items: center; gap: 8px; }
.use-compat h4 .ic { font-size: 16px; color: var(--accent); }
.md-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; margin-bottom: 18px; background: var(--accent-muted); color: var(--accent-deep); font-size: 13.5px; line-height: 1.45; }
.md-note .ic { font-size: 17px; flex: none; margin-top: 1px; }
.lib-note { margin: -8px 0 20px; padding: 12px 16px; border-radius: 16px; font-size: 14px; color: var(--text-secondary); }
.tier-local { background: rgba(13, 27, 46, 0.05); color: var(--text-secondary); font-family: var(--font); font-weight: 540; letter-spacing: 0; font-size: 12px; }

.empty { padding: 40px; text-align: center; color: var(--text-secondary); display: grid; gap: 12px; justify-items: center; }
.empty-ic { font-size: 30px; color: var(--accent); }
.load-more-wrap { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- how to use ---------- */
.how-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.how-copy { display: grid; gap: 22px; align-content: start; }
.steps { display: grid; gap: 6px; margin-top: 6px; position: relative; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 14px 0; border-radius: 16px; transition: background-color var(--t-med) var(--ease), opacity var(--t-med) var(--ease); }
.step-n { font-size: 12px; letter-spacing: 0.08em; color: var(--text-tertiary); padding-top: 5px; transition: color var(--t-med) var(--ease); }
.step h3 { margin-bottom: 5px; }
.step p { color: var(--text-secondary); font-size: 15px; }
.steps.is-lit .step { opacity: 0.45; }
.steps.is-lit .step.lit { opacity: 1; }
.steps.is-lit .step.lit .step-n { color: var(--accent); }

.how-demo { border-radius: 26px; overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(13, 27, 46, 0.06); }
.demo-dots { display: inline-flex; gap: 6px; }
.demo-dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(13, 27, 46, 0.12); }
.demo-title { font-size: 12px; color: var(--text-secondary); }
.demo-body { padding: 22px 22px 12px; min-height: 176px; }
.demo-term { margin: 0; font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.demo-line { display: block; opacity: 0.22; transition: opacity var(--t-med) var(--ease), color var(--t-med) var(--ease); }
.demo-line.on { opacity: 1; }
.demo-line .prompt { color: var(--accent); margin-right: 8px; }
.demo-out { color: var(--text-secondary); }
.demo-out b { color: var(--accent-deep); font-weight: 600; }
.demo-foot { display: flex; align-items: center; gap: 16px; padding: 10px 22px 22px; flex-wrap: wrap; }
.hold {
  position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px;
  background: var(--text-primary); color: #fff; font-weight: 560; font-size: 14px; user-select: none; -webkit-user-select: none; touch-action: none;
  box-shadow: 0 10px 26px -12px rgba(13, 27, 46, 0.6); transition: transform var(--t-fast) var(--ease), background-color var(--t-med) var(--ease);
}
.hold:hover { transform: translateY(-1px); }
.hold.is-done { background: var(--accent); }
.hold-ring { width: 36px; height: 36px; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 2.5; }
.hold-ring .hold-prog { stroke: #fff; stroke-dasharray: 97.4; stroke-dashoffset: calc(97.4 * (1 - var(--p, 0))); transition: stroke-dashoffset 60ms linear; }
.demo-hint { font-size: 13px; color: var(--text-secondary); }

/* ---------- footer ---------- */
.footer { width: min(var(--max), 100% - 2 * var(--gutter)); margin: clamp(80px, 10vw, 140px) auto 0; padding: 36px 0 44px; border-top: 1px solid rgba(13, 27, 46, 0.08); }
.footer-inner { display: grid; gap: 14px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 620; letter-spacing: -0.015em; }
.footer-note { color: var(--text-secondary); font-size: 14px; max-width: 72ch; }
.footer-meta { font-size: 12px; color: var(--text-tertiary); letter-spacing: 0.02em; word-break: break-all; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 16px; font-weight: 560; font-size: 14.5px;
  animation: toastIn 320ms var(--ease) both;
}
.toast .ic { color: #0f7a4a; font-size: 18px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- entrances ---------- */
[data-reveal] .r { opacity: 0; transform: translateY(16px); }
[data-reveal].in .r { animation: rise 760ms var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cat-grid.in > li { animation: rise 600ms var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.cat-grid > li { opacity: 0; }

/* ======================================================================
   DETAIL VIEW
   ====================================================================== */
.detail { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; padding-top: calc(var(--nav-h) + 48px); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); margin-bottom: 26px; flex-wrap: wrap; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.crumbs a:hover { background: rgba(255, 255, 255, 0.7); color: var(--text-primary); }
.crumbs .sep { color: var(--text-tertiary); font-size: 14px; }
.crumbs .cur { color: var(--text-primary); font-weight: 560; }

.d-head { padding: clamp(24px, 3.5vw, 40px); border-radius: 28px; display: grid; grid-template-columns: 72px 1fr; gap: 22px; align-items: start; }
.d-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 34px; color: var(--accent-deep); background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.65)); border: 1px solid var(--border); box-shadow: inset 0 1px 0 #fff, 0 12px 30px -14px var(--accent-glow); }
.d-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.d-title { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; font-weight: 640; line-height: 1.05; word-break: break-word; }
.d-desc { color: var(--text-secondary); font-size: 16.5px; max-width: 78ch; line-height: 1.55; }
.d-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 16px; font-size: 13.5px; color: var(--text-secondary); }
.d-meta span { display: inline-flex; align-items: center; gap: 6px; }
.d-meta .ic { font-size: 15px; color: var(--text-tertiary); }
.d-meta a { color: var(--accent-deep); font-weight: 560; }
.d-meta a:hover { text-decoration: underline; }
.d-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.d-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; margin-top: 24px; align-items: start; }
.d-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }
.d-side { min-width: 0; position: sticky; top: calc(var(--nav-h) + 30px); display: grid; gap: 16px; }

.panel { padding: 24px 26px; border-radius: 24px; min-width: 0; max-width: 100%; }
.panel-title { max-width: none; display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); font-family: var(--mono); margin-bottom: 18px; }
.panel-title .ic { font-size: 16px; color: var(--accent); }

.use-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.use-block h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.use-block p { color: var(--text-secondary); font-size: 14.5px; }
.use-tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(13, 27, 46, 0.05); margin-bottom: 10px; }
.use-tab { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 560; color: var(--text-secondary); }
.use-tab.is-on { background: #fff; color: var(--text-primary); box-shadow: 0 1px 3px rgba(13, 27, 46, 0.1); }
.cmd { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px 12px 12px 16px; border-radius: 14px; background: rgba(13, 27, 46, 0.045); border: 1px solid rgba(13, 27, 46, 0.05); margin-top: 8px; }
.cmd code { background: none; color: var(--text-primary); padding: 0; font-size: 13px; word-break: break-word; white-space: pre-wrap; line-height: 1.5; }
.cmd code .c { color: var(--text-tertiary); }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-secondary); background: rgba(255, 255, 255, 0.75); border: 1px solid var(--border); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.icon-btn:hover { background: #fff; color: var(--accent-deep); transform: translateY(-1px); }
.icon-btn.is-done { color: #0f7a4a; }
.icon-btn .ic { font-size: 16px; }

.warn { border-color: rgba(200, 120, 20, 0.28); background: rgba(255, 244, 222, 0.7); }
.warn .panel-title .ic { color: #b96a00; }
.warn p { color: #5d3f10; font-size: 14.5px; }

.file-list { display: grid; gap: 6px; }
.file-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(13, 27, 46, 0.05); }
.file-row a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--text-primary); min-width: 0; }
.file-row a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row a .ic { color: var(--accent); font-size: 15px; }
.file-row a:hover { color: var(--accent-deep); }
.file-row.is-cur { border-color: var(--accent); }
.file-actions { display: inline-flex; gap: 6px; }

/* rendered markdown */
.md-panel { padding: clamp(22px, 3vw, 40px); }
.md-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid rgba(13, 27, 46, 0.07); }
.md-toolbar .panel-title { margin: 0; }
.md-toolbar .right { display: inline-flex; gap: 8px; }
.md { font-size: 15.5px; line-height: 1.65; color: var(--text-primary); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { max-width: none; letter-spacing: -0.02em; font-weight: 620; line-height: 1.2; margin: 1.7em 0 0.6em; scroll-margin-top: calc(var(--nav-h) + 40px); }
.md h1 { font-size: 30px; }
.md h2 { font-size: 24px; padding-top: 0.6em; border-top: 1px solid rgba(13, 27, 46, 0.07); }
.md h3 { font-size: 19px; }
.md h4 { font-size: 16px; }
.md p { margin: 0.8em 0; }
.md ul, .md ol { margin: 0.7em 0; padding-left: 1.5em; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin: 0.3em 0; }
.md li > ul, .md li > ol { margin: 0.3em 0; }
.md blockquote { margin: 1em 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--accent-muted); border-radius: 0 14px 14px 0; color: var(--text-secondary); }
.md blockquote p { margin: 0.3em 0; }
.md hr { border: 0; border-top: 1px solid rgba(13, 27, 46, 0.1); margin: 2em 0; }
.md a { color: var(--accent-deep); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.md pre { margin: 1em 0; padding: 16px 18px; border-radius: 16px; background: #0f1a2c; color: #dfe8f7; font-size: 13px; line-height: 1.6; overflow: auto; border: 1px solid rgba(13, 27, 46, 0.2); }
.md pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.md table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1em 0; font-size: 14px; }
.md th, .md td { padding: 8px 12px; border: 1px solid rgba(13, 27, 46, 0.1); text-align: left; vertical-align: top; }
.md th { background: rgba(13, 27, 46, 0.04); font-weight: 600; }
.md img { border-radius: 14px; }
.md .fm { margin: 0 0 1.4em; padding: 14px 18px; border-radius: 14px; background: rgba(13, 27, 46, 0.04); font-family: var(--mono); font-size: 12.5px; color: var(--text-secondary); white-space: pre-wrap; }
.md .fm b { color: var(--accent-deep); font-weight: 600; }
.raw { display: none; margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.6; color: var(--text-primary); }
.md-panel.is-raw .md { display: none; }
.md-panel.is-raw .raw { display: block; }

.toc { padding: 18px 20px; }
.toc-list { display: grid; gap: 2px; max-height: calc(100vh - var(--nav-h) - 240px); overflow: auto; }
.toc-list a { display: block; padding: 6px 10px; border-radius: 9px; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.toc-list a:hover { background: rgba(255, 255, 255, 0.8); color: var(--text-primary); }
.toc-list a.l3 { padding-left: 22px; font-size: 12.5px; }
.toc-list a.is-cur { color: var(--accent-deep); background: var(--accent-muted); }
.side-meta { display: grid; gap: 10px; font-size: 13.5px; }
.side-meta .row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-secondary); }
.side-meta .row b { font-weight: 560; color: var(--text-primary); text-align: right; word-break: break-word; }

.loading { padding: 40px; text-align: center; color: var(--text-secondary); display: grid; gap: 12px; justify-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--accent-muted); border-top-color: var(--accent); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notfound { padding: 60px 20px; text-align: center; display: grid; gap: 16px; justify-items: center; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .d-body { grid-template-columns: 1fr; }
  .d-side { position: static; }
  .toc { display: none; }
  .how-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --nav-h: 56px; }
  .nav { top: 10px; }
  .nav-inner { grid-template-columns: 1fr auto; gap: 8px; padding: 0 8px 0 14px; border-radius: 18px; }
  .nav-links { display: none; }
  .nav-search { padding: 8px 10px; }
  .nav-search-label, .nav-search .kbd { display: none; }
  .hero { padding-top: calc(var(--nav-h) + 64px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .palette-field { height: 58px; padding-left: 16px; }
  .palette-field input { font-size: 16px; }
  .palette-kbd { display: none; }
  .filters { top: calc(var(--nav-h) + 16px); padding: 10px 12px; }
  .d-head { grid-template-columns: 1fr; }
  .d-ic { width: 56px; height: 56px; font-size: 26px; border-radius: 18px; }
  .panel { padding: 20px 18px; }
  .md-panel { padding: 20px 18px; }
  .lens { top: 40%; width: 120vw; }
}
@media (max-width: 520px) { .nowrap { white-space: normal; } }
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .stats .stat:last-child { grid-column: auto; }
}
@media (max-height: 560px) { .lens { display: none; } }

/* ---------- pause everything on hidden tabs ---------- */
body.paused .glow, body.paused .lens > span, body.paused .vt-fab, body.paused .vt-fab::after, body.paused .spinner { animation-play-state: paused !important; }

/* ---------- reduced motion: final states, no drives ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; transition-delay: 0s !important; animation-delay: 0s !important; }
  [data-reveal] .r, .skill-li, .cat-grid > li { opacity: 1 !important; transform: none !important; }
  .trace path { stroke-dashoffset: 0 !important; }
  .demo-line { opacity: 1; }
}
body.reduce [data-reveal] .r, body.reduce .skill-li, body.reduce .cat-grid > li { opacity: 1 !important; transform: none !important; animation: none !important; }
body.reduce .trace path { stroke-dashoffset: 0 !important; }
body.reduce .demo-line { opacity: 1; }
