/* Shared palette. Layout and component refinements live in refinement.css. */
:root {
  --page-bg: #090910;
  --panel-bg: #11111b;
  --panel-raised: #191724;
  --text-primary: #f6f3fb;
  --text-secondary: #aaa4b9;
  --border-soft: #ffffff17;
  --glass-bg: rgba(23, 22, 34, .73);
  --glass-border: rgba(255, 255, 255, .13);
  --glass-shadow: 0 14px 40px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .08);
  --glass-highlight: rgba(255, 255, 255, .08);
  --accent-text: #c7a4ff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f7f7fb;
  --panel-bg: #ffffff;
  --panel-raised: #eeedf5;
  --text-primary: #201a31;
  --text-secondary: #696176;
  --border-soft: rgba(53, 37, 81, .13);
  --glass-bg: rgba(255, 255, 255, .76);
  --glass-border: rgba(255, 255, 255, .9);
  --glass-shadow: 0 12px 35px rgba(43, 30, 72, .09), inset 0 1px 0 #ffffff;
  --glass-highlight: rgba(255, 255, 255, .95);
  --accent-text: #6e40bb;
  --bg: var(--page-bg);
  --surface: var(--panel-bg);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-soft);
}

.theme-logo-light, .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-logo-dark,
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-logo-light,
html[data-theme="light"] .theme-icon-moon { display: block; }

