/* Engine docs skin (scripts/docs-build.mjs). Its own look, not the company site's (2026-11-26 user: "도큐먼트의 경우에는 전용
   스킨으로 만드는게 좋겠어 바닐라펀치 사이트랑 동일하게 가져갈필요없다"): a cool neutral reading layout with a blue accent,
   a sticky top bar, the module tree on the left and the page contents on the right. Both languages are in each page;
   html[data-lang] shows one. Light and dark follow the system unless the reader picks one (html[data-theme]). */
:root {
  --d-bg: #fbfbfc; --d-panel: #ffffff; --d-side: #f5f6f8; --d-text: #1d232b; --d-muted: #5c6672; --d-faint: #8a939e;
  --d-line: #e3e6ea; --d-accent: #2b66d9; --d-accent-soft: #e8effc; --d-code: #f2f4f7; --d-code-text: #24292f;
  --d-kind-method: #2b66d9; --d-kind-static: #8a4fd6; --d-kind-property: #0f8a6a; --d-kind-field: #b8650a; --d-kind-constructor: #c4363f;
  --c-key: #a626a4; --c-str: #2f7d32; --c-num: #b45309; --c-com: #8a939e; --c-type: #0e7490; --c-fn: #2b66d9;
  --d-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --d-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --d-bg: #0f1216; --d-panel: #151a20; --d-side: #12161b; --d-text: #e4e8ee; --d-muted: #9aa5b2; --d-faint: #6e7884;
    --d-line: #252c35; --d-accent: #6ea2ff; --d-accent-soft: #1b2a44; --d-code: #1c222a; --d-code-text: #dbe2ea;
    --d-kind-method: #6ea2ff; --d-kind-static: #b48cff; --d-kind-property: #45c79f; --d-kind-field: #f0a24a; --d-kind-constructor: #ff7b84;
    --c-key: #d38cf0; --c-str: #8fd18f; --c-num: #f2b46b; --c-com: #6e7884; --c-type: #5fd0e0; --c-fn: #7fb0ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --d-bg: #0f1216; --d-panel: #151a20; --d-side: #12161b; --d-text: #e4e8ee; --d-muted: #9aa5b2; --d-faint: #6e7884;
  --d-line: #252c35; --d-accent: #6ea2ff; --d-accent-soft: #1b2a44; --d-code: #1c222a; --d-code-text: #dbe2ea;
  --d-kind-method: #6ea2ff; --d-kind-static: #b48cff; --d-kind-property: #45c79f; --d-kind-field: #f0a24a; --d-kind-constructor: #ff7b84;
  --c-key: #d38cf0; --c-str: #8fd18f; --c-num: #f2b46b; --c-com: #6e7884; --c-type: #5fd0e0; --c-fn: #7fb0ff;
  color-scheme: dark;
}

/* one language at a time */
html[data-lang="ko"] .t[lang="en"], html[data-lang="en"] .t[lang="ko"] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--d-bg); color: var(--d-text); font: 15px/1.65 var(--d-sans); -webkit-text-size-adjust: 100%; }
a { color: var(--d-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--d-mono); }
button, select, input { font: inherit; color: inherit; }

/* top bar */
.d-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 18px;
  background: color-mix(in srgb, var(--d-panel) 92%, transparent); border-bottom: 1px solid var(--d-line); backdrop-filter: blur(8px); }
