/* ==========================================================================
   Yuan Qu Cool — plugin portal
   Shared design system for the landing page and every plugin documentation
   page. Per-plugin colour is driven by --accent / --accent-ink / --accent-soft
   set on <body class="plugin-<slug>">.
   ========================================================================== */

:root {
    /* Palette */
    --bg: #fbfbfc;
    --bg-soft: #f4f5f8;
    --surface: #ffffff;
    --ink: #17191f;
    --ink-2: #3f4652;
    --ink-3: #667085;
    --ink-4: #6b7585;
    --line: #e7e9ee;
    --line-strong: #d6dae2;

    /* Brand + default accent */
    --brand: #ef5b3f;
    --accent: #ef5b3f;
    --accent-ink: #c2410c;
    --accent-soft: rgba(239, 91, 63, 0.12);

    /* Shape */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 4px 14px -6px rgba(16, 24, 40, 0.16);
    --shadow-md: 0 22px 48px -24px rgba(16, 24, 40, 0.28);
    --shadow-lg: 0 40px 80px -40px rgba(16, 24, 40, 0.35);

    /* Type */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code", Consolas,
        "Liberation Mono", Menlo, monospace;

    /* Layout */
    --maxw: 1140px;
    --header-h: 64px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

/* Per-plugin palettes ------------------------------------------------------
   Applied on <body class="accent--x"> for documentation pages and on the card
   element for the landing page. Add a palette here to theme a new plugin. */

.accent--coral {
    --accent: #ef5b3f;
    --accent-ink: #b93a20;
    --accent-soft: rgba(239, 91, 63, 0.12);
}

.accent--blue {
    --accent: #5b7cfa;
    --accent-ink: #3550cd;
    --accent-soft: rgba(91, 124, 250, 0.13);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main {
    flex: 1 0 auto;
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
        background-color 0.18s var(--ease), opacity 0.18s var(--ease);
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol,
table {
    margin: 0;
}

ul,
ol {
    padding-left: 1.25em;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

::selection {
    background: var(--accent);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Layout helpers */
.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
}

.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;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 251, 252, 0.82);
    border-bottom: 1px solid transparent;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-header.is-scrolled {
    border-bottom-color: var(--line);
    background: rgba(251, 251, 252, 0.94);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}

.brand:hover {
    opacity: 0.75;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.site-nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--ink-3);
}

.site-nav a:hover {
    color: var(--ink);
    background: rgba(23, 25, 31, 0.05);
}

.site-nav .nav-cta {
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    margin-left: 6px;
    padding: 8px 16px;
}

.site-nav .nav-cta:hover {
    background: var(--ink);
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--ink);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
        box-shadow 0.18s var(--ease), color 0.18s var(--ease),
        border-color 0.18s var(--ease);
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn--primary {
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 18px -8px var(--accent);
}

.btn--accent:hover {
    transform: translateY(-1px);
    filter: saturate(1.08) brightness(1.03);
}

.btn--ghost {
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    background: rgba(255, 255, 255, 0.6);
}

.btn--ghost:hover {
    box-shadow: inset 0 0 0 1px var(--ink);
    transform: translateY(-1px);
}

.btn--soon {
    color: var(--ink-4);
    background: var(--bg-soft);
    box-shadow: inset 0 0 0 1px var(--line-strong);
    cursor: default;
}

.btn--quiet {
    color: var(--ink-3);
    padding: 8px 4px;
}

.btn--quiet:hover {
    color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   Home — hero
   -------------------------------------------------------------------------- */

.page-home::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(760px 460px at 8% -6%, rgba(239, 91, 63, 0.13), transparent 62%),
        radial-gradient(720px 440px at 92% -4%, rgba(91, 124, 250, 0.16), transparent 62%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, var(--bg) 100%);
}

.hero {
    padding-top: 104px;
    padding-bottom: 40px;
}

.hero .eyebrow {
    margin-bottom: 22px;
}

.hero h1 {
    max-width: 1000px;
    font-size: clamp(40px, 5.6vw, 68px);
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 700;
    text-wrap: balance;
}

.hero h1 .grad {
    background: linear-gradient(96deg, #ef5b3f 4%, #8b5cf6 58%, #3f7cf5 96%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .lede {
    max-width: 58rem;
    margin-top: 24px;
    font-size: clamp(16.5px, 1.5vw, 19px);
    line-height: 1.65;
    color: var(--ink-2);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 24px;
    margin-top: 30px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-3);
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-meta span:not(:last-child)::after {
    content: "·";
    color: var(--line-strong);
    margin-left: 14px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ef5b3f, #8b5cf6);
}

/* --------------------------------------------------------------------------
   Home — plugin list
   -------------------------------------------------------------------------- */

.plugins {
    padding-top: 34px;
    padding-bottom: 40px;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 40px;
}

.section-head h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-head p {
    font-size: 15px;
    color: var(--ink-3);
}

.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 30px;
}

.plugin-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease),
        border-color 0.24s var(--ease);
}

