/* The public layouts share chapter surfaces. Existing page components own their content, links and controls. */
:root,
:is(.gixo-public-shell, .localized-marketing-layout, .platform-marketing, .gixo-site-header) {
    --gixo-public-primary: #284ed1;
    --gixo-public-primary-hover: #1e3fae;
    --gixo-public-button-radius: 9px;
    --gixo-public-button-hero-height: 50px;
    --gixo-public-button-header-height: 44px;
    --gixo-public-header-height: 69px;
    --gixo-public-card-radius: var(--gixo-radius-lg, 16px);
    --gixo-public-radius-sm: var(--gixo-radius, 8px);
    --gixo-public-card-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --section-paper: #ffffff;
    --section-warm: #faf8f3;
    --section-neutral: #f5f6f8;
    --section-cool: #edf3f8;
    --section-violet: #f0eef9;
    --section-teal: #edf6f5;
    --section-ink: #131e31;
    --section-on-ink: #f5f7fb;
    --section-muted-on-ink: #c5d0e0;
    --section-link-on-ink: #c4d8ff;
    --section-rule: #d3dce7;
    --section-compact: clamp(1.5rem, 3vw, 2.75rem);
    --section-standard: clamp(2.25rem, 4.5vw, 4rem);
    --section-spacious: clamp(3rem, 6vw, 5.25rem);
    --section-inset: clamp(1rem, 3vw, 2rem);
}

/* Extend the surface while leaving the section itself on the site's reading grid. */
.gixo-public-container:has(.showroom-landing.keystone-marketing) {
    width: 100%;
    max-width: none;
    padding-inline: 0;
}

.gixo-public-shell :is(
    [data-section-composition="artifact-stage"],
    [data-section-composition="workflow"],
    .gixo-home-editorial .section:has(.book-workflow),
    [data-section-composition="showcase"]:has(> :not(.trust-bar, link, style, script)),
    [data-section-composition="evidence"],
    .showroom-landing.keystone-marketing [data-testid="landing-row-2"]
) {
    position: relative;
    isolation: isolate;
    background-color: var(--section-surface);
}

.gixo-public-shell :is(
    [data-section-composition="artifact-stage"],
    [data-section-composition="workflow"],
    .gixo-home-editorial .section:has(.book-workflow),
    [data-section-composition="showcase"]:has(> :not(.trust-bar, link, style, script)),
    [data-section-composition="evidence"],
    .showroom-landing.keystone-marketing [data-testid="landing-row-2"]
)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--section-surface);
    box-shadow: 0 0 0 100vmax var(--section-surface);
    clip-path: inset(0 -100vmax);
}

/* The homepage gives finished work and the cross-product workflow their own stages. */
.gixo-home-editorial [data-section-composition="artifact-stage"] {
    --section-surface: var(--section-ink);
    padding-block: var(--section-compact);
}

.gixo-home-editorial [data-section-composition="artifact-stage"] .ag-root {
    background: var(--section-surface);
    border-radius: 0;
}

.gixo-home-editorial .section[data-section-composition="workflow"] {
    --section-surface: var(--section-cool);
    padding-block: var(--section-spacious);
}

.gixo-home-editorial .section:has(.book-workflow) {
    --section-surface: var(--section-warm);
}

.gixo-home-editorial [data-section-composition="credibility"] .hero-explanations {
    row-gap: 1rem;
}

@media (max-width: 600px) {
    .gixo-home-editorial .suite-selection__grid a {
        padding: .875rem 1rem;
    }

    .gixo-home-editorial .section[data-section-composition="workflow"] {
        padding-block: var(--section-standard);
    }
}

/* Product-specific colour is concentrated in the showcase. Reading, FAQ and plan sections stay quiet. */
.showroom-landing { --section-showcase: var(--section-cool); }
.showroom-landing:is(.product-scope--quill, .product-scope--lex, .product-scope--folio) {
    --section-showcase: var(--section-warm);
}
.showroom-landing:is(.product-scope--lumen, .product-scope--arc, .product-scope--prism) {
    --section-showcase: var(--section-violet);
}
.showroom-landing.keystone-marketing { --section-showcase: var(--section-teal); }
.showroom-landing.keystone-marketing [data-testid="landing-row-2"] {
    --section-surface: var(--section-teal);
    border-top: 0;
}

