@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================
   QuadratUI for AI — black & white base, any accent color
   ============================================================ */
:root {
  --bg: #f7f7f5;
  --bg-sub: #f0f0ee;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --ink: #151515;
  --ink-2: #4b4b4b;
  --ink-3: #858585;
  --line: #e2e2df;
  --line-strong: #c9c9c5;
  --accent: #171717;
  --accent-hover: color-mix(in srgb, var(--accent) 74%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--accent) 20%, transparent);
  --on-accent: #ffffff;
  --stage-accent: #9a9a9a;
  --stage-on-accent: #111311;
  --ok: #2f7a5b;
  --radius: 3px;
  --radius-lg: 5px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.05);
  --shadow-2: 0 18px 48px rgba(0,0,0,.12);
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --t-micro: 160ms;
  --t-mid: 220ms;
  --maxw: 1400px;
  --gutter: clamp(18px, 3.6vw, 56px);
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(100% - var(--gutter) * 2, var(--maxw)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; }
.skip-link:focus { top: 12px; }

/* ---------- site-level motion ---------- */
@keyframes site-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes site-line { from { clip-path: inset(0 100% 0 0); } }
@keyframes site-pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.site-header { animation: site-in .6s var(--ease-out) both; }
.hero h1 .line { display: block; animation: site-line .9s var(--ease-out) both; }
.hero h1 .line:nth-child(1) { animation-delay: .08s; }
.hero h1 .line:nth-child(2) { animation-delay: .2s; }
.hero .eyebrow, .hero__lede, .hero__actions, .hero__meta { animation: site-in .7s var(--ease-out) both; }
.hero .eyebrow { animation-delay: .02s; }
.hero__lede { animation-delay: .26s; }
.hero__actions { animation-delay: .34s; }
.hero__meta { animation-delay: .42s; }
.preview-card { animation: site-in .8s var(--ease-out) .3s both; }
.reveal-card { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); transition-delay: calc(var(--i, 0) * 45ms); }
.reveal-card.is-in { opacity: 1; transform: none; }
.scroll-progress { position: fixed; top: 64px; left: 0; right: 0; height: 2px; z-index: 101; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--sp, 0)); transform-origin: left; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); }
.header-inner { height: 64px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand__mark { width: 22px; height: 22px; }
.brand__mark rect { fill: var(--ink); }
.brand__mark rect:nth-child(4) { fill: var(--accent); }
.brand__name { font-family: var(--font-mono); font-weight: 600; font-size: 14px; letter-spacing: .05em; }
.brand__for { font-family: var(--font-mono); font-size: 10px; color: var(--accent); border: 1px solid var(--accent); border-radius: 20px; padding: 1px 8px; }
.header-search { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 0 11px; transition: border-color var(--t-micro) ease; }
.header-search:focus-within { border-color: var(--accent); }
.header-search svg { width: 15px; height: 15px; color: var(--ink-3); flex: 0 0 auto; }
.header-search input { width: 168px; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.header-search input::placeholder { color: var(--ink-3); }
.colors { display: flex; align-items: center; gap: 7px; padding-left: 12px; border-left: 1px solid var(--line); }
.colors__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-3); }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; transition: transform var(--t-micro) var(--ease-spring), box-shadow var(--t-micro) ease; }
.swatch:hover { transform: scale(1.22); }
.swatch.is-on { box-shadow: 0 0 0 2px var(--accent); }
.color-input { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; padding: 2px; background: var(--surface); cursor: pointer; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(50px, 6.6vw, 88px) 0 54px; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(to bottom, #000, transparent 94%); pointer-events: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(28px, 5vw, 70px); align-items: center; }
.eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow--accent { color: var(--accent); }
.hero h1 { margin: 16px 0 18px; font-size: clamp(40px, 5.8vw, 72px); line-height: 1.06; letter-spacing: -.05em; font-weight: 600; }
.hero h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 2px var(--accent); }
@supports not (-webkit-text-stroke: 1px #000) { .hero h1 em { color: var(--accent); } }
.hero__lede { max-width: 38em; color: var(--ink-2); font-size: clamp(14.5px, 1.35vw, 16.5px); line-height: 1.9; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; font-weight: 600; transition: transform var(--t-mid) var(--ease-out), background-color var(--t-micro) ease, border-color var(--t-micro) ease, box-shadow var(--t-mid) ease; }
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); box-shadow: 0 8px 22px var(--accent-soft-2); }
.btn--ghost { background: transparent; border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: .09em; color: var(--ink-3); text-transform: uppercase; }
.hero__meta b { color: var(--ink); font-weight: 600; }
.preview-card { position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); padding: 20px; box-shadow: var(--shadow-2); overflow: hidden; }
.preview-card__head { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.preview-visual { position: relative; height: 132px; margin: 14px 0 8px; overflow: hidden; border-radius: var(--radius); background: #111311; display: grid; place-items: center; }
.preview-visual::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(to right, #2b302b 1px, transparent 1px), linear-gradient(to bottom, #2b302b 1px, transparent 1px); background-size: 22px 22px; }
.pv-ring { position: absolute; width: 96px; height: 96px; border: 1px dashed #5b6059; border-radius: 50%; animation: k-orbit 12s linear infinite; }
.pv-ring::after { content: ""; position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.pv-ring--2 { width: 62px; height: 62px; border-style: solid; border-color: #3d423c; animation-direction: reverse; animation-duration: 8s; }
.pv-ring--2::after { background: #f3f3f0; box-shadow: none; }
.pv-core { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 8px var(--accent-soft), 0 0 26px var(--accent); animation: k-breathe 2.6s ease-in-out infinite; }
.pv-beam { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7; animation: k-slide-x 3.4s ease-in-out infinite alternate; }
.preview-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; display: block; }
.preview-visual.has-3d .pv-ring, .preview-visual.has-3d .pv-core, .preview-visual.has-3d .pv-beam { opacity: .12; }
.preview-card__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.preview-card__row:last-child { border-bottom: 0; padding-bottom: 2px; }
.preview-card__row span:first-child { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-3); }
.preview-card__row b { font-size: 12px; font-weight: 500; }
.pulse-line { width: 84px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; position: relative; }
.pulse-line::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: k-progress 2.8s var(--ease-out) infinite; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: k-breathe 2s ease-in-out infinite; }
.pulse-beam { width: 74px; height: 8px; border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; position: relative; }
.pulse-beam::after { content: ""; position: absolute; top: 0; bottom: 0; width: 24px; background: var(--accent-soft-2); border-right: 1px solid var(--accent); animation: k-slide-x 2.6s ease-in-out infinite alternate; }

/* ---------- category nav ---------- */
.lab3d { position: relative; padding: clamp(38px, 5vw, 68px) 0; border-bottom: 1px solid var(--line); }
.lab3d__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.lab3d__head h2 { margin-top: 10px; font-size: clamp(24px, 3.1vw, 38px); line-height: 1.16; letter-spacing: -.035em; font-weight: 600; }
.lab3d__head > p { max-width: 34em; color: var(--ink-3); font-size: 12.5px; line-height: 1.8; }
.lab3d__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lab3d__card { position: relative; min-height: 240px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: #0e100e; box-shadow: var(--shadow-2); cursor: pointer; transition: border-color var(--t-micro) ease, transform var(--t-micro) ease; }
.lab3d__card:hover, .lab3d__card:focus-visible { border-color: var(--accent); transform: translateY(-3px); outline: none; }
.lab3d__card::after { content: "TUNE ↗"; position: absolute; top: 12px; right: 12px; z-index: 3; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: #c9cfc6; opacity: 0; transition: opacity var(--t-micro) ease; }
.lab3d__card:hover::after, .lab3d__card:focus-visible::after { opacity: 1; }
.config-preview .demo__stage:has(.tuner-3d) canvas { display: block; }
.tuner-3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab3d__card::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(to right, #282d28 1px, transparent 1px), linear-gradient(to bottom, #282d28 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.lab3d__card canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lab3d__meta { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: #c9cfc6; }
.lab3d__meta span { color: var(--accent); }
.lab3d__meta b { font-weight: 600; }
.lab3d__meta em { margin-left: auto; font-style: normal; color: #8b9289; }
@media (max-width: 900px) { .lab3d__head { align-items: start; flex-direction: column; } .lab3d__grid { grid-template-columns: 1fr; } .lab3d__card { min-height: 220px; } }

.catnav { position: sticky; top: 64px; z-index: 90; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.catnav__inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catnav__inner::-webkit-scrollbar { display: none; }
.catnav a { flex: 0 0 auto; display: flex; align-items: baseline; gap: 7px; padding: 12px 13px 11px; font-size: 12.5px; color: var(--ink-3); border-bottom: 2px solid transparent; transition: color var(--t-micro) ease, border-color var(--t-micro) ease; }
.catnav a:hover { color: var(--ink); }
.catnav a.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.catnav a i { font-family: var(--font-mono); font-size: 9.5px; font-style: normal; color: var(--accent); }

/* ---------- catalog & cards ---------- */
.cat { padding: 58px 0 10px; }
.cat + .cat { border-top: 1px solid var(--line); margin-top: 48px; }
.cat__head { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 18px; align-items: end; margin-bottom: 24px; }
.cat__num { font-family: var(--font-mono); font-size: 40px; line-height: 1; letter-spacing: -.06em; color: var(--line-strong); font-weight: 600; }
.cat__title { font-size: clamp(23px, 2.5vw, 32px); font-weight: 600; letter-spacing: -.035em; }
.cat__en { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; margin-top: 4px; }
.cat__desc { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); max-width: 56em; }
.cat__count { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-3); white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: border-color var(--t-mid) ease, transform var(--t-mid) var(--ease-out), box-shadow var(--t-mid) ease; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 480ms var(--ease-out); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 18px 36px rgba(0,0,0,.09); }
.card:hover::before { transform: scaleX(1); }
.card__head { display: flex; align-items: flex-start; gap: 9px; min-height: 40px; }
.card__idx { font-family: var(--font-mono); font-size: 10px; color: var(--accent); border: 1px solid var(--accent); border-radius: 2px; padding: 2px 5px; margin-top: 2px; flex: 0 0 auto; }
.card__title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.card__en { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.card__badge { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .05em; color: var(--ink-3); border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px; margin-top: 2px; }
.demo, .preview-visual {
  --accent: var(--stage-accent);
  --accent-hover: var(--stage-accent);
  --accent-soft: color-mix(in srgb, var(--stage-accent) 15%, transparent);
  --accent-soft-2: color-mix(in srgb, var(--stage-accent) 27%, transparent);
  --on-accent: var(--stage-on-accent);
}
.demo {
  --bg: #111311; --bg-sub: #111311; --surface: #1c1f1c; --surface-2: #242824;
  --ink: #f3f3f0; --ink-2: #bcbfb8; --ink-3: #7b8079;
  --line: #363a35; --line-strong: #5b6059;
  position: relative; height: 158px; margin: 14px 0; overflow: hidden;
  border: 1px solid #2a2e2a; border-radius: var(--radius);
  background-color: var(--bg-sub); color: var(--ink); display: grid; place-items: center;
  transition: background-color var(--t-mid) ease, border-color var(--t-mid) ease, box-shadow var(--t-mid) ease;
}
.card:hover .demo { border-color: var(--accent); background-color: var(--surface-2); box-shadow: inset 0 0 40px var(--accent-soft); }
.demo::before { content: ""; position: absolute; inset: 0; opacity: .4; background-image: radial-gradient(var(--line-strong) .6px, transparent .6px); background-size: 14px 14px; pointer-events: none; }
.demo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 45%, transparent 30%, rgba(0,0,0,.38) 100%); }
.demo__stage { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; }
.demo__loop { position: absolute; z-index: 4; top: 7px; right: 8px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .07em; color: var(--ink-3); display: flex; align-items: center; gap: 4px; pointer-events: none; }
.demo__loop i { width: 5px; height: 5px; border: 1px solid var(--accent); border-radius: 50%; animation: site-pulse 1.6s infinite; }
.demo__tip { position: absolute; z-index: 4; left: 8px; bottom: 7px; font-family: var(--font-mono); font-size: 8px; color: var(--ink-3); opacity: 0; transform: translateY(4px); transition: opacity var(--t-mid) ease, transform var(--t-mid) var(--ease-out); pointer-events: none; }
.card:hover .demo__tip { opacity: 1; transform: none; }
.card__desc { font-size: 12px; color: var(--ink-2); line-height: 1.65; min-height: 40px; }
.card__scene { margin-top: 6px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__scene b { color: var(--ink-2); font-weight: 500; }
.card__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card__action { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.card__action:hover { color: var(--accent); }
.card.is-hidden, .cat.is-hidden { display: none; }

/* ---------- shared keyframes ---------- */
@keyframes k-blink { 50% { opacity: .15; } }
@keyframes k-progress { 0% { transform: scaleX(0); } 70%,100% { transform: scaleX(1); } }
@keyframes k-slide-x { 0% { transform: translateX(-6px); } 100% { transform: translateX(56px); } }
@keyframes k-breathe { 0%,100% { transform: scale(.82); opacity: .55; } 50% { transform: scale(1.18); opacity: 1; } }
@keyframes k-fade { 0%,100% { opacity: .16; } 45%,65% { opacity: 1; } }
@keyframes k-up { 0%,12% { transform: translateY(13px); opacity: 0; } 40%,72% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-8px); opacity: 0; } }
@keyframes k-scale { 0%,10% { transform: scale(.55); opacity: 0; } 38%,74% { transform: scale(1); opacity: 1; } 100% { transform: scale(.86); opacity: 0; } }
@keyframes k-blur { 0%,10% { filter: blur(9px); opacity: 0; } 40%,72% { filter: blur(0); opacity: 1; } 100% { filter: blur(5px); opacity: 0; } }
@keyframes k-clip { 0%,8% { clip-path: inset(0 100% 0 0); } 42%,76% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes k-stagger { 0%,8% { transform: translateY(12px); opacity: .15; } 28%,78% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(12px); opacity: .15; } }
@keyframes k-spot { 0%,100% { transform: translate(-38px,-14px); } 50% { transform: translate(38px,16px); } }
@keyframes k-tilt { 0%,100% { transform: perspective(500px) rotateX(8deg) rotateY(-12deg); } 50% { transform: perspective(500px) rotateX(-8deg) rotateY(12deg); } }
@keyframes k-magnet { 0%,100% { transform: translate(-7px,-3px); } 50% { transform: translate(7px,3px); } }
@keyframes k-lift { 0%,100% { transform: translateY(4px); box-shadow: 0 2px 4px rgba(0,0,0,.05); } 50% { transform: translateY(-7px); box-shadow: 0 12px 20px rgba(0,0,0,.14); } }
@keyframes k-ripple { 0% { transform: scale(.25); opacity: .85; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes k-wiggle { 0%,100% { transform: rotate(-13deg); } 50% { transform: rotate(13deg); } }
@keyframes k-pan { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-32px); } }
@keyframes k-pan-fast { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-72px); } }
@keyframes k-frame { 0%,28% { opacity: 1; transform: translateY(0); } 34%,94% { opacity: 0; transform: translateY(9px); } 100% { opacity: 1; } }
@keyframes k-stack { 0%,100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(11px) rotate(-3deg); } }
@keyframes k-snap { 0%,30% { transform: translateX(0); } 36%,63% { transform: translateX(-33.33%); } 70%,100% { transform: translateX(-66.66%); } }
@keyframes k-glitch { 0%,88%,100% { clip-path: inset(0 0 0 0); transform: translate(0); } 90% { clip-path: inset(12% 0 58% 0); transform: translate(-3px,1px); } 93% { clip-path: inset(62% 0 12% 0); transform: translate(3px,-1px); } 96% { clip-path: inset(32% 0 38% 0); transform: translate(-2px); } }
@keyframes k-char { 0%,100% { transform: translateY(9px); opacity: .15; } 35%,75% { transform: translateY(0); opacity: 1; } }
@keyframes k-marquee { to { transform: translateX(-50%); } }
@keyframes k-shimmer { to { transform: translateX(100%); } }
@keyframes k-pulse-op { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes k-spin { to { transform: rotate(360deg); } }
@keyframes k-ring { 0% { stroke-dashoffset: 138; } 70%,100% { stroke-dashoffset: 24; } }
@keyframes k-dot { 0%,70%,100% { transform: translateY(0); opacity: .4; } 35% { transform: translateY(-8px); opacity: 1; } }
@keyframes k-beam { to { --beam-angle: 360deg; } }
@property --beam-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes k-draw { 0%,100% { stroke-dashoffset: 320; } 45%,75% { stroke-dashoffset: 0; } }
@keyframes k-grad { to { background-position: 200% 0; } }
@keyframes k-orbit { to { transform: rotate(360deg); } }
@keyframes k-float { 0%,100% { transform: translateY(6px) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes k-grid-drift { to { background-position: 26px 26px; } }
@keyframes k-glow { 0%,100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 12px transparent; } }
@keyframes k-spring { 0%,20% { left: 8%; } 52% { left: 94%; } 66% { left: 84%; } 78% { left: 92%; } 100% { left: 8%; } }
@keyframes k-flip { 0%,32% { transform: rotateY(0); } 55%,88% { transform: rotateY(180deg); } 100% { transform: rotateY(0); } }
@keyframes k-accordion { 0%,18% { height: 8px; } 45%,80% { height: 54px; } 100% { height: 8px; } }
@keyframes k-morph { 0%,100% { border-radius: 50%; transform: rotate(0); } 50% { border-radius: 28% 72% 62% 38%; transform: rotate(90deg); } }
@keyframes k-toggle { 0%,30% { transform: translateX(0); } 55%,85% { transform: translateX(30px); } 100% { transform: translateX(0); } }
@keyframes k-toast { 0%,12% { transform: translateY(16px); opacity: 0; } 25%,72% { transform: translateY(0); opacity: 1; } 88%,100% { transform: translateY(10px); opacity: 0; } }
@keyframes k-race { 0%,12% { left: 0; } 72%,100% { left: 100%; } }
@keyframes k-bounce { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-32px); } 55% { transform: translateY(-4px); } 68% { transform: translateY(-13px); } }
@keyframes k-wave { 0%,100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes k-carousel { 0%,27% { transform: translateX(0); } 36%,63% { transform: translateX(-33.33%); } 72%,100% { transform: translateX(-66.66%); } }
@keyframes k-swing { 0%,100% { transform: rotate(-16deg); } 50% { transform: rotate(16deg); } }
@keyframes k-flipin { 0%,10% { transform: perspective(500px) rotateX(-90deg); opacity: 0; } 40%,75% { transform: perspective(500px) rotateX(0); opacity: 1; } 100% { transform: perspective(500px) rotateX(70deg); opacity: 0; } }
@keyframes k-dropin { 0%,8% { transform: translateY(-42px) scale(.9); opacity: 0; } 34% { transform: translateY(4px) scale(1); opacity: 1; } 48% { transform: translateY(-6px); } 62%,88% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }
@keyframes k-zoomb { 0%,10% { transform: scale(.4); filter: blur(8px); opacity: 0; } 40%,72% { transform: scale(1); filter: blur(0); opacity: 1; } 100% { transform: scale(1.2); filter: blur(6px); opacity: 0; } }
@keyframes k-hoverglow { 0%,100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 7px var(--accent-soft-2); } }
@keyframes k-underline { 0%,10% { transform: scaleX(0); } 50%,80% { transform: scaleX(1); } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes k-skew { 0%,100% { transform: skewX(-14deg); } 50% { transform: skewX(14deg); } }
@keyframes k-hscroll { 0%,30% { transform: translateX(0); } 55%,100% { transform: translateX(-50%); } }
@keyframes k-tshadow { 0%,100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 3px 3px 0 var(--accent-soft-2); } }
@keyframes k-tspacing { 0%,100% { letter-spacing: 0; } 50% { letter-spacing: .22em; } }
@keyframes k-scanline { 0%,100% { transform: translateY(-26px); } 50% { transform: translateY(26px); } }
@keyframes k-noise { 0%,25%,50%,75%,100% { background-position: 0 0, 8px 6px; } 12%,37%,62%,87% { background-position: 12px 8px, 0 0; } }
@keyframes k-checkdraw { 0%,12% { stroke-dashoffset: 48; } 45%,85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 48; } }
@keyframes k-expand { 0%,12% { transform: scale(.62); } 45%,82% { transform: scale(1); } 100% { transform: scale(.62); } }
@keyframes k-stepper { 0%,100% { background: var(--line-strong); transform: scale(1); } 30%,70% { background: var(--accent); transform: scale(1.18); } }
@keyframes k-wobble { 0%,100% { transform: scaleX(1) skewX(0); } 35% { transform: scaleX(1.12) skewX(-8deg); } 65% { transform: scaleX(.94) skewX(6deg); } }
@keyframes k-shake { 0%,100% { transform: translateX(0); } 10%,30%,50% { transform: translateX(-7px); } 20%,40%,60% { transform: translateX(7px); } }

/* ---------- demo visuals ---------- */
.d-box { width: 70px; height: 50px; border-radius: var(--radius); background: var(--accent); }
.d-line { display: block; height: 9px; background: var(--line-strong); border-radius: 2px; }
.d-reveal, .d-shimmer, .d-skeleton, .d-ease, .d-waveload { grid-template-columns: minmax(0,1fr); justify-items: stretch; }

/* entrance */
.d-fade i { animation: k-fade 2.8s ease-in-out infinite; }
.d-slide i { animation: k-up 3s var(--ease-out) infinite; }
.d-scale i { animation: k-scale 3s var(--ease-out) infinite; }
.d-blur b { font-family: var(--font-mono); font-size: 17px; font-weight: 600; animation: k-blur 3.2s ease-in-out infinite; }
.d-clip i { background: var(--accent); border-radius: var(--radius); animation: k-clip 3.4s var(--ease-out) infinite; }
.d-stagger { display: flex; gap: 7px; }
.d-stagger i { width: 11px; height: 36px; background: var(--accent); border-radius: 2px; animation: k-stagger 3.2s var(--ease-out) infinite; animation-delay: calc(var(--k) * 110ms); }
.d-stagger i:nth-child(even) { background: var(--ink-3); }
.d-flipin i { animation: k-flipin 3.6s var(--ease-out) infinite; }
.d-dropin i { animation: k-dropin 3.4s ease-in-out infinite; }
.d-zoomb i { animation: k-zoomb 3.4s var(--ease-out) infinite; }

/* hover */
.d-spotlight { position: relative; width: 100%; height: 100%; }
.d-spotlight i { position: absolute; width: 92px; height: 72px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft-2), transparent 70%); animation: k-spot 3.6s ease-in-out infinite; }
.d-spotlight b { font-size: 12px; font-weight: 600; }
.d-tilt i { width: 96px; height: 60px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; font-weight: 600; box-shadow: 3px 5px 0 var(--line); animation: k-tilt 4s ease-in-out infinite; }
.d-magnetic button { background: var(--ink); color: var(--bg); border: 0; border-radius: 30px; padding: 9px 18px; font-size: 12px; animation: k-magnet 3.2s ease-in-out infinite; }
.d-lift i { width: 126px; padding: 11px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: 11px; text-align: center; animation: k-lift 3s ease-in-out infinite; }
.d-ripple { position: relative; display: grid; place-items: center; }
.d-ripple b { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); position: relative; z-index: 2; }
.d-ripple i { position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: k-ripple 2.4s ease-out infinite; }
.d-ripple i:nth-of-type(2) { animation-delay: .8s; }
.d-ripple i:nth-of-type(3) { animation-delay: 1.6s; }
.d-wiggle svg { width: 34px; height: 34px; color: var(--accent); transform-origin: 50% 80%; animation: k-wiggle 2.2s ease-in-out infinite; }
.d-hoverglow button { background: var(--surface); color: var(--ink); border: 1px solid var(--accent); border-radius: var(--radius); padding: 9px 16px; font-size: 12px; animation: k-hoverglow 2.6s ease-out infinite; }
.d-underline b { font-size: 14px; font-weight: 600; position: relative; padding-bottom: 7px; }
.d-underline i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform-origin: left; animation: k-underline 3s var(--ease-out) infinite; }
.d-skew i { width: 82px; height: 44px; border-radius: var(--radius); background: var(--accent-soft-2); border: 1px solid var(--accent); animation: k-skew 2.8s ease-in-out infinite; }

