/* Kuro Client — page styles. Tokens first; the product's own interface lives under [data-ui]. */

:root {
  --bg: #0a0b0d;
  --surface: #131519;
  --surface-2: #1b1e23;
  --surface-3: #262a30;
  --ink: #f3f4f6;
  --muted: #a3a7b0;
  --accent: #ffffff;
  --accent-ink: #0a0b0d;

  --font: "Switzer", ui-sans-serif, system-ui, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.375rem, 1.1rem + 0.9vw, 2rem);
  --step-head: clamp(2.25rem, 1.4rem + 3.4vw, 4.5rem);
  --step-display: clamp(4rem, 1.5rem + 9vw, 10rem);

  --margin: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 12vw, 11rem);
  --radius: 16px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.5; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: 5.5rem; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { padding-inline: var(--margin); }
.section { padding-block: calc(var(--section) / 2); }

/* ---------- controls ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.6rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:hover { background: #d9dbe0; }
.button:active { transform: scale(0.96); }
.button-small { min-height: 2.5rem; padding: 0 1.15rem; font-size: var(--step-small); }
.button-ghost { background: var(--surface-2); color: var(--ink); }
.button-ghost:hover { background: var(--surface-3); }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.25em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
.link:hover { text-decoration-color: currentColor; }

/* ---------- bar ---------- */
.bar { position: sticky; top: 0; z-index: 50; background: var(--bg); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 4.5rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; font-weight: 500; font-size: var(--step-body); transition: opacity var(--t-hover) ease; }
.brand:hover { opacity: 0.8; }
.bar-links { display: flex; gap: 2rem; font-size: var(--step-small); color: var(--muted); }
.bar-links a:hover { color: var(--ink); }
@media (max-width: 47.99em) { .bar-links { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: clamp(2rem, 4vw, 3.5rem); }
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.display { font-size: var(--step-display); line-height: 0.92; letter-spacing: -0.045em; font-weight: 600; }
.hero-sub { margin-top: 1.5rem; font-size: var(--step-lead); line-height: 1.3; max-width: 30ch; color: var(--muted); }
.actions { margin-top: 2rem; display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.stage-wrap { margin-top: clamp(2.5rem, 4vw, 3.5rem); }

/* ---------- opening: the island at dusk ---------- */
.opening { position: relative; height: calc(100svh - 4.5rem); min-height: 640px; max-height: 1100px; overflow: hidden; background: #121735; color: #fff; }
.opening-scene { position: absolute; inset: 0; }
.opening-scene canvas { position: absolute; inset: 0; pointer-events: none; }
.opening-fallback { width: 100%; height: 100%; object-fit: cover; }
.opening.has-3d .opening-fallback { display: none; }
.opening-copy { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; max-width: min(48rem, 54%); }
.opening .hero-sub { color: rgba(255, 255, 255, 0.84); max-width: 24ch; text-align: left; }
.opening .actions { justify-content: flex-start; }
.opening-link { margin-top: 1.75rem; color: rgba(255, 255, 255, 0.8); font-size: var(--step-small); text-underline-offset: 0.25em; transition: color var(--t-hover) ease; }
.opening-link:hover { color: #fff; }
.button-dark { background: rgba(10, 11, 13, 0.6); color: #fff; }
.button-dark:hover { background: rgba(10, 11, 13, 0.85); }
.menu-section { padding-top: var(--section); }
.menu-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; margin-bottom: 2.5rem; }
.menu-head .section-head { grid-column: 1 / 8; }
.menu-head .section-sub { grid-column: 8 / 13; margin-top: 0; justify-self: end; }
.join-link { margin-top: 1.75rem; font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; text-underline-offset: 0.2em; text-decoration-thickness: 0.06em; }
.join-link + .button { margin-top: 1.5rem; }
.foot-discord { color: var(--ink); font-size: var(--step-body); font-weight: 500; text-underline-offset: 0.25em; }
@media (max-width: 63.99em) {
  .opening { height: auto; min-height: 0; max-height: none; aspect-ratio: auto; }
  .opening-scene { position: relative; height: 62svh; min-height: 380px; }
  .opening-copy { height: auto; max-width: none; padding-block: 2.5rem 1rem; }
  .menu-head { display: block; }
  .menu-head .section-sub { margin-top: 1.25rem; }
}

/* ---------- section heads ---------- */
.section-head { font-size: var(--step-head); line-height: 1; letter-spacing: -0.035em; font-weight: 600; }
.section-sub { margin-top: 1.5rem; max-width: 46ch; color: var(--muted); }

/* ---------- modules ---------- */
.modules { padding-top: var(--section); }
.modules-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
.modules-head .section-head { grid-column: 1 / 8; }
.modules-head .section-sub { grid-column: 8 / 13; margin-top: 0; justify-self: end; }
.chips { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0 1.1rem; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: var(--step-small); font-weight: 500; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.chip b { font-weight: 500; opacity: 0.6; font-variant-numeric: tabular-nums; }
.mod-cards { margin-top: 2rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 1rem; }
.mod-card { display: flex; flex-direction: column; text-align: left; border-radius: var(--radius); transition: transform var(--t-ui) var(--ease-out); }
.mod-card:hover { transform: translateY(-4px); }
.mod-card:active { transform: scale(0.985); }
.mod-shot { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 16 / 10; }
.mod-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-soft); }
.mod-card:hover .mod-shot img { transform: scale(1.06); }
.mod-run { position: absolute; right: 12px; bottom: 12px; padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: var(--step-small); font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity var(--t-ui) ease, transform var(--t-ui) var(--ease-out); }
.mod-card:hover .mod-run, .mod-card:focus-visible .mod-run, .mod-card.is-playing .mod-run { opacity: 1; transform: none; }
.mod-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.mod-card-name { font-weight: 500; font-size: var(--step-body); }
.mod-key { flex: none; font-size: var(--step-small); font-weight: 500; color: var(--accent-ink); background: var(--ink); border-radius: 6px; padding: 0.05rem 0.5rem; }
.mod-key.is-none { background: var(--surface-2); color: var(--muted); }
.mod-card-desc { margin-top: 0.35rem; color: var(--muted); font-size: var(--step-body); line-height: 1.5; max-width: 34ch; }
.mod-list-wrap { margin-top: 4rem; }
.mod-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

.mod-controls { margin-top: 3rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.mod-controls .chips { margin-top: 0; }
.mod-search { position: relative; flex: 0 1 22rem; min-width: 14rem; }
.mod-search svg { position: absolute; left: 1rem; top: 50%; translate: 0 -50%; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.mod-search input { width: 100%; min-height: 2.75rem; padding: 0 1rem 0 2.75rem; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: max(1rem, var(--step-small)); outline: none; transition: background-color var(--t-hover) ease; }
.mod-search input:focus { background: var(--surface-2); outline: 2px solid var(--ink); outline-offset: 0; }
.mod-search input::placeholder { color: var(--muted); }
.mod-card-cat { margin-top: 0.15rem; color: var(--muted); font-size: var(--step-small); }
.mod-list-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.25rem; }
.mod-list-head h3 { font-size: var(--step-lead); letter-spacing: -0.02em; }
.mod-list-head span { color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.mod-row { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.15rem; border-radius: 12px; background: var(--surface); min-height: 0; transition: background-color var(--t-hover) ease; }
.mod-row.has-demo { cursor: pointer; }
.mod-row:hover { background: var(--surface-2); }
.mod-row-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.mod-row-name { font-weight: 500; }
.mod-row-desc { color: var(--muted); font-size: var(--step-body); line-height: 1.5; }
.mod-row-cat { color: var(--muted); font-size: var(--step-small); opacity: 0.75; }
.mod-more { margin-top: 1.5rem; }
.mod-more[hidden], .mod-cards[hidden] { display: none; }
.mod-empty { color: var(--muted); padding: 2rem 0; }

/* ---------- setup ---------- */
.setup { padding-top: var(--section); }
.setup-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
.setup-text { grid-column: 1 / 7; }
.steps { margin: 3rem 0 2.5rem; display: flex; flex-direction: column; gap: 6px; }
.steps li { padding: 1.4rem 1.5rem; border-radius: var(--radius); background: var(--surface); transition: background-color var(--t-hover) ease; }
.steps li:hover { background: var(--surface-2); }
.steps h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.steps p { margin-top: 0.4rem; color: var(--muted); }
.setup-pic { grid-column: 8 / 13; }
.setup-pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.setup-pic figcaption, .faq-pic figcaption { margin-top: 0.75rem; color: var(--muted); font-size: var(--step-small); }

/* ---------- join ---------- */
.join { padding-block: calc(var(--section) / 2); }
.join-panel { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); border-radius: calc(var(--radius) * 1.5); overflow: hidden; background: var(--surface); min-height: min(640px, 80svh); }
.join-text { grid-column: 1 / 6; padding: clamp(2rem, 4vw, 4rem); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; }
.join-text .button { margin-top: 2rem; }
.join-pic { grid-column: 6 / 13; position: relative; overflow: hidden; }
.join-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; transition: transform 1.6s var(--ease-soft); }
.join-panel:hover .join-pic img { transform: scale(1.04); }

/* ---------- faq ---------- */
.faq { padding-top: calc(var(--section) / 2); }
.faq-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.faq-side { grid-column: 1 / 5; position: sticky; top: 6rem; align-self: start; }
.faq-pic { margin-top: 2.5rem; }
.faq-pic img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.faq-list { grid-column: 6 / 13; display: flex; flex-direction: column; gap: 6px; }
.faq-list details { background: var(--surface); border-radius: var(--radius); transition: background-color var(--t-ui) ease; }
.faq-list details[open] { background: var(--accent); color: var(--accent-ink); }
.faq-list summary { position: relative; list-style: none; cursor: pointer; display: flex; align-items: center; min-height: 4.5rem; padding: 0.75rem 3.5rem 0.75rem 1.5rem; font-size: var(--step-body); font-weight: 500; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before, .faq-list summary::after { content: ""; position: absolute; right: 1.5rem; top: 50%; width: 16px; height: 3px; margin-top: -1.5px; background: currentColor; transition: transform var(--t-ui) var(--ease-out); }
.faq-list summary::after { transform: rotate(90deg); }
.faq-list details[open] summary::after { transform: rotate(0deg); }
.faq-list summary:hover { opacity: 0.85; }
.faq-list details p { padding: 0 1.5rem 1.5rem; max-width: 52ch; }

/* ---------- footer ---------- */
.foot { margin-top: calc(var(--section) / 2); padding-bottom: 2rem; }
.foot-top { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding-block: 2rem; }
.foot-links { display: flex; gap: 2rem; flex-wrap: wrap; color: var(--muted); }
.foot-links a:hover { color: var(--ink); }
.foot-word { font-size: clamp(6rem, 27vw, 26rem); line-height: 0.78; letter-spacing: -0.065em; font-weight: 600; color: var(--ink); text-align: center; margin-inline: -0.04em; user-select: none; }
.foot-bottom { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-top: 2rem; color: var(--muted); font-size: var(--step-small); }
.foot-bottom p { max-width: 60ch; }

/* ---------- responsive page ---------- */
@media (max-width: 63.99em) {
  .mod-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mod-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-text { grid-column: 1 / -1; }
  .setup-pic { grid-column: 1 / -1; margin-top: 3rem; max-width: 520px; }
  .join-text { grid-column: 1 / -1; order: 2; }
  .join-pic { grid-column: 1 / -1; min-height: 360px; }
}
@media (max-width: 47.99em) {
  .modules-head { display: block; }
  .modules-head .section-sub { margin-top: 1.25rem; }
  .mod-cards { grid-template-columns: 1fr; }
  .mod-list { grid-template-columns: 1fr; }
  .faq-grid { display: block; }
  .faq-side { position: static; }
  .faq-pic { margin-bottom: 2rem; }
  .faq-list summary { min-height: 4rem; padding: 0.75rem 3.25rem 0.75rem 1.25rem; }
  .faq-list summary::before, .faq-list summary::after { right: 1.25rem; }
  .steps li { padding: 1.2rem 1.25rem; }
  .join-pic { min-height: 260px; }
  .foot-links { gap: 1.25rem; }
}

/* =====================================================================
   The product: Kuro's own interface and the rendered world it runs in.
   Its own conventions (glass, 1px borders, glows, its purple) apply.
   ===================================================================== */

[data-ui].stage {
  position: relative; height: clamp(640px, 52vw, 800px); border-radius: var(--radius); overflow: hidden; background: #9cc4ee; isolation: isolate;
}
[data-ui] .scene3d { position: absolute; inset: 0; }
[data-ui] .scene3d canvas { position: absolute; inset: 0; }
[data-ui] .scene-fallback { width: 100%; height: 100%; object-fit: cover; }
[data-ui].has-3d .scene-fallback { display: none; }
[data-ui] .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 1; }
[data-ui] .flash.go { animation: flash 0.5s ease-out 1; }
@keyframes flash { 0% { opacity: 0.8; } 100% { opacity: 0; } }

/* caption + tour */
[data-ui] .demo-cap { position: absolute; left: 20px; top: 20px; z-index: 3; display: flex; align-items: center; gap: 12px; max-width: min(440px, 34%); padding: 10px 16px 10px 10px; border-radius: 12px; background: rgba(10, 11, 13, 0.82); color: #fff; }
[data-ui] .demo-key { flex: none; min-width: 36px; height: 36px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: #0a0b0d; font-weight: 600; font-size: 15px; }
[data-ui] .demo-text { display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; color: #c9ccd3; }
[data-ui] .demo-text strong { color: #fff; font-weight: 500; font-size: 16px; }
[data-ui] .demo-cap.swap { animation: capswap 0.45s var(--ease-out) 1; }
@keyframes capswap { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
[data-ui] .tour-btn { position: absolute; left: 20px; bottom: 20px; z-index: 3; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(10, 11, 13, 0.82); color: #fff; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
[data-ui] .tour-btn[hidden] { display: none; }
[data-ui] .tour-btn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6ee7b7; }
[data-ui] .tour-btn[aria-pressed="false"]::before { background: #6b7280; }
[data-ui] .tour-btn:hover { background: rgba(10, 11, 13, 0.95); }
[data-ui] .tour-btn:active { transform: scale(0.95); }
[data-ui] .reopen { position: absolute; right: 24px; bottom: 24px; z-index: 4; display: inline-flex; gap: 10px; align-items: center; height: 44px; padding: 0 8px 0 18px; border-radius: 999px; background: #fff; color: #0a0b0d; font-weight: 500; font-size: 15px; transition: transform var(--t-press) var(--ease-out); }
[data-ui] .reopen[hidden] { display: none; }
[data-ui] .reopen span { background: #0a0b0d; color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
[data-ui] .reopen:active { transform: scale(0.95); }

/* the GUI: the Kuro Black Glass UI, tilted like an in-game screen */
[data-ui] .gui-wrap { position: absolute; z-index: 2; right: 28px; top: 50%; width: min(1000px, 65%); perspective: 2000px; translate: 0 -50%; }
[data-ui] .kuro-gui { position: relative; height: min(640px, calc(var(--stage-h, 720px) - 56px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; color: #f4f4f5; font-size: 14px; line-height: 1.4; background: rgba(8, 8, 8, 0.84); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); /* taste-skill-ignore: the GUI is Kuro Glass */ border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12); transform-origin: 70% 50%; transform: rotateY(-12deg) rotateX(4deg); transition: transform 0.7s var(--ease-out), opacity 0.45s ease, border-color 0.3s ease; }
[data-ui] .gui-wrap:hover .kuro-gui, [data-ui] .gui-wrap:focus-within .kuro-gui { transform: rotateY(-4deg) rotateX(1deg); border-color: rgba(255, 255, 255, 0.22); }
[data-ui] .gui-wrap.is-closed .kuro-gui { transform: rotateY(-40deg) rotateX(8deg) translateX(30%) scale(0.85); opacity: 0; pointer-events: none; }
[data-ui] .gui-wrap.is-opening .kuro-gui { animation: guiopen 0.9s var(--ease-expo) 1; }
@keyframes guiopen { from { transform: rotateY(-40deg) rotateX(10deg) translateX(18%) scale(0.88); opacity: 0; } }
[data-ui] .kg-watermark { position: absolute; right: -130px; bottom: -130px; width: 520px; height: 520px; opacity: 0.05; pointer-events: none; filter: grayscale(1) brightness(2.4); }
[data-ui] .kg-shimmer { height: 2px; flex: none; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent); /* taste-skill-ignore: the GUI's own rim light */ }
[data-ui] .kg-head { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.6); }
[data-ui] .kg-brand { display: flex; align-items: center; gap: 12px; flex: none; }
[data-ui] .kg-logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: rgba(9, 9, 11, 0.8); border: 1px solid rgba(255, 255, 255, 0.15); transition: transform 0.3s var(--ease-out); }
[data-ui] .kg-logo:hover { transform: rotate(12deg) scale(1.08); }
[data-ui] .kg-brand-text { display: flex; flex-direction: column; align-items: flex-start; }
[data-ui] .kg-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: 0.08em; color: #fff; }
[data-ui] .kg-pill { font-size: 10.5px; font-weight: 300; letter-spacing: 0.16em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #d4d4d8; }
[data-ui] .kg-copy { font-variant-numeric: tabular-nums; font-size: 12px; color: #a1a1aa; transition: color 0.2s; }
[data-ui] .kg-copy:hover { color: #fff; }
[data-ui] .kg-search { position: relative; flex: 1 1 300px; max-width: 380px; min-width: 140px; }
[data-ui] .kg-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; fill: none; stroke: #71717a; stroke-width: 2; stroke-linecap: round; }
[data-ui] .kg-search input { width: 100%; height: 36px; padding: 0 44px 0 34px; border-radius: 12px; background: rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; color: #e4e4e7; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
[data-ui] .kg-search input::placeholder { color: #9a9aa3; }
[data-ui] .kg-search input:focus { border-color: rgba(255, 255, 255, 0.4); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); }
[data-ui] .kg-search kbd { position: absolute; right: 10px; top: 50%; translate: 0 -50%; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; color: #a1a1aa; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1); }
[data-ui] .kg-status { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #9a9aa3; flex: none; }
[data-ui] .kg-toggle-all { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #e4e4e7; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); transition: background-color 0.2s, transform 0.14s var(--ease-out); }
[data-ui] .kg-toggle-all:hover { background: rgba(255, 255, 255, 0.1); }
[data-ui] .kg-toggle-all:active { transform: scale(0.95); }
[data-ui] .kg-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; animation: ping 1.8s ease-in-out infinite; }
@keyframes ping { 50% { opacity: 0.4; } }
[data-ui] .kg-counter b { color: #fff; }
[data-ui] .kg-key { padding: 5px 9px; border-radius: 8px; color: #d4d4d8; border: 1px solid rgba(255, 255, 255, 0.12); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; transition: background-color 0.2s, color 0.2s; }
[data-ui] .kg-key:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
[data-ui] .kg-body { position: relative; flex: 1; display: flex; min-height: 0; }
[data-ui] .kg-rail { width: 210px; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; border-right: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.5); }
[data-ui] .kg-rail-label { padding: 2px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #a1a1aa; }
[data-ui] .kg-cats { display: flex; flex-direction: column; gap: 4px; }
[data-ui] .kg-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 11px; border-radius: 12px; border: 1px solid transparent; font-size: 13.5px; font-weight: 500; color: #a1a1aa; text-align: left; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
[data-ui] .kg-cat-name { display: flex; align-items: center; gap: 10px; }
[data-ui] .kg-cat svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-ui] .kg-cat:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
[data-ui] .kg-cat.is-on { color: #fff; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); }
[data-ui] .kg-badge-n { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); color: #a1a1aa; font-variant-numeric: tabular-nums; }
[data-ui] .kg-cat.is-on .kg-badge-n { background: rgba(255, 255, 255, 0.1); color: #e4e4e7; }
[data-ui] .kg-rail-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: #9a9aa3; }
[data-ui] .kg-rail-foot > span { display: flex; justify-content: space-between; }
[data-ui] .kg-rail-foot b { font-weight: 500; color: #d4d4d8; }
[data-ui] .kg-main { flex: 1; min-width: 0; padding: 16px 18px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
[data-ui] .kg-main-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
[data-ui] .kg-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: #fff; }
[data-ui] .kg-count { font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); color: #d4d4d8; }
[data-ui] .kg-hint { font-size: 11.5px; color: #9a9aa3; white-space: nowrap; }
[data-ui] .kg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
[data-ui] .kg-empty { grid-column: 1 / -1; padding: 56px 0; text-align: center; display: flex; flex-direction: column; gap: 4px; color: #9a9aa3; font-size: 12px; }
[data-ui] .kg-empty strong { color: #a1a1aa; font-size: 14px; font-weight: 500; }
[data-ui] .kg-mod { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 16px; cursor: pointer; background: rgba(14, 14, 14, 0.7); border: 1px solid rgba(255, 255, 255, 0.07); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04); transition: background-color 0.25s, border-color 0.25s, transform 0.25s var(--ease-expo), box-shadow 0.25s; }
[data-ui] .kg-mod:hover { background: rgba(22, 22, 22, 0.85); border-color: rgba(255, 255, 255, 0.25); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.06); }
[data-ui] .kg-mod.is-on { background: rgba(26, 26, 26, 0.85); border-color: rgba(255, 255, 255, 0.3); }
[data-ui] .kg-mod.is-sel { border-color: rgba(255, 255, 255, 0.7); box-shadow: 0 8px 35px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 25px rgba(255, 255, 255, 0.12); }
[data-ui] .kg-mod-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
[data-ui] .kg-mod-main { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; text-align: left; }
[data-ui] .kg-mod-name { font-weight: 600; font-size: 14.5px; color: #e4e4e7; }
[data-ui] .kg-mod.is-on .kg-mod-name { color: #fff; font-weight: 700; }
[data-ui] .kg-tag { font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: #a1a1aa; }
[data-ui] .kg-mod-desc { font-size: 12.5px; color: #a1a1aa; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
[data-ui] .kg-mod-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.05); font-size: 11.5px; }
[data-ui] .kg-status { color: #9a9aa3; display: flex; align-items: center; gap: 8px; }
[data-ui] .kg-status b { font-weight: 500; color: #9a9aa3; }
[data-ui] .kg-mod.is-on .kg-status b { color: #fff; }
[data-ui] .kg-demo { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #fff; color: #000; }
[data-ui] .kg-bind { font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 6px; background: rgba(24, 24, 27, 0.9); color: #d4d4d8; border: 1px solid rgba(255, 255, 255, 0.1); transition: border-color 0.2s, background-color 0.2s; }
[data-ui] .kg-bind:hover { border-color: rgba(255, 255, 255, 0.3); background: #27272a; }
[data-ui] .kg-bind.is-listening { background: #fff; color: #000; border-color: #fff; }
[data-ui] .kg-switch { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; padding: 3px; background: #27272a; transition: background-color 0.25s; cursor: pointer; }
[data-ui] .kg-switch > span { display: block; width: 16px; height: 16px; border-radius: 50%; background: #a1a1aa; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s; }
[data-ui] .kg-switch[aria-checked="true"] { background: #fff; }
[data-ui] .kg-switch[aria-checked="true"] > span { transform: translateX(18px); background: #000; }

/* tablet and phone: the scene on top, the menu flat underneath */
@media (max-width: 63.99em) {
  [data-ui].stage { height: auto; display: flex; flex-direction: column; background: #0e1118; }
  [data-ui] .scene3d { position: relative; inset: auto; height: 380px; flex: none; }
  [data-ui] .gui-wrap { position: relative; right: auto; top: auto; translate: none; width: auto; margin: 0 12px 12px; perspective: none; }
  [data-ui] .kuro-gui, [data-ui] .gui-wrap:hover .kuro-gui, [data-ui] .gui-wrap:focus-within .kuro-gui { transform: none; height: auto; background: rgba(8, 8, 8, 0.97); }
  [data-ui] .gui-wrap.is-closed .kuro-gui { transform: none; opacity: 1; pointer-events: auto; }
  [data-ui] .kg-head { flex-wrap: wrap; }
  [data-ui] .kg-body { flex-direction: column; }
  [data-ui] .kg-rail { width: auto; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 10px; }
  [data-ui] .kg-rail-label, [data-ui] .kg-rail-foot, [data-ui] .kg-hint { display: none; }
  [data-ui] .kg-cats { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  [data-ui] .kg-cat { width: auto; flex: none; padding: 10px 12px; }
  [data-ui] .kg-main { max-height: 520px; }
  [data-ui] .demo-cap { top: 12px; left: 12px; right: 12px; max-width: none; }
  [data-ui] .tour-btn { top: 332px; bottom: auto; left: 12px; }
  [data-ui] #kg-close, [data-ui] .reopen { display: none; }
  [data-ui] .flash { height: 380px; }
}
@media (max-width: 40em) {
  [data-ui] .scene3d { height: 340px; }
  [data-ui] .tour-btn { top: 292px; }
  [data-ui] .kg-head { padding: 12px; }
  [data-ui] .kg-search { order: 3; flex: 1 1 100%; max-width: none; }
  [data-ui] .kg-search input { height: 42px; font-size: 16px; }
  [data-ui] .kg-grid { grid-template-columns: 1fr; }
  [data-ui] .kg-switch { width: 46px; height: 26px; }
  [data-ui] .kg-switch > span { width: 20px; height: 20px; }
  [data-ui] .kg-switch[aria-checked="true"] > span { transform: translateX(20px); }
  [data-ui] .kg-bind { padding: 6px 10px; }
}

/* ---------- motion layer (content stays visible without script) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(24px); animation: rise 900ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 100ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .mod-card.t-in { animation: rise 600ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