.plugin-card:hover,
.plugin-card:focus-within {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
    box-shadow: var(--shadow-md);
}

.plugin-card .card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0f1116;
    overflow: hidden;
}

.plugin-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease), opacity 0.24s var(--ease);
}

.plugin-card:hover .card-media img {
    transform: scale(1.035);
}

.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 12, 16, 0) 55%,
        rgba(10, 12, 16, 0.28) 100%
    );
    opacity: 0;
    transition: opacity 0.24s var(--ease);
}

.plugin-card:hover .card-media::after {
    opacity: 1;
}

.card-flag {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(12, 14, 19, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.card-flag--new {
    background: var(--accent);
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    padding: 24px 26px 22px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.card-title a {
    color: var(--ink);
}

/* Stretched link makes the whole card clickable while keeping the card's DOM
   semantic and letting other links sit on top of it. */
.card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.card-title .arrow {
    color: var(--accent);
    transition: transform 0.24s var(--ease);
}

.plugin-card:hover .card-title .arrow {
    transform: translateX(4px);
}

.card-tagline {
    margin-top: -4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--accent-ink);
}

.card-desc {
    font-size: 14.5px;
    line-height: 1.62;
    color: var(--ink-2);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.chips li {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.card-meta {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--ink-4);
}

.card-store {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3);
    padding: 4px 0;
}

.card-store:hover {
    color: var(--accent-ink);
}

.card-store--soon {
    color: var(--ink-4);
    cursor: default;
}

.plugins-note {
    margin-top: 34px;
    font-size: 14px;
    color: var(--ink-3);
    text-align: center;
}

.plugins-note a {
    color: var(--ink);
    font-weight: 600;
    border-bottom: 1px solid var(--line-strong);
}

.plugins-note a:hover {
    border-bottom-color: var(--ink);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: 96px;
    padding: 44px 0 56px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.5);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.footer-brand img {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    box-shadow: inset 0 0 0 1px var(--line);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    font-size: 13.5px;
    color: var(--ink-3);
}

.footer-links a:hover {
    color: var(--ink);
}

.footer-note {
    width: 100%;
    margin-top: 22px;
    font-size: 12.5px;
    color: var(--ink-4);
}

/* --------------------------------------------------------------------------
   Documentation page — hero
   -------------------------------------------------------------------------- */

.doc-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(720px 320px at 88% -40%, var(--accent-soft), transparent 70%),
        linear-gradient(180deg, #ffffff, var(--bg));
}

.doc-hero .wrap {
    position: relative;
    padding-top: 40px;
    padding-bottom: 44px;
}

.backlink {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-3);
}

.backlink svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s var(--ease);
}

.backlink:hover {
    color: var(--ink);
}

.backlink:hover svg {
    transform: translateX(-3px);
}

.doc-icon {
    display: block;
    width: 52px;
    height: 52px;
    margin-top: 26px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px var(--line), var(--shadow-xs);
    background: #fff;
}

.doc-hero h1 {
    margin-top: 18px;
    font-size: clamp(34px, 4.6vw, 54px);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 700;
}

.doc-hero .doc-tagline {
    max-width: 62ch;
    margin-top: 16px;
    font-size: clamp(16px, 1.6vw, 18.5px);
    line-height: 1.6;
    color: var(--ink-2);
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.pill--accent {
    color: var(--accent-ink);
    background: var(--accent-soft);
    box-shadow: none;
}

a.pill--accent:hover {
    background: color-mix(in srgb, var(--accent) 20%, #fff);
}

.doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

/* --------------------------------------------------------------------------
   Documentation page — layout
   -------------------------------------------------------------------------- */

.doc-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 72px;
    padding-top: 56px;
    padding-bottom: 24px;
}

.doc-toc {
    position: sticky;
    top: calc(var(--header-h) + 28px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 56px);
    overflow-y: auto;
    padding-bottom: 20px;
    font-size: 13.5px;
    scrollbar-width: thin;
}

.doc-toc .toc-title {
    display: block;
    margin-bottom: 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-4);
}