/* scroll */
.d-reveal { width: 74%; display: grid; gap: 8px; }
.d-reveal i { animation: k-up 3.2s var(--ease-out) infinite; animation-delay: calc(var(--k) * 130ms); }
.d-parallax { position: relative; width: 100%; height: 100%; overflow: hidden; }
.d-parallax i { position: absolute; display: block; }
.d-parallax .back { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--accent); top: 16px; left: 22%; animation: k-pan 4s ease-in-out infinite; }
.d-parallax .mid { width: 130%; height: 52px; background: var(--line); bottom: -8px; left: -15%; transform: rotate(-5deg); animation: k-pan 4s ease-in-out infinite; }
.d-parallax .front { width: 130%; height: 38px; background: var(--line-strong); bottom: -20px; left: -15%; transform: rotate(4deg); animation: k-pan-fast 4s ease-in-out infinite; }
.d-narrative { position: relative; width: 82%; height: 60px; }
.d-narrative b { display: block; font-size: 12px; font-weight: 600; }
.d-narrative span { display: block; font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); margin-top: 4px; }
.d-narrative i { display: block; position: absolute; inset: 0; opacity: 0; animation: k-frame 4.5s ease-in-out infinite; }
.d-narrative i:nth-child(2) { animation-delay: 1.5s; }
.d-narrative i:nth-child(3) { animation-delay: 3s; }
.d-progress { width: 82%; }
.d-progress i { display: block; height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; }
.d-progress i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: k-progress 3.2s var(--ease-out) infinite; }
.d-progress em { display: block; margin-top: 9px; font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); font-style: normal; }
.d-stack { position: relative; width: 118px; height: 60px; }
.d-stack i { position: absolute; left: 12px; right: 12px; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); animation: k-stack 4s ease-in-out infinite; }
.d-stack i:nth-child(1) { top: 18px; }
.d-stack i:nth-child(2) { top: 30px; animation-delay: .25s; }
.d-stack i:nth-child(3) { top: 42px; animation-delay: .5s; background: var(--accent-soft-2); border-color: var(--accent); }
.d-snap, .d-hscroll { width: 100%; overflow: hidden; }
.d-snap__track, .d-hscroll__track { display: flex; width: 300%; }
.d-snap__track { animation: k-snap 4.5s ease-in-out infinite; }
.d-hscroll__track { animation: k-hscroll 4.2s ease-in-out infinite; }
.d-snap__track i, .d-hscroll__track i { flex: 0 0 33.33%; height: 52px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; }
.d-counter i { position: absolute; display: block; }
.d-counter .c1 { width: 100%; height: 40px; background: var(--line); bottom: -8px; animation: k-pan-fast 3.4s ease-in-out infinite reverse; }
.d-counter .c2 { width: 44px; height: 44px; border: 1px solid var(--accent); border-radius: 50%; top: 14px; left: 26%; animation: k-pan 3.4s ease-in-out infinite reverse; }
.d-scrollmorph i { width: 62px; height: 62px; background: var(--accent); animation: k-morph 3.6s ease-in-out infinite; }