.showroom-landing [data-section-composition="showcase"] {
    --section-surface: var(--section-showcase);
    padding-block: var(--section-compact) var(--section-standard);
}
.showroom-landing [data-section-composition="showcase"]:not(:has(> :not(.trust-bar, link, style, script))) {
    padding-block: 0;
}
.showroom-landing [data-section-composition="showcase"] > .quill-outputs,
.showroom-landing [data-section-composition="showcase"] > .presentations-section {
    background: transparent;
}

.showroom-landing [data-section-composition="feature"] {
    padding-block: var(--section-standard);
}

.showroom-landing [data-section-composition="evidence"] {
    --section-surface: var(--section-ink);
    padding-block: var(--section-spacious);
}

.showroom-landing [data-section-composition="evidence"] .showroom-row__copy > h2,
.showroom-landing [data-section-composition="evidence"] .showroom-row__copy > details > summary {
    color: var(--section-on-ink);
}

.showroom-landing [data-section-composition="evidence"] .showroom-row__copy > :is(p, details) {
    color: var(--section-muted-on-ink);
}

.showroom-landing [data-section-composition="evidence"] .showroom-row__copy > details {
    border-top-color: var(--section-muted-on-ink);
}

.showroom-landing [data-section-composition="evidence"] .showroom-row__copy > details > p {
    color: var(--section-muted-on-ink);
}

.showroom-landing [data-section-composition="evidence"] .showroom-links > a,
.showroom-landing [data-section-composition="evidence"] .showroom-row__copy > details > p > a {
    color: var(--section-link-on-ink);
}

.showroom-landing [data-section-composition="evidence"] .showroom-row__copy :focus-visible {
    outline-color: var(--section-link-on-ink);
}

.showroom-landing [data-section-composition="questions"] {
    padding-block: var(--section-compact);
}

.showroom-landing [data-section-composition="conversion"] {
    padding-block: var(--section-standard);
}

/* Feature and use-case pages inherit roles from the existing section or component structure. */
#main-content.gixo-feature-page :is(.seo-hero, .qph-hero, .lph-hero, .arc-hub-hero, .lxh-hero, .books-seo-hero) {
    border-block-end-color: var(--section-rule);
    padding-block-end: var(--section-standard);
}

#main-content.gixo-feature-page :is(.seo-section, .books-seo-section):has(> :is(.seo-table-wrap, .books-seo-table-wrap, .seo-comparison-table)) {
    background: var(--section-cool);
    border-radius: var(--gixo-public-card-radius, 16px);
    padding: var(--section-compact) var(--section-inset);
}

#main-content.gixo-feature-page :is(.seo-section, .books-seo-section):has(> :is(.seo-steps, .books-seo-steps)) {
    border-block-start: 1px solid var(--section-rule);
    padding-block: var(--section-standard);
}

#main-content.gixo-feature-page .workflow-example {
    background: var(--section-neutral);
    border-radius: var(--gixo-public-card-radius, 16px);
    padding: var(--section-standard) var(--section-inset);
}

#main-content.gixo-feature-page .workflow-example__proof {
    background: var(--section-paper);
    margin-inline: 0;
}

#main-content.gixo-feature-page :is(.feature-proof, .output-study) {
    background: var(--section-ink);
    padding-block: var(--section-spacious);
}

#main-content.gixo-feature-page :is(.seo-section, .books-seo-section):has(> :is(.seo-faq, .books-seo-faq)) {
    padding-block: var(--section-compact);
}

/* Product, example and conversion pages keep their own controls and apply a surface at chapter scale. */
.gixo-public-shell :is(.product-editorial-examples, .lph-section:has(> .lumen-template-gallery), .tools-hub__section:has(> .tools-hub__table-scroll)) {
    background: var(--section-neutral);
    border-radius: var(--gixo-public-card-radius, 16px);
    padding-inline: var(--section-inset);
}

.gixo-public-shell .pricing-page-shell > .pricing-hero {
    background: var(--section-cool);
    padding-inline: var(--section-inset);
}

.gixo-public-shell :is(.public-builder__hero, .public-analysis__hero, .public-artifact__hero) {
    padding-block-end: var(--section-compact);
    border-block-end: 1px solid var(--section-rule);
}


/* Standalone marketing templates share the same palette and chapter spacing. */
.localized-marketing-layout .locale-hero {
    background: var(--section-violet);
    padding-block: var(--section-spacious);
}

.localized-marketing-layout .locale-output {
    background: var(--section-ink);
    padding-block: var(--section-standard);
}

.localized-marketing-layout .locale-copy + .locale-copy {
    border-block-start: 1px solid var(--section-rule);
}

