/* KTreon public site: light (default) and dark themes.
   Every public stylesheet uses these tokens instead of raw colors (see docs/design/PUBLIC-SITE-REVIEW.md).
   The theme is chosen before first paint by _ThemeHead (localStorage "ktreon-theme"), so there is no flash.
   Graphite neutrals (Owner 15.11.2026, no blue tint). Buttons are monochrome (--p-fill: black on light,
   white on dark); gold (--p-accent-text) only for the logo, links and the active item. */

:root,
:root[data-theme="light"]{
    color-scheme:light;
    --p-bg:#f3f3f3;
    --p-surface:#ffffff;
    --p-surface-2:#f9f9f9;
    --p-surface-3:#eeeeee;
    --p-surface-4:#e4e4e4;
    --p-line-soft:#ebebeb;
    --p-line:#e0e0e0;
    --p-line-strong:#c8c8c8;
    --p-text:#161616;
    --p-text-2:#2f2f2f;
    --p-text-3:#555555;
    --p-accent-text:#855f1c;
    --p-accent-text-soft:#6e4e15;
    --p-success-text:#13804f;
    --p-danger-text:#b42318;
    --p-focus:#c99a45;
    --p-accent-soft:#f6eedf;
    --p-fill:#161616;
    --p-fill-hover:#2e2e2e;
    --p-on-fill:#ffffff;
    --p-header-bg:color-mix(in srgb,#ffffff 92%,transparent);
    --p-shadow:0 1px 2px rgba(0,0,0,.06),0 8px 24px rgba(0,0,0,.06);
}
:root[data-theme="dark"]{
    color-scheme:dark;
    --p-bg:#0b0b0b;
    --p-surface:#131313;
    --p-surface-2:#181818;
    --p-surface-3:#1f1f1f;
    --p-surface-4:#2a2a2a;
    --p-line-soft:#1b1b1b;
    --p-line:#252525;
    --p-line-strong:#3a3a3a;
    --p-text:#f2f2f2;
    --p-text-2:#dcdcdc;
    --p-text-3:#a9a9a9;
    --p-accent-text:#d6b26e;
    --p-accent-text-soft:#ead3a3;
    --p-success-text:#6fd9a5;
    --p-danger-text:#ff9f9a;
    --p-focus:#d6b26e;
    --p-accent-soft:rgba(214,178,110,.12);
    --p-fill:#f2f2f2;
    --p-fill-hover:#ffffff;
    --p-on-fill:#111111;
    --p-header-bg:color-mix(in srgb,#0d0d0d 94%,transparent);
    --p-shadow:0 1px 2px rgba(0,0,0,.45),0 12px 32px rgba(0,0,0,.4);
}

/* Smooth switch: the whole page cross-fades once (public-theme.js, View Transitions);
   element transitions are off meanwhile so nothing animates inside the new snapshot. */
.theme-switching,.theme-switching *:not(.ktt *),.theme-switching *:not(.ktt *)::before,.theme-switching *:not(.ktt *)::after{transition:none !important}
/* Same length as the switch knob's travel and its sky fade (~0.6 s), so page and switch move together (Owner 15.11.2026). */
::view-transition-old(root),::view-transition-new(root){animation-duration:.6s;animation-timing-function:cubic-bezier(.4,0,.2,1)}
/* The switch itself is not cross-faded with the page: it animates live (knob, sky, stars) on top. */
.ktr-site-actions .ktr-theme-button,.ktr-site-mobile-theme .ktt{view-transition-name:ktr-theme-toggle}
::view-transition-group(ktr-theme-toggle),::view-transition-new(ktr-theme-toggle){animation:none}
::view-transition-old(ktr-theme-toggle){display:none}

/* Base elements on public pages (site.css still styles setup/admin-era pages in dark). */
.public-body,.ktreon-landing{background:var(--p-bg);color:var(--p-text)}
.public-body p{color:var(--p-text-2)}
.public-body h1,.public-body h2,.public-body h3{color:var(--p-text)}
.public-body a{color:var(--p-accent-text)}
.public-body label{color:var(--p-text-2)}
/* The line above a page title: plain words, no gold capitals (Owner 15.11.2026). */
.public-body .eyebrow{color:var(--p-text-2);font-size:14px;font-weight:600;letter-spacing:0;text-transform:none}
.public-body code{color:var(--p-text-2)}
.public-body .panel{background:var(--p-surface);border-color:var(--p-line)}
.public-body input:not([type="checkbox"]):not([type="radio"]),.public-body select,.public-body textarea,
.ktreon-landing input:not([type="checkbox"]):not([type="radio"]),.ktreon-landing select{
    background:var(--p-surface);border-color:var(--p-line-strong);color:var(--p-text)}
.public-body input::placeholder,.ktreon-landing input::placeholder{color:var(--p-text-3)}
.public-body .field-error,.public-body .summary-error{color:var(--p-danger-text)}
.public-body .agent-success{color:var(--p-success-text)}

/* Theme toggle (header). */

/* Theme-specific brand images (light logo on light header, dark logo on dark header). */
.brand-stack{display:grid;flex:none;min-width:0}
.brand-themed{display:block;grid-area:1/1;min-width:0}
.brand-for-dark{visibility:hidden}
:root[data-theme="dark"] .brand-for-dark{visibility:visible}
:root[data-theme="dark"] .brand-for-light{visibility:hidden}

/* Landing hero artwork: light and dark versions cross-fade with the theme. */
/* 16:9 artwork in a ~3.6:1 band (starting under the header): keep the face and the castle in frame. */
.ktreon-landing .hero-art{position:absolute;inset:0;z-index:-1;background-size:cover;background-position:center 4%;transition:opacity .6s ease}
.ktreon-landing .hero-art--light{background-image:url("/images/landing/hero-elf-day.webp")}
.ktreon-landing .hero-art--dark{background-image:url("/images/landing/hero-elf-night.webp");opacity:0}
/* Seasonal (New Year) variants. */
.ktreon-landing .hero--festive .hero-art--light{background-image:url("/images/landing/hero-light-xmas.webp")}
.ktreon-landing .hero--festive .hero-art--dark{background-image:url("/images/landing/hero-dark-xmas.webp")}
:root[data-theme="dark"] .ktreon-landing .hero-art--dark{opacity:1}
:root[data-theme="dark"] .ktreon-landing .hero-art--light{opacity:0}
/* A game's own artwork (wide landscape, subject on the right): keep the middle of the height. */
.ktreon-landing .hero--game .hero-art{background-position:center 55%}
@media(max-width:680px){.ktreon-landing .hero-art{background-position:72% 18%}.ktreon-landing .hero--game .hero-art{background-position:75% 55%}}
@media(prefers-reduced-motion:reduce){.ktreon-landing .hero-art{transition:none}}

/* Catalog selects submit on change (public-theme.js); their buttons are a no-JS fallback. */
.js [data-noscript-only]{display:none}

/* Visually hidden, still read by screen readers (inner pages do not load the landing CSS). */
.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}