/* typography */
.d-type { width: 84%; font-family: var(--font-mono); font-size: 12px; min-height: 40px; }
.d-type i { display: inline-block; width: 6px; height: 1em; background: var(--accent); vertical-align: -.14em; animation: k-blink .9s step-end infinite; }
.d-scramble b { font-family: var(--font-mono); font-size: 16px; font-weight: 600; letter-spacing: .05em; border-bottom: 1px solid var(--accent); padding-bottom: 4px; }
.d-glitch b { font-family: var(--font-mono); font-size: 18px; font-weight: 600; letter-spacing: .04em; animation: k-glitch 3.6s steps(1) infinite; }
.d-marquee { width: 100%; overflow: hidden; }
.d-marquee__track { display: flex; width: max-content; animation: k-marquee 9s linear infinite; }
.d-marquee__track span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; padding-right: 28px; white-space: nowrap; }
.d-split { display: flex; gap: 3px; }
.d-split i { font-family: var(--font-mono); font-size: 16px; font-style: normal; font-weight: 600; animation: k-char 3.2s var(--ease-out) infinite; animation-delay: calc(var(--k) * 80ms); }
.d-count b { font-family: var(--font-mono); font-size: 38px; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.d-count span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: var(--ink-3); display: block; margin-top: 6px; }
.d-tgradient b { font-family: var(--font-mono); font-size: 17px; font-weight: 600; background: linear-gradient(90deg, var(--ink), var(--accent), var(--ink), var(--accent)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: k-grad 3.4s linear infinite; }
.d-tshadow b { font-family: var(--font-mono); font-size: 17px; font-weight: 600; animation: k-tshadow 2.6s ease-in-out infinite; }
.d-tspacing b { font-family: var(--font-mono); font-size: 15px; font-weight: 600; animation: k-tspacing 3.4s ease-in-out infinite; }

/* loading */
.d-shimmer { width: 78%; display: grid; gap: 10px; }
.d-shimmer i { height: 10px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.d-shimmer i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--surface), transparent); animation: k-shimmer 1.9s infinite; }
.d-skeleton { width: 78%; display: grid; gap: 9px; }
.d-skeleton i { height: 10px; border-radius: 2px; background: var(--line-strong); animation: k-pulse-op 1.8s ease-in-out infinite; }
.d-skeleton i:nth-child(2) { width: 78%; animation-delay: .15s; }
.d-skeleton i:nth-child(3) { width: 55%; animation-delay: .3s; }
.d-spinner i { width: 38px; height: 38px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: k-spin 1.1s linear infinite; }
.d-ring svg { width: 60px; height: 60px; transform: rotate(-90deg); }
.d-ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.d-ring .track { stroke: var(--line); }
.d-ring .bar { stroke: var(--accent); stroke-dasharray: 138; stroke-dashoffset: 24; animation: k-ring 3s var(--ease-out) infinite; }
.d-barload { width: 82%; }
.d-barload i { display: block; width: 100%; height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; position: relative; }
.d-barload i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: k-progress 2.6s var(--ease-out) infinite; }
.d-dots { display: flex; gap: 8px; }
.d-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: k-dot 1.5s ease-in-out infinite; }
.d-dots i:nth-child(2) { animation-delay: .18s; }
.d-dots i:nth-child(3) { animation-delay: .36s; }
.d-waveload i { height: 12px; border-radius: 6px; background: var(--accent); animation: k-wave 2s ease-in-out infinite; }
.d-waveload i:nth-child(2) { animation-delay: .1s; }
.d-waveload i:nth-child(3) { animation-delay: .2s; }
.d-waveload i:nth-child(4) { animation-delay: .3s; }
.d-waveload i:nth-child(5) { animation-delay: .4s; }
.d-blocks { display: flex; gap: 7px; align-items: center; height: 56px; }
.d-blocks i { width: 11px; height: 24px; background: var(--accent); border-radius: 2px; animation: k-dot 1.4s ease-in-out infinite; }
.d-blocks i:nth-child(2) { animation-delay: .14s; }
.d-blocks i:nth-child(3) { animation-delay: .28s; }
.d-blocks i:nth-child(4) { animation-delay: .42s; }
.d-trail { position: relative; width: 78px; height: 78px; animation: k-orbit 4s linear infinite; }
.d-trail i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .8; top: -4px; left: 35px; }
.d-trail i:nth-child(2) { transform: rotate(90deg); opacity: .6; }
.d-trail i:nth-child(3) { transform: rotate(180deg); opacity: .4; }
.d-trail i:nth-child(4) { transform: rotate(270deg); opacity: .2; }