.d-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--d-text); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.d-brand:hover { text-decoration: none; }
.d-brand svg { width: 20px; height: 20px; fill: var(--d-accent); }
.d-brand small { color: var(--d-muted); font-weight: 600; font-size: 13px; }
.d-engines { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--d-side); border: 1px solid var(--d-line); }
.d-engines a, .d-engines span { padding: 4px 10px; border-radius: 7px; color: var(--d-muted); font-size: 13px; font-weight: 700; font-family: var(--d-mono); white-space: nowrap; }
.d-engines a:hover { color: var(--d-text); text-decoration: none; }
.d-engines [aria-current="page"] { background: var(--d-panel); color: var(--d-text); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.d-engines span { opacity: 0.55; cursor: default; }
.d-preview { flex: none; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--d-kind-field); color: var(--d-kind-field); font-size: 12px; font-weight: 800; white-space: nowrap; }
.d-version { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--d-line); border-radius: 8px; background: var(--d-panel); font-family: var(--d-mono); font-size: 13px; cursor: pointer; }
.d-spacer { flex: 1; }
.d-tools { display: flex; align-items: center; gap: 4px; }
.d-tool { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--d-muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.d-tool:hover { background: var(--d-side); color: var(--d-text); text-decoration: none; }
.d-tool svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
/* language list under its button, like the company site's menu */
.d-lang-wrap { position: relative; }
.d-tool .i-chevron { width: 14px; height: 14px; opacity: 0.7; }
.d-lang[aria-expanded="true"] { background: var(--d-side); color: var(--d-text); }
.d-lang-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 160px; padding: 6px; border: 1px solid var(--d-line); border-radius: 10px; background: var(--d-panel); box-shadow: 0 10px 30px rgb(0 0 0 / 0.14); }
.d-lang-menu[hidden] { display: none; }
.d-lang-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--d-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.d-lang-menu button:hover, .d-lang-menu button:focus-visible { background: var(--d-side); outline: none; }
.d-lang-menu .i-mark { width: 16px; height: 16px; stroke: var(--d-accent); fill: none; stroke-width: 2.4; visibility: hidden; }
.d-lang-menu [aria-checked="true"] { color: var(--d-accent); font-weight: 700; }
.d-lang-menu [aria-checked="true"] .i-mark { visibility: visible; }
.d-menu { display: none; }

