/* Opaque defaults are the fallback when backdrop filtering is unavailable. */
:root {
  color-scheme: dark;
  --ink: #edf5ff;
  --muted: #a4b5c9;
  --line: #d5e8ff24;
  --paper: #081321;
  --card: #14243a;
  --glass: #11263eaa;
  --field: #b4d8ff0b;
  --field-hover: #b4d8ff18;
  --raised: #c3e1ff1b;
  --navy: #e0edff;
  --blue: #9bbfff;
  --blue-soft: #477ffa27;
  --teal: #8be3d5;
  --teal-soft: #36bba32a;
  --edge: #d9edff38;
  --rule: #c1def019;
  --shadow: #00091b60;
  --button-selected: linear-gradient(135deg, #3d71d6, #2754a1);
  --button-text: #fff;
  --title-gradient: linear-gradient(110deg, #8eb7ff 10%, #b6e8ff 55%, #84dec9);
  --ambient: radial-gradient(ellipse at 8% 0%, #1b4d7975, transparent 50%), radial-gradient(ellipse at 98% 30%, #0d70684a, transparent 48%), radial-gradient(ellipse at 42% 100%, #1e427756, transparent 54%);
  --radius: 24px;
  font-synthesis: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #182d48;
  --muted: #536b84;
  --line: #7195b335;
  --paper: #eaf1f7;
  --card: #f6faff;
  --glass: #ffffff99;
  --field: #ffffff5c;
  --field-hover: #fff9;
  --raised: #ffffffd4;
  --navy: #153b68;
  --blue: #255ec2;
  --blue-soft: #3778ea12;
  --teal: #136e61;
  --teal-soft: #218f7a14;
  --edge: #ffffffed;
  --rule: #7395b427;
  --shadow: #2955811a;
  --button-selected: linear-gradient(135deg, #366bd0, #214f9b);
  --button-text: #fff;
  --title-gradient: linear-gradient(110deg, #2354b3 10%, #297f9b 55%, #197866);
  --ambient: radial-gradient(ellipse at 5% 0%, #9dc4ff65, transparent 48%), radial-gradient(ellipse at 100% 28%, #96dec38a, transparent 50%), radial-gradient(ellipse at 30% 95%, #a6c8f76b, transparent 52%);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ambient), var(--paper); color: var(--ink); font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
button, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button { transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; z-index: 20; top: 8px; left: 16px; padding: 12px; background: var(--card); color: var(--blue); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.app { max-width: 1600px; margin: auto; padding: 22px 40px 28px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 650; letter-spacing: -.7px; }
.mark { flex: none; }
.brand-detail { margin-left: 4px; padding-left: 16px; border-left: 1px solid var(--line); font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.appearance-toggle { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 30px; font-size: 14px; background: var(--field); color: var(--muted); }
.appearance-toggle:hover { background: var(--field-hover); color: var(--ink); }
[data-theme="dark"] .moon-icon, [data-theme="light"] .sun-icon { display: none; }
.intro-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; margin: 28px 0 20px; }
h1 { margin: 0; font-size: clamp(27px, 2.75vw, 42px); font-weight: 600; line-height: 1.18; letter-spacing: -1.25px; }
.title-accent { color: var(--blue); }
@supports (background-clip: text) or (-webkit-background-clip: text) { .title-accent { background: var(--title-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; } }
.sub { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.places { display: flex; gap: 10px; }
.places button { position: relative; width: 140px; height: 82px; border: 1px solid var(--line); border-radius: 14px; padding: 0; overflow: hidden; background: #101d2d; color: white; isolation: isolate; }
.places img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.places span { position: absolute; inset: auto 0 0; background: #071729d9; padding: 4px 8px; text-align: center; font-size: 14px; font-weight: 600; }
.places button:hover { border-color: var(--blue); }
.places button[aria-pressed="true"] { border: 2px solid #85adff; box-shadow: 0 0 0 2px #4584ef22, 0 6px 24px #2570ee24; }
.places button[aria-pressed="true"] img { opacity: 1; }
.experience { position: relative; }
.stage { position: relative; aspect-ratio: 2.55 / 1; overflow: hidden; border: 1px solid #b7d9f957; border-radius: 20px; background: #101c2a; box-shadow: 0 18px 60px -24px #0008; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.stage[data-scene="trail"] { aspect-ratio: 2 / 1; }
.stage canvas { display: block; width: 100%; height: 100%; }
.fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 30px; background: #142f4b; color: #fff; text-align: center; }
.labels .label { position: absolute; transform: translate(-50%, -50%); font-size: 12px; font-weight: 500; color: #fff; background: #10243bde; border: 1px solid #ffffff45; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.tag { position: absolute; top: 18px; display: flex; align-items: center; gap: 10px; background: #0c2139d9; color: white; border: 1px solid #d9edff55; border-radius: 12px; padding: 9px 12px; pointer-events: none; }
.tag.left { left: 18px; }
.tag.right { right: 18px; }
.tag strong { display: block; font-size: 14px; font-weight: 650; }
.tag small { display: block; font-size: 12px; color: #d2e4f8; }
.side-dot { display: grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 9px; background: #376dc8; color: white; font-size: 16px; font-weight: 650; }
.tag.right .side-dot, #picker-1 .side-dot { background: #168678; }
.split { position: absolute; top: 0; bottom: 0; width: 48px; margin-left: -24px; cursor: ew-resize; touch-action: none; outline: none; }
.split::before { content: ""; position: absolute; left: 23px; top: 0; bottom: 0; width: 2px; background: #ffffffed; box-shadow: 0 0 7px #0005; }
.grip { position: absolute; left: 50%; top: 40%; width: 46px; height: 46px; transform: translate(-50%, -50%); border: 1px solid #ffffffd0; border-radius: 50%; background: #eff7ffdb; box-shadow: inset 0 1px 0 #fff, 0 0 0 5px #d2eaff28, 0 5px 20px #05152950; display: grid; place-items: center; color: #183d67; }
.grip svg { width: 24px; height: 24px; }
/* Keep the handle off what is being compared: above the car ahead (its licence plate) in the
   city, and between the specials board and the menu in the restaurant. */
.stage[data-scene="city"] .grip { top: 30%; }
.stage[data-scene="restaurant"] .grip { top: 49%; }
.split:hover .grip { box-shadow: 0 0 0 7px #ffffff30, 0 5px 20px #05152950; }
.split:focus-visible .grip { outline: 3px solid #8ab5ff; outline-offset: 3px; }
.controls { position: relative; z-index: 2; width: min(1080px, calc(100% - 160px)); margin: -26px auto 0; padding: 12px 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 1fr) minmax(0, 1fr); align-items: center; gap: 36px; border: 1px solid var(--edge); border-radius: 20px; background: var(--card); box-shadow: inset 0 1px 0 var(--edge), 0 12px 32px var(--shadow); }
.picker { display: flex; align-items: center; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--field); }
.picker:focus-within { border-color: var(--blue); }
#picker-1:focus-within { border-color: var(--teal); }
.picker-body { min-width: 0; flex: 1; }
select { display: block; width: 100%; min-height: 44px; border: none; background: transparent; font-size: 15px; font-weight: 600; padding: 0 2px; }
select option, select optgroup { background: var(--card); color: var(--ink); font-size: 16px; }
.view-kind { display: block; margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.picker[data-kind="condition"] .view-kind, .card[data-kind="condition"] > .view-kind { color: #e6c991; }
[data-theme="light"] .picker[data-kind="condition"] .view-kind, [data-theme="light"] .card[data-kind="condition"] > .view-kind { color: #846023; }
.seg { display: inline-flex; gap: 2px; background: var(--field); border: 1px solid var(--line); padding: 3px; border-radius: 12px; }
.seg button { min-height: 42px; border: 0; border-radius: 9px; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent; white-space: nowrap; }
.seg button:hover { background: var(--field-hover); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--button-selected); color: #fff; box-shadow: inset 0 1px 0 #ffffff33, 0 4px 12px #0b1d4040; }
.mode { display: flex; }
.mode button { flex: 1; padding-inline: 10px; }
.controls.single { grid-template-columns: minmax(200px, 360px) minmax(230px, 360px); justify-content: center; }
.patient { width: min(1080px, calc(100% - 160px)); margin: 10px auto 0; padding: 10px 20px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; gap: 8px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--field); }
.patient[hidden], .patient .field[hidden] { display: none; }
.patient-title { margin: 0 0 12px; font-size: 13px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.patient .field { display: grid; gap: 2px; min-width: 0; }
.patient label { font-size: 12px; color: var(--muted); }
.patient select { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: var(--field); }
.patient select:focus-visible, .patient input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.patient output { color: var(--ink); font-weight: 600; margin-left: 4px; }
.patient input[type="range"] { width: 100%; min-height: 40px; accent-color: #477ffa; }
.patient-note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); }
.scene-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 8px 0 0; }
#compare-hint { margin: 0; color: var(--muted); font-size: 13px; }
.view-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.scene-heading { font-size: 13px; color: var(--muted); margin-right: 8px; }
.compact button { min-height: 36px; font-size: 13px; padding: 5px 10px; }
.tool-button, .icon-button { min-height: 40px; background: var(--field); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.tool-button { padding: 7px 11px; font-size: 13px; }
.icon-button { width: 40px; padding: 0; display: grid; place-items: center; }
#labels-toggle[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
#play[data-playing="true"] .i-play, #play[data-playing="false"] .i-pause { display: none; }
.details { margin-top: 12px; }
.info { display: grid; gap: 40px; }
.info.two { grid-template-columns: 1fr 1fr; }
.card { --accent: var(--blue); min-width: 0; padding: 4px 40px; }
.card[data-side="right"] { --accent: var(--teal); }
.info.two .card + .card { border-left: 1px solid var(--line); }
.card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; color: var(--accent); font-size: 20px; line-height: 1.3; font-weight: 650; letter-spacing: -.35px; }
.card .side { order: 1; font-size: 12px; font-weight: 400; color: var(--muted); }
.card > .view-kind { margin: 2px 0 6px; color: var(--accent); }
.card dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 5px 20px; margin: 0; font-size: 14px; line-height: 1.4; }
.card dt { color: var(--muted); }
.card dd { margin: 0; display: grid; grid-template-columns: minmax(40px, 1fr) 112px; align-items: center; gap: 20px; }
.bar { display: block; height: 7px; border-radius: 6px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.about-view { margin-top: 14px; color: var(--muted); font-size: 14px; }
.about-view summary { color: var(--accent); width: fit-content; min-height: 30px; padding: 3px 0; }
.about-view p { margin: 10px 0; line-height: 1.65; max-width: 65ch; }
.lens-tagline { font-weight: 600; }
.night-note { display: flex; gap: 8px; align-items: flex-start; }
.night-note svg { margin-top: 12px; width: 17px; height: 17px; }
.night-note strong { display: block; color: var(--ink); }
.note { display: flex; align-items: center; gap: 20px; margin-top: 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.note p { margin: 0; max-width: 1050px; }
.badge { margin-left: auto; padding: 5px 10px; border: 1px solid var(--line); border-radius: 30px; font-size: 11px; white-space: nowrap; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .controls { background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(125%); backdrop-filter: blur(24px) saturate(125%); }
}
.embed .top, .embed .intro, .embed .note { display: none; }
.embed .app { padding: 12px; }
.embed .intro-row { display: flex; justify-content: center; margin: 0 0 12px; }
@media (max-width: 1199px) {
  .app { padding-inline: 24px; }
  .intro-row { gap: 20px; }
  .places button { width: 112px; height: 72px; }
  h1 { font-size: 30px; }
  .controls { width: calc(100% - 80px); gap: 20px; }
  .patient { width: calc(100% - 80px); }
  .card { padding-inline: 16px; }
}
@media (max-width: 900px) {
  .intro-row { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
  .places { width: 100%; }
  .places button { width: auto; flex: 1; height: 72px; }
  .stage, .stage[data-scene="trail"] { aspect-ratio: 16 / 9; }
  .stage[data-scene="city"] .grip { top: 36%; }
  .stage[data-scene="restaurant"] .grip { top: 40%; }
  .controls { width: calc(100% - 32px); grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; margin-top: -18px; }
  .picker { order: 0; }
  .mode { order: 1; grid-column: 1 / -1; width: min(340px, 100%); justify-self: center; }
  .controls.single { grid-template-columns: 1fr; }
  .patient { width: calc(100% - 32px); grid-template-columns: 1fr 1fr; }
  .patient-title { grid-column: 1 / -1; margin: 0; }
  .patient .axis-field { grid-column: 1 / -1; order: 1; }
  .patient-note { order: 2; }
  .controls.single .picker { width: min(400px, 100%); justify-self: center; }
  .info { gap: 20px; }
  .card { padding: 0 8px; }
  .card dl { grid-template-columns: 94px minmax(0, 1fr); gap: 9px 12px; }
  .card dd { grid-template-columns: minmax(25px, 1fr) 96px; gap: 10px; }
}
@media (max-width: 640px) {
  .app { padding: 16px 12px 24px; }
  .brand { gap: 9px; font-size: 21px; }
  .mark { width: 30px; height: 30px; }
  .brand-detail { display: none; }
  .appearance-toggle { width: 40px; padding: 0; justify-content: center; }
  .appearance-toggle span { display: none; }
  .intro-row { margin: 18px 0 14px; gap: 14px; }
  h1 { font-size: 25px; line-height: 1.18; letter-spacing: -.65px; }
  .sub { display: none; }
  .places { gap: 8px; }
  .places button { height: 64px; border-radius: 12px; }
  .places span { font-size: 11.5px; padding: 3px 1px; white-space: nowrap; }
  .stage, .stage[data-scene="trail"] { aspect-ratio: 4 / 5; border-radius: 16px; }
  /* On a phone the car sits higher and the traffic signals are right above it, so the
     handle goes on the road between the car and the phone. */
  .stage[data-scene="city"] .grip { top: 56%; }
  .tag { top: 10px; padding: 6px 8px; gap: 6px; border-radius: 10px; }
  .tag.left { left: 10px; }
  .tag.right { right: 10px; }
  .tag strong { font-size: 12px; }
  .tag small { font-size: 10px; }
  .tag .side-dot { width: 24px; height: 24px; border-radius: 6px; font-size: 13px; }
  .labels .label { font-size: 10px; padding: 3px 7px; }
  .controls { width: calc(100% - 12px); margin-top: -20px; border-radius: 17px; padding: 10px; gap: 10px; }
  .picker { padding: 7px 5px; gap: 6px; border-radius: 10px; }
  .picker .side-dot { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
  select { font-size: 16px; min-height: 44px; }
  .view-kind { font-size: 12px; }
  .mode { width: 100%; }
  .patient { width: 100%; padding: 10px 12px; }
  .patient select { min-height: 44px; font-size: 16px; }
  .seg button { min-height: 40px; }
  .scene-tools { padding: 12px 4px 2px; gap: 8px; }
  #compare-hint { font-size: 12px; }
  .view-options { gap: 6px; width: 100%; }
  .scene-heading { font-size: 12px; margin-right: auto; }
  .compact button { min-height: 38px; padding: 5px 9px; font-size: 12px; }
  .details { margin-top: 20px; }
  .info, .info.two { grid-template-columns: 1fr; gap: 22px; }
  .info.two .card + .card { border-left: none; border-top: 1px solid var(--line); padding-top: 18px; }
  .card { padding-inline: 6px; }
  .card h3 { font-size: 20px; }
  .card > .view-kind { font-size: 12px; }
  .card dl { grid-template-columns: 94px minmax(0, 1fr); font-size: 14px; }
  .card dd { grid-template-columns: minmax(40px, 1fr) 112px; gap: 14px; }
  .note { display: block; margin-top: 22px; }
  .badge { display: inline-block; margin-top: 12px; }
  .embed .app { padding: 8px; }
  .embed .intro-row { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) { .controls { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; } .title-accent { background: none; color: var(--ink); } .tag, .labels .label { background: #10243b; } }
@media (forced-colors: active) { .title-accent { background: none; color: CanvasText; } .places button[aria-pressed="true"], .seg button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; } }

@media (max-width: 360px) { .picker > .side-dot { display: none; } }