/* decoration */
.d-beam { width: 72%; height: 60px; border-radius: var(--radius); background: var(--surface); position: relative; display: grid; place-items: center; font-size: 11px; }
.d-beam::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 250deg, var(--accent) 305deg, transparent 350deg); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; animation: k-beam 3s linear infinite; }
.d-draw svg { width: 128px; height: 64px; }
.d-draw rect { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 320; stroke-dashoffset: 0; animation: k-draw 3.6s ease-in-out infinite; }
.d-grad i { width: 138px; height: 34px; border-radius: var(--radius); background: linear-gradient(90deg, var(--accent), var(--accent-soft), var(--accent), var(--accent-soft), var(--accent)); background-size: 200% 100%; animation: k-grad 3.4s linear infinite; }
.d-orbit { position: relative; width: 82px; height: 82px; }
.d-orbit i { position: absolute; inset: 0; border: 1px dashed var(--line-strong); border-radius: 50%; animation: k-orbit 5s linear infinite; }
.d-orbit i::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--accent); }
.d-float i { width: 60px; height: 60px; border-radius: 16px; background: var(--accent-soft-2); border: 1px solid var(--accent); animation: k-float 3.6s ease-in-out infinite; }
.d-grid { width: 100%; height: 100%; }
.d-grid i { position: absolute; inset: -26px; background-image: linear-gradient(to right, var(--line-strong) 1px, transparent 1px), linear-gradient(to bottom, var(--line-strong) 1px, transparent 1px); background-size: 26px 26px; animation: k-grid-drift 3s linear infinite; }
.d-particle { position: relative; width: 100%; height: 100%; }
.d-particle i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: k-float 3.4s ease-in-out infinite; }
.d-particle i:nth-child(1) { left: 22%; top: 26%; }
.d-particle i:nth-child(2) { left: 48%; top: 52%; animation-delay: .4s; }
.d-particle i:nth-child(3) { left: 70%; top: 24%; animation-delay: .8s; }
.d-particle i:nth-child(4) { left: 34%; top: 68%; animation-delay: 1.2s; }
.d-particle i:nth-child(5) { left: 80%; top: 62%; animation-delay: 1.6s; }
.d-scanline { position: relative; width: 100%; height: 100%; overflow: hidden; }
.d-scanline i { position: absolute; left: 12%; right: 12%; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: k-scanline 2.8s ease-in-out infinite; }
.d-noise { position: relative; width: 130px; height: 70px; overflow: hidden; }
.d-noise i { position: absolute; inset: -20px; background-image: radial-gradient(var(--accent) 1px, transparent 1px), radial-gradient(var(--line-strong) 1px, transparent 1px); background-size: 12px 12px, 17px 17px; opacity: .55; animation: k-noise 1.6s steps(1) infinite; }

