/* #1090 SUNDERED SPHERES Dark / Light theme (owner 2026-11-30: 'we need a light mode option too').
   The toggle is built by site-header.js in the bar of every page; html[data-theme] holds the choice (dark is the default).
   Light Mode = warm illuminated parchment with ink text and bronze accents. Pictures, 3D views, videos, the hero art,
   the forged buttons, the sculpted icons, the bar and the footers keep their own look.
   Per-element colours are in light-theme.generated.css (scripts/site/gen_light_theme.py); this file holds the toggle,
   the parchment canvas and the hand-made finishing rules. Both use cascade layers, so their !important rules outrank
   the older sheets' unlayered !important rules without a specificity fight. */
/* !important rules: the EARLIER layer wins, so the hand-made finishing layer is named first */
@layer ss-owner-fix, ss-light-finish, ss-light;   /* ss-owner-fix (r260-owner-fix.css, r257v14) outranks both Light Mode layers */
@import url("light-theme.generated.css");

/* ---- the toggle: a small raised bronze disc, sun in dark mode (go light), moon in light mode (go dark) ---- */
.ss-theme-toggle {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(236, 200, 116, .55);
  border-radius: 50%;
  color: #f3d58c;
  background: radial-gradient(circle at 34% 28%, #6a4a22 0%, #3a2710 58%, #1f1408 100%);
  box-shadow: inset 0 1px 0 rgba(255, 232, 170, .38), inset 0 -3px 5px rgba(0, 0, 0, .5), 0 3px 8px rgba(0, 0, 0, .5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .2s ease, color .2s ease;
}
.ss-theme-toggle:hover { color: #fff0c2; box-shadow: inset 0 1px 0 rgba(255, 232, 170, .5), inset 0 -3px 5px rgba(0, 0, 0, .5), 0 3px 8px rgba(0, 0, 0, .5), 0 0 14px rgba(240, 200, 110, .45); }
.ss-theme-toggle:active { transform: translateY(2px) scale(.95); }
.ss-theme-toggle:focus-visible { outline: 2px solid #f3d58c; outline-offset: 3px; }
.ss-theme-toggle .ss-theme-ico { grid-area: 1 / 1; width: 21px; height: 21px; transition: opacity .25s ease, transform .35s ease; }
.ss-theme-toggle .ss-theme-moon { opacity: 0; transform: rotate(-70deg) scale(.5); }
html[data-theme="light"] .ss-theme-toggle .ss-theme-sun { opacity: 0; transform: rotate(70deg) scale(.5); }
html[data-theme="light"] .ss-theme-toggle .ss-theme-moon { opacity: 1; transform: none; }
@media (max-width: 699px) { .ss-theme-toggle { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .ss-theme-toggle, .ss-theme-toggle .ss-theme-ico { transition: none; } }

/* ---- light canvas ---- */
html[data-theme="light"] { color-scheme: light; }
@layer ss-light-finish {
  /* r257v14 (owner 11-30: 'too light ... 50% more darker'): burnished parchment / sunlit sandstone, a warm mid-tone sheet
     with a soft sunlit glow at the top, fixed behind the page (was near-white cream #efe2c4) */
  html[data-theme="light"] body {
    background-color: #c5aa82 !important;
    background-image: radial-gradient(120% 80% at 50% 0%, rgba(226, 204, 162, .85) 0%, rgba(226, 204, 162, 0) 62%), linear-gradient(180deg, #ccb28a 0%, #b99c72 100%) !important;
    background-attachment: fixed !important;
  }
}

/* phone: the pinned bar holds the crest, the theme toggle, Sign in, Play and the menu; the wordmark does not fit beside
   them, so the small crest stands alone there (the full name is on the masthead at the top of the page) */
@media (max-width: 699px) {
  html:root:root:root:root:root body header#bar.bar a.bar-brand > span { display: none !important; }
  html:root:root:root:root:root body header#bar.bar .bar-end { flex: none !important; margin-left: auto !important; }
}

/* light sheet: the chosen Path's name is written in ink (a red or orange name on parchment reads as an error state);
   the Path's own palette stays on the medallion's lit rim and shimmer */
@layer ss-light-finish {
  html[data-theme="light"] body .path-medallion .ss-medallion__label { color: #2a1b07 !important; }
  html[data-theme="light"] body .path-medallion.is-selected .ss-medallion__label { color: #140b02 !important; font-weight: 700 !important; }
  html[data-theme="light"] body .path-medallion.is-selected { background: rgba(80, 52, 14, .14) !important; }
}