.platform-marketing > .intro {
    max-inline-size: none;
    background: var(--section-cool);
    padding: var(--section-standard) var(--section-inset);
    border-radius: var(--gixo-public-card-radius, 16px);
}

.platform-marketing > #examples {
    background: var(--section-neutral);
    padding: var(--section-compact) var(--section-inset);
    border-radius: var(--gixo-public-card-radius, 16px);
}

/* Long-tail marketing pages share opening layouts by the kind of work they introduce. */
#main-content.gixo-feature-page :is(.deck-guide-hero, .gen-hero, .pvg-hero, .qa-hero, .templates-hub__hero) {
    background: var(--section-neutral);
    border-radius: var(--gixo-public-card-radius, 16px);
    padding-inline: var(--section-inset);
    margin-block-end: var(--section-compact);
}

#main-content.gixo-public-shell :is(
    .guide-hero, .ug-masthead, .ug-hero, .document-converter-hero, .prism-studio-intro,
    .prism-intro, .km-hero, .phase-tool__hero, .compliance-hero, .consultant-hero, .about-hero, .story-header,
    .business-examples-hero, .lex-trust-hero, .arc-roi__hero, .contrast-hero, .ext-hero,
    .faq-hero, .gemini-hero, .howto-hero, .method-hero, .resource-hero,
    .reference-directory__hero, .reference-index__hero, .a11y-ref__hero
) {
    padding-block-end: var(--section-compact);
    border-block-end: 1px solid var(--section-rule);
}

.gixo-public-shell .compliance-product-shell .seo-section {
    border-block-start: 1px solid color-mix(in srgb, var(--section-rule) 20%, transparent);
}

#main-content.gixo-public-shell :is(
    .prism-tool:not(:has(.prism-studio-intro)) > .prism-h1,
    .gixo-products-directory h1,
    .analyst-landing h1,
    .business-compare-shell > h1,
    .business-demo-shell > h1,
    .business-faq-shell > h1,
    .business-trust-shell > h1,
    .arc-an-title, .partner-program-title, .generated-marketing-page h1,
    :is(.dft-root, .dsc-root, .lcc-root, .case-calc-page, .evidence-page, .scorecard-page, .qhc-root) h1
) {
    padding-block-end: clamp(.75rem, 1.5vw, 1.125rem);
    border-block-end: 1px solid var(--section-rule);
    text-wrap: balance;
}

.gixo-public-shell .analyst-landing code {
    color: var(--analyst-body);
}

/* Keep in-page plan anchors clear of the pinned public header across layouts. */
:is(#plans, #choose-a-plan) {
    scroll-margin-top: 96px;
}

/* Phones: a button that starts a trial, and the button beside it, reads at the size of the text
   around it. Their rem sizes resolve against the small phone root in app.css, which left the labels
   near 12px beside 16px prose. Buttons only: cards and text links that lead to a trial keep their own
   size, and the header, footer and navigation keep their own geometry. This sheet loads before first
   paint, so the labels do not resize under the visitor. */
@media (max-width: 600px) {
    .gixo-public-layout :is(
        .mud-button-root[href*="start-trial"],
        :has(> .mud-button-root[href*="start-trial"]) > .mud-button-root,
        :is(.seo-hero, .seo-cta, .books-seo-actions) .mud-button-root,
        .seo-hero-cta, .seo-hero-secondary, .pricing-hero-button, .gixo-home-button, .deck-guide-button,
        .product-editorial-primary, .lpj-primary, .qpe-primary, .prepared-document-example__primary
    ):not(:where(.gixo-site-header *, .gixo-site-footer *, nav *)) {
        font-size: 16px;
        /* A long label stays inside its box instead of pushing the button past it. */
        max-width: 100%;
    }

    /* At 400px and below app.css keeps every button label on one line and ends it with an ellipsis.
       A label held to its box wraps onto a second line instead of losing its last words. */
    .gixo-public-layout :is(
        .mud-button-root[href*="start-trial"],
        :has(> .mud-button-root[href*="start-trial"]) > .mud-button-root,
        :is(.seo-hero, .seo-cta, .books-seo-actions) .mud-button-root
    ):not(:where(.gixo-site-header *, .gixo-site-footer *, nav *)) .mud-button-label {
        white-space: normal;
        text-overflow: clip;
    }

    /* The closing box centres buttons that carry an 8px side margin (mx-2): leave room for both.
       The class is doubled so this outranks the rule above it, whose :has() argument counts. */
    .gixo-public-layout .seo-cta.seo-cta .mud-button-root {
        max-width: calc(100% - 16px);
    }
}