/* states */
.d-spring { position: relative; width: 88%; height: 22px; display: flex; align-items: center; }
.d-spring i { display: block; width: 100%; height: 5px; background: var(--line); border-radius: 4px; }
.d-spring b { position: absolute; top: 50%; left: 8%; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%; background: var(--accent); animation: k-spring 4s ease-in-out infinite; }
.d-flip { perspective: 500px; width: 86px; height: 58px; }
.d-flip i { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: k-flip 4.6s ease-in-out infinite; }
.d-flip b { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-family: var(--font-mono); font-size: 11px; }
.d-flip b:last-child { transform: rotateY(180deg); background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.d-accordion { width: 82%; }
.d-accordion i { width: 100%; height: 8px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); animation: k-accordion 4s ease-in-out infinite; }
.d-accordion b { display: block; height: 54px; padding: 7px; font-size: 10px; font-weight: 500; background: var(--accent-soft-2); color: var(--accent); }
.d-morph i { width: 56px; height: 56px; background: var(--accent); animation: k-morph 4.4s ease-in-out infinite; }
.d-toggle i { position: relative; width: 64px; height: 32px; border-radius: 20px; background: var(--line-strong); display: block; }
.d-toggle b { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.18); animation: k-toggle 3.4s ease-in-out infinite; }
.d-toast i { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); font-size: 11px; animation: k-toast 4s ease-in-out infinite; }
.d-toast b { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.d-check svg { width: 58px; height: 58px; }
.d-check path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 0; animation: k-checkdraw 3.4s ease-in-out infinite; }
.d-expand i { width: 76px; height: 46px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft-2); animation: k-expand 3.6s var(--ease-out) infinite; }
.d-stepper { display: flex; gap: 9px; align-items: center; }
.d-stepper i { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); animation: k-stepper 3.6s ease-in-out infinite; }
.d-stepper i:nth-child(2) { animation-delay: .35s; }
.d-stepper i:nth-child(3) { animation-delay: .7s; }
.d-stepper i:nth-child(4) { animation-delay: 1.05s; }

/* rhythm */
.d-ease { width: 84%; display: grid; gap: 12px; }
.d-ease i { position: relative; display: block; height: 2px; background: var(--line-strong); }
.d-ease i::after { content: ""; position: absolute; top: 50%; left: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ink-3); animation: k-race 3.4s linear infinite; }
.d-ease .out::after { background: var(--accent); animation-timing-function: var(--ease-out); }
.d-bounce { position: relative; }
.d-bounce i { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); animation: k-bounce 2s ease-in-out infinite; }
.d-bounce::after { content: ""; position: absolute; bottom: 18px; width: 42px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.d-breath i { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--accent); background: var(--accent-soft-2); animation: k-breathe 3s ease-in-out infinite; }
.d-wave { display: flex; gap: 6px; align-items: center; height: 58px; }
.d-wave i { width: 7px; height: 36px; border-radius: 4px; background: var(--accent); animation: k-wave 1.8s ease-in-out infinite; }
.d-wave i:nth-child(2) { animation-delay: .12s; }
.d-wave i:nth-child(3) { animation-delay: .24s; }
.d-wave i:nth-child(4) { animation-delay: .36s; }
.d-wave i:nth-child(5) { animation-delay: .48s; }
.d-wave i:nth-child(6) { animation-delay: .6s; }
.d-carousel { width: 100%; overflow: hidden; }
.d-carousel__track { display: flex; width: 300%; animation: k-carousel 6s ease-in-out infinite; }
.d-carousel__track i { flex: 0 0 33.33%; height: 60px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.d-carousel__track i:nth-child(2) { background: var(--accent-soft-2); border-color: var(--accent); color: var(--accent); }
.d-swing { position: relative; width: 88px; height: 68px; }
.d-swing i { position: absolute; top: 0; left: 50%; width: 2px; height: 50px; margin-left: -1px; background: var(--line-strong); transform-origin: top center; animation: k-swing 2.8s ease-in-out infinite; }
.d-swing i::after { content: ""; position: absolute; bottom: -8px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--accent); }
.d-pendulum { position: relative; width: 88px; height: 68px; }
.d-pendulum i { position: absolute; top: 0; left: 50%; width: 2px; height: 48px; margin-left: -1px; background: var(--accent); transform-origin: top center; animation: k-swing 3.2s ease-in-out infinite; }
.d-pendulum i::after { content: ""; position: absolute; bottom: -11px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.d-wobble i { width: 66px; height: 46px; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft-2); animation: k-wobble 2.6s ease-in-out infinite; }
.d-shake i { width: 70px; height: 44px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; font-size: 10px; animation: k-shake 3s ease-in-out infinite; }