.doc-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.doc-toc a {
    display: block;
    padding: 6px 0 6px 14px;
    border-left: 2px solid var(--line);
    color: var(--ink-3);
    line-height: 1.45;
}

.doc-toc a:hover {
    color: var(--ink);
    border-left-color: var(--line-strong);
}

.doc-toc a.is-active {
    color: var(--accent-ink);
    font-weight: 600;
    border-left-color: var(--accent);
}

.doc-toc .toc-sub a {
    padding-left: 26px;
    font-size: 12.5px;
    color: var(--ink-4);
}

.doc-toc .toc-sub a.is-active {
    color: var(--accent-ink);
}

.toc-mobile {
    display: none;
}

/* --------------------------------------------------------------------------
   Prose
   -------------------------------------------------------------------------- */

.prose {
    max-width: 780px;
    font-size: 16px;
    color: var(--ink-2);
}

.prose > section {
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h2 {
    margin: 68px 0 18px;
    font-size: 29px;
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 700;
    color: var(--ink);
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose > section:first-child > h2:first-child,
.prose > h2:first-child {
    margin-top: 0;
}

.prose h3 {
    margin: 40px 0 12px;
    font-size: 19px;
    line-height: 1.35;
    letter-spacing: -0.015em;
    font-weight: 650;
    color: var(--ink);
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h4 {
    margin: 24px 0 8px;
    font-size: 15px;
    font-weight: 650;
    color: var(--ink);
}

.prose p {
    margin: 0 0 16px;
    line-height: 1.72;
}

.prose strong {
    color: var(--ink);
    font-weight: 650;
}

.prose em {
    color: var(--ink);
}

.prose a {
    color: var(--accent-ink);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-underline-offset: 3px;
}

.prose a:hover {
    text-decoration-color: var(--accent);
}

.prose ul,
.prose ol {
    margin: 0 0 18px;
    padding-left: 1.35em;
}

.prose li {
    margin-bottom: 8px;
    line-height: 1.68;
}

.prose li::marker {
    color: var(--ink-4);
}

.prose ul li > ul {
    margin-top: 8px;
}

.prose hr {
    height: 1px;
    margin: 44px 0;
    border: 0;
    background: var(--line);
}

.prose .lead {
    font-size: 18.5px;
    line-height: 1.68;
    color: var(--ink-2);
}

/* Inline code */
.prose :not(pre) > code {
    padding: 0.14em 0.4em;
    border-radius: 6px;
    background: var(--bg-soft);
    box-shadow: inset 0 0 0 1px var(--line);
    font-family: var(--mono);
    font-size: 0.86em;
    color: var(--ink);
    overflow-wrap: anywhere;
}

/* Code blocks */
.code-block {
    position: relative;
    margin: 20px 0 26px;
    border: 1px solid #1b2028;
    border-radius: 14px;
    background: #0d1117;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px 8px 16px;
    background: #141a22;
    border-bottom: 1px solid #1b2028;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7d8b9d;
}

.code-copy {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #a9b6c6;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.code-copy:hover {
    background: #1f2731;
    color: #fff;
}

.code-copy.is-copied {
    color: #7ee2b8;
}

.code-block pre {
    margin: 0;
    padding: 18px 20px 20px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.68;
    color: #dbe3ee;
    tab-size: 4;
}

.code-block pre code {
    font-family: inherit;
    white-space: pre;
}

/* Highlight tokens (rendered by the small C#-style highlighter in site.js) */
.tok-cmt {
    color: #7d8ba0;
    font-style: italic;
}

.tok-str {
    color: #a5d6ff;
}

.tok-kw {
    color: #ff8f7a;
}

.tok-num {
    color: #79c0ff;
}

.tok-type {
    color: #d2b4ff;
}

/* Tables */
.prose .table-wrap {
    margin: 6px 0 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    background: var(--surface);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.prose thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}

.prose tbody td {
    padding: 12px 16px;
    vertical-align: top;
    line-height: 1.6;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.prose tbody tr:last-child td {
    border-bottom: 0;
}

.prose tbody td:first-child {
    color: var(--ink);
    font-weight: 500;
}

.prose td code {
    white-space: normal;
}

/* Figures and media */
.prose figure.media {
    margin: 26px 0 34px;
}

.prose figure.media > img,
.prose figure.media > video {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-soft);
    box-shadow: var(--shadow-sm);
}

.prose figure.media figcaption {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-4);
}

.prose .media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0 30px;
}

.prose .media-grid figure.media {
    margin: 0;
}

/* Feature list with accent bullets */
.feature-list {
    display: grid;
    gap: 10px;
    margin: 20px 0 28px;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    margin: 0;
    padding-left: 26px;
    line-height: 1.66;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--accent);
    opacity: 0.85;
}

