/* Theme controls are shared by the journey and detailed service pages. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  color: #e5e4dc;
  background: #ffffff08;
  border: 1px solid #ffffff30;
  border-radius: 24px;
  font: inherit;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { flex: 0 0 18px; }
.theme-toggle:hover { background: #ffffff14; border-color: #dca679; }
.theme-toggle:focus-visible { outline: 2px solid #dca679; outline-offset: 4px; }
.theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }
[data-page="journey"] .header-actions { gap: 20px; }
[data-page="journey"] .motion-toggle { min-width: 44px; justify-content: center; }
[data-page="details"] .header-actions { gap: 17px; }

/* Warm paper, graphite type and a restrained copper accent. */
:root[data-theme="light"] {
  --theme-surface: #f6f3ec;
  --theme-raised: #fffcf6;
  --theme-ink: #1d3036;
  --theme-muted: #5a686b;
  --theme-copper: #9a4c2c;
  --theme-line: #23383e26;
}
:root[data-theme="light"][data-page="journey"] {
  --night: var(--theme-surface);
  --paper: var(--theme-ink);
  --muted: var(--theme-muted);
  --orange: var(--theme-copper);
  --line: var(--theme-line);
}
[data-theme="light"] .site-header,
[data-theme="light"] .site-header.is-solid {
  color: var(--theme-ink);
  background: #f6f3ecf5;
  border-bottom: 1px solid var(--theme-line);
  backdrop-filter: blur(14px);
}
[data-theme="light"] .theme-toggle {
  color: var(--theme-ink);
  background: #fffaf2;
  border-color: #a7937d60;
}
[data-theme="light"] .theme-toggle:hover { background: #ede6da; border-color: var(--theme-copper); }
[data-theme="light"] .theme-toggle:focus-visible { outline-color: var(--theme-copper); }
[data-theme="light"] .site-header .motion-toggle,
[data-theme="light"] .site-header .language { color: var(--theme-muted); }
[data-theme="light"] .site-header .motion-toggle:hover { color: var(--theme-ink); }
[data-theme="light"] .site-header .header-contact > span { color: var(--theme-copper); }

/* The cinematic scene is a self-contained dark canvas, in either theme. */
[data-theme="light"][data-page="journey"] .experience {
  --night: #071721;
  --paper: #e8ecea;
  --muted: #99a7ad;
  --orange: #dca679;
  --line: #d9e7ec29;
  color: var(--paper);
}
[data-theme="light"][data-page="journey"] .geography-section { background: #ece9e0; }
[data-theme="light"][data-page="journey"] :is(.services-note,.geography-note,.country-code) { color: var(--theme-muted); }
[data-theme="light"][data-page="journey"] .country-tabs button { color: var(--theme-muted); }
[data-theme="light"][data-page="journey"] .country-tabs button[aria-selected="true"] { color: var(--theme-copper); }
[data-theme="light"][data-page="journey"] .country-panel #country-description { color: #3e535a; }
[data-theme="light"][data-page="journey"] .country-focus > p { color: var(--theme-muted); }
[data-theme="light"][data-page="journey"] .country-focus { border-color: #9a4c2c60; }
[data-theme="light"][data-page="journey"] .geography-note { border-color: var(--theme-line); }
[data-theme="light"][data-page="journey"] .primary-button { color: #fffaf2; background: var(--theme-copper); }
[data-theme="light"][data-page="journey"] .primary-button:hover { background: #793b24; }
[data-theme="light"][data-page="journey"] .footer-brand { color: var(--theme-ink); }
[data-theme="light"][data-page="journey"] .brief-dialog { background: var(--theme-raised); border-color: var(--theme-line); }
[data-theme="light"][data-page="journey"] .brief-dialog :is(input,select,textarea) { background: #f6f3ec; }
[data-theme="light"][data-page="journey"] .brief-dialog :is(input,textarea)::placeholder { color: #6a7475; }
[data-theme="light"][data-page="journey"] .form-status { color: #32604b; }
[data-theme="light"][data-page="journey"] .skip-link { background: var(--theme-ink); color: var(--theme-surface); }
[data-theme="light"][data-page="journey"] ::selection { color: #fffaf2; background: #9a4c2c; }

/* Repaint the vector geography directly; media and canvas are never inverted. */
[data-theme="light"] .network-heading { color: #40575f; }
[data-theme="light"] .network-heading > span:last-child { color: #617176; }
[data-theme="light"] .network-grid-layer { fill: #63787f; stroke: #4a656d40; }
[data-theme="light"] #network-grid path { stroke: #526e75; stroke-opacity: .12; }
[data-theme="light"] #network-atmosphere stop:first-child { stop-color: #a6b8af; stop-opacity: .19; }
[data-theme="light"] #network-atmosphere stop:last-child { stop-color: #ece9e0; }
[data-theme="light"] #network-land-fill stop:first-child { stop-color: #e2e4d9; }
[data-theme="light"] #network-land-fill stop:last-child { stop-color: #c6d0c5; }
[data-theme="light"] #network-selected-fill stop:first-child { stop-color: #c28359; stop-opacity: .42; }
[data-theme="light"] #network-selected-fill stop:last-child { stop-color: #d5bb94; stop-opacity: .32; }
[data-theme="light"] #route-gradient stop:first-child { stop-color: #9a4c2c; }
[data-theme="light"] #route-gradient stop:last-child { stop-color: #74452d; }
[data-theme="light"] .network-land-depth { fill: #bec8bc; stroke: #a9b6aa; }
[data-theme="light"] .network-land-muted { fill: #e2e3d9; stroke: #a8b5aa; opacity: .78; }
[data-theme="light"] .network-region { stroke: #899e91; }
[data-theme="light"] .network-region.is-selected { stroke: #9a6141; }
[data-theme="light"] .network-origin-region { fill: #d5d9ca; stroke: #94a38f; }
[data-theme="light"] .network-relief { stroke: #365d57; opacity: .075; }
[data-theme="light"] .network-corridor { stroke: #426b70; opacity: .35; }
[data-theme="light"] .network-corridor.is-selected { opacity: 0; }
[data-theme="light"] .network-route-bed { stroke: #bd85565e; }
[data-theme="light"] .network-route-flow { stroke: #8b3c21; }
[data-theme="light"] .network-distribution path { stroke: #5c787b; }
[data-theme="light"] .network-distribution rect { fill: #76928a; stroke: #ece9e0; }
[data-theme="light"] .network-distribution.is-selected path { stroke: #955737; }
[data-theme="light"] .network-distribution.is-selected rect { fill: #955737; }
[data-theme="light"] .market-network .network-station { fill: #445e66; }
[data-theme="light"] .market-network .network-station.is-active { fill: #8b4229; }
[data-theme="light"] .market-network .network-station .network-hub { fill: #4b6d70; }
[data-theme="light"] .market-network .network-station .network-hub-ring { fill: #e8e8db; stroke: #5e7d79; }
[data-theme="light"] .market-network .network-station .network-hub-cross { stroke: #6a8682; }
[data-theme="light"] .market-network .network-station.is-active .network-hub { fill: #9a4c2c; }
[data-theme="light"] .market-network .network-station.is-active .network-hub-ring { fill: #f3e5d0; stroke: #9a4c2c; }
[data-theme="light"] .market-network .network-station.is-active :is(.network-hub-cross,.network-halo) { stroke: #9a4c2c; }
[data-theme="light"] .network-origin { fill: #9a4c2c; }
[data-theme="light"] .network-origin-ring { fill: #e9dbc8; stroke: #9a6747; }
[data-theme="light"] .network-cargo { fill: #eee8d8; stroke: #7c4f34; }
[data-theme="light"] .network-origin-base { stroke: #8e6449; }
[data-theme="light"] .network-origin-label { fill: #71482f; }
[data-theme="light"] .network-origin-label .network-origin-subtitle { fill: #5b6d6f; }
[data-theme="light"] .network-distribution-caption { fill: #536e72; stroke: #536e72; }
[data-theme="light"] .network-distribution-caption rect { fill: #9a6141; }
[data-theme="light"] .network-distribution-caption path { stroke: #9a6141; }
[data-theme="light"] .network-legend { color: #4b6268; border-color: var(--theme-line); }
[data-theme="light"] .network-legend b { color: #9a4c2c; }
[data-theme="light"] .network-legend > i { color: #788a86; }

/* The detailed version shares the same paper and copper palette. */
:root[data-theme="light"][data-page="details"] {
  --ink: #1d3036;
  --ink-soft: #ece9e0;
  --paper: #f6f3ec;
  --paper-light: #fffcf6;
  --muted: #5a686b;
  --light-muted: #5a686b;
  --reading-ink: #40545a;
  --reading-muted: #5a686b;
  --accent: #9a4c2c;
  --action: #9a4c2c;
  --line: #23383e26;
  --line-dark: #23383e26;
}
[data-theme="light"][data-page="details"] .dark-section { background: #ece9e0; color: var(--ink); }
[data-theme="light"][data-page="details"] :is(.why-umay,.infrastructure) { background: #eeeae0; }
[data-theme="light"][data-page="details"] .hero--cinematic {
  --ink: #0b1115;
  --paper: #eeeae1;
  --light-muted: #b0bab9;
  --accent: #dca679;
  --action: #dca679;
  --line-dark: #eeeae133;
  --reading-ink: #ccd7d2;
  --reading-muted: #acbcb5;
  background: #0b1115;
  color: #eeeae1;
}
[data-theme="light"][data-page="details"] .primary { color: #fffaf2; background: #9a4c2c; }
[data-theme="light"][data-page="details"] .primary:hover { background: #793b24; }
[data-theme="light"][data-page="details"] .hero--cinematic .primary { color: #0b1115; background: #dca679; }
[data-theme="light"][data-page="details"] .dark-section:not(.hero) :is(.section-label,.budget-payment > .note) { color: #5a686b; }
[data-theme="light"][data-page="details"] :is(.process-steps .step-result,.prototype-note strong) { color: var(--ink); }
[data-theme="light"][data-page="details"] :is(.process-steps .step-index,.service-number) { color: #9a4c2c; }
[data-theme="light"][data-page="details"] :is(.route-explorer,.route-step-button) { color: var(--ink); }
[data-theme="light"][data-page="details"] :is(.route-sticky,.route-rail-node) { background: #ece9e0; }
[data-theme="light"][data-page="details"] .route-rail-node.is-passed { background: var(--accent); }
[data-theme="light"][data-page="details"] .route-step-button[aria-pressed="true"] { background: #9a4c2c0b; }
[data-theme="light"][data-page="details"] .route-scene-number { color: #dca679; }
[data-theme="light"][data-page="details"] .route-inspection { --accent: #83ada6; }
[data-theme="light"][data-page="details"] .field :is(input,textarea,select) { color: var(--ink); border-color: #8b9994; color-scheme: light; }
[data-theme="light"][data-page="details"] .field :is(input,textarea)::placeholder { color: #677673; }
[data-theme="light"][data-page="details"] .field select option { background: #f6f3ec; color: var(--ink); }
[data-theme="light"][data-page="details"] .field :is(input,textarea,select):hover { border-color: #9a4c2c; }
[data-theme="light"][data-page="details"] .channel-options input:checked + span { background: #9a4c2c; color: #fffaf2; }
[data-theme="light"][data-page="details"] .channel-options input:focus-visible + span { outline-color: #9a4c2c; }
[data-theme="light"][data-page="details"] :is(.field-error,.form-status) { color: #9a392d; }
[data-theme="light"][data-page="details"] .estimate-fields > summary:hover { color: #9a4c2c; }
[data-theme="light"][data-page="details"] .site-header { color: var(--ink); }
[data-theme="light"][data-page="details"] .site-header .motion-toggle-icon { border-color: #a7937d80; }
[data-theme="light"][data-page="details"] .menu-dialog { color: var(--ink); background: var(--paper); }
[data-theme="light"][data-page="details"] .scene figcaption { color: var(--ink); }
[data-theme="light"][data-page="details"] .hero--cinematic .scene figcaption { color: #eeeae1; }

@media (max-width: 1400px) and (min-width: 1021px) {
  [data-page="details"] .motion-toggle-label { display: none; }
  [data-page="details"] .theme-toggle-label { display: none; }
  [data-page="details"] .theme-toggle { width: 44px; padding: 0; }
}
@media (max-width: 1100px) {
  .theme-toggle-label { display: none; }
  .theme-toggle { width: 44px; padding: 0; }
}
@media (max-width: 760px) {
  [data-page="journey"] .header-actions { gap: 7px; }
  [data-page="journey"] .site-header { gap: 9px; }
  [data-page="journey"] .header-contact { gap: 7px; }
  [data-page="details"] .header-actions { gap: 9px; }
  [data-page="details"] .language { display: none; }
}
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }
@media print { .theme-toggle { display: none !important; } }