/* ---------- larger stage presence ---------- */
.d-box { width: 88px; height: 62px; }
.d-line { height: 11px; }
.d-blur b, .d-glitch b, .d-scramble b, .d-tgradient b, .d-tshadow b, .d-tspacing b { font-size: 20px; }
.d-tilt i { width: 118px; height: 74px; font-size: 16px; }
.d-lift i { width: 156px; padding: 13px; font-size: 12px; }
.d-beam { height: 76px; font-size: 12px; }
.d-float i, .d-morph i { width: 74px; height: 74px; }
.d-breath i { width: 70px; height: 70px; }
.d-bounce i { width: 38px; height: 38px; }
.d-spinner i { width: 48px; height: 48px; }
.d-ring svg { width: 76px; height: 76px; }
.d-orbit { width: 98px; height: 98px; }
.d-trail { width: 92px; height: 92px; }
.d-count b { font-size: 50px; }
.d-wave i { height: 48px; }
.d-bars i { width: 15px; }
.d-shimmer i, .d-skeleton i { height: 12px; }
.d-stagger i { height: 46px; width: 13px; }
.d-flip { width: 104px; height: 70px; }
.d-accordion { width: 86%; }
.d-draw svg { width: 158px; height: 78px; }
.d-grad i { width: 166px; height: 40px; }
.d-ease i::after { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.d-type { font-size: 13px; }
.d-progress, .d-reveal, .d-shimmer, .d-skeleton { width: 80%; }

/* ---------- interactive pointer states ---------- */
.card.is-pointing .d-spotlight i { animation: none; left: calc(var(--mx, .5) * 100% - 46px); top: calc(var(--my, .5) * 100% - 36px); }
.card.is-pointing .d-tilt i { animation: none; transform: perspective(500px) rotateX(calc(var(--dy, 0) * -14deg)) rotateY(calc(var(--dx, 0) * 18deg)); transition: transform 90ms linear; }
.card.is-pointing .d-magnetic button { animation: none; transform: translate(calc(var(--dx, 0) * 14px), calc(var(--dy, 0) * 10px)); transition: transform 90ms linear; }
.card.is-pointing .d-slide i, .card.is-pointing .d-fade i, .card.is-pointing .d-scale i { animation-duration: 1.4s; }
.ripple-burst { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 2px solid var(--accent); pointer-events: none; animation: k-ripple .7s ease-out forwards; z-index: 3; }
.card.is-tapped .demo__stage { animation: k-wobble .5s ease-in-out; }

/* ---------- config modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 200; background: rgba(10,10,10,.48); opacity: 0; pointer-events: none; transition: opacity var(--t-mid) ease; }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.modal { position: fixed; z-index: 210; left: 50%; top: 50%; width: min(920px, calc(100% - 32px)); max-height: min(88vh, 800px); transform: translate(-50%, -46%) scale(.96); opacity: 0; pointer-events: none; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; transition: opacity var(--t-mid) ease, transform 520ms var(--ease-spring); }
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; font-weight: 600; }
.modal__head .eyebrow { margin-top: 2px; }
.modal__body { overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 20px; }
.modal__close { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); display: grid; place-items: center; }
.modal__close svg { width: 16px; height: 16px; }
.config-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.config-preview__label { padding: 9px 12px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-3); display: flex; justify-content: space-between; }
.config-preview .demo { height: 190px; margin: 0; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.config-preview .demo__stage { transform: scale(var(--cfg-amp, 1)); transition: transform var(--t-mid) var(--ease-out); }
.config-preview .demo__stage, .config-preview .demo__stage *, .config-preview .demo__stage *::before, .config-preview .demo__stage *::after { animation-duration: var(--cfg-dur, 3s) !important; animation-timing-function: var(--cfg-ease, ease) !important; animation-delay: calc(var(--k, 0) * var(--cfg-delay, 0ms)) !important; animation-iteration-count: var(--cfg-loop, infinite) !important; }
.config-preview .demo__stage.u-live { animation-duration: 4s !important; animation-timing-function: ease-in-out !important; }
.config-preview .demo__stage.u-demo button, .config-preview .demo__stage.u-demo input, .config-preview .demo__stage.u-demo label { transition-duration: var(--cfg-dur, 220ms) !important; transition-timing-function: var(--cfg-ease, ease) !important; }
.config-preview [data-typing], .config-preview [data-scramble], .config-preview [data-count-loop] { font-size: 15px; }
.controls { display: grid; gap: 16px; align-content: start; }
.control label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 500; margin-bottom: 7px; }
.control label b { font-family: var(--font-mono); font-size: 11px; color: var(--accent); font-weight: 500; }
.control input[type="range"] { width: 100%; accent-color: var(--accent); height: 4px; }
.control select { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 9px; font-size: 12px; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prompt-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.prompt-box__head { display: flex; justify-content: space-between; align-items: center; padding: 8px 11px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-3); }
.prompt-box textarea { width: 100%; min-height: 132px; resize: vertical; border: 0; outline: 0; background: var(--surface); padding: 12px; font-family: var(--font-mono); font-size: 11px; line-height: 1.8; color: var(--ink-2); }
.modal__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal__foot small { font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); }

/* ---------- footer / toast ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-sub); padding: 40px 0 26px; margin-top: 60px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: flex-end; }
.footer-inner p { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.footer-note { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--ink-3); text-align: right; line-height: 1.9; }
.empty { display: none; padding: 60px 0; text-align: center; color: var(--ink-3); }
.empty.is-show { display: block; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 300; transform: translate(-50%, 14px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--radius); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity var(--t-mid) ease, transform 460ms var(--ease-spring); }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   UI component demos — real controls, hover/focus states,
   tunable radius / gap / border / shadow via CSS variables
   ============================================================ */
.ui-only { display: none; }
.modal.is-ui .ui-only, .modal.is-3d .ui-only { display: block; }
.u-demo {
  --ui-radius: 6px; --ui-gap: 6px; --ui-border: 1px; --ui-shadow: 2;
  display: flex; align-items: center; justify-content: center; gap: var(--ui-gap);
  width: 100%; height: 100%; font-size: 10.5px;
}
.u-demo * { box-shadow: 0 calc(var(--ui-shadow) * 1px) calc(var(--ui-shadow) * 4px) rgba(0,0,0,.07); }
.u-demo button, .u-demo input, .u-demo select { cursor: pointer; }
@keyframes u-state { 0%,68%,100% { transform: translateY(0); } 78%,92% { transform: translateY(-3px); } }
.u-live { animation: u-state 4s ease-in-out infinite; }
.u-box { background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); }

/* buttons */
.u-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 14px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); color: var(--ink); font-size: 10.5px; font-weight: 500; transition: all var(--t-micro) ease; }
.u-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.u-btn--solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.u-btn--solid:hover { background: var(--accent-hover); color: var(--on-accent); }
.u-btn--outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.u-btn--text { background: transparent; border-color: transparent; color: var(--ink-2); }
.u-btn--icon { width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.u-btn--pill { border-radius: 30px; padding-inline: 18px; }
.u-btn--ghost { background: var(--bg-sub); }
.u-btn--danger { background: transparent; border-color: var(--danger, #bb3d35); color: var(--danger, #bb3d35); }
.u-btn--loading { position: relative; color: transparent; }
.u-btn--loading::after { content: ""; position: absolute; width: 11px; height: 11px; border: 2px solid var(--on-accent); border-top-color: transparent; border-radius: 50%; animation: k-spin .9s linear infinite; }
.u-split { display: flex; }
.u-split .u-btn:first-child { border-radius: var(--ui-radius) 0 0 var(--ui-radius); }
.u-split .u-btn:last-child { border-radius: 0 var(--ui-radius) var(--ui-radius) 0; border-left: 0; padding-inline: 8px; }

/* cards */
.u-card { padding: 11px; width: 132px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); }
.u-card b { display: block; font-size: 10.5px; font-weight: 600; }
.u-card small { display: block; font-size: 8.5px; color: var(--ink-3); margin-top: 2px; }
.u-card--media { padding: 0; overflow: hidden; }
.u-card--media i { display: block; height: 40px; background: var(--accent-soft-2); border-bottom: 1px solid var(--line); }
.u-card--media div { padding: 9px; }
.u-card--profile { display: flex; gap: 9px; align-items: center; }
.u-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft-2); border: 1px solid var(--accent); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--accent); flex: 0 0 auto; }
.u-card--price { width: 136px; }
.u-card--price strong { display: block; font-family: var(--font-mono); font-size: 22px; letter-spacing: -.04em; line-height: 1.2; }
.u-card--price .u-btn { width: 100%; margin-top: 8px; padding-block: 5px; }
.u-card--stat strong { display: block; font-family: var(--font-mono); font-size: 21px; letter-spacing: -.04em; }
.u-card--click { display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: transform var(--t-micro) ease; }
.u-card--click:hover { transform: translateY(-2px); border-color: var(--accent); }
.u-card--click span { color: var(--accent); font-size: 13px; }
.u-card--collapse header { display: flex; justify-content: space-between; font-size: 10px; font-weight: 600; }
.u-card--collapse i { display: block; height: 5px; margin-top: 6px; background: var(--line); border-radius: 2px; }
.u-card--horizontal { display: flex; gap: 9px; align-items: center; width: 160px; }
.u-card--horizontal i { width: 42px; height: 42px; flex: 0 0 auto; background: var(--accent-soft-2); border-radius: var(--ui-radius); }
.u-card--glass { background: color-mix(in srgb, var(--surface) 55%, transparent); backdrop-filter: blur(6px); border-color: var(--line-strong); }

/* forms */
.u-input { width: 168px; padding: 9px 11px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); color: var(--ink-3); font-size: 10.5px; transition: border-color var(--t-micro) ease; }
.u-input:hover, .u-input:focus-within { border-color: var(--accent); }
.u-search { display: flex; align-items: center; gap: 7px; }
.u-search svg { width: 13px; height: 13px; color: var(--ink-3); flex: 0 0 auto; }
.u-field { display: flex; align-items: center; gap: 7px; font-size: 10.5px; padding: 7px 11px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); cursor: pointer; }
.u-check { width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 3px; display: grid; place-items: center; font-size: 9px; color: var(--on-accent); }
.u-check.is-on { background: var(--accent); border-color: var(--accent); }
.u-radio { width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; }
.u-radio.is-on { border-color: var(--accent); }
.u-radio.is-on::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.u-field:hover .u-check, .u-field:hover .u-radio { border-color: var(--accent); }
.u-switch { width: 38px; height: 20px; border-radius: 20px; background: var(--line-strong); position: relative; cursor: pointer; transition: background var(--t-micro) ease; }
.u-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--t-mid) var(--ease-spring); }
.u-switch.is-on { background: var(--accent); }
.u-switch.is-on::after { transform: translateX(18px); }
.u-select { width: 132px; padding: 9px 11px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); display: flex; justify-content: space-between; align-items: center; }
.u-select::after { content: "⌄"; color: var(--ink-3); }
.u-slider { width: 150px; height: 4px; border-radius: 3px; background: var(--line-strong); position: relative; }
.u-slider::before { content: ""; position: absolute; inset: 0 38% 0 0; background: var(--accent); border-radius: 3px; }
.u-slider::after { content: ""; position: absolute; top: 50%; left: 62%; width: 13px; height: 13px; margin: -6.5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.u-date { display: flex; align-items: center; gap: 9px; padding: 8px 11px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); font-family: var(--font-mono); font-size: 10px; }
.u-tags { display: flex; flex-wrap: wrap; gap: 5px; max-width: 180px; padding: 7px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); }
.u-tag { padding: 2px 7px; border-radius: 20px; background: var(--accent-soft-2); color: var(--accent); font-size: 9px; }