/* Callouts */
.note {
    display: flex;
    gap: 12px;
    margin: 22px 0 26px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    background: color-mix(in srgb, var(--accent) 6%, #fff);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ink-2);
}

.note strong {
    color: var(--accent-ink);
    font-weight: 700;
    white-space: nowrap;
}

.note--plain {
    border-color: var(--line);
    background: var(--bg-soft);
}

.note--plain strong {
    color: var(--ink);
}

/* Key/value strip used on the overview */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    margin: 26px 0 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--line);
}

.detail-grid div {
    padding: 14px 16px;
    background: var(--surface);
}

.detail-grid dt {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
}

.detail-grid dd {
    margin: 4px 0 0;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Documentation page — pager
   -------------------------------------------------------------------------- */

.plugin-pager {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 72px;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease),
        box-shadow 0.2s var(--ease);
}

.pager-link:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.pager-link .pager-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
}

.pager-link .pager-name {
    font-size: 17px;
    font-weight: 650;
    color: var(--ink);
}

.pager-link .pager-tagline {
    font-size: 13.5px;
    color: var(--ink-3);
}

.pager-link--next {
    text-align: right;
    align-items: flex-end;
}

/* --------------------------------------------------------------------------
   No-JS fallbacks. Every page is readable without JavaScript: the plugin grid
   is hidden in favour of the <noscript> list and the documentation drops its
   empty sidebar column.
   -------------------------------------------------------------------------- */

html.no-js #plugin-grid,
html.no-js .doc-toc {
    display: none;
}

html.no-js .doc-layout {
    grid-template-columns: minmax(0, 1fr);
}

html.no-js .plugin-pager {
    display: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
    .doc-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 28px;
    }

    .doc-toc {
        display: none;
    }

    .toc-mobile {
        display: block;
        margin: 0 0 34px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
        overflow: hidden;
    }

    .toc-mobile summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 13px 18px;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--ink-3);
        cursor: pointer;
        list-style: none;
    }

    .toc-mobile summary::-webkit-details-marker {
        display: none;
    }

    .toc-mobile summary::after {
        content: "+";
        font-size: 18px;
        line-height: 1;
        color: var(--ink-3);
    }

    .toc-mobile[open] summary::after {
        content: "−";
    }

    .toc-mobile nav {
        padding: 0 10px 12px;
    }

    .toc-mobile a {
        display: block;
        padding: 7px 10px;
        font-size: 14px;
        color: var(--ink-2);
        border-radius: 6px;
    }

    .toc-mobile a:hover {
        background: var(--bg-soft);
    }

    .prose {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .wrap {
        padding: 0 20px;
    }

    .hero {
        padding-top: 64px;
        padding-bottom: 52px;
    }

    .hero h1 {
        max-width: none;
    }

    .hero-meta {
        gap: 8px 20px;
    }

    .hero-meta span:not(:last-child)::after {
        content: none;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .section-head p {
        font-size: 14px;
    }

    .site-nav a:not(.nav-cta) {
        display: none;
    }

    .plugin-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .card-body {
        padding: 20px 20px 18px;
    }

    .card-title {
        font-size: 21px;
    }

    .doc-hero .wrap {
        padding-top: 28px;
        padding-bottom: 34px;
    }

    .prose h2 {
        font-size: 25px;
        margin-top: 52px;
    }

    .prose h3 {
        font-size: 18px;
    }

    .prose .media-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .prose .code-block pre {
        font-size: 12.5px;
        padding: 14px 16px 16px;
    }

    .site-footer {
        margin-top: 64px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Cross-document view transitions: smooth page-to-page navigation in browsers
   that support it, instantly ignored by the ones that do not. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.22s;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Print: documentation pages stay readable on paper. */
@media print {
    .site-header,
    .doc-toc,
    .doc-actions,
    .plugin-pager,
    .site-footer,
    .code-copy {
        display: none !important;
    }

    .doc-layout {
        display: block;
        padding: 0;
    }

    .prose {
        max-width: none;
        font-size: 11pt;
    }

    .prose a {
        color: inherit;
        text-decoration: none;
    }

    .code-block {
        border: 1px solid #ccc;
        background: #fff;
        box-shadow: none;
    }

    .code-block pre {
        color: #111;
    }
}