/* The light palette keeps deep violet for actions and soft silver for surfaces. */
html[data-theme="light"] body { background: var(--page-bg); color: var(--text-primary); }
html[data-theme="light"] ::selection { background: #d7c4ff; color: #26143d; }
html[data-theme="light"] :is(a, button, summary):focus-visible { outline-color: #7741c5; }
html[data-theme="light"] .section-heading h2 span { color: #82758f; }
html[data-theme="light"] .section-tag {
  color: #57406e;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(115deg, #d6b9e7, #c1cfee) border-box;
}
html[data-theme="light"] .section-footnote { color: #71657e; }
html[data-theme="light"] .framed:before,
html[data-theme="light"] .framed:after { background: #c5b9d3; }
html[data-theme="light"] .secondary { color: #654099; background: #ffffff80; border-color: #bba0dd; }
html[data-theme="light"] .secondary:hover { background: #ede3fa; }
html[data-theme="light"] .text-link:hover { color: #6934a3; }
html[data-theme="light"] .pill { color: #785e92; }
html[data-theme="light"] .brand-name small { color: #756781; }
html[data-theme="light"] .desktop-nav a { color: #71667d; }
html[data-theme="light"] .desktop-nav a:hover,
html[data-theme="light"] .desktop-nav a.active { color: #251536; }
html[data-theme="light"] .locale-switch { background: #eeebf3; border-color: #d9d2e3; box-shadow: inset 0 1px 4px #51406108; }
html[data-theme="light"] .locale-switch button { color: #766681; }
html[data-theme="light"] .locale-switch button[aria-pressed="true"] { color: white; }
html[data-theme="light"] .menu-toggle { color: #544060; }

/* Hero, overview and section previews. */
html[data-theme="light"] .hero { background: radial-gradient(ellipse at 50% 12%, #efe8fa 0, transparent 63%); }
html[data-theme="light"] .hero-kicker { color: #815b9f; }
html[data-theme="light"] .hero h1 .hero-slogan { color: #514461; }
html[data-theme="light"] .hero-year {
  background-image: linear-gradient(115deg, #673bc6 10%, #9d45b6 62%, #bf487e);
}
html[data-theme="light"] .hero-description { color: #6f617f; }
html[data-theme="light"] .season-status { color: #73657f; }
html[data-theme="light"] .status-dot { background: #9169b6; }
html[data-theme="light"] .orbit-spark { color: #b75eb3; }
html[data-theme="light"] .orbital-field { opacity: .62; }
html[data-theme="light"] .stats-context { color: #7d638d; }
html[data-theme="light"] .stat strong { background-image: linear-gradient(105deg, #ad4283, #7b45c7, #4b6ec0); }
html[data-theme="light"] .stat span { color: #71627f; }
html[data-theme="light"] .track-card {
  color: var(--text-primary);
  background: radial-gradient(ellipse at 50% 30%, #a06ada12, transparent 70%), var(--panel-bg);
}
html[data-theme="light"] .track-card:before {
  background: radial-gradient(400px at var(--pointer-x, 50%) var(--pointer-y, 50%), #9554d312, transparent 60%);
}
html[data-theme="light"] .track-top { color: #756380; }
html[data-theme="light"] .track-card:hover .track-top svg { color: #8d42b2; }
html[data-theme="light"] .track-bottom { color: #795a97; }
html[data-theme="light"] .track-local-title { color: #655271!important; }

/* Contained code / AI / media illustrations retain their own nighttime palette. */
html[data-theme="light"] .code-window { box-shadow: 0 16px 35px #53307520; }
html[data-theme="light"] .film-screen { box-shadow: 0 14px 30px #53307520; }
html[data-theme="light"] .process-step { color: #756380; }
html[data-theme="light"] .step-number { color: #815b9c; background: #f0eaf7; border-color: #d3c3e2; }
html[data-theme="light"] .process-step small { color: #756380; }
html[data-theme="light"] .process-step[aria-pressed="true"] { color: #65418f; }
html[data-theme="light"] .process-step[aria-pressed="true"] .step-number { color: white; }
/* The supplied orbit is an opaque dark illustration: preserve its canvas and
   place the light information card above it, instead of fading it to grey. */
html[data-theme="light"] .process-stage { background: #171324; border-color: #d8cce5; }
html[data-theme="light"] .process-orbit { opacity: .86; }
html[data-theme="light"] .process-card {
  color: #2d203c;
  background: #fffcfff0;
  border-color: #ffffff;
  box-shadow: 0 12px 35px #37254e1f;
}
html[data-theme="light"] .process-card-top { color: #805599; }
html[data-theme="light"] .process-card p { color: #736080; }
html[data-theme="light"] .process-progress i { background: #dfd4e9; }
html[data-theme="light"] .process-progress .active { background: linear-gradient(90deg, #9666d1, #d365a1); }
html[data-theme="light"] .process-caption { color: #dccbe8; }

/* Program, venue, segmented controls and frequently asked questions. */
html[data-theme="light"] .light-section {
  background: #efedf5;
  color: var(--text-primary);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-soft);
}
html[data-theme="light"] .program-panel,
html[data-theme="light"] .venue-panel { background: var(--panel-bg); border-color: #ded6e8; box-shadow: 0 8px 24px #3d295005; }
html[data-theme="light"] .program-topbar { background: #faf8fc; border-color: #e7e0ed; }
html[data-theme="light"] .segmented { background: #eae5f1; border-color: #ddd3e7; }
html[data-theme="light"] .segmented button { color: #746580; }
html[data-theme="light"] .segmented button[aria-pressed="true"] { background: #7950c5; color: white; }
html[data-theme="light"] .schedule-time { color: #775399; }
html[data-theme="light"] .schedule-row { border-color: #e9e2ef; }
html[data-theme="light"] .source-link,
html[data-theme="light"] .venue-content .text-link { color: #76568d; }
html[data-theme="light"] .venue-list li { color: #72617e; }
html[data-theme="light"] .venue-list span,
html[data-theme="light"] .map-label { color: #786486; }
html[data-theme="light"] .faq-list details { border-color: #d9d0e3; }
html[data-theme="light"] .faq-list details p { color: #6c5c79; }
html[data-theme="light"] .faq-list summary>span { color: #786486; }

/* People, the regional route and results archive. */
html[data-theme="light"] .person:hover { background: #a26ed508; }
html[data-theme="light"] .person-avatar {
  color: #755091;
  background: linear-gradient(145deg, #eee1f7, #f6f0fc);
  border-color: #d9c9e7;
  box-shadow: inset 0 1px #ffffff;
}
html[data-theme="light"] .person:nth-child(3n+2) .person-avatar { background: linear-gradient(145deg, #f5e2ef, #fcf1f8); color: #a35e8a; }
html[data-theme="light"] .person:nth-child(3n) .person-avatar { background: linear-gradient(145deg, #e4e9f9, #f0f4ff); color: #6176ad; }
html[data-theme="light"] .roadshow-section { background: radial-gradient(ellipse at 50% 100%, #a879d50b, transparent 60%); }
html[data-theme="light"] .route-dot { color: #865da2; background: #f7f3fc; border-color: #bfa0d9; }
html[data-theme="light"] .roadshow-stop:last-child .route-dot { color: white; }
html[data-theme="light"] .roadshow-stop time { color: #7a5d92; }
html[data-theme="light"] .roadshow-stop p { color: #74617f; }
html[data-theme="light"] .archive-content {
  background: radial-gradient(ellipse at 85% 0%, #ac7bde13, transparent 75%), #ffffff;
  border-color: #d9c8e7;
  box-shadow: 0 14px 40px #50336607;
}
html[data-theme="light"] .archive-banner { background: linear-gradient(110deg, #a86dc80b, transparent); border-color: #dfd2e9; }
html[data-theme="light"] .year-big { color: #9a6bc1; }
html[data-theme="light"] .archive-year p { color: #795f88; }
html[data-theme="light"] .winner { background: radial-gradient(ellipse at 0% 100%, #b282d508, transparent); }
html[data-theme="light"] .winner+.winner { border-color: #e5d9ee; }
html[data-theme="light"] .winner-top { color: #85629f; }
html[data-theme="light"] .winner-top svg { color: #a66b9c; }
html[data-theme="light"] .winner p { color: #7a5e8b; }
html[data-theme="light"] .winner .winner-desc { color: #74617f; }
html[data-theme="light"] .archive-bottom { border-color: #e5d9ee; color: #74617f; }
html[data-theme="light"] .archive-bottom .text-link { color: #865a9e; }
html[data-theme="light"] .archive-summary { color: #74617f; }
html[data-theme="light"] .archive-summary strong { color: #5d3e73; }
html[data-theme="light"] .film-link { color: #6b527d; }
html[data-theme="light"] .film-link:hover { color: #45245f; }
html[data-theme="light"] .film-link small { color: #74617f; }

/* Registration copy, organizer wall, and footer. The official poster stays intact. */
html[data-theme="light"] .registration-section { background: #efedf5; }
html[data-theme="light"] .registration-panel { color: #31233f; background: #faf7fe; border-color: #d5bfe8; box-shadow: 0 16px 45px #5232680b; }
html[data-theme="light"] .registration-copy>p { color: #74617f; }
html[data-theme="light"] .registration-copy .registration-note { color: #756380; }
html[data-theme="light"] .registration-copy .white { background: #7142ba; color: white; }
html[data-theme="light"] .registration-copy .secondary { color: #785293; border-color: #c5a7dc; background: transparent; }
html[data-theme="light"] .registration-copy .secondary:hover { background: #eee3f7; }
html[data-theme="light"] .organizers-section { background: #f7f7fb; }
html[data-theme="light"] .organizer-card { border-color: #e0d9e9; box-shadow: 0 4px 15px #45245e03; }
html[data-theme="light"] .partners-label,
html[data-theme="light"] .partner-names { color: #74617f; }
html[data-theme="light"] .partner { color: #725580; }
html[data-theme="light"] .partner small { color: #74617f; }
html[data-theme="light"] .footer { background: #f0eef5; }
html[data-theme="light"] .footer-brand>p { color: #74617f; }
html[data-theme="light"] .social-links { color: #7f579a; }
html[data-theme="light"] .footer-column { color: #74617f; }
html[data-theme="light"] .footer-column>span { color: #634d73; }
html[data-theme="light"] .footer-column>a:hover { color: #422156; }
html[data-theme="light"] .footer-column small { color: #756380; }
html[data-theme="light"] .footer-bottom { color: #756380; }
html[data-theme="light"] .motion-toggle { color: #795f88; }
html[data-theme="light"] .motion-toggle i { background: #cdbbdc; }
html[data-theme="light"] .motion-toggle[aria-pressed="true"] i { background: #9167b2; }

/* Both modal types share the page palette, including dynamically rendered details. */
html[data-theme="light"] dialog { color: var(--text-primary); background: #fcfaff; border-color: #dfd0ed; box-shadow: 0 30px 100px #2e1b4250; }
html[data-theme="light"] dialog::backdrop { background: #2b183e6b; }
html[data-theme="light"] .dialog-close { background: #eee4f7; border-color: #d8c4e7; color: #78528e; }
html[data-theme="light"] .dialog-close:hover { background: #e5d8f0; }
html[data-theme="light"] .dialog-detail span { color: #795f88; }
html[data-theme="light"] .dialog-detail>p,
html[data-theme="light"] .dialog-prizes dt { color: #7a6289; }
html[data-theme="light"] .dialog-prizes dd { color: #654477; }
html[data-theme="light"] .dialog-body .text-link { color: #86549f; }
html[data-theme="light"] .mobile-nav a:hover { color: #774396; }

@media (prefers-reduced-transparency: reduce) {
  :root { --glass-bg: #191724; }
  :root[data-theme="light"] { --glass-bg: #ffffff; }
}