/* navigation */
.u-topnav { display: flex; align-items: center; gap: 14px; padding: 8px 12px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); }
.u-topnav b { font-family: var(--font-mono); font-size: 9px; }
.u-topnav span { font-size: 9px; color: var(--ink-3); }
.u-topnav span.is-on { color: var(--accent); font-weight: 600; }
.u-sidebar { width: 128px; padding: 9px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); display: grid; gap: 4px; }
.u-sidebar i { display: block; height: 8px; border-radius: 2px; background: var(--line); }
.u-sidebar i.is-on { background: var(--accent-soft-2); border-left: 2px solid var(--accent); width: 84%; }
.u-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.u-tabs span { font-size: 10px; color: var(--ink-3); padding-bottom: 5px; }
.u-tabs span.is-on { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
.u-breadcrumb { display: flex; gap: 6px; font-size: 9.5px; color: var(--ink-3); }
.u-breadcrumb b { color: var(--ink); font-weight: 500; }
.u-pagination { display: flex; gap: 4px; }
.u-pagination i { width: 23px; height: 23px; display: grid; place-items: center; font-style: normal; font-family: var(--font-mono); font-size: 9px; border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); background: var(--surface); }
.u-pagination i.is-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.u-steps { display: flex; align-items: center; gap: 5px; }
.u-steps i { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 8px; border: 1px solid var(--line-strong); background: var(--surface); }
.u-steps i.is-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.u-steps s { width: 16px; height: 1px; background: var(--line-strong); }
.u-bottomnav { display: flex; gap: 26px; padding: 9px 18px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); }
.u-bottomnav i { width: 14px; height: 14px; border-radius: 4px; background: var(--line-strong); }
.u-bottomnav i.is-on { background: var(--accent); }
.u-command { width: 184px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); overflow: hidden; }
.u-command div { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 9.5px; color: var(--ink-3); }
.u-command i { display: block; padding: 6px 10px; font-style: normal; font-size: 9.5px; }
.u-command i.is-on { background: var(--accent-soft-2); color: var(--accent); }
.u-menu { width: 112px; padding: 5px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); display: grid; gap: 2px; }
.u-menu i { font-style: normal; padding: 4px 7px; font-size: 9.5px; border-radius: 2px; }
.u-menu i.is-on { background: var(--accent-soft-2); color: var(--accent); }

/* data display */
.u-table { width: 180px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); overflow: hidden; }
.u-table div { display: flex; justify-content: space-between; padding: 5px 9px; border-bottom: 1px solid var(--line); font-size: 9px; }
.u-table div:first-child { background: var(--bg-sub); color: var(--ink-3); }
.u-table div:last-child { border-bottom: 0; }
.u-metric { text-align: center; }
.u-metric strong { display: block; font-family: var(--font-mono); font-size: 24px; letter-spacing: -.04em; line-height: 1.1; }
.u-metric span { font-size: 8.5px; color: var(--ink-3); }
.u-prog { width: 150px; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.u-prog i { display: block; height: 100%; width: 68%; background: var(--accent); border-radius: 4px; }
.u-donut { width: 58px; height: 58px; border-radius: 50%; background: conic-gradient(var(--accent) 0 68%, var(--line) 68% 100%); display: grid; place-items: center; }
.u-donut::after { content: "68%"; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--font-mono); font-size: 9px; }
.u-chart { width: 158px; height: 60px; }
.u-chart polyline { fill: none; stroke: var(--accent); stroke-width: 2; }
.u-chart line { stroke: var(--line); stroke-width: 1; }
.u-bars { display: flex; gap: 6px; align-items: flex-end; height: 60px; }
.u-bars i { width: 12px; background: var(--line-strong); border-radius: 2px 2px 0 0; }
.u-bars i:nth-child(2), .u-bars i:nth-child(4) { background: var(--accent); }
.u-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; background: var(--accent-soft-2); color: var(--accent); font-size: 9.5px; }
.u-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.u-avatars { display: flex; }
.u-avatars .u-avatar { margin-left: -7px; border: 2px solid var(--surface); }
.u-avatars .u-avatar:first-child { margin-left: 0; }
.u-timeline { display: grid; gap: 9px; }
.u-timeline i { display: flex; align-items: center; gap: 7px; font-style: normal; font-size: 9.5px; }
.u-timeline i::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--accent); }
.u-timeline i.is-on::before { background: var(--accent); }

/* feedback */
.u-tooltip { position: relative; padding: 7px 11px; background: var(--ink); color: var(--bg); border-radius: var(--ui-radius); font-size: 9.5px; }
.u-tooltip::after { content: ""; position: absolute; bottom: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; background: var(--ink); transform: rotate(45deg); }
.u-popover { width: 152px; padding: 10px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); }
.u-popover b { display: block; font-size: 10px; }
.u-popover i { display: block; height: 5px; margin-top: 6px; background: var(--line); border-radius: 2px; }
.u-alert { display: flex; align-items: center; gap: 8px; width: 190px; padding: 9px 11px; background: var(--accent-soft-2); border-left: 3px solid var(--accent); border-radius: var(--ui-radius); font-size: 10px; }
.u-alert b { color: var(--accent); }
.u-toast-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--ink); color: var(--bg); border-radius: var(--ui-radius); font-size: 10px; }
.u-toast-item i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.u-confirm { width: 170px; padding: 12px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); text-align: center; }
.u-confirm b { display: block; font-size: 10.5px; }
.u-confirm div { display: flex; gap: 6px; justify-content: center; margin-top: 9px; }
.u-confirm .u-btn { padding: 4px 10px; font-size: 9px; }
.u-empty { text-align: center; color: var(--ink-3); }
.u-empty i { display: block; width: 26px; height: 26px; margin: 0 auto 6px; border: 1px dashed var(--line-strong); border-radius: var(--ui-radius); }
.u-empty span { font-size: 9.5px; }
.u-skel { width: 150px; display: grid; gap: 7px; }
.u-skel i { height: 7px; border-radius: 3px; background: var(--line); }
.u-skel i:nth-child(2) { width: 78%; }
.u-skel i:nth-child(3) { width: 55%; }
.u-error { display: flex; align-items: center; gap: 7px; color: var(--danger, #bb3d35); font-size: 10px; }
.u-error::before { content: "!"; width: 15px; height: 15px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-size: 9px; }
.u-success { display: flex; align-items: center; gap: 7px; color: var(--ok); font-size: 10px; }
.u-success::before { content: "✓"; width: 15px; height: 15px; border-radius: 50%; background: currentColor; color: var(--surface); display: grid; place-items: center; font-size: 9px; }

/* overlays */
.u-modal-box { width: 178px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); overflow: hidden; box-shadow: 0 12px 26px rgba(0,0,0,.16); }
.u-modal-box header { padding: 8px 11px; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 600; }
.u-modal-box div { padding: 11px; font-size: 9px; color: var(--ink-3); }
.u-drawer-box { width: 118px; height: 84px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); box-shadow: 8px 0 20px rgba(0,0,0,.12); padding: 9px; }
.u-drawer-box i { display: block; height: 6px; background: var(--line); margin-bottom: 6px; border-radius: 2px; }
.u-popconfirm { width: 158px; padding: 10px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); font-size: 9.5px; }
.u-popconfirm div { display: flex; gap: 5px; justify-content: flex-end; margin-top: 8px; }
.u-context { display: grid; gap: 3px; padding: 5px; }
.u-context i { font-style: normal; font-size: 9px; width: 90px; }
.u-fab { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 19px; box-shadow: 0 8px 20px var(--accent-soft-2); }
.u-sticky-head { width: 150px; padding: 8px 10px; background: var(--surface); border: var(--ui-border) solid var(--line-strong); border-radius: var(--ui-radius); font-size: 9.5px; font-weight: 600; }
.u-scrim-demo { position: relative; width: 150px; height: 76px; border-radius: var(--ui-radius); background: var(--line); display: grid; place-items: center; }
.u-scrim-demo::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.34); border-radius: inherit; }
.u-scrim-demo b { position: relative; z-index: 2; }
.u-onboard { position: relative; width: 150px; height: 76px; border: 1px dashed var(--accent); border-radius: var(--ui-radius); display: grid; place-items: center; font-size: 9px; color: var(--accent); }
.u-onboard i { position: absolute; width: 46px; height: 30px; left: 12px; top: 12px; border: 2px solid var(--accent); border-radius: var(--ui-radius); box-shadow: 0 0 0 100px rgba(0,0,0,.28); }
.u-toaststack { display: grid; gap: 5px; }
.u-toaststack i { font-style: normal; padding: 5px 10px; background: var(--ink); color: var(--bg); border-radius: var(--ui-radius); font-size: 9px; }

