/* REDWALK shared design system (index.html, twin.html, mission.html).
   Visual language adapted from the MIT-licensed "Lilac Meadow Landing" template (Kedhareswer Naidu): tinted neutrals,
   one hue ramp (sky / wash / deep / accent), soft rounded panels, pill controls, sentence-case kickers, frosted header,
   spring easing, a "dusk" dark theme. Re-coloured for Mars: ochre accent, butterscotch sky, cocoa.
   Pages map their own variable names onto these --mw-* tokens; theme.js sets data-theme="day|dusk" on <html>.
   Everything drawn over the 3D view or over photos uses the --mw-glass-* tokens, which stay dark in both themes. */
:root {
  --mw-sans: "Plus Jakarta Sans", "Manrope", "Inter", "SF Pro Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mw-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --mw-ease: cubic-bezier(.2, .7, .2, 1);
  --mw-r-card: 20px; --mw-r-tile: 14px; --mw-r-pill: 999px;
  /* glass: overlays on the 3D scene, photos and maps (same in both themes) */
  --mw-glass: rgba(24, 16, 12, .80); --mw-glass-strong: rgba(24, 16, 12, .92); --mw-glass-fg: #f3ebe4; --mw-glass-mut: #c9b9ad;
  --mw-glass-line: rgba(255, 236, 224, .16); --mw-glass-accent: #f0a674;
  /* Mars day (default) */
  --mw-bg: #f4efe9; --mw-panel: #ffffff; --mw-panel2: #faf5ef; --mw-line: rgba(43, 26, 20, .11);
  --mw-tx: #1f1612; --mw-mut: #6b5d55; --mw-faint: #76675e;
  --mw-accent: #96441f; --mw-deep: #2b1a14; --mw-ondeep: #fbf3ec; --mw-wash: #f1dfd0; --mw-wash2: #faf3ec;
  --mw-sky0: #e6c8ad; --mw-sky1: #f1dfcf; --mw-sky2: #faf3ec; --mw-glow: rgba(255, 255, 255, .85);
  --mw-ok: #2f7a4c; --mw-warn: #9a6210; --mw-bad: #b0381f; --mw-route: #1f7486; --mw-crew: #2d68a6; --mw-sim: #8048ad;
  --mw-track: #efe4da; --mw-mapbg: #e9ddd1;
  --mw-shadow: 0 1px 2px rgba(43, 26, 20, .05), 0 10px 28px -16px rgba(43, 26, 20, .22);
  color-scheme: light;
}
:root[data-theme="dusk"] {
  --mw-bg: #120d0b; --mw-panel: #1b1411; --mw-panel2: #231a16; --mw-line: rgba(255, 236, 224, .10);
  --mw-tx: #f3ebe4; --mw-mut: #b4a69c; --mw-faint: #8c7e75;
  --mw-accent: #e0895b; --mw-deep: #f3e6da; --mw-ondeep: #2b1a14; --mw-wash: #2a1d17; --mw-wash2: #1f1612;
  --mw-sky0: #120c0a; --mw-sky1: #2a1812; --mw-sky2: #43281b; --mw-glow: rgba(224, 137, 91, .30);
  --mw-ok: #5cbf7f; --mw-warn: #e2ab45; --mw-bad: #ef6b52; --mw-route: #55c6d9; --mw-crew: #8cc4f5; --mw-sim: #d39cf0;
  --mw-track: #0e0a08; --mw-mapbg: #0e0a08;
  --mw-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  color-scheme: dark;
}
html, body { background: var(--mw-bg); color: var(--mw-tx); -webkit-font-smoothing: antialiased; transition: background-color .5s ease, color .5s ease; }
/* frosted sky band used by every page header */
.mw-sky {
  background: radial-gradient(60% 140% at 22% 0%, var(--mw-glow), transparent 70%), linear-gradient(180deg, var(--mw-sky0), var(--mw-sky1) 55%, var(--mw-sky2));
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
.mw-theme-btn { font: 500 12.5px var(--mw-sans); color: var(--mw-tx); background: var(--mw-panel2); border: 1px solid var(--mw-line); border-radius: var(--mw-r-pill); padding: 6px 12px; cursor: pointer; transition: transform .25s var(--mw-ease), border-color .25s; }
.mw-theme-btn:hover { border-color: var(--mw-accent); transform: translateY(-1px); }
.mw-pill-primary { background: var(--mw-deep) !important; color: var(--mw-ondeep) !important; border-color: transparent !important; }
:focus-visible { outline: 2px solid var(--mw-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; } }

/* Texture (15 Nov): real 10 m elevation contours of the study area (HiRISE DTM, contours.svg, heavier every 50 m) and a fine
   dust grain behind every page header; softer layered shadows on panels. Decoration only, behind text, no effect on contrast. */
:root { --mw-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .12 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --mw-shadow: 0 1px 2px rgba(43, 26, 20, .05), 0 8px 24px -14px rgba(43, 26, 20, .20), 0 22px 44px -28px rgba(43, 26, 20, .16); }
.mw-sky { background-image: var(--mw-grain), url("contours.svg"), radial-gradient(60% 140% at 22% 0%, var(--mw-glow), transparent 70%), linear-gradient(180deg, var(--mw-sky0), var(--mw-sky1) 55%, var(--mw-sky2));
  background-size: 160px 160px, 900px auto, auto, auto; background-position: 0 0, 70% 38%, 0 0, 0 0; background-repeat: repeat, no-repeat, no-repeat, no-repeat; }
:root[data-theme="dusk"] .mw-sky { background-blend-mode: soft-light, screen, normal, normal; }
