/* Theme layer, loaded last on every page.
   The whole site is light: a white page, near-black text and a deep green accent, for strong contrast.
   The hero is white too, with black stars around the globe. */

:root{color-scheme:only light;
 --canvas:#ffffff;--surface:#f7f8f7;--raised:#f1f3f2;--soft:#e8ece9;--ink:#0f1412;--muted:#535b57;--line:#0f141214;--line-strong:#0f141229;
 --accent-text:#11744a;--up-text:#0f7a45;--down-text:#c62828;--good-text:#11744a;--weak-text:#5b625e;--chip:#f1f3f2;--chip-hover:#e6e9e7;--nav-current:#e7f4ec;
 --stage:#ffffff;--shadow:0 20px 60px #0f14121a}

html,:root{background:var(--canvas);color:var(--ink)}
body{background:var(--canvas)}
:focus-visible{outline-color:var(--accent-text)}

/* App shell */
.desktop-window{background:var(--surface);border-color:var(--line-strong);box-shadow:var(--shadow)}
.titlebar{background:color-mix(in srgb,var(--surface) 94%,transparent);border-color:var(--line)}
.sidebar{background:var(--raised);border-color:var(--line)}
.sidebar nav a{color:var(--muted)}
.sidebar nav a:hover{background:var(--chip-hover);color:var(--ink)}
.sidebar nav a[aria-current]{background:var(--nav-current);color:var(--ink)}
.sidebar nav .nav-contact{border-color:var(--line-strong)}
.sidebar-bottom button,footer,footer button,.footer-learn,.footer-copyright{color:var(--muted)}
.section,.closing,footer,.offline-note,.visual-toolbar,.visual-footer,.example-toolbar{border-color:var(--line)}

/* Sections */
.reading-visual,.example-workspace{background:var(--raised);border-color:var(--line-strong)}
.visual-toolbar,.visual-footer{color:var(--muted)}
.example-toolbar{background:var(--soft);color:var(--muted)}
.mini-brand{color:var(--ink)}
.offline-note>svg{color:var(--accent-text)}
.demo-unmute{background:#000000b3;color:#fff}
.cycle-icon{background:var(--soft);color:var(--accent-text)}
.cycle-arrow{color:var(--muted)}
.cycle-return{border-color:var(--line-strong)}
.cycle-return>span{background:var(--surface);color:var(--muted)}
.notes-progress article,.proof-card,.more-card{background:var(--raised);border-color:var(--line-strong)}
.closing{background:none}
.proof-note{color:var(--muted)}
.proof-loss{color:var(--down-text)}
.proof-source:hover{color:var(--accent-text)}

/* Proof charts: SVG text follows the theme (CSS beats the presentation attributes) */
.proof-card svg text[fill="#e7efe8"]{fill:var(--ink)}
.proof-card svg text[fill="#b7c9bc"]{fill:var(--muted)}
.proof-card svg text[fill="#93f2c0"]{fill:var(--up-text)}
.proof-card svg text[fill="#ff6b6b"]{fill:var(--down-text)}
.proof-card svg line[stroke="#b6d5c055"]{stroke:var(--line-strong)}
.proof-card svg line[stroke="#e7efe8"]{stroke:var(--muted)}
.proof-card svg text[fill="#5fd79a"]{fill:var(--good-text)}
.proof-card svg text[fill="#8fa79a"]{fill:var(--weak-text)}

/* Dialogs and mobile navigation */
dialog{background:var(--surface);color:var(--ink);border-color:var(--line-strong)}
dialog p,.dialog-close{color:var(--muted)}
dialog::backdrop{background:#000000a6}
.contact-actions a,.contact-actions button{border-color:var(--line-strong);color:var(--ink)}
.mobile-nav{background:color-mix(in srgb,var(--surface) 94%,transparent);border-color:var(--line-strong)}
.mobile-nav a,.mobile-nav a:last-child{color:var(--muted)}
.mobile-nav a[aria-current]{background:var(--nav-current);color:var(--ink)}

/* Hero: a true-dark stage in both themes */
.game-hero{color:var(--ink);background:radial-gradient(ellipse at 50% 55%,#11744a0d,transparent 55%),var(--stage)}
.game-hero:before{background:none}
.game-hero h1{color:var(--ink);text-shadow:none}
.game-hero h1>span{color:var(--accent-text)}
.game-toolbar{color:var(--muted)}
.game-score,.motion-toggle,.game-reset{background:#ffffff;border-color:var(--line-strong);color:var(--muted)}
.game-score strong{color:var(--ink)}
.motion-toggle:hover,.game-reset:hover{background:var(--chip-hover)}
.game-hero .hero-actions>a:not(.download-button),.hero-actions .learn-button{background:#ffffff;border:1px solid var(--line-strong);color:var(--ink)}
.game-hero .hero-actions>a:not(.download-button):hover,.hero-actions .learn-button:hover{background:var(--chip-hover)}
.game-hero .hero-actions .download-button,.cta .hero-actions .download-button{background:#bde5c8;border:1px solid #7fbf98;color:#0d2b1b;box-shadow:0 4px 14px #11744a1f}
.game-hero .hero-actions .download-button:hover,.cta .hero-actions .download-button:hover{background:#a9dcb9;border-color:#5fae82}
.game-hero :focus-visible{outline-color:var(--accent-text)}

/* More from Stadiy */
.more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.more-card{display:flex;flex-direction:column;gap:8px;padding:22px 22px 18px;border:1px solid var(--line-strong);border-radius:12px}
.more-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:var(--soft);color:var(--accent-text);margin-bottom:8px}
.more-icon svg{width:21px;height:21px}
.more-audience{font-size:11px;letter-spacing:.6px;text-transform:uppercase;color:var(--accent-text);font-weight:600;line-height:1.4}
.more-card h3{font-size:19px;font-weight:500;letter-spacing:-.4px}
.more-text{font-size:13px;color:var(--muted);line-height:1.65;flex:1}
.more-link{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;margin-top:8px;font-size:13px;font-weight:550;color:var(--accent-text)}
.more-link:hover{text-decoration:underline;text-underline-offset:3px}
@media(max-width:1000px){.more-grid{grid-template-columns:1fr;max-width:520px}}
.sidebar nav .nav-more span{line-height:1.35}
.footer-products{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:11px}
.footer-products a{color:var(--muted);min-height:32px;display:inline-flex;align-items:center}
.footer-products a:hover{color:var(--ink)}

/* Store button labels fit on the narrowest phones */
@media(max-width:360px){.game-hero .hero-actions .download-button .download-label>strong{font-size:14.5px;letter-spacing:-.4px}}
@media(max-width:360px){.hero-actions .web-suffix{display:none}}

/* Website privacy link (sidebar and footer), styled like the old dialog button */
.sidebar-bottom .privacy-link{display:flex;align-items:center;padding:0;font-size:11px;color:var(--muted)}
footer .privacy-link{display:inline-flex;align-items:center;font-size:10px;color:var(--muted);margin-left:auto}
.sidebar-bottom .privacy-link:hover,footer .privacy-link:hover{color:var(--ink)}
.privacy-link[aria-current]{color:var(--ink)}
@media(max-width:760px){footer .privacy-link{font-size:9px}}

/* Article-style pages (website privacy): readable dark text on the light page */
.article-page:not(.research-page) .article-body{color:#2f3633}
.article-page:not(.research-page) .article-back{color:var(--muted)}
