/* SPDX-FileCopyrightText: 2026 gllm
 * SPDX-License-Identifier: MIT
 * Docsify shell around the PUI landing page.
 */

:root {
  --theme-color: #6ee7ff;
  --sidebar-width: 268px;
  --content-margin-inline: clamp(18px, 4vw, 45px);
  --content-max-width: 960px;
  --border-radius: 8px;
  --link-color: var(--lp-accent);
  --link-underline-color: color-mix(in srgb, var(--lp-accent) 60%, transparent);
  --link-underline-color-hover: var(--lp-accent);
  --strong-color: var(--lp-text);
  --heading-color: var(--lp-text);
  --border-color: var(--lp-border);
  --code-bg: #121c2b;
  --codeblock-bg: #0a111c;
  --codeblock-color: #c8d8ec;
  --sidebar-bg: var(--lp-bg-2);
  --sidebar-border-color: var(--lp-border);
  --sidebar-link-color: var(--lp-muted);
  --sidebar-link-color-active: var(--lp-accent);
  --sidebar-name-color: var(--lp-text);
  --navbar-link-color: var(--lp-muted);
  --navbar-link-color-active: var(--lp-accent);
  --form-element-bg: var(--lp-panel-2);
  --form-element-border-color: var(--lp-border);
  --form-element-color: var(--lp-text);
}
html[data-theme="dark"] { --color-bg: #070b12; --color-text: #edf5ff; }
html[data-theme="light"] { --color-bg: #f4f7fb; --color-text: #122034; }

body { background: var(--lp-bg); color: var(--lp-text); }
body:not(.ready) { overflow: hidden; }
.sidebar { border-right-color: var(--lp-border); }
.app-nav a { color: var(--lp-muted); }
.markdown-section { color: var(--lp-text); }
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4 { color: var(--lp-text); }
.markdown-section code { background: #121c2b; color: #c8d8ec; }
body[data-page="README.md"] .markdown-section code { background: transparent; color: inherit; }

/* The landing owns the full viewport; docs pages keep the Docsify shell. */
body[data-page="README.md"] .sidebar,
body[data-page="README.md"] .sidebar-toggle,
body[data-page="README.md"] .app-nav,
body[data-page="README.md"] .github-corner { display: none !important; }
body[data-page="README.md"] main > .content { left: 0 !important; }
body[data-page="README.md"] .markdown-section {
  width: min(1288px, calc(100% - 48px));
  max-width: none;
  margin: 0 auto;
  padding: 0 0 24px;
  font-size: 16px;
}
body[data-page="README.md"] .markdown-section > .site-header { margin-top: 0; }
body[data-page="README.md"] .markdown-section > .hero { padding-top: 64px; }
body[data-page="README.md"] .markdown-section > #main { display: block; width: 100%; }
body[data-page="README.md"] .markdown-section .hero h1,
body[data-page="README.md"] .markdown-section .hero h1 span { font-size: clamp(2.65rem, 5.1vw, 4.65rem); line-height: 1.02; letter-spacing: -.055em; }
body[data-page="README.md"] .markdown-section .section h2 { font-size: clamp(1.9rem, 3.5vw, 3.15rem); line-height: 1.08; letter-spacing: -.045em; }
body[data-page="README.md"] .markdown-section .section-heading > p:last-child { font-size: 1.02rem; }
body[data-page="README.md"] .markdown-section .hero,
body[data-page="README.md"] .markdown-section .section,
body[data-page="README.md"] .markdown-section .cta,
body[data-page="README.md"] .markdown-section .site-footer { width: min(1240px, calc(100% - 48px)); max-width: none; margin-inline: auto; padding-inline: 0; }
body[data-page="README.md"] .markdown-section .site-header { width: min(1240px, calc(100% - 48px)); }
body[data-page="README.md"] .markdown-section .site-footer { padding-bottom: 24px; }

/* Docs pages */
body:not([data-page="README.md"]) .markdown-section { max-width: 920px; }
body:not([data-page="README.md"]) .markdown-section h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
body:not([data-page="README.md"]) .markdown-section h2 { font-size: 1.75rem; }
body:not([data-page="README.md"]) .markdown-section p { font-size: 1rem; }

/* Docsify's global form/code rules must not leak into the embedded PUI demo. */
.demo-mount .pui output { display: inline; padding: 0; margin: 0; border: 0; background: none; position: static; }
.demo-mount .pui button { margin: 0; box-shadow: none; }
.demo-mount .pui button[type] { padding: 4px 7px; border-width: 1px; border-radius: 4px; background: var(--pui-surface-2); color: var(--pui-text); }
.demo-mount .pui input, .demo-mount .pui select, .demo-mount .pui textarea { margin: 0; }
.demo-mount .pui .pui-button { margin: 0; }

@media (max-width: 760px) {
  body[data-page="README.md"] .markdown-section { width: calc(100% - 32px); }
  body[data-page="README.md"] .markdown-section > .hero,
  body[data-page="README.md"] .markdown-section > .section,
  body[data-page="README.md"] .markdown-section > .cta,
  body[data-page="README.md"] .markdown-section > .site-footer { padding-inline: 0; }
}