/* layout */
.d-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.d-side { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; padding: 0 14px 40px; background: var(--d-side); border-right: 1px solid var(--d-line); }
/* the search box stays at the top of the tree while it scrolls */
.d-search { position: sticky; top: 0; z-index: 1; margin-top: 16px; box-shadow: 0 -16px 0 var(--d-side), 0 6px 10px var(--d-side); }
.d-top-switch { display: flex; align-items: center; gap: 10px; }
.d-side-switch { display: none; }
.d-search { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--d-line); border-radius: 9px; background: var(--d-panel); font-size: 14px; }
.d-search:focus { outline: 2px solid var(--d-accent); outline-offset: -1px; }
.d-results { margin-top: 10px; }
.d-results a { display: block; padding: 6px 8px; border-radius: 7px; color: var(--d-text); font-size: 13px; }
.d-results a:hover, .d-results a.is-active { background: var(--d-accent-soft); text-decoration: none; }
.d-results code { font-size: 13px; font-weight: 700; }
.d-results small { display: block; color: var(--d-faint); font-family: var(--d-mono); font-size: 11px; }
.d-results p { margin: 8px; color: var(--d-faint); font-size: 13px; }
.d-results .d-results-head { margin: 12px 8px 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.d-results .d-results-head:first-child { margin-top: 4px; }
.d-results .d-where { font-family: var(--d-sans); }
.d-results strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.d-snippet { display: block; margin-top: 2px; color: var(--d-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.d-snippet mark { background: var(--d-accent-soft); color: var(--d-accent); border-radius: 3px; padding: 0 1px; }
.d-nav { margin-top: 14px; }
.d-group { margin: 18px 8px 6px; color: var(--d-faint); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.d-nav a { display: block; padding: 4px 8px; border-radius: 7px; color: var(--d-muted); font-size: 14px; }
.d-nav a:hover { color: var(--d-text); background: var(--d-panel); text-decoration: none; }
.d-nav a[aria-current="page"] { color: var(--d-accent); background: var(--d-accent-soft); font-weight: 700; }
.d-nav details { margin: 2px 0; }
.d-nav summary { padding: 4px 8px; border-radius: 7px; color: var(--d-text); font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
.d-nav summary::-webkit-details-marker { display: none; }
.d-nav summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 2px; border-right: 2px solid var(--d-faint); border-bottom: 2px solid var(--d-faint); transform: rotate(-45deg); transition: transform 0.15s; }
.d-nav details[open] > summary::before { transform: rotate(45deg); }
.d-nav details a { padding-left: 24px; font-family: var(--d-mono); font-size: 13px; }

/* main */
.d-main { display: grid; grid-template-columns: minmax(0, 860px) 220px; gap: 40px; justify-content: center; padding: 32px 40px 80px; }
.d-article { min-width: 0; }
.d-crumbs { margin-bottom: 10px; color: var(--d-faint); font-size: 13px; font-family: var(--d-mono); }
.d-crumbs a { color: var(--d-muted); }
.d-article h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.25; letter-spacing: -0.02em; }
.d-article h1 code { font-size: 28px; padding: 0 !important; background: none !important; }
.d-article h2 { margin: 44px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--d-line); font-size: 23px; line-height: 1.3; }
.d-article h3 { margin: 28px 0 10px; font-size: 18px; }
.d-article p, .d-article ul, .d-article ol, .d-article table, .d-article pre, .d-article blockquote { margin: 0 0 14px; }
.d-article ul, .d-article ol { padding-left: 1.5em; }
.d-article li { margin: 3px 0; }
.d-article :not(pre) > code { padding: 1px 6px; border-radius: 6px; background: var(--d-code); color: var(--d-code-text); font-size: 0.9em; }
.d-article pre { overflow-x: auto; padding: 14px 16px; border-radius: 10px; background: var(--d-code); color: var(--d-code-text); font-size: 13px; line-height: 1.55; border: 1px solid var(--d-line); }
.d-article table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.d-article th, .d-article td { padding: 7px 12px; border: 1px solid var(--d-line); text-align: left; vertical-align: top; }
/* code shows the characters as typed (Cascadia Code would draw >= as one sign) */
.d-article code, .d-article pre { font-variant-ligatures: none; }
/* the engines' code is indented with tabs; 4 columns instead of the browser's 8 */
.d-article pre { tab-size: 4; }
/* long lines of code wrap (2026-11-26 user); blocks without a language (folder trees, diagrams) keep their lines and scroll */
.d-article pre code[class*="language-"] { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Korean words stay whole in tables, so a short first column (갈래) does not break one letter per line */
.d-article th, .d-article td { word-break: keep-all; }
.d-article th:first-child, .d-article td:first-child { min-width: 64px; }
.d-article th { background: var(--d-side); }
.d-article blockquote { padding: 4px 14px; border-left: 3px solid var(--d-line); color: var(--d-muted); }
.d-article img { max-width: 100%; height: auto; border-radius: 10px; }
/* screenshots: in guides (../images/<file>) and under an example's code (example.image) */
.d-article p > img { display: block; margin: 4px 0; border: 1px solid var(--d-line); }
.d-shot { margin: 10px 0 0; }
.d-shot img { display: block; border: 1px solid var(--d-line); }
.d-lead { color: var(--d-muted); font-size: 16px; }
.d-empty { color: var(--d-faint); }

/* API */
.d-class-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.d-class-head code { font-size: 21px; font-weight: 800; background: none !important; padding: 0 !important; }
.d-inherit { color: var(--d-muted); font-size: 14px; font-family: var(--d-mono); }
.d-subhead { margin: 24px 0 8px; color: var(--d-faint); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.d-member { margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--d-line); border-radius: 12px; background: var(--d-panel); }
.d-member:target { border-color: var(--d-accent); box-shadow: 0 0 0 3px var(--d-accent-soft); }
.d-sig { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.d-sig > code { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; background: none !important; padding: 0 !important; }
.d-kind { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; border: 1px solid currentColor; }
.k-method { color: var(--d-kind-method); } .k-static { color: var(--d-kind-static); } .k-property { color: var(--d-kind-property); }
.k-field { color: var(--d-kind-field); } .k-constructor { color: var(--d-kind-constructor); }
.d-meta { margin-left: auto; display: inline-flex; gap: 10px; color: var(--d-faint); font-size: 12px; font-family: var(--d-mono); }
.d-meta a { color: var(--d-faint); }
.d-anchor { color: var(--d-faint); font-size: 13px; opacity: 0; }
.d-member:hover .d-anchor { opacity: 1; }
.d-desc { margin: 8px 0 0; }
.d-desc p, .d-lead p { margin: 0 0 6px; }
.d-desc ul, .d-lead ul { margin: 0 0 6px; padding-left: 1.3em; }
.d-desc > :last-child > :last-child, .d-lead > :last-child > :last-child { margin-bottom: 0; }
.d-lead { margin: 0 0 14px; }
.d-params { margin: 10px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 14px; }
.d-params dt { font-family: var(--d-mono); font-size: 13px; }
.d-params dd { margin: 0; color: var(--d-muted); }
.d-type { color: var(--d-kind-field); font-family: var(--d-mono); font-size: 12px; margin-left: 6px; }
.d-returns { margin: 8px 0 0; color: var(--d-muted); font-size: 14px; }
.d-label { color: var(--d-faint); font-size: 12px; font-weight: 800; margin-right: 6px; }
.d-deprecated { color: var(--d-kind-constructor); font-size: 13px; }
.d-counterpart { margin: 8px 0 0; font-size: 13px; color: var(--d-faint); }
.d-class-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 10px; font-size: 13px; color: var(--d-faint); }
.d-class-meta a { color: var(--d-faint); }
.d-class-meta a code { color: inherit; }
.d-modules { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.d-modules li { margin: 0; }
.d-modules a { font-family: var(--d-mono); font-weight: 700; }
.d-modules span { color: var(--d-muted); font-size: 14px; margin-left: 10px; }

/* examples and code blocks */
.d-example { margin: 12px 0 20px; }
.d-member .d-example { margin: 12px 0 0; }
.d-lead + .d-example, .d-example + .d-example { margin-top: 10px; }
.d-example-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 6px; font-size: 13px; }
.d-example-head .d-label { color: var(--d-accent); }
.d-example-title { color: var(--d-text); font-weight: 600; }
.d-code { position: relative; margin: 0 0 14px; }
.d-example .d-code { margin: 0; }
.d-code pre { margin: 0 !important; padding-right: 44px !important; }
.d-member .d-code pre { font-size: 12.5px; }
.d-copy { position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--d-line); border-radius: 8px; background: var(--d-panel); color: var(--d-muted); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.d-copy svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.d-copy .i-check, .d-copy.is-copied .i-copy { display: none; }
.d-copy.is-copied .i-check { display: block; }
.d-copy.is-copied { color: var(--d-kind-property); opacity: 1; }
.d-code:hover .d-copy, .d-copy:focus-visible { opacity: 1; }
@media (hover: none) { .d-copy { opacity: 1; } }
.c-key { color: var(--c-key); } .c-str { color: var(--c-str); } .c-num { color: var(--c-num); }
.c-com { color: var(--c-com); font-style: italic; } .c-type { color: var(--c-type); } .c-fn { color: var(--c-fn); }

/* right column */
.d-toc { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 13px; }
.d-toc p { margin: 0 0 8px; color: var(--d-faint); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.d-toc a { display: block; padding: 3px 0 3px 10px; border-left: 2px solid var(--d-line); color: var(--d-muted); }
.d-toc code { font-size: 12px; }
.d-toc a:hover { color: var(--d-text); border-left-color: var(--d-accent); text-decoration: none; }

/* home */
.d-home { max-width: 960px; margin: 0 auto; padding: 72px 24px; }
.d-home h1 { font-size: 40px; letter-spacing: -0.02em; margin: 0 0 8px; }
.d-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 32px; }
.d-card { display: block; padding: 22px; border: 1px solid var(--d-line); border-radius: 16px; background: var(--d-panel); color: var(--d-text); }
.d-card:hover { border-color: var(--d-accent); text-decoration: none; }
.d-card h2 { margin: 0 0 6px; font-family: var(--d-mono); font-size: 20px; }
.d-card p { margin: 0 0 12px; color: var(--d-muted); }
.d-card small { color: var(--d-faint); font-family: var(--d-mono); }

/* narrow screens: the tree becomes a drawer */
@media (max-width: 1180px) { .d-main { grid-template-columns: minmax(0, 860px); } .d-toc { display: none; } }
@media (max-width: 860px) {
  .d-layout { grid-template-columns: minmax(0, 1fr); }
  .d-side { position: fixed; top: 56px; left: 0; z-index: 15; width: min(320px, 86vw); transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 10px 30px rgb(0 0 0 / 0.2); }
  html.d-nav-open .d-side { transform: none; }
  .d-menu { display: inline-flex; }
  .d-top-switch { display: none; }
  .d-side-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; }
  .d-main { padding: 22px 16px 60px; }
  .d-top { gap: 8px; padding: 0 10px; }
  .d-brand small, .d-tool-text, .d-site { display: none; }
  .d-engines a, .d-engines span { padding: 4px 7px; font-size: 12px; }
  .d-article h1 { font-size: 26px; }
  .d-meta { margin-left: 0; width: 100%; }
}
