@font-face { font-family: "Martian Mono"; src: url("fonts/MartianMono.ttf") format("truetype"); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }
:root {
  --bg: #fff;
  --soft: #f6f6f7;
  --line: #e7e7ea;
  --text: #16161a;
  --muted: #6c6c76;
  --accent: #e54d33;
  --logo: none;
  font: 15px/1.7 "Martian Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e0e11; --soft: #17171b; --line: #27272d; --text: #ededf0; --muted: #9a9aa5; --logo: invert(1); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0e0e11; --soft: #17171b; --line: #27272d; --text: #ededf0; --muted: #9a9aa5; --logo: invert(1); color-scheme: dark; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
* { box-sizing: border-box; }
html { scroll-padding-top: 128px; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

header { position: sticky; top: 0; z-index: 11; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.logo img { display: block; height: 36px; width: auto; filter: var(--logo); }
.version { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
nav.main { display: flex; gap: 20px; margin-left: 16px; font-size: 14px; }
nav.main a { color: var(--muted); text-decoration: none; transition: color .18s; }
nav.main a:hover { color: var(--text); }
nav.main span { color: var(--muted); opacity: .6; }
nav.main small { font-size: 11px; }
.tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.tool { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; color: var(--muted); font-size: 12px; text-decoration: none; transition: color .18s, background .18s; }
.tool:hover { color: var(--text); background: var(--soft); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool svg.solid { fill: currentColor; stroke: none; }
.theme { position: relative; }
.theme svg { position: absolute; transition: opacity .25s, transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-mode="dark"] .moon { opacity: 1; transform: none; }
:root[data-mode="dark"] .sun { opacity: 0; transform: rotate(60deg) scale(.6); }
.menu { display: none; }
footer.site { margin-top: 48px; border-top: 1px solid var(--line); font-size: 14px; }
footer.site div { display: flex; flex-wrap: wrap; gap: 48px; max-width: 1400px; margin: 0 auto; padding: 32px 24px; }
footer.site img { height: 36px; width: auto; filter: var(--logo); }
footer.site p { margin: 0; font-weight: 600; }
footer.site a { display: block; margin-top: 6px; font-weight: 400; color: var(--muted); text-decoration: none; transition: color .18s; }
footer.site a:hover { color: var(--text); }
footer.site small { margin-left: auto; color: var(--muted); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }
.tabs { position: sticky; top: 64px; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tabs div { display: flex; gap: 24px; max-width: 1400px; margin: 0 auto; padding: 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 7px; height: 46px; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .18s, border-color .18s; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--accent); border-color: var(--accent); }
.layout { position: relative; display: grid; grid-template-columns: 232px minmax(0, 1fr) 216px; gap: 40px; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.crumbs { margin: 0; font-size: 14px; color: var(--muted); }
.crumbs span { margin: 0 8px; }
.crumbs b { font-weight: 500; color: var(--accent); }
.note { margin: 20px 0; padding: 4px 16px; font-size: 15px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 10px; }
.note code { background: none; border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.toc hr { margin: 20px 0; border: 0; border-top: 1px dashed var(--line); }
.toc a.here { color: var(--accent); }
.sidebar, .toc { position: sticky; top: 111px; align-self: start; max-height: calc(100vh - 111px); overflow: auto; padding: 32px 0; font-size: 14px; }
.sidebar { border-right: 1px solid var(--line); padding-right: 16px; min-height: calc(100vh - 111px); }
.toc p { margin: 0 0 8px; font-weight: 600; }
.sidebar ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.sidebar a, .toc a { display: block; padding: 4px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.toc a { padding: 3px 0; }
.sidebar a:hover, .toc a:hover { color: var(--text); }
.sidebar a, .toc a, main footer a, .cards a, .start a, .copy, .search-open { transition: color .18s, background .18s, border-color .18s, transform .18s; }
.sidebar a[aria-current] { color: var(--accent); font-weight: 500; }

main { min-width: 0; max-width: 800px; width: 100%; margin: 0 auto; padding: 40px 0 64px; }
.group { margin: 0; font-size: 14px; font-weight: 600; color: var(--accent); }
h1 { margin: 12px 0 12px; font-size: 38px; line-height: 1.15; letter-spacing: -.02em; }
h2 { margin: 48px 0 12px; font-size: 24px; letter-spacing: -.01em; }
h2 a { text-decoration: none; }
h3 { margin: 32px 0 8px; font-size: 18px; }
h1 + p { font-size: 18px; color: var(--muted); padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
main a:not(footer a, h2 a) { color: var(--accent); }
h1, h2, h3, .tabs a, .crumbs, .version { font-family: "Martian Mono", ui-monospace, monospace; }
h1 { letter-spacing: -.03em; }
code { font: .82em "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.code { position: relative; margin: 16px 0; }
pre { margin: 0; padding: 16px; overflow: auto; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; }
.copy { position: absolute; top: 8px; right: 8px; font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }
main footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; }
main footer a { flex: 1; max-width: 50%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 500; }
main footer a:hover { border-color: var(--text); }
main footer small { display: block; font-weight: 400; color: var(--muted); }
.next { text-align: right; }

.stage { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; min-height: 280px; margin: 20px 0; border-radius: 14px; overflow: hidden; touch-action: pan-y; background: #e54d33; }
.stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage edinstvo-glass { color: #fff; font-weight: 600; font-size: 14px; }
.stage [data-drag] { cursor: grab; touch-action: none; }
.stage .card { width: 260px; height: 150px; --glass-radius: 28px; }
.stage .pill { padding: 12px 28px; --glass-radius: 99px; }
.stage .dot { width: 84px; height: 84px; --glass-radius: 42px; }
.stage edinstvo-glass-group { position: relative; display: block; width: 300px; height: 96px; }
.stage edinstvo-glass-group edinstvo-glass { position: absolute; top: 6px; }
.stage .bar { display: flex; gap: 20px; padding: 12px 24px; --glass-radius: 99px; }

.playground { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; }
.playground .stage { margin: 0; min-height: 420px; }
.controls { display: grid; gap: 6px; align-content: start; font-size: 13px; }
.controls label { display: grid; grid-template-columns: 1fr 40px; gap: 0 8px; }
.controls input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); margin: 0; }
.controls output { text-align: right; color: var(--muted); }

dialog.search { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
dialog.search::backdrop { background: rgb(0 0 0 / .35); }
dialog.search input { width: 100%; padding: 16px; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); outline: 0; }
dialog.search ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
dialog.search a { display: block; padding: 8px; border-radius: 6px; text-decoration: none; font-size: 14px; }
dialog.search a:hover, dialog.search a:focus { background: var(--soft); outline: 0; }
dialog.search small { display: block; color: var(--muted); }

.stage.hero { min-height: 400px; margin-top: 24px; border-radius: 20px; }
.stage .dot.big { width: 132px; height: 132px; --glass-radius: 66px; }
.stage .dot.small { width: 56px; height: 56px; --glass-radius: 28px; }
.stage.hero edinstvo-glass-group { width: 380px; height: 140px; max-width: 100%; }
.start { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0 8px; font-size: 15px; }
.start a { padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--text) !important; }
.start a:hover { border-color: var(--text); }
.start a.primary { background: var(--text); border-color: var(--text); color: var(--bg) !important; }
.start code { margin-left: auto; padding: 9px 12px; }
.cards { margin: 24px 0; border-top: 1px solid var(--line); }
.cards a { display: grid; grid-template-columns: 96px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text) !important; }
.cards a:hover b { color: var(--accent); }
.cards b { font-weight: 500; }
.cards span { font-size: 14px; color: var(--muted); }

@media (max-width: 1180px) { .layout { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .layout { display: block; padding: 0 16px; }
  header { padding: 0 16px; gap: 10px; }
  .version, nav.main { display: none; }
  .menu { display: grid; }
  .sidebar { display: none; position: static; max-height: none; min-height: 0; border: 0; padding: 16px 0 0; }
  .tabs div { padding: 0 16px; }
  .sidebar.open { display: block; }
  h1 { font-size: 30px; }
  .start code { margin-left: 0; }
  .playground { grid-template-columns: 1fr; }
  .playground .stage { min-height: 320px; }
}
