:root { color-scheme: light; }
.page-header { gap: 20px; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mode-switch { display: flex; gap: 3px; padding: 4px; border: 1px solid #e2e5ec; border-radius: 10px; background: #f3f5f8; }
.mode-switch button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: transparent; color: #737373; padding: 0; }
.mode-switch button svg { width: 18px; height: 18px; stroke-width: 1.7; }
.mode-switch button:hover { color: #1c1c1c; background: #e7eaf1; }
.mode-switch button[aria-pressed="true"] { background: #fff; color: #1c1c1c; box-shadow: 0 1px 4px #00000012; }

/* Gentle separation on the white canvas, without tinting the page itself. */
:root:not([data-theme="dark"]) .hero { box-shadow: 0 4px 24px #18244806; }
:root:not([data-theme="dark"]) .feature-card,
:root:not([data-theme="dark"]) .result-card { box-shadow: 0 3px 14px #18244806; }
:root:not([data-theme="dark"]) .hero-app .app-tagline { color: #686d76; }
:root:not([data-theme="dark"]) .feature-endless .feature-art:after { background: linear-gradient(180deg,#080b14b3,transparent 90%); }
:root:not([data-theme="dark"]) .dialog-close:hover { background: #e7eaf1; }

/* Neutral charcoal surfaces; app artwork retains its original colors. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191919;
  --sidebar: #1e1e1e;
  --ink: #ededed;
  --muted: #ababab;
  --line: #353535;
  --orange: #d6d6d6;
}
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] a:focus-visible,
[data-theme="dark"] input:focus-visible { outline-color: #c9c9c9; }
[data-theme="dark"] .mode-switch { background: #242424; border-color: #3b3b3b; }
[data-theme="dark"] .mode-switch button { color: #999; }
[data-theme="dark"] .mode-switch button:hover { background: #353535; color: #f3f3f3; }
[data-theme="dark"] .mode-switch button[aria-pressed="true"] { background: #474747; color: #fff; box-shadow: 0 1px 5px #0003; }
[data-theme="dark"] .brand-caption,
[data-theme="dark"] .nav-label,
[data-theme="dark"] .sidebar-fineprint { color: #a0a0a0; }
[data-theme="dark"] .search-box { background: #272727; border-color: #3b3b3b; }
[data-theme="dark"] .search-box input { color: #eee; }
[data-theme="dark"] .search-box input::placeholder { color: #aaa; }
[data-theme="dark"] .search-box svg,
[data-theme="dark"] .search-box kbd { color: #aaa; }
[data-theme="dark"] .search-box kbd { border-color: #4d4d4d; }
[data-theme="dark"] .search-box:focus-within { border-color: #888; box-shadow: 0 0 0 3px #ffffff08; }
[data-theme="dark"] .nav-item { color: #b9b9b9; }
[data-theme="dark"] .nav-item:hover { background: #292929; }
[data-theme="dark"] .nav-item.active { background: #343434; color: #f3f3f3; }
[data-theme="dark"] .nav-item.active svg { color: #ededed; }
[data-theme="dark"] .nav-dot { background: #c8c8c8; }
[data-theme="dark"] .nav-count { background: #414141; color: #d7d7d7; }
[data-theme="dark"] .little-note { background: #242424; border-color: #383838; }
[data-theme="dark"] .little-note:before { background: linear-gradient(90deg,transparent,#777,transparent); }
[data-theme="dark"] .little-note p { color: #aaa; }
[data-theme="dark"] .little-note strong { color: #e5e5e5; }
[data-theme="dark"] .about-link { color: #bbb; }
[data-theme="dark"] .page-header p { color: #a7a7a7; }
[data-theme="dark"] .surprise-button,
[data-theme="dark"] .primary-button,
[data-theme="dark"] .hero-app .hero-action { background: #e6e6e6; color: #202020; border-color: #e6e6e6; box-shadow: 0 2px 4px #0002; }
[data-theme="dark"] .surprise-button:hover,
[data-theme="dark"] .primary-button:hover,
[data-theme="dark"] .hero-app .hero-action:hover { background: #fff; border-color: #fff; }
[data-theme="dark"] .hero,
[data-theme="dark"] .hero.hero-aicromancer,
[data-theme="dark"] .hero.hero-endless { background: radial-gradient(ellipse at 95% 100%,#343434,transparent 57%),#222; border-color: #393939; }
[data-theme="dark"] .hero-connections g { stroke: #424242; }
[data-theme="dark"] .hero-kicker { color: #b3b3b3; }
[data-theme="dark"] .hero-kicker:before { background: #bcbcbc; }
[data-theme="dark"] .hero-title,
[data-theme="dark"] .hero-aicromancer .hero-title,
[data-theme="dark"] .hero-endless .hero-title { color: #f2f2f2; }
[data-theme="dark"] .hero-description,
[data-theme="dark"] .hero-aicromancer .hero-description { color: #b3b3b3; }
[data-theme="dark"] .hero-app { border-color: #404040; }
[data-theme="dark"] .hero-app .app-tagline { color: #aaa; }
[data-theme="dark"] .orbit-app { background: #303030; border-color: #4b4b4b; box-shadow: 0 2px 2px #0002,0 12px 20px #0003; }
[data-theme="dark"] .tile-endless svg { stroke: #ccc; }
[data-theme="dark"] .screen-frame,
[data-theme="dark"] .hero-aicromancer .screen-frame,
[data-theme="dark"] .hero-endless .screen-frame { background: #303030; border-color: #555; box-shadow: 0 5px 12px #0002,0 25px 45px #0004; }
[data-theme="dark"] .window-bar { background: #303030; border-bottom-color: #444; }
[data-theme="dark"] .window-bar span { color: #bbb; }
[data-theme="dark"] .hero-controls>span { color: #aaa; }
[data-theme="dark"] .hero-dots button { background: #616161; }
[data-theme="dark"] .hero-dots button.selected { background: #ddd; }
[data-theme="dark"] .hero-arrows button { color: #eee; background: #303030f5; border-color: #5b5b5b; }
[data-theme="dark"] .hero-arrows button:hover { background: #454545; }
[data-theme="dark"] .section-heading p,
[data-theme="dark"] .collection-tag { color: #a7a7a7; }
[data-theme="dark"] .app-icon { background: #363636; }
[data-theme="dark"] .icon-endless { background: #353535; color: #ccc; }
[data-theme="dark"] .app-name { color: #eee; }
[data-theme="dark"] .app-tagline,
[data-theme="dark"] .feature-caption { color: #b0b0b0; }
[data-theme="dark"] .view-button,
[data-theme="dark"] .pill-button,
[data-theme="dark"] .secondary-button { background: #303030; border-color: #4a4a4a; color: #e3e3e3; }
[data-theme="dark"] .view-button:hover,
[data-theme="dark"] .pill-button:hover,
[data-theme="dark"] .secondary-button:hover { background: #424242; color: #fff; }
[data-theme="dark"] .text-button { color: #d0d0d0; }
[data-theme="dark"] .feature-card,
[data-theme="dark"] .result-card { background: #232323; border-color: #3a3a3a; }
[data-theme="dark"] .manifesto { background: #262626; }
[data-theme="dark"] .manifesto:before { background: linear-gradient(90deg,#222 15%,#22222200),repeating-conic-gradient(from 70deg at 28% 50%,#ffffff03 0deg 8deg,#ffffff09 8deg 16deg); }
[data-theme="dark"] .manifesto .secondary-button { background: #e6e6e6; color: #202020; border-color: #e6e6e6; }
[data-theme="dark"] .manifesto .secondary-button:hover { background: #fff; }
[data-theme="dark"] .page-footer { color: #a0a0a0; }
[data-theme="dark"] .footer-brand,
[data-theme="dark"] .page-footer button { color: #ccc; }
[data-theme="dark"] .detail-tag { background: #353535; color: #bfbfbf; }
[data-theme="dark"] .empty-state { border-color: #494949; color: #bbb; }
[data-theme="dark"] .empty-state h3 { color: #ededed; }
[data-theme="dark"] .app-dialog,
[data-theme="dark"] .about-dialog { background: #242424; border: 1px solid #424242; }
[data-theme="dark"] .app-dialog::backdrop,
[data-theme="dark"] .about-dialog::backdrop { background: #0009; }
[data-theme="dark"] .dialog-close { background: #383838; color: #eee; }
[data-theme="dark"] .dialog-close:hover { background: #4a4a4a; }
[data-theme="dark"] .detail-meta,
[data-theme="dark"] .detail-body p,
[data-theme="dark"] .detail-features li,
[data-theme="dark"] .preview-note { color: #bdbdbd; }
[data-theme="dark"] .detail-meta h2,
[data-theme="dark"] .detail-body h3 { color: #eee; }
[data-theme="dark"] .detail-features li:before { color: #c7c7c7; }
[data-theme="dark"] .about-dialog>p:not(.eyebrow) { color: #bdbdbd; }
[data-theme="dark"] .about-footnote { background: #303030; color: #bdbdbd; border-color: #464646; }
[data-theme="dark"] .toast { background: #ddd; color: #222; }
[data-theme="dark"] .skip-link { background: #333; color: #fff; }

@media(max-width:700px) {
  /* Keep the navigation swipeable without showing a scrollbar. */
  .primary-nav { scrollbar-width: none; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .header-actions { gap: 8px; }
  .mode-switch { padding: 3px; gap: 2px; }
  .mode-switch button { width: 30px; height: 30px; }
  .mode-switch button svg { width: 17px; height: 17px; }
}
@media(max-width:440px) {
  .page-header { align-items: center; gap: 12px; }
  .header-actions { flex-direction: column-reverse; align-items: flex-end; gap: 7px; }
}
