:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --surface: #f1f2ef;
  --line: #e4e5e0;
  --text: #141513;
  --text-soft: #52554e;
  --text-dim: #73776e;
  --blue: #141513;
  --blue-soft: #f1f2ef;
  --blue-border: #d4d6cf;
  --mint: #15803d;
  --terminal: #111214;
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-body);
  --font-mono: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 64px;
  --max: 1100px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 21, 19, .04), 0 4px 12px rgba(20, 21, 19, .025);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 88px; }
body { color: var(--text); background: var(--bg); overflow-x: clip; font-family: var(--font-body); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
::selection { background: var(--blue-soft); color: #1e3a8a; }

.shell { width: min(var(--max), calc(100% - 64px)); margin: 0 auto; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 18px; background: var(--text); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.page-section { display: none; }
.page-section.active { display: block; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(246, 247, 249, .85); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.nav-inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { flex-shrink: 0; }
.brand-version { font: 500 11px var(--font-mono); color: var(--text-dim); background: var(--panel); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--text-soft); transition: color .15s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links .nav-start { background: var(--text); color: #fff; padding: 8px 15px; border-radius: 8px; font-size: 13px; font-weight: 550; }
.nav-links .nav-start:hover { background: #1e293b; color: #fff; }

/* Primary actions */
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; text-decoration: none; font-size: 14px; font-weight: 550; border-radius: 9px; border: 1px solid var(--line); transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; box-shadow: 0 4px 14px rgba(20, 21, 19, .14); }
.btn-primary:hover { background: #272924; border-color: #272924; }
.btn-secondary { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.btn-secondary:hover { background: var(--surface); border-color: #cbd5e1; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.metrics-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0 40px; }
.metric-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px 18px; text-align: center; box-shadow: var(--shadow-sm); }
.metric-item strong { display: block; font: 700 28px/1.15 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.03em; color: var(--text); }
.metric-item span { display: block; margin-top: 7px; font-size: 13px; color: var(--text-dim); }
.bento-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0 0 36px; }
.bento-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 28px 24px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); scroll-margin-top: 88px; transition: border-color .15s, transform .15s; }
.bento-card:hover { border-color: #cbd5e1; transform: translateY(-2px); }
.bento-card h2 { font-size: 19px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; margin-bottom: 10px; color: var(--text); }
.bento-card p { font-size: 14px; line-height: 1.75; color: var(--text-soft); flex: 1; }
.bento-card code { font: 12.5px var(--font-mono); background: var(--surface); color: var(--text); padding: 1.5px 6px; border-radius: 5px; }
.bento-card .text-link { margin-top: 20px; }
.text-link { font-size: 13px; font-weight: 550; color: var(--blue); text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Quickstart */
.section { padding: 12px 0 60px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.section-header h2 { font-size: clamp(24px, 2.8vw, 32px); font-weight: 700; letter-spacing: -.02em; }
.section-header p { font-size: 14px; line-height: 1.7; color: var(--text-soft); }
.quickstart-shell { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--panel); box-shadow: var(--shadow-sm); }
.quickstart-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--surface); padding: 0 22px; gap: 24px; overflow-x: auto; }
.tab-button { position: relative; flex-shrink: 0; font-size: 13.5px; font-weight: 500; border: 0; color: var(--text-dim); background: transparent; padding: 15px 4px; transition: color .15s; }
.tab-button:hover { color: var(--text); }
.tab-button.active { color: var(--text); font-weight: 600; }
.tab-button.active::after { content: ""; position: absolute; height: 2px; background: var(--blue); bottom: 0; left: 0; right: 0; }
.tab-panel { display: none; grid-template-columns: .82fr 1.18fr; min-height: 310px; }
.tab-panel.active { display: grid; }
.tab-copy { padding: 30px; display: flex; flex-direction: column; }
.tab-copy h3 { font-size: 19px; margin-bottom: 10px; font-weight: 650; }
.tab-copy p { font-size: 14px; line-height: 1.75; color: var(--text-soft); }
.tab-copy ul { margin: 18px 0 22px; list-style: none; }
.tab-copy li { font-size: 13px; color: var(--text-soft); padding: 4px 0; }
.tab-copy li::before { content: "•"; color: var(--blue); margin-right: 8px; }
.tab-copy .text-link { margin-top: auto; }
.quick-code { background: var(--terminal); color: #e2e8f0; min-width: 0; display: flex; flex-direction: column; }
.quick-code .top { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.08); font: 11.5px var(--font-mono); color: #94a3b8; }
.copy-button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid #334155; border-radius: 6px; background: transparent; font-size: 11.5px; color: #cbd5e1; transition: border-color .15s, color .15s; }
.copy-button:hover { border-color: #60a5fa; color: #fff; }
.quick-code pre { padding: 22px; overflow: auto; flex: 1; }
.quick-code code { display: block; font: 12.5px/1.78 var(--font-mono); white-space: pre; color: #e2e8f0; }
.quick-code .c { color: #64748b; }
.quick-code .b { color: #60a5fa; }
.quick-code .g { color: #34d399; }
.quick-code .y { color: #fbbf24; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner { padding: 24px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.footer-brand span { font-size: 13px; color: var(--text-dim); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--blue); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; padding: 10px 18px; background: var(--text); color: #fff; border-radius: 8px; font-size: 13px; box-shadow: 0 10px 25px rgba(0,0,0,.18); }
.toast[hidden] { display: none; }

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: 1fr; }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-panel { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .brand-version, .nav-links .nav-github { display: none; }
  .nav-links { gap: 16px; }
  .metrics-strip { grid-template-columns: 1fr; }
  .section-header, .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Documentation reader: bounded navigation and content scroll containers. */
.docs-shell { overflow: visible; }
.doc-content { max-width: 100%; overflow-wrap: anywhere; padding: 40px 36px 56px; }
.docs-layout > * { min-width: 0; }
.doc-sidebar { align-self: start; position: sticky; top: var(--nav-h); max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; }
.doc-tree summary { cursor: pointer; }
.doc-tree + .doc-tree { margin-top: 22px; }
.doc-nav-close { display: none; }
.doc-table-scroll { max-width: 100%; overflow-x: auto; }
.doc-table-scroll table { width: max-content; min-width: 100%; margin: 16px 0; }
.code-frame, .doc-content pre { max-width: 100%; min-width: 0; }
.doc-content pre { overflow-x: auto; }
.doc-pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 24px 36px; }
.doc-pager a, .doc-catalogue a { color: var(--blue); overflow-wrap: anywhere; }
.doc-catalogue { display: grid; gap: 14px; }
#doc-nav-backdrop { position: fixed; inset: 0; background: #20231f70; z-index: 70; }
#doc-nav-backdrop[hidden] { display: none; }
@media (min-width: 821px) and (max-width: 1240px) {
  #doc-toc-toggle { display: inline-flex; }
  .doc-toc-panel.toc-open { display: block !important; grid-column: 2; grid-row: 1; border-bottom: 1px solid var(--line); }
  .doc-toc-inner { position: static; max-height: 38dvh; }
  .doc-main { grid-column: 2; }
  .doc-sidebar { grid-column: 1; grid-row: 1 / span 2; }
}
@media (max-width: 820px) {
  .doc-nav-open { overflow: hidden; }
  .docs-topbar { padding: 16px; align-items: flex-start; flex-direction: column; }
  .doc-content { padding: 28px 18px 40px; }
  .doc-content h1 { font-size: 28px; }
  .doc-content h2 { font-size: 22px; }
  .doc-pager { padding: 20px 18px; }
  .doc-sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: min(320px, 90vw); max-height: 100dvh; z-index: 80; padding: 20px; background: var(--bg); }
  .docs-shell.sidebar-open .doc-sidebar { display: block; }
  .doc-nav-close { display: block; padding: 10px; margin-bottom: 20px; }
  .doc-toc-panel.toc-open { display: block !important; grid-row: 1; padding: 18px; border-bottom: 1px solid var(--line); }
  .doc-toc-inner { position: static; max-height: 35dvh; }
  .doc-sidebar-toggle { display: inline-flex; }
}
.doc-tree summary.group::after { content: " +"; float: right; }
.doc-tree[open] summary.group::after { content: " −"; }

/* Scroll feedback and chapter entry transitions */
.scroll-progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 60;
  transform: scaleX(0); transform-origin: left; pointer-events: none;
  background: var(--text);
}
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .45s ease, transform .45s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

.section-head p { color: var(--text-soft); line-height: 1.75; margin-top: 10px; }
.hmos-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }

/* Monochrome landing page */
body:has(#page-home.active) {
  --bg: #f7f7f4;
  --panel: #fdfdfa;
  --surface: #eeefec;
  --line: #dcded8;
  --text: #191a18;
  --ink: var(--text);
  --text-soft: #494b46;
  --text-dim: #60625c;
  --blue: #282926;
  --blue-soft: #dedfda;
  --mint: #595b54;
  --terminal: #141414;
  --max: 1280px;
}
body:has(#page-home.active) ::selection { color: #111; background: #ddd; }
body:has(#page-home.active) .nav { background: rgb(247 247 244 / 88%); }
body:has(#page-home.active) .nav-links a[aria-current="location"]:not(.nav-start) { color: var(--text); text-decoration: underline; text-underline-offset: 7px; }
body:has(#page-home.active) .nav-links .nav-start,
#page-home .btn-primary { color: #fff; background: #1e1f1c; border-color: #1e1f1c; }
body:has(#page-home.active) .nav-links .nav-start:hover,
#page-home .btn-primary:hover { color: #fff; background: #3b3c37; border-color: #3b3c37; }
.site-wordmark { font-size: 21px; font-weight: 750; letter-spacing: -.045em; }
body:has(#page-home.active) .brand-version { background: transparent; border-radius: 4px; }
body:has(#page-home.active) .scroll-progress { background: #383a34; }
#page-home { font-size: 1rem; }
#page-home .btn { border-radius: 7px; box-shadow: 0 1px 2px #1b1d1610; }
#page-home .btn-secondary { background: var(--panel); }
#page-home .btn-secondary:hover { background: var(--surface); border-color: #a5a6a0; }
/* A quiet introduction followed by chapter-sized product demonstrations. */
#page-home .hero {
  isolation: isolate; position: relative; overflow: clip;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: clamp(420px, 65svh, 640px); text-align: center; padding: 60px 18px;
  border-bottom: 1px solid var(--line);
}
#page-home .hero::before {
  content: ""; z-index: -1; position: absolute; inset: 5% 0 8%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 60%, #fdfdfa 12%, transparent 68%),
    url("mink-mark.svg") right 10% center / min(38%, 390px) auto no-repeat;
  opacity: .055;
  animation: hero-wash 1.9s ease-out both;
}
#page-home .hero::after {
  content: ""; position: absolute; z-index: -1; inset: 10% -8% 2%; pointer-events: none;
  transform: perspective(380px) rotateX(48deg);
  background: repeating-linear-gradient(90deg, transparent 0 39px, #31372c23 40px, transparent 41px);
  mask-image: radial-gradient(ellipse, transparent 23%, #0008 55%, transparent 72%);
}
.hero-kicker {
  color: var(--text-dim); font: .87rem/1.45 var(--font-mono); letter-spacing: .1em;
}
.hero h1 {
  margin: 17px 0 18px; font: 730 clamp(2.5rem, 5vw, 4.65rem)/1.17 var(--font-body);
  letter-spacing: -.054em; text-wrap: balance;
}
.hero h1 span { display: inline-block; animation: title-arrival .76s cubic-bezier(.22,.77,.24,1) both; }
.hero h1 span + span { color: #64675e; animation-delay: .12s; }
.hero .lead {
  max-width: 37rem; color: var(--text-soft); font-size: clamp(1rem, 1.3vw, 1.13rem);
  line-height: 1.75; text-wrap: pretty; animation: stage-rise .65s .23s ease-out both;
}
.hero .hero-actions { margin: 26px 0 0; animation: stage-rise .65s .31s ease-out both; }
@keyframes hero-wash {
  from { transform: translateX(32px); opacity: 0; }
  to { transform: none; opacity: .055; }
}

.product-chapter { padding-top: clamp(53px, 7vw, 92px); }
.product-story {
  --art-height: clamp(255px, 37vh, 370px);
  --active-line: #30332b;
  display: grid; grid-template-columns: minmax(0, .73fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 118px);
}
@media (min-width: 821px) {
  #features .product-story { grid-template-columns: minmax(0, 1fr) minmax(0, .73fr); }
  #features .scene-notes { grid-column: 2; grid-row: 1; }
  #features .scene-track { grid-column: 1; grid-row: 1; }
}
.scene-notes { border-bottom: 1px solid var(--line); }
#page-home .scene-note {
  min-height: clamp(172px, 25vh, 237px); padding: 25px 18px 25px 21px;
  display: flex; flex-direction: column; justify-content: center; align-items: start;
  position: relative; border: 0; border-top: 1px solid var(--line); border-radius: 0;
  box-shadow: none; background: transparent; scroll-margin-top: 72px;
  transition: background .35s ease;
}
#page-home .scene-note:last-child { min-height: calc(var(--art-height) + 46px); }
#page-home .scene-note:hover { transform: none; }
#page-home .scene-note.is-current { background: linear-gradient(90deg, #e8eae3, transparent 96%); }
.scene-note::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--active-line);
  transform-origin: top; transform: scaleY(0); transition: transform .4s cubic-bezier(.2,.72,.22,1);
}
.scene-note.is-current::before { transform: scaleY(1); }
#page-home .scene-note > code {
  font: .78rem/1.45 var(--font-mono); color: #53574c; padding: 0; margin: 0 0 8px; background: transparent;
}
#page-home .scene-note h3 { margin: 0 0 6px; font-size: clamp(1.25rem, 2vw, 1.7rem); letter-spacing: -.028em; }
#page-home .scene-note p { margin: 0; max-width: 43ch; color: var(--text-soft); font-size: 1rem; line-height: 1.7; flex: none; }
#page-home .scene-note .text-link { display: inline-block; margin-top: 10px; }
.scene-track { min-width: 0; }
.product-visual {
  position: sticky; top: 100px; isolation: isolate; overflow: clip;
  margin: 0; border: 1px solid #d8dad2; border-radius: 12px; background: #f5f6f1;
  box-shadow: 0 19px 60px -35px #20251e52;
}
.product-visual figcaption {
  padding: 10px 17px; min-height: 42px; border-bottom: 1px solid var(--line);
  background: #fdfdfa; color: #42453c; font: .84rem/1.5 var(--font-mono);
}
.visual-art {
  height: var(--art-height); display: grid; position: relative; overflow: clip;
  background: radial-gradient(circle, #595d4e3d .7px, transparent 1px) 0 0 / 13px 13px,
    linear-gradient(135deg, #eaece6, #f8f8f4 64%, #eaebe6);
}
.visual-index { display: flex; border-top: 1px solid var(--line); }
.visual-index a {
  position: relative; flex: 1; min-height: 43px; display: grid; place-items: center;
  text-decoration: none; color: var(--text-dim); background: #f9faf6; font-size: .84rem;
  transition: background .3s, color .3s;
}
.visual-index a + a { border-left: 1px solid #dcddd6; }
.visual-index a:hover { background: #eceee7; }
.visual-index a[aria-current] { color: #262923; background: #e9ebe4; font-weight: 650; }
.visual-index a[aria-current]::after {
  content: ""; position: absolute; height: 2px; background: #393d33; left: 0; right: 0; bottom: 0;
  transform: scaleX(max(.08, var(--beat-progress, 0))); transform-origin: left;
}
.visual-index a:focus-visible { outline-offset: -4px; }

/* The overview and mechanism diagrams share the same open stage. */
.open-visual {
  border: 0; border-radius: 0; background: var(--bg); box-shadow: none;
}
.open-visual figcaption { padding-inline: 0; border: 0; background: transparent; }
.open-visual .visual-index a { background: transparent; }
.open-visual .visual-index a + a { border-left: 0; }
.open-visual .visual-index a:hover, .open-visual .visual-index a[aria-current] { background: #eceee7; }
.open-visual .visual-art { isolation: isolate; background: transparent; }
.open-visual .visual-art::before {
  content: ""; position: absolute; z-index: -1; inset: 4% 1%; pointer-events: none;
  background: radial-gradient(circle, #63685946 .65px, transparent 1px) 0 0 / 12px 12px;
  mask-image: radial-gradient(ellipse at center, #000a 20%, transparent 71%);
}
.entry-art {
  --shell-ease: cubic-bezier(.2,.73,.23,1);
  --surface-width: min(82%, 390px);
}
.entry-shell {
  position: absolute; top: 50%; left: 50%;
  width: var(--surface-width); height: 62%;
  border: 1px solid #b6baaf; border-radius: 11px;
  background: linear-gradient(145deg, #ffffffed, #eef0e9e6);
  box-shadow: 0 17px 32px -23px #272c234f, 0 1px 0 #fff inset;
  color: #494d43; overflow: clip;
  visibility: hidden; opacity: 0; filter: blur(3px);
  transform: translate(-50%, calc(-50% + 21px)) scale(.965);
  transition: opacity .32s ease, transform .5s var(--shell-ease), filter .35s, visibility .33s;
}
[data-active="0"] [data-shell="0"], [data-active="1"] [data-shell="1"],
[data-active="2"] [data-shell="2"], [data-active="3"] [data-shell="3"] {
  visibility: visible; opacity: 1; filter: none;
  transform: translate(-50%, calc(-50% - 6px * var(--beat-progress, 0)));
}
.shell-header {
  display: flex; align-items: center; gap: 5px; padding: 0 12px; height: 18%; min-height: 22px;
  border-bottom: 1px solid #d1d4ca; background: #f1f2ed;
}
.shell-header i { width: 5px; height: 5px; border-radius: 50%; background: #adb2a6; }
.shell-header :is(code, span) { margin-left: auto; font: .72rem var(--font-mono); }
.shell-prompt {
  position: absolute; display: flex; gap: 8px; align-items: center;
  bottom: 13%; left: 7%; right: 7%; height: 18%; padding: 0 8px;
  border: 1px solid #cdd0c5; border-radius: 4px; background: #fdfefa;
}
.shell-prompt b { font: 700 1rem/1 var(--font-mono); color: #474b42; }
.shell-prompt i { width: 19%; height: 3px; border-radius: 2px; background: #c2c6bb; }

.shell-sidebar {
  position: absolute; top: 18%; bottom: 0; width: 20%;
  padding: 13px 8px; display: grid; align-content: start; gap: 6px;
  background: #e9ebe4; border-right: 1px solid #cfd2c8;
}
.shell-sidebar i, .shell-web-lines i { height: 3px; border-radius: 2px; background: #b9beb1; }
.shell-sidebar i:nth-child(2) { width: 72%; }
.shell-sidebar i:nth-child(3) { width: 84%; }
.shell-web-lines {
  position: absolute; left: 28%; right: 8%; bottom: 14%; display: grid; gap: 6px;
}
.shell-web-lines i:last-child { width: 63%; background: #d1d5ca; }

.entry-sdk { display: grid; grid-template-rows: minmax(22px, 18%) minmax(0, 1fr); }
.entry-sdk .shell-header { height: auto; }
.sdk-workspace {
  min-height: 0; padding: 10px 11px; display: grid; align-items: stretch;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 10px;
}
.sdk-host-layout {
  display: grid; align-content: center; gap: 8px;
  background: #f6f7f3; padding: 10px; border-radius: 5px;
}
.sdk-host-layout i {
  display: block; height: 3px; border-radius: 2px; background: #c0c4b8;
}
.sdk-host-layout i:nth-child(2) { width: 70%; }
.sdk-host-layout i:nth-child(3) { width: 82%; }
.sdk-socket {
  display: grid; padding: 6px; overflow: clip;
  background: #e6e9e0; border: 1px solid #c3c8ba; border-radius: 7px;
  box-shadow: 0 1px 5px #383d321c inset;
}
.sdk-module {
  display: grid; align-content: center; justify-items: center; gap: 4px;
  padding: 4px; border: 1px solid #b8bdaf; border-radius: 4px; background: #fcfcfa;
  box-shadow: 0 2px 5px #272c2314;
}
.sdk-module img { filter: grayscale(1); }
.sdk-module b { color: #252821; font: 700 .84rem/1.2 var(--font-mono); white-space: nowrap; }
.sdk-module small { color: #61655a; font-size: .72rem; white-space: nowrap; }
[data-active="2"] .sdk-module { animation: sdk-seat .48s .16s var(--shell-ease) both; }
@keyframes sdk-seat {
  from { transform: translateY(-10px); opacity: .25; }
  to { transform: none; opacity: 1; }
}

.entry-phone {
  height: 76%; display: flex; justify-content: center; align-items: center; gap: clamp(10px, 4%, 22px);
  border: 0; background: transparent; box-shadow: none; overflow: visible;
}
.shell-device {
  flex: 0 0 auto; aspect-ratio: 1320 / 2104; height: 100%;
  position: relative; display: grid; align-content: center; justify-items: center; gap: 12px;
  padding: 10px; text-align: center;
  border: 1px solid #aeb2a5; border-radius: 16px; background: linear-gradient(135deg, #fff, #eef0e9);
  box-shadow: inset 0 0 0 3px #dce0d6, 0 14px 30px -21px #272c2360;
}
.shell-phone-title { font: .7rem var(--font-mono); }
.shell-phone-task { padding: 5px 8px; border-radius: 4px; background: #e0e4d9; font-size: .75rem; white-space: nowrap; }
.shell-phone-camera, .shell-phone-home {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: 8%; width: 24%; height: 3px; border-radius: 99px; background: #92978a;
}
.shell-phone-home { top: auto; bottom: 8%; width: 33%; background: #b6baad; }
.shell-workspace {
  flex: 0 1 33%; display: grid; gap: 7px;
  padding: 14px 12px; border: 1px solid #cdd1c6; border-radius: 6px; background: #f8f9f5;
  box-shadow: 0 8px 22px -16px #272c2359;
}
.shell-workspace i {
  position: relative; display: block; height: 2px; margin: 3px 0 3px 11px;
  border-radius: 2px; background: #c1c6b9;
}
.shell-workspace i::before {
  content: ""; position: absolute; inset: -1px auto auto -11px; width: 4px; height: 4px;
  border: 1px solid #acb1a4; border-radius: 1px;
}
.shell-workspace i:nth-child(2) { width: 62%; }
.shell-workspace i:nth-child(3) { width: 73%; }
[data-active="3"] .shell-workspace { animation: sdk-seat .48s .16s var(--shell-ease) both; }

@media (prefers-reduced-motion: reduce) {
  [data-active="0"] [data-shell="0"], [data-active="1"] [data-shell="1"],
  [data-active="2"] [data-shell="2"], [data-active="3"] [data-shell="3"] {
    transform: translate(-50%, -50%);
  }
}

.mechanism-view, .phone-art > a {
  grid-area: 1 / 1; visibility: hidden; opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .38s, transform .55s cubic-bezier(.2,.72,.22,1), visibility .4s;
}
[data-active="0"] [data-view="0"], [data-active="1"] [data-view="1"],
[data-active="2"] [data-view="2"] { visibility: visible; opacity: 1; transform: none; }
.mechanism-view {
  display: grid; grid-template-columns: minmax(0, 440px); place-content: center;
  gap: 17px; padding: 8%;
}
.mechanism-view > code { text-align: center; color: #55594e; font: .78rem/1.45 var(--font-mono); }
.host-diagram, .edit-diagram { display: flex; align-items: stretch; justify-content: center; gap: 8px; }
.host-diagram > *, .edit-diagram > * {
  position: relative; display: grid; place-items: center; flex: 1;
  text-align: center; min-height: 65px; padding: 8px 10px;
  border: 1px solid #c5c8bd; border-radius: 6px; background: #fcfcfa;
  font: .84rem var(--font-mono); white-space: nowrap;
}
.host-diagram > * + *::before, .edit-diagram > * + *::before {
  content: ""; position: absolute; right: 100%; top: 50%; width: 9px; height: 1px; background: #a6aa9f;
}
.host-diagram strong, .edit-diagram strong { background: #2c3028; color: #f8f8f3; border-color: #2c3028; }
.context-diagram { display: grid; gap: 9px; }
.context-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 5px; }
[data-active="1"] .context-line.is-compact { animation: compress-history .7s cubic-bezier(.2,.72,.22,1) both; transform-origin: left; }
@keyframes compress-history { from { transform: scaleX(1.22); opacity: .3; } to { transform: none; opacity: 1; } }
.context-line.is-compact { grid-template-columns: minmax(0, 1fr) minmax(0, .72fr) minmax(0, 1fr); margin-right: 22%; }
.context-line span {
  text-align: center; padding: 10px 6px; border: 1px solid #c9ccc2; border-radius: 5px;
  background: #fdfdfa; color: #44483e; font-size: .81rem;
}
.context-line span:nth-child(2) { color: #f8f8f2; background: #55594d; border-color: #55594d; }
.is-compact span:nth-child(2) { background: #262923; }
/* Keep the physical frame at the source screenshot's portrait ratio. */
.phone-story {
  --phone-width: clamp(210px, 33.5svh, 322px);
  --art-height: calc(var(--phone-width) * 2104 / 1320);
}
.phone-story .product-visual {
  width: min(100%, var(--phone-width)); margin-inline: auto;
  overflow: visible; border: 0; background: transparent; box-shadow: none;
}
.phone-story figcaption {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  min-height: 0; padding: 0 0 9px; border: 0; background: var(--bg);
}
.phone-story figcaption span { color: var(--text-dim); font: .78rem var(--font-body); }
.phone-art {
  height: auto; aspect-ratio: 1320 / 2104; place-items: stretch;
  border: 1px solid #d1d4cb; border-radius: 12px; background: #fdfdfa;
  box-shadow: 0 15px 45px -25px #1c211b70;
}
.phone-art > a { display: block; min-width: 0; }
.phone-art img { display: block; width: 100%; height: auto; }
.phone-art > a:focus-visible { outline-offset: -4px; }
.phone-story .visual-index {
  margin-top: 10px; overflow: clip; border: 1px solid var(--line); border-radius: 7px;
}

@keyframes title-arrival {
  from { opacity: 0; transform: translateY(23px); clip-path: inset(0 0 100%); }
  to { opacity: 1; transform: none; clip-path: inset(-.12em -.12em -.23em -.03em); }
}
@keyframes stage-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
#page-home .text-link { font-size: .875rem; text-underline-offset: 4px; text-decoration: underline; }
#page-home .text-link:hover { color: #585b52; }

#page-home .metrics-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center;
  margin: 22px 0 clamp(35px, 4.5vw, 64px); gap: 0; border-bottom: 1px solid var(--line);
}
#page-home .metric-item {
  padding: 13px 10px 20px 0; text-align: left; border: 0; background: transparent; box-shadow: none;
}
.metric-item strong { font-size: clamp(1.3rem, 2.4vw, 2.2rem); }
.metric-item small { font-size: .63em; }
.metric-source { color: var(--text-soft); font-size: .85rem; text-underline-offset: 4px; }
#page-home :is(#features, #usages, #hmos, #start) { margin: 0 0 clamp(53px, 6.7vw, 92px); }
#page-home .section-head { max-width: 47rem; margin-bottom: 25px; }
#page-home .section-head h2 { font: 700 clamp(1.9rem, 4vw, 3.65rem)/1.12 var(--font-body); letter-spacing: -.045em; }
#page-home .section-head p { font-size: 1rem; }
#page-home .hmos-section { padding-bottom: 0; }
#page-home #hmos-title { text-wrap: balance; }
#page-home .start-section { padding: 0; border: 0; background: transparent; }
#page-home .quickstart-tabs { gap: 6px; padding: 10px; }
#page-home .tab-button { font-size: .9rem; padding: 8px 13px; }
#page-home .tab-button.active::after { display: none; }
#page-home .tab-button.active { background: #272824; color: #fff; border-radius: 5px; }
#page-home .tab-copy h3 { font: 650 1.2rem/1.4 var(--font-body); }
#page-home .tab-copy p { font-size: 1rem; }
#page-home .quick-code :is(.b,.g,.y) { color: #eee; }
#page-home .quick-code :is(.top,.c) { color: #a4a4a4; }
#page-home .copy-button { border-color: #636363; color: #efefef; }
#page-home .copy-button:focus-visible { outline-color: #efefef; }

@media (max-width: 820px) {
  #page-home .hero { min-height: clamp(380px, 57svh, 515px); padding-block: 44px; }
  .product-story {
    --art-height: clamp(142px, 25svh, 238px);
    display: flex; flex-direction: column; gap: 0;
  }
  .scene-track { display: contents; }
  .product-visual { order: -1; top: 90px; z-index: 2; margin-bottom: 24px; }
  .product-visual figcaption { min-height: 34px; padding: 7px 12px; font-size: .78rem; }
  .open-visual figcaption { padding-inline: 0; }
  .visual-index a { min-height: 37px; }
  #page-home .scene-note {
    min-height: clamp(180px, 28vh, 238px); padding-block: 23px;
    scroll-margin-top: calc(var(--art-height) + 62px);
  }
  #page-home .scene-note:last-child { min-height: clamp(185px, 31vh, 265px); }
  .shell-header { padding-inline: 8px; gap: 4px; }
  .sdk-workspace { padding: 7px; gap: 7px; }
  .sdk-module img { width: 19px; height: 19px; }
  .shell-device { padding: 6px; gap: 8px; }
  .shell-workspace { padding: 9px; gap: 5px; }
  .phone-story {
    --phone-width: clamp(137px, 21.5svh, 206px);
    --art-height: calc(var(--phone-width) * 2104 / 1320);
  }
  .phone-story .product-visual { align-self: center; }
  .phone-story figcaption { padding-inline: 0; }
  #page-home .phone-story .scene-note { scroll-margin-top: calc(var(--art-height) + 48px); }
  #page-home .metrics-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metric-source { grid-column: 1 / -1; padding-bottom: 12px; }
  #page-home .capability-row { min-height: 0; }
}
@media (max-width: 620px) {
  .nav-inner { height: auto; min-height: 64px; flex-wrap: wrap; justify-content: start; gap: 4px 12px; padding-block: 7px; }
  .nav-links { gap: 6px 11px; flex-wrap: wrap; }
  .nav-links a { font-size: .8rem; }
  .nav-links .nav-start { padding: 4px 7px; }
  html { scroll-padding-top: 104px; }
  .hero h1 { font-size: clamp(2.4rem, 8vw, 3.1rem); }
  .hero h1 span { display: block; }
  .mechanism-view { padding: 7%; }
  .host-diagram, .edit-diagram { gap: 4px; }
  .host-diagram > * + *::before, .edit-diagram > * + *::before { width: 5px; }
  .host-diagram > *, .edit-diagram > * { min-height: 49px; padding: 6px; font-size: .7rem; }
  #page-home .quickstart-tabs { flex-wrap: wrap; }
}