/* layout patterns */
.u-layout { display: grid; gap: 5px; width: 160px; }
.u-layout i { display: block; border-radius: 2px; background: var(--accent-soft-2); border: 1px solid var(--accent); min-height: 20px; }
.u-two { grid-template-columns: 1fr 2fr; }
.u-three { grid-template-columns: repeat(3, 1fr); }
.u-grid4 { grid-template-columns: repeat(4, 1fr); }
.u-grid4 i { min-height: 36px; }
.u-masonry { columns: 3; column-gap: 5px; }
.u-masonry i { break-inside: avoid; margin-bottom: 5px; }
.u-masonry i:nth-child(2n) { min-height: 42px; }
.u-split { display: flex; width: 170px; height: 66px; border: 1px solid var(--line-strong); border-radius: var(--ui-radius); overflow: hidden; }
.u-split i { flex: 1; background: var(--accent-soft-2); }
.u-split b { width: 3px; background: var(--accent); }
.u-sticky-side { width: 160px; height: 62px; display: flex; gap: 5px; }
.u-sticky-side i { width: 42px; background: var(--accent-soft-2); border: 1px solid var(--accent); border-radius: 2px; }
.u-sticky-side s { flex: 1; background: repeating-linear-gradient(to bottom, var(--line) 0 4px, transparent 4px 9px); }
.u-fullbleed { width: 100%; height: 62px; background: var(--accent-soft-2); border-block: 1px solid var(--accent); display: grid; place-items: center; font-size: 9.5px; color: var(--accent); }
.u-stack-cards { position: relative; width: 130px; height: 62px; }
.u-stack-cards i { position: absolute; inset: 10px 22px; border: 1px solid var(--accent); border-radius: var(--ui-radius); background: var(--surface); transform: translateY(6px) rotate(-2deg); }
.u-stack-cards i:first-child { transform: translateY(-4px) rotate(2deg); }
.u-nested { width: 160px; display: grid; gap: 4px; }
.u-nested i { display: block; height: 11px; border-radius: 2px; background: var(--line); }
.u-nested i:nth-child(2), .u-nested i:nth-child(3) { margin-left: 14px; background: var(--accent-soft-2); }
.u-nested i:nth-child(3) { margin-left: 28px; }

/* config preview: UI variables */
.config-preview .demo__stage.u-demo { transform: scale(var(--cfg-amp, 1)); }
.config-preview .u-demo { --ui-radius: var(--cfg-radius, 6px); --ui-shadow: var(--cfg-shadow, 2); --ui-gap: var(--cfg-delay, 6px); --ui-border: 1px; }

/* ============================================================
   Composer / combination workspace & skill exports
   ============================================================ */
.combo-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); font-size: 12px; white-space: nowrap; transition: border-color var(--t-micro) ease, color var(--t-micro) ease; }
.combo-btn svg { width: 15px; height: 15px; }
.combo-btn:hover { border-color: var(--accent); color: var(--accent); }
.combo-btn b { font-family: var(--font-mono); font-size: 10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.reward-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 12px; white-space: nowrap; transition: border-color var(--t-micro) ease, color var(--t-micro) ease, background var(--t-micro) ease; }
.reward-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.reward-scrim { position: fixed; inset: 0; z-index: 210; background: rgba(8,10,8,.62); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
.reward-scrim.is-open { opacity: 1; pointer-events: auto; }
.reward-modal { position: fixed; top: 50%; left: 50%; z-index: 220; width: min(620px, calc(100vw - 32px)); transform: translate(-50%,-46%) scale(.97); opacity: 0; pointer-events: none; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); transition: opacity .28s ease, transform .38s var(--ease-spring); }
.reward-modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
.reward-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.reward-modal__head h2 { margin-top: 5px; font-size: 18px; font-weight: 600; }
.reward-modal__body { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; padding: 22px; }
.reward-modal__body img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.reward-modal__body p { color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.reward-modal__note { margin-top: 8px; color: var(--ink-3); font-size: 11px; }
.reward-modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 620px) { .reward-modal__body { grid-template-columns: 1fr; } .reward-modal__body img { max-width: 260px; margin: 0 auto; } }
.combo-add { display: inline-flex; align-items: center; gap: 3px; padding: 0; background: none; border: 0; color: var(--ink-3); font-size: 9.5px; white-space: nowrap; }
.combo-add:hover, .combo-add.is-on { color: var(--accent); }
.combo-add svg { width: 11px; height: 11px; }

.combo-scrim { position: fixed; inset: 0; z-index: 180; background: rgba(10,10,10,.44); opacity: 0; pointer-events: none; transition: opacity var(--t-mid) ease; }
.combo-scrim.is-open { opacity: 1; pointer-events: auto; }
.combo-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 190; width: min(560px, 100%); background: var(--bg); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-2); transform: translateX(100%); transition: transform 540ms var(--ease-spring); display: flex; flex-direction: column; }
.combo-panel.is-open { transform: none; }
.combo-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.combo-panel__head h2 { font-size: 17px; font-weight: 600; }
.combo-panel__body { overflow: auto; padding: 22px; display: grid; gap: 26px; }
.combo-section h3 { font-size: 12px; font-weight: 600; margin-bottom: 11px; display: flex; justify-content: space-between; }
.combo-section h3 span { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); font-weight: 400; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-grid button { text-align: left; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; font-weight: 600; transition: border-color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.preset-grid button:hover { border-color: var(--accent); transform: translateY(-2px); }
.preset-grid small { display: block; margin-top: 5px; font-size: 9.5px; color: var(--ink-3); font-weight: 400; line-height: 1.5; }
.combo-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.combo-list li { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 11.5px; }
.combo-list li span { font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); min-width: 22px; }
.combo-list li b { font-weight: 500; }
.combo-list li em { font-style: normal; font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); margin-left: auto; }
.combo-list li button { border: 0; background: none; color: var(--ink-3); font-size: 11px; padding: 0 3px; }
.combo-list li button:hover { color: var(--accent); }
.combo-list .empty-tip { display: block; padding: 16px; text-align: center; color: var(--ink-3); font-size: 11.5px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.combo-name { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 12px; margin-bottom: 8px; }
.combo-prompt, .export-text { width: 100%; min-height: 148px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 12px; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.8; color: var(--ink-2); }
.export-text { min-height: 220px; }
.format-tabs { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.format-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 5px 11px; font-size: 10.5px; color: var(--ink-2); }
.format-tabs button.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.export-hint { margin: 8px 0 0; font-size: 10px; color: var(--ink-3); line-height: 1.6; }
.export-actions { display: flex; gap: 8px; margin-top: 10px; }
.import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.import-actions .btn { width: 100%; justify-content: center; }
.import-note { margin: 0 0 10px; padding: 9px 10px; border-left: 2px solid var(--accent); background: var(--surface-2); color: var(--ink-3); font-size: 10px; line-height: 1.65; }
.import-note code { font-family: var(--font-mono); color: var(--ink-2); }
@media (max-width: 520px) { .import-actions { grid-template-columns: 1fr; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero__grid { grid-template-columns: 1fr; }
  .preview-card { max-width: 520px; }
  .modal__body { grid-template-columns: 1fr; }
  .colors__label { display: none; }
}
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
  .brand__for { display: none; }
  .header-search input { width: 96px; }
  .colors { gap: 5px; padding-left: 8px; }
  .swatch:nth-of-type(n+4) { display: none; }
  .hero { padding-top: 40px; }
  .cat__head { grid-template-columns: 46px minmax(0,1fr); gap: 10px; }
  .cat__num { font-size: 28px; }
  .cat__count { display: none; }
  .modal__foot { flex-wrap: wrap; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal-card { opacity: 1; transform: none; }
  .demo__loop, .demo__tip { display: none; }
}
