/* KuroCat homepage — conventional product page at Apple-page craft.
   One blue for actions, white / #f5f5f7 fields, one black stage for the 3D keyboard. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #636368;
  --ink-3: #737378;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --blue: #0071e3;
  --blue-hover: #0062c8;
  --blue-link: #0066cc;
  --blue-soft: #e8f1fc;
  --night: #000000;
  --night-ink: #f5f5f7;
  --night-ink-2: #a1a1a6;
  --green-screen: #00ff00;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Helvetica Neue", "Segoe UI", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-h: 52px;
  --gutter: clamp(20px, 4vw, 40px);
  --wrap: 1180px;
  --r-xl: 30px;
  --r-l: 22px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
  scrollbar-color: #c7c7cc transparent;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: rgba(0, 113, 227, 0.18); color: inherit; }
input, textarea { caret-color: var(--blue); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #c7c7cc; border: 3px solid var(--bg); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--blue-link); text-decoration: none; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: var(--mono); }
b, strong { font-weight: 600; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.nkro :focus-visible { outline-color: #66aaff; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i .fill, .i-plat { fill: currentColor; stroke: none; }
.i-xs { width: 15px; height: 15px; }
.i-plat { width: 34px; height: 34px; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; font-size: 16px;
  border: 0; border-radius: 980px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-s { height: 30px; padding: 0 14px; font-size: 13px; }
.btn-m { height: 44px; padding: 0 22px; font-size: 16px; }
.btn-l { height: 52px; padding: 0 28px; font-size: 17px; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-hover); }
.btn-grey { background: var(--line-soft); color: var(--ink); }
.btn-grey:hover { background: #dcdce1; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333336; }

.link-more {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--blue-link); font-size: 17px; font-weight: 400;
}
.link-more .i { transition: transform 0.25s var(--ease); }
.link-more:hover .i { transform: translateX(3px); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: rgba(0, 0, 0, 0.08); background: rgba(255, 255, 255, 0.8); }
.nav-in {
  max-width: 1280px; height: 100%; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: 12px; }
.nav-links a { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); opacity: 0.82; font-size: 13px; transition: opacity 0.2s, color 0.2s; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a.is-active { opacity: 1; color: var(--blue-link); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nav-lang { color: var(--ink); font-size: 13px; opacity: 0.82; }
.nav-lang:hover { opacity: 1; text-decoration: none; }
.nav-gh {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px;
  border-radius: 980px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav-gh:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--ink-3); }
.nav-gh .i { width: 17px; height: 17px; }
.nav-menu { display: none; width: 36px; height: 36px; border: 0; background: none; position: relative; padding: 0; }
.nav-menu span { position: absolute; left: 10px; width: 16px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 0.3s var(--ease); }
.nav-menu span:first-child { top: 14px; }
.nav-menu span:last-child { top: 21px; }
.nav-menu[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-menu[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.nav-drawer { display: none; }

/* ---------- Hero + story (one grid, pinned stage) ---------- */
.show { padding: clamp(40px, 7vh, 88px) 0 0; }
.show-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "hero stage" "story stage";
  column-gap: clamp(32px, 5vw, 72px);
}
.hero { grid-area: hero; padding-top: clamp(16px, 5vh, 56px); padding-bottom: 12vh; }
.hero-name {
  font-size: clamp(56px, 6.1vw, 88px); line-height: 0.98; font-weight: 700; letter-spacing: -0.035em;
}
.hero-line {
  margin-top: 18px; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.18; font-weight: 600; letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-sub { margin-top: 22px; max-width: 30em; font-size: clamp(17px, 1.45vw, 19px); line-height: 1.6; color: var(--ink-2); }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.hero-spec {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  display: grid; grid-template-columns: repeat(2, max-content); gap: 12px 30px;
  font-size: 14px; color: var(--ink-2);
}
.hero-spec li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hero-spec .i { color: var(--blue); stroke-width: 2.2; }

/* Chinese headings: break at phrase boundaries, never overflow */
html[lang="zh-CN"] :is(.hero-line, .story-head, .step h3, .sec-h, .closing-h, .skin-name) {
  word-break: keep-all; overflow-wrap: anywhere;
}

.stage {
  grid-area: stage; align-self: start;
  position: sticky; top: calc(var(--nav-h) + 20px);
  display: flex; flex-direction: column; gap: 14px;
}
.stage-panel {
  position: relative; width: 100%;
  aspect-ratio: 16 / 13; max-height: calc(100vh - var(--nav-h) - 110px);
  border-radius: var(--r-xl); background: transparent; overflow: visible;
  isolation: isolate;
  transition: background-color 0.8s var(--ease);
}
.stage[data-mode="green"] .stage-panel { background: var(--green-screen); overflow: hidden; }
.stage-desk, .stage-green, .pet-canvas-box { position: absolute; inset: 0; }

.stage-desk {
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.win {
  position: absolute; left: 6%; top: 7%; width: 56%;
  background: #fff; border-radius: 12px; border: 1px solid var(--line-soft);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px -8px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.win-bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line-soft); background: #fbfbfd; }
.win-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.win-bar span:nth-child(2) { background: #febc2e; }
.win-bar span:nth-child(3) { background: #28c840; }
.win-bar b { margin-left: 10px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-body { padding: 16px 18px 22px; }
.win-note { font-size: 12.5px; color: var(--ink-3); }
.win-line { margin-top: 10px; min-height: 1.4em; font-size: clamp(17px, 1.7vw, 23px); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin: 0 1px -0.16em; background: var(--blue); animation: caret 1.05s steps(1) infinite; }
.win-ghost { color: var(--ink-3); font-weight: 400; }
.win-line.has-text .win-ghost { display: none; }
@keyframes caret { 50% { opacity: 0; } }

.stage-green {
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 18px 22px; opacity: 0; pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
.stage-green span { font-family: var(--mono); font-size: 13px; color: rgba(0, 60, 0, 0.6); }
.stage[data-mode="green"] .stage-green { opacity: 1; }

.pet-canvas-box {
  display: flex; align-items: flex-end; justify-content: flex-end;
  pointer-events: none;
}
.pet-mount {
  position: relative; width: 74%; aspect-ratio: 9 / 8; margin: 0 2% 1% 0;
  pointer-events: auto;
  transform-origin: 50% 100%;
  transition: transform 0.9s var(--ease);
}
#livePetCanvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
#livePetCanvas.is-dragging { cursor: grabbing; }

.stage[data-mode="focus"] .stage-desk,
.stage[data-mode="green"] .stage-desk,
.stage-panel:has(.pet-canvas-box.is-undocked) .stage-desk { opacity: 0; transform: translateY(-14px) scale(0.98); }
.stage[data-mode="focus"] .pet-mount,
.stage[data-mode="green"] .pet-mount { transform: translateX(-14.9%) translateY(-7%) scale(1.2); }

.pet-docked {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 0 24px; text-align: center; color: var(--ink-2); font-size: 15px; pointer-events: auto;
}
.stage[data-mode="green"] .pet-docked { color: #063b06; }
.pet-canvas-box.is-undocked .pet-docked { display: flex; }
.pet-canvas-box.is-undocked .pet-mount { visibility: hidden; }

.stage-hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 30px; padding: 0 6px; }
.hud-caption { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; text-wrap: pretty; }
html[lang="zh-CN"] .hud-caption { word-break: keep-all; overflow-wrap: anywhere; }
.hud-caption::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #30d158; flex: none; box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.18); }
.hud-right { display: flex; align-items: center; gap: 10px; flex: none; }
.hud-count { font-family: var(--mono); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.hud-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 0; border-radius: 980px; background: var(--line-soft); color: var(--ink); font-size: 13px;
  transition: background-color 0.2s;
}
.hud-btn:hover { background: #dcdce1; }
.hud-btn.active { background: var(--ink); color: #fff; }

.story { grid-area: story; padding-bottom: 4vh; }
.story .step:last-child { min-height: 64vh; }
.story-head {
  font-size: clamp(34px, 3.8vw, 52px); line-height: 1.1; font-weight: 700; letter-spacing: -0.025em;
  max-width: 12em; text-wrap: balance;
  padding-top: 4vh;
}
.step {
  min-height: 78vh; display: flex; flex-direction: column; justify-content: center; gap: 16px;
  max-width: 30em;
}
.step h3 { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.step p { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.62; color: var(--ink-2); }
.step p.step-meta { font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.js .step { opacity: 0.28; transition: opacity 0.6s var(--ease); }
.js .step.is-active { opacity: 1; }
.js .step.is-active p { color: var(--ink-2); }

/* Entrance: pure CSS so a slow CDN never holds the first viewport hostage */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes rise-stage { from { opacity: 0; transform: translateY(36px) scale(0.975); } }
.js [data-intro] { animation: rise 1.1s var(--ease) both; animation-delay: calc(var(--i, 0) * 85ms + 40ms); }
.js .stage[data-intro] { animation-name: rise-stage; animation-duration: 1.4s; animation-delay: 140ms; }

/* ---------- Section frame ---------- */
section.native, section.skins, section.open, section.download, section.faq, section.closing, section.nkro {
  padding: clamp(88px, 13vh, 148px) 0;
}
.native, .open, .faq { background: var(--bg-alt); }
.sec-h {
  font-size: clamp(36px, 4.6vw, 60px); line-height: 1.07; font-weight: 700; letter-spacing: -0.03em;
  max-width: 15em; text-wrap: balance;
}
.sec-sub {
  margin-top: 20px; max-width: 34em;
  font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2);
}

/* ---------- Native & size bars ---------- */
.sizes {
  margin-top: clamp(48px, 8vh, 80px);
  background: #fff; border-radius: var(--r-l); padding: clamp(24px, 3.4vw, 44px);
  display: grid; gap: 22px;
}
.size-row {
  display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 96px; align-items: center; gap: 22px;
}
.size-name { font-size: 15px; color: var(--ink); }
.size-track { position: relative; height: 16px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.size-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--v) * 100%); min-width: 7px; border-radius: 99px;
  background: var(--blue); transform-origin: left center;
}
.is-other .size-bar { background: linear-gradient(to right, #86868b 0 53.3%, #c7c7cc 53.3% 100%); }
.size-val { font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.is-kuro .size-val { color: var(--blue-link); }
.sizes figcaption { font-size: 13px; color: var(--ink-3); }

.platforms {
  margin-top: clamp(48px, 8vh, 80px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
}
.platforms li { border-top: 1px solid var(--line); padding-top: 26px; display: grid; gap: 10px; align-content: start; }
.platforms h3 { margin-top: 8px; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.platforms p { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.platforms p.plat-stack { font-size: 14px; font-weight: 600; color: var(--ink); }
.plat-mark { display: inline-flex; color: var(--ink); }
.plat-mark .i { width: 28px; height: 28px; }

/* ---------- NKRO (dark) ---------- */
.nkro { background: var(--night); color: var(--night-ink); overflow: hidden; }
.nkro .sec-sub { color: var(--night-ink-2); }
.nkro ::selection { background: rgba(102, 170, 255, 0.35); }
.kb-stage { position: relative; height: clamp(320px, 58vh, 620px); margin: clamp(24px, 4vh, 48px) 0 0; }
.kb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1s var(--ease); }
.kb-stage.is-3d .kb-canvas { opacity: 1; }
.kb-stage.is-3d .kb-flat { display: none; }
.kb-flat {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) perspective(1200px) rotateX(28deg);
  width: min(980px, calc(100% - 2 * var(--gutter)));
  padding: 12px; border-radius: 20px; background: linear-gradient(#cfd0d4, #a8aaaf);
  box-shadow: 0 50px 90px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: grid; gap: 6px;
}
.kb-row { display: grid; column-gap: 0; grid-template-columns: repeat(60, minmax(0, 1fr)); }
.kb-key {
  min-width: 0; margin: 0 3px; overflow: hidden; white-space: nowrap;
  height: clamp(24px, 4.2vw, 52px); border-radius: 7px;
  background: linear-gradient(#fbfbfc, #ececef); color: #3a3a3f;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  display: flex; align-items: flex-start; justify-content: flex-start; padding: 5px 7px;
  font-size: clamp(8px, 0.9vw, 12px); font-weight: 500; letter-spacing: 0;
  transition: transform 0.12s var(--ease), background 0.25s, color 0.25s, box-shadow 0.25s;
}
.kb-key.is-mod { background: linear-gradient(#eeeef1, #dcdce1); color: #6e6e73; }
.kb-flat { touch-action: none; user-select: none; -webkit-user-select: none; }
.kb-key.is-down {
  transform: translateY(2px);
  background: linear-gradient(#2f7cf6, #0a63d8); color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.nkro-meter {
  margin-top: clamp(16px, 3vh, 28px); text-align: center; font-size: 15px; color: var(--night-ink-2);
  font-variant-numeric: tabular-nums;
}
.nkro-meter b { display: inline-block; min-width: 1.4em; font-size: 34px; font-weight: 600; color: var(--night-ink); vertical-align: -4px; margin: 0 4px; }
.nkro-meter .nkro-sep { margin: 0 14px; color: #48484a; }
.nkro-privacy { margin: 26px auto 0; max-width: 40em; text-align: center; font-size: 15px; line-height: 1.6; color: var(--night-ink-2); }
.nkro .wrap:first-child .sec-h,
.nkro .wrap:first-child .sec-sub { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Skins ---------- */
.skin-show {
  margin-top: clamp(40px, 7vh, 72px);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center;
}
.skin-view {
  --tint: #eef3f9;
  border-radius: var(--r-xl); background: var(--tint);
  aspect-ratio: 9 / 7; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  transition: background-color 0.7s var(--ease);
}
.skin-view canvas { width: 82%; height: auto; aspect-ratio: 9 / 8; }
.skin-name { font-size: clamp(28px, 2.6vw, 36px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.skin-desc { margin-top: 10px; font-size: 17px; line-height: 1.6; color: var(--ink-2); min-height: 3.2em; }
.swatches { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 14px; }
.swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 0 #fff, 0 0 0 0 var(--ink);
  transition: box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}
.swatch:hover { transform: scale(1.06); }
.swatch.active { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.skin-links { margin-top: 34px; display: grid; gap: 12px; justify-items: start; }

/* ---------- Open source ---------- */
.repo {
  margin-top: clamp(40px, 7vh, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: #fff; border-radius: var(--r-l); padding: 26px 28px;
}
.repo-main { display: flex; align-items: center; gap: 18px; }
.repo-mark { width: 44px; height: 44px; color: var(--ink); }
.repo-name { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.repo-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.repo-meta span { display: inline-flex; align-items: center; gap: 4px; }
.repo-meta b { color: var(--ink); font-weight: 600; }
.eco { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.eco li { border-top: 1px solid var(--line); }
.eco a {
  position: relative; display: grid; gap: 6px; padding: 24px 40px 26px 0; color: var(--ink);
}
.eco a:hover { text-decoration: none; }
.eco a:hover .eco-t { color: var(--blue-link); }
.eco-t { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; transition: color 0.2s; }
.eco-d { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.eco-go { position: absolute; right: 4px; top: 26px; color: var(--ink-3); transition: transform 0.25s var(--ease), color 0.2s; }
.eco a:hover .eco-go { color: var(--blue-link); transform: translate(2px, -2px); }

/* ---------- Download ---------- */
.dl-grid { margin-top: clamp(40px, 7vh, 72px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dl-col {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  background: var(--bg-alt); border-radius: var(--r-l); padding: 32px 28px 28px;
  box-shadow: inset 0 0 0 0 var(--blue);
  transition: box-shadow 0.3s var(--ease);
}
.dl-col.is-detected { box-shadow: inset 0 0 0 2px var(--blue); }
.dl-col.is-detected::after {
  content: attr(data-yours); position: absolute; right: 22px; top: 26px;
  font-size: 12px; font-weight: 600; color: var(--blue-link); background: var(--blue-soft); padding: 3px 10px; border-radius: 99px;
}
.dl-col h3 { margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.dl-req { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.dl-file { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.dl-file span:first-child { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-file span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; flex: none; }
.dl-col .btn { width: 100%; }
.dl-col .link-more { font-size: 15px; }
.arch { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--line-soft); }
.arch button { border: 0; background: transparent; height: 30px; padding: 0 14px; border-radius: 99px; font-size: 13px; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.arch button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.arch-panel { width: 100%; display: grid; gap: 10px; }
.arch-panel[hidden] { display: none; }
.sha { width: 100%; font-size: 13px; }
.sha summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; color: var(--ink-2); font-weight: 500; }
.sha summary::-webkit-details-marker { display: none; }
.sha summary:hover { color: var(--ink); }
.sha[open] summary .i { transform: rotate(180deg); }
.sha summary .i { transition: transform 0.25s var(--ease); }
.sha-body { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 10px; background: #fff; border-radius: 10px; padding: 10px 10px 10px 12px; }
.sha-body + .sha-body { margin-top: 6px; }
.sha-body small { grid-column: 1 / -1; font-size: 11px; color: var(--ink-3); }
.sha-body code { font-size: 11.5px; line-height: 1.5; word-break: break-all; color: var(--ink); }
.copy { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--line-soft); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); transition: background 0.2s; }
.copy:hover { background: #dcdce1; }
.copy.done { background: #d8f5df; color: #1a7f37; }
.dl-note { margin-top: auto; padding-top: 6px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.dl-foot { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; font-size: 14px; color: var(--ink-2); }
.dl-foot .link-more { font-size: 14px; }

/* ---------- FAQ ---------- */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq-side { position: sticky; top: calc(var(--nav-h) + 40px); display: grid; gap: 0; justify-items: start; }
.faq-side .link-more { margin-top: 26px; }
.faq-list { border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 0; cursor: pointer; list-style: none;
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.4;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary .i { color: var(--ink-3); transition: transform 0.3s var(--ease); }
.qa[open] summary .i { transform: rotate(180deg); }
.qa p { padding: 0 48px 26px 0; font-size: 17px; line-height: 1.65; color: var(--ink-2); }

/* ---------- Closing ---------- */
.closing-in { text-align: center; display: grid; justify-items: center; }
.closing-mark { width: 48px; height: 48px; color: var(--ink); margin-bottom: 26px; }
.closing-h { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.05; font-weight: 700; letter-spacing: -0.035em; }
.closing .sec-sub { margin-left: auto; margin-right: auto; }
.closing-actions { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 28px; }

/* ---------- Footer ---------- */
.foot { background: var(--bg-alt); padding: 40px 0 28px; font-size: 12.5px; color: var(--ink-2); }
.foot-privacy { padding-bottom: 18px; border-bottom: 1px solid var(--line); line-height: 1.6; max-width: 72em; }
.foot-grid { padding: 26px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; border-bottom: 1px solid var(--line); }
.foot h3 { font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.foot li { margin: 7px 0; }
.foot a, .foot button { color: var(--ink-2); background: none; border: 0; padding: 0; font-size: 12.5px; text-align: left; }
.foot a:hover, .foot button:hover { color: var(--ink); text-decoration: underline; }
.foot-bottom { padding-top: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- Modal, float dock, toast ---------- */
.modal {
  width: min(400px, calc(100vw - 32px)); border: 0; border-radius: var(--r-l); padding: 26px;
  color: var(--ink); background: #fff;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.35);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in 0.4s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-head h3 { font-size: 21px; font-weight: 700; }
.modal-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--line-soft); display: inline-flex; align-items: center; justify-content: center; }
.modal p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.modal img { margin-top: 16px; width: 100%; height: auto; border-radius: 14px; }
.modal .modal-foot { font-size: 13px; text-align: center; }

.float-dock {
  position: fixed; right: 20px; bottom: 20px; z-index: 180; max-width: calc(100vw - 24px);
  display: none; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none;
}
.float-dock.active { display: flex; }
.float-tools {
  pointer-events: auto; display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 4px; padding: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.float-tools button {
  border: 0; background: transparent; height: 30px; line-height: 1; padding: 0 12px; border-radius: 99px; font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; flex: none;
}
.float-tools button:hover { background: var(--line-soft); }
.float-stage { width: 250px; aspect-ratio: 9 / 8; pointer-events: auto; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.18)); }
.float-stage #livePetCanvas { width: 100%; height: 100%; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 260; transform: translate(-50%, 16px);
  background: rgba(29, 29, 31, 0.92); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 99px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (min-width: 1069px) {
  .hero-sub, .step p { font-size: 21px; line-height: 1.55; }
}

@media (max-width: 1199px) {
  .hero-spec { grid-template-columns: max-content; }
}

@media (max-width: 1068px) {
  .nav-links { gap: 18px; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .dl-grid { grid-template-columns: 1fr; max-width: 560px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 48px; }
  .nav-links, .nav-lang { display: none; }
  .nav-menu { display: block; }
  .nav-gh { display: none; }
  .nav-drawer {
    display: grid; position: absolute; left: 0; right: 0; top: var(--nav-h);
    padding: 8px var(--gutter) 28px; background: #fff;
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid var(--line-soft);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav-drawer.open { opacity: 1; transform: none; visibility: visible; }
  .nav-drawer a { display: flex; align-items: center; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 19px; font-weight: 600; }
  .nav-drawer a .i { color: var(--ink-3); }

  .show { padding-top: 28px; }
  .show-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "stage" "story"; }
  .hero { padding-top: 8px; padding-bottom: 32px; }
  .hero-actions .btn-l { height: 48px; }
  .stage { top: var(--nav-h); padding-top: 6px; z-index: 5; background: var(--bg); padding-bottom: 6px; gap: 8px; }
  .stage::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 48px; background: linear-gradient(var(--bg) 40%, rgba(255, 255, 255, 0)); pointer-events: none; }
  .stage-panel { aspect-ratio: 16 / 11; max-height: 40vh; border-radius: var(--r-l); }
  .win { width: 64%; left: 4%; top: 6%; }
  .win-body { padding: 10px 12px 14px; }
  .win-note { display: none; }
  .win-line { margin-top: 0; font-size: 16px; }
  .pet-mount { width: 60%; }
  .stage[data-mode="focus"] .pet-mount, .stage[data-mode="green"] .pet-mount { transform: translateX(-30%) translateY(-3%) scale(1.18); }
  .hud-caption { font-size: 12.5px; }
  #petFloatToggle span { display: none; }
  .story { padding-bottom: 12vh; }
  .story-head { padding-top: 32px; font-size: 30px; }
  .step { min-height: 62vh; justify-content: flex-start; padding-top: 18vh; }

  .kb-stage { height: clamp(200px, 58vw, 420px); }
  .size-row { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .size-track { grid-column: 1 / -1; grid-row: 2; }
  .skin-show { grid-template-columns: 1fr; }
  .eco { grid-template-columns: 1fr; }
  .faq-wrap { grid-template-columns: 1fr; }
  .faq-side { position: static; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .float-dock { right: 12px; bottom: 12px; }
  .float-stage { width: 180px; }
}

@media (max-width: 560px) {
  .platforms { grid-template-columns: 1fr; }
  .hero-spec { font-size: 13px; }
  .qa summary { font-size: 17px; }
  .qa p { padding-right: 0; font-size: 16px; }
  .repo { padding: 22px; }
  .dl-col { padding: 26px 22px 22px; }
  .kb-key { padding: 3px 3px; border-radius: 4px; margin: 0 1.5px; font-size: 7px; }
  .kb-flat { padding: 7px; border-radius: 12px; gap: 3px; }
  /* small phones: keep the live cat in the first screen; the facts return in the native section */
  .hero-spec { display: none; }
  .hero-name { font-size: 54px; }
  .hero-line { margin-top: 12px; font-size: 24px; }
  .hero-sub { margin-top: 14px; font-size: 16px; line-height: 1.55; }
  .hero-actions { margin-top: 22px; }
  .hero { padding-bottom: 24px; }
}

/* ---------- Subpages (OBS Guide & 404) ---------- */
.guide-hero { padding: clamp(56px, 9vh, 108px) 0 clamp(44px, 6vh, 68px); }
.guide-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }
.guide-crumb a { color: var(--ink-2); }
.guide-crumb a:hover { color: var(--ink); }
.guide-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--blue-link);
  background: var(--blue-soft); padding: 4px 12px; border-radius: 99px;
}
.guide-title {
  margin-top: 18px; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.08;
  font-weight: 700; letter-spacing: -0.03em; max-width: 18em; text-wrap: balance;
}
.guide-toc { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.guide-toc a {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px;
  border-radius: 99px; background: var(--bg-alt); color: var(--ink); font-size: 14px; font-weight: 500;
  white-space: nowrap; transition: background 0.2s, color 0.2s;
}
.guide-toc a:hover { background: var(--line-soft); text-decoration: none; }
.guide-sec { padding: clamp(64px, 9vh, 104px) 0; }
.guide-sec.is-alt { background: var(--bg-alt); }
.guide-kicker { font-size: 13px; font-weight: 600; color: var(--blue-link); letter-spacing: 0.02em; margin-bottom: 10px; }
.guide-grid { margin-top: clamp(28px, 5vh, 48px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.guide-card {
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.guide-sec:not(.is-alt) .guide-card { background: var(--bg-alt); border-color: transparent; }
.guide-card h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.guide-card ol, .guide-card ul { display: grid; gap: 10px; padding-left: 1.25em; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.guide-card ul { list-style: disc; }
.guide-card strong { color: var(--ink); font-weight: 600; }
.guide-code {
  font-family: var(--mono); font-size: 0.88em; padding: 2px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.055); color: var(--ink);
}
.guide-note {
  margin-top: auto; padding: 12px 14px; border-radius: 12px;
  background: var(--blue-soft); color: var(--ink-2); font-size: 13.5px; line-height: 1.55;
}
.guide-note strong { color: var(--blue-link); }
.guide-cta {
  margin-top: clamp(36px, 6vh, 56px); padding: clamp(28px, 4vw, 44px);
  border-radius: var(--r-xl); background: var(--ink); color: var(--night-ink);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.guide-cta h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.02em; }
.guide-cta p { margin-top: 8px; font-size: 16px; color: var(--night-ink-2); max-width: 34em; }
.guide-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-outline-light { background: rgba(255, 255, 255, 0.14); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.22); }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } }

.notfound { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); background: var(--bg); }
.notfound-card {
  max-width: 560px; width: 100%; padding: clamp(32px, 5vw, 48px) clamp(24px, 4vw, 40px); border-radius: var(--r-xl);
  background: var(--bg-alt); text-align: center; display: grid; justify-items: center;
}
.notfound-mark { width: 48px; height: 48px; color: var(--ink); margin-bottom: 20px; }
.notfound-code { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--blue-link); }
.notfound-card h1 { margin-top: 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
.notfound-card p { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.notfound-actions { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .caret { animation: none; }
}
