:root {
  --footer-tint: rgb(255 255 255 / 5%);
  --footer-ink: #182b41;
  --footer-filter: blur(4px) saturate(.84) contrast(.36) brightness(1.65);
}

:root[data-theme="black"] {
  color-scheme: dark;
  --theme-page: #101114;
  --theme-panel: #1b1e25;
  --theme-wash: #222731;
  --theme-layer: #2a303b;
  --theme-border: #383f4b;
  --theme-text: #f4f5f9;
  --theme-muted: #b6becc;
  --theme-link: #a2b8ff;
  --theme-action: #315edd;
  --theme-feature: #202d4b;
  --theme-warm: #302b20;
  --theme-positive: #1c2c29;
  --theme-success: #99dac0;
  --theme-negative: #35242a;
  --theme-danger: #ffb5ae;
  --paper: var(--theme-page);
  --footer-tint: rgb(16 17 20 / 5%);
  --footer-ink: var(--theme-text);
  --footer-filter: blur(4px) saturate(.84) brightness(.45);
  --plaivi-play-surface: rgb(38 50 74 / 30%);
  --plaivi-play-active: rgb(53 71 114 / 46%);
  --plaivi-play-ink: #dbe5ff;
  accent-color: var(--theme-action);
  background-color: var(--theme-page);
}

[data-theme="black"] body,
[data-theme="black"] body:has(.ad-home) {
  --ad-ink: var(--theme-text);
  --ad-dim: var(--theme-muted);
  --ad-blue: var(--theme-link);
  --ad-soft: var(--theme-panel);
  background-color: var(--theme-page);
  color: var(--theme-text);
}

[data-theme="black"] #topnav,
[data-theme="black"] body:has(.ad-home) #topnav {
  background: var(--theme-page);
  box-shadow: none;
}

[data-theme="black"] .ph-bar .brand-art b { color: var(--theme-text); }
[data-theme="black"] .ph-bar .brand-art svg { filter: brightness(1.55); }
[data-theme="black"] .home-view { --c-paper: var(--theme-page); }
[data-theme="black"] :is(.lb-feature,.lb-audio-player,.ac-report-cover,.ac-video-screen) { background: var(--theme-feature); }
[data-theme="black"] .lb-feature :is(.lb-kicker,.lb-feature-cta) { color: var(--theme-link); }
[data-theme="black"] .ac-membership-status .ac-chip { background: var(--theme-layer); }
[data-theme="black"] .ad-workout .ad-start { background: var(--theme-action); }
[data-theme="black"] :is(.ad-play,.pv-play-badge,.tr-thumb-play) { color: var(--plaivi-play-ink); }
[data-theme="black"] :is(.pv-play-badge .play-wordmark,.tr-thumb-play) { text-shadow: 0 1px 3px rgb(7 12 24 / 85%); }
[data-theme="black"] .tr-session-photo-caption { background: var(--theme-panel); }
[data-theme="black"] :is(input,textarea)::placeholder { color: var(--theme-muted); opacity: .85; }
[data-theme="black"] .ad-card figure span,
[data-theme="black"] .home-place-photo figcaption { color: #182b41; }

body > #foot {
  background: var(--footer-tint);
  -webkit-backdrop-filter: var(--footer-filter);
  backdrop-filter: var(--footer-filter);
}

body > #foot .ad-footer {
  background: transparent;
  color: var(--footer-ink);
}

.ad-footer .site-theme-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  color: var(--footer-ink);
  font: 680 clamp(29px, 1.5vw, 58px) / 1 var(--plaivi-font);
  letter-spacing: var(--plaivi-wordmark-tracking);
  text-transform: lowercase;
  cursor: pointer;
  pointer-events: auto;
}

.ad-footer .site-theme-toggle:is(:hover,:focus-visible) { color: var(--theme-link, #244dd7); }
.ad-footer .site-theme-toggle:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: .16em;
}

@media screen and (max-width: 739px) {
  body[data-route]:not(.focus-session) > #foot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    border-top: 1px solid var(--theme-border, rgb(0 0 0 / 12%));
    background: var(--footer-tint);
  }
  body[data-route]:not(.focus-session) > #foot .ad-footer { display: contents; }
  body[data-route] > #foot .ad-footer > :is(span,nav) { display: none; }
  .ph-dock.ph-mobile-nav {
    border: 0;
    background: transparent;
  }
  .ph-dock a {
    color: var(--footer-ink);
    font-size: clamp(10px, 2.9vw, 13px);
  }
  .ph-dock a[aria-current]::before { background: var(--theme-link, var(--blue)); }
  body[data-route] .ad-footer .site-theme-toggle {
    padding-inline: 18px 6px;
    padding-bottom: var(--dock-safe-bottom, env(safe-area-inset-bottom, 0px));
    font-size: clamp(18px, 4.45vw, 24px);
  }
  body[data-route]:not(.focus-session) > #main {
    padding-block-end: calc(var(--dock-height) + 1px);
    scroll-padding-block-end: calc(var(--dock-height) + 1px);
  }
}
