@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700&display=swap');

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Improved text readability */
p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Better heading spacing */
h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1:first-child,
h2:first-child,
h3:first-child {
    margin-top: 0;
}

/* Link styling */
a {
    transition: all 0.2s ease;
}

/* Better list spacing */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Blockquote styling */
blockquote {
    border-left: 4px solid var(--mantine-color-teal-5);
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--mantine-color-dimmed);
}

input:invalid {
    outline: none !important;
}

#wrapper {
    padding: 10px;
    margin-left: 320px;
    margin-right: 320px;
}

:root[data-mantine-color-scheme="dark"] #dark-theme-icon {
    display: none;
}

:root[data-mantine-color-scheme="light"] #light-theme-icon {
    display: none;
}

.demo-container {
    display: flex;
    max-width: 100%;
    overflow: hidden;
}

.demo-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    justify-content: center;
}

.demo-controls {
    width: 250px;
    padding: 20px;
    gap: 10px;
}

.demo-control {
    margin: 10px;
}

@media only screen and (max-width: 750px) {
    .demo-container {
        flex-direction: column;
    }

    .demo-controls {
        width: 100%;
    }
}

.dmc-bar {
    background-image: linear-gradient(to right, yellow, orange);
}

.dmc-thumb {
    border-color: orange;
    height: 20px;
    width: 20px;
    background-color: white;
}

.mantine-Table-th {
    font-size: 15px;
    font-weight: 500;
}

.dmc-indicator {
  width: 12px;
  height: 4px;
  transition: width 250ms ease;

  &[data-active] {
    width: 40px;
  }
}

.dmc-control {
  &[data-inactive] {
    opacity: 0;
    cursor: default;
  }
}

.dmc-controls {
  transition: opacity 150ms ease;
  opacity: 0;
}

.dmc-root {
  &:hover {
    .dmc-controls {
      opacity: 1;
    }
  }
}



.dmc-slider-track {
  &::before {
    background-color: light-dark(var(--mantine-color-blue-1), var(--mantine-color-dark-3));
  }
}

.dmc-slider-mark {
  width: 6px;
  height: 6px;
  border-radius: 6px;
  transform: translateX(-3px) translateY(-2px);
  border-color: light-dark(var(--mantine-color-blue-1), var(--mantine-color-dark-3));

  &[data-filled] {
    border-color: var(--mantine-color-blue-6);
  }
}

.dmc-slider-markLabel {
  font-size: var(--mantine-font-size-sm);
  color: var(--mantine-color-green-5);
  margin-bottom: 5px;
  margin-top: 0;
}

.dmc-slider-thumb {
  height: 16px;
  width: 16px;
  background-color: var(--mantine-color-green-5);
  border-width: 1px;
  box-shadow: var(--mantine-shadow-lg);
}

.navbar-link {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background 0.1s;
    color: inherit;
    display: inline-flex;
    gap: 0.5rem;

    &:hover {
        text-decoration: none;
        background: color-mix(in srgb, var(--mantine-color-gray-5), transparent 90%);
    }
}

.m_b8a05bbd {
    margin-top: 80px !important;
    height: 63vh !important;
}

div .m_46b77525 {
    margin-top: calc(0.5rem* var(--mantine-scale)) !important;
}

.m_5caae85b {
    position: absolute !important;
    top: calc(0.3125rem* var(--mantine-scale));
    inset-inline-end: calc(0.3125rem* var(--mantine-scale));
    z-index: 1;
}

.m_9cdde9a {
    inset-inline-end: 0;
    width: var(--app-shell-aside-width);
    transform: var(--app-shell-aside-transform);
    z-index: var(--app-shell-aside-z-index);
    margin-top: 15px;
}

:root[data-mantine-color-scheme="dark"] {
    --mantine-color-anchor: #74c0fc !important;
    --mantine-color-dark-light: rgba(63, 63, 70, 0.15);
    --mantine-color-dark-light-hover: rgba(63, 63, 70, 0.2);
    --mantine-color-dark-outline-hover: rgba(113, 113, 122, 0.05);
}

img[alt=logo] { width: 100%; }

/* Theme-aware code blocks */
:root[data-mantine-color-scheme="light"] pre,
:root[data-mantine-color-scheme="light"] code {
    background-color: #f8f9fa;
    color: #1a1b1e;
}

:root[data-mantine-color-scheme="dark"] pre,
:root[data-mantine-color-scheme="dark"] code {
    background-color: #1a1b1e;
    color: #c1c2c5;
}

/* Inline code */
:root[data-mantine-color-scheme="light"] code {
    background-color: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

:root[data-mantine-color-scheme="dark"] code {
    background-color: #25262b;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---- Petri Dish: theme-aware dish + silhouettes ---- */
/* The circular field background + inner glow, light and dark variants. */
.petri-dish {
    background: radial-gradient(circle at 50% 45%, #f6fbff 0%, #e8f0f8 55%, #d3deec 100%);
    box-shadow: inset 0 0 60px 14px rgba(20, 40, 60, 0.18),
                inset 0 0 0 2px rgba(51, 153, 255, 0.28);
}
:root[data-mantine-color-scheme="dark"] .petri-dish {
    background: radial-gradient(circle at 50% 45%, #16222f 0%, #101a26 55%, #0b121b 100%);
    box-shadow: inset 0 0 60px 14px rgba(0, 0, 0, 0.45),
                inset 0 0 0 2px rgba(51, 153, 255, 0.30);
}

/* /tileset-dish: the petri-dish ring WITHOUT the agar background — the dish
   floor is a live leaflet tile basemap showing through the circular clip.
   The inset shadow sits on an overlay (not the clip div) so it paints ABOVE
   the map tiles; pointer-events stay off so the joystick/keys own all input. */
.tdish-dish {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
}
.tdish-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    box-shadow: inset 0 0 60px 14px rgba(20, 40, 60, 0.30),
                inset 0 0 0 2px rgba(51, 153, 255, 0.35);
    /* feather the dish rim into the page body so the floor blends with the app
       theme (color-mix keeps it tracking the live light/dark scheme) */
    background: radial-gradient(circle at 50% 48%,
        transparent 58%,
        color-mix(in srgb, var(--mantine-color-body) 30%, transparent) 100%);
}
/* the dish backdrop is THEME-AWARE (the .petri-dish agar gradients) and the tile
   pane is slightly translucent, so the theme bleeds through the tileset — the
   floor visibly re-tints when light/dark switches. Unpainted tile space (stages
   not yet published / beyond the arenas) reads as agar/deep fluid, not blank. */
.tdish-dish .leaflet-container {
    background: radial-gradient(circle at 50% 45%, #f6fbff 0%, #e8f0f8 55%, #d3deec 100%);
}
:root[data-mantine-color-scheme="dark"] .tdish-dish .leaflet-container {
    background: radial-gradient(circle at 50% 45%, #14202d 0%, #0c1520 55%, #070d15 100%);
}
.tdish-dish .leaflet-tile-pane {
    opacity: 0.84;
    transition: opacity 200ms ease;
}
:root[data-mantine-color-scheme="dark"] .tdish-dish .leaflet-tile-pane {
    opacity: 0.74;
}

/* in-game tileset floor (#pde-floor, under the arena svg): the world tab's own
   theme gradient is the backdrop — keep leaflet transparent and let the theme
   bleed through slightly-translucent tiles, same blend as the lab dish */
#pde-floor .leaflet-container { background: transparent; }
#pde-floor .leaflet-tile-pane {
    opacity: 0.8;
    transition: opacity 200ms ease;
}
:root[data-mantine-color-scheme="dark"] #pde-floor .leaflet-tile-pane {
    opacity: 0.7;
}

/* PhyloPic silhouettes are black artwork — recolour to white in dark mode so the
   console portrait and catalogue thumbnails stay visible. (On-dish specimen
   images are tinted per-species via an SVG filter, so they're unaffected.) */
:root[data-mantine-color-scheme="dark"] #petri-portrait,
:root[data-mantine-color-scheme="dark"] .petri-silhouette {
    filter: brightness(0) invert(1);
}

/* ---- Eyespot Lab: lootbox / splice reel ---- */
.eye-type-reel {
    text-align: center; padding: 8px; margin: 6px 0;
    border: 1px solid var(--mantine-color-default-border); border-radius: 10px;
    background: var(--mantine-color-default);
}
.eye-type-reel > div:last-child { font-family: monospace; font-weight: 800; font-size: 20px; letter-spacing: 2px; }
.eye-type-spin { color: var(--mantine-color-dimmed); opacity: 0.7; }
.eye-type-hit  { color: #3399ff; text-shadow: 0 0 10px rgba(51,153,255,0.6); }
.eye-type-miss { color: #e8590c; }

.eye-odds-row { display: flex; gap: 8px; margin: 8px 0; }
.eye-odd {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 4px; border: 2px solid var(--mantine-color-default-border);
    border-radius: 10px; transition: all 0.12s ease;
}
.eye-bar-track {
    width: 22px; height: 70px; border-radius: 6px;
    background: var(--mantine-color-default); display: flex; align-items: flex-end;
    overflow: hidden;
}
.eye-bar {
    width: 100%; height: 0%;
    background: linear-gradient(0deg, #3399ff, #8effb4);
    transition: height 0.25s ease;
}
.eye-odd.eye-hl {
    border-color: #ffd43b; transform: translateY(-3px) scale(1.04);
    box-shadow: 0 0 14px rgba(255,212,59,0.7);
}
.eye-odd.eye-win {
    border-color: #3399ff;
    box-shadow: 0 0 18px rgba(51,153,255,0.85);
    animation: eye-pop 0.5s ease;
}
@keyframes eye-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }

/* Code blocks */
:root[data-mantine-color-scheme="light"] pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

:root[data-mantine-color-scheme="dark"] pre {
    background-color: #1a1b1e;
    border: 1px solid #373a40;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

/* Code inside pre blocks */
:root[data-mantine-color-scheme="light"] pre code {
    background-color: transparent;
    padding: 0;
    color: #1a1b1e;
}

:root[data-mantine-color-scheme="dark"] pre code {
    background-color: transparent;
    padding: 0;
    color: #c1c2c5;
}

/* Sun icon rotation animations - direction based on scroll */
@keyframes rotate-sun-clockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-sun-counter-clockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

/* Clockwise rotation (scroll down) */
#light-theme-icon.rotating-down,
#light-theme-icon.rotating-down svg,
#light-theme-icon.rotating-down iconify-icon {
    animation: rotate-sun-clockwise 1.2s ease-out infinite;
    display: inline-block;
}

/* Counter-clockwise rotation (scroll up) */
#light-theme-icon.rotating-up,
#light-theme-icon.rotating-up svg,
#light-theme-icon.rotating-up iconify-icon {
    animation: rotate-sun-counter-clockwise 1.2s ease-out infinite;
    display: inline-block;
}

/* Smooth transition when stopping */
#light-theme-icon,
#light-theme-icon svg,
#light-theme-icon iconify-icon {
    transition: transform 0.3s ease-out;
    display: inline-block;
}

/* Typewriter cursor animation for Dash Docs title */
@keyframes blink-cursor {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Add blinking cursor while typing */
#dash-docs-title.typing::after {
    content: '▋';
    animation: blink-cursor 1s step-end infinite;
    margin-left: 2px;
    color: #03c7e5;
}

/* AG Grid Dark Mode Support */
/* Override AG Grid theme colors for dark mode */
:root[data-mantine-color-scheme="dark"] .ag-theme-alpine {
    /* Core background colors */
    --ag-background-color: #1a1b1e;
    --ag-foreground-color: #c1c2c5;
    --ag-border-color: #373a40;
    --ag-secondary-border-color: #2c2e33;

    /* Header colors */
    --ag-header-background-color: #25262b;
    --ag-header-foreground-color: #c1c2c5;

    /* Row colors */
    --ag-odd-row-background-color: #1a1b1e;
    --ag-row-hover-color: #25262b;
    --ag-selected-row-background-color: #373a40;

    /* Control panel (filters, pagination) */
    --ag-control-panel-background-color: #25262b;

    /* Input colors */
    --ag-input-border-color: #373a40;
    --ag-input-disabled-border-color: #2c2e33;
    --ag-input-disabled-background-color: #25262b;

    /* Pagination and widgets */
    --ag-disabled-foreground-color: #5c5f66;
    --ag-chip-background-color: #373a40;

    /* Hover and focus states */
    --ag-row-border-color: #2c2e33;
    --ag-cell-horizontal-border: solid #2c2e33;

    /* Filter colors */
    --ag-input-focus-border-color: #5c5f66;

    /* Icons */
    color-scheme: dark;
}

/* Light mode adjustments (ensure proper contrast) */
:root[data-mantine-color-scheme="light"] .ag-theme-alpine {
    --ag-background-color: #ffffff;
    --ag-foreground-color: #1a1b1e;
    --ag-border-color: #dee2e6;
    --ag-header-background-color: #f8f9fa;
    --ag-row-hover-color: #f1f3f5;
}

/* Custom AG Grid Cell Styling - Light Mode */
:root[data-mantine-color-scheme="light"] .ag-theme-alpine .timestamp-cell {
    font-family: monospace;
    font-size: 14px;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .bot-type-cell {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .bot-training {
    background-color: #ffe0e0;
    color: #c92a2a;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .bot-search {
    background-color: #d0ebff;
    color: #1971c2;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .bot-traditional {
    background-color: #d3f9d8;
    color: #2f9e44;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .bot-unknown {
    background-color: #f1f3f5;
    color: #868e96;
    font-weight: 400;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .page-cell {
    font-family: monospace;
    font-size: 12px;
    background-color: #f8f9fa;
    padding: 4px 6px;
    border-radius: 4px;
}

:root[data-mantine-color-scheme="light"] .ag-theme-alpine .user-agent-cell {
    font-size: 12px;
    color: #868e96;
}

/* Custom AG Grid Cell Styling - Dark Mode */
:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .timestamp-cell {
    font-family: monospace;
    font-size: 14px;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .bot-type-cell {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .bot-training {
    background-color: #5c1414;
    color: #ffa8a8;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .bot-search {
    background-color: #1c3d5a;
    color: #74c0fc;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .bot-traditional {
    background-color: #1b4332;
    color: #8ce99a;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .bot-unknown {
    background-color: #373a40;
    color: #909296;
    font-weight: 400;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .page-cell {
    font-family: monospace;
    font-size: 12px;
    background-color: #25262b;
    padding: 4px 6px;
    border-radius: 4px;
}

:root[data-mantine-color-scheme="dark"] .ag-theme-alpine .user-agent-cell {
    font-size: 12px;
    color: #909296;
}

/* ------------------------------------------------------------------------- */
/* dash-mui-scheduler docs tweaks                                            */
/* ------------------------------------------------------------------------- */

/* Align the scheduler's desktop event drawer with the navbar: inset it below
   the 70px AppShell header (consumed by the component's injected drawer CSS). */
:root {
    --dms-dialog-top-offset: 70px;
}

/* Keep the auto-generated `.. kwargs::` props tables from breaking the layout
   on small screens — long rows scroll horizontally inside their own box. */
.m2d-kwargs-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile: never let the page itself scroll horizontally. Wide content (props
   tables, code blocks) scrolls inside its own container instead. */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }
    .mantine-CodeHighlight-root,
    .mantine-CodeHighlight-pre,
    pre {
        max-width: 100%;
    }
}

/* Radar navigation game joystick (docs/radar) */
.radar-joystick-ctrl {
    background: radial-gradient(circle at 35% 30%, #7dffb4, #1f9d5b) !important;
    border: 1px solid rgba(57, 255, 153, 0.7) !important;
    box-shadow: 0 0 14px rgba(57, 255, 153, 0.55) !important;
}

/* Microscope stage-control knob (docs/petri_dish) — brass mechanical knob */
.petri-stage-ctrl {
    background: radial-gradient(circle at 35% 30%, #e9d8a6, #9c7b3a) !important;
    border: 1px solid rgba(120, 92, 40, 0.7) !important;
    box-shadow: 0 0 12px rgba(180, 140, 70, 0.5), inset 0 -2px 6px rgba(80, 58, 20, 0.5) !important;
}

/* PhyloPic catalogue thumbnails (docs/silhouette_tracer) */
.pp-thumb { transition: border-color 120ms ease, transform 120ms ease; }
.pp-thumb:hover {
    border-color: #3399ff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(51, 153, 255, 0.18);
}
:root[data-mantine-color-scheme="dark"] .pp-thumb img { filter: invert(1) brightness(1.6); }
/* ===================================================================== */
/*  /petri-dish-evolution — full-bleed flexlayout-dash game shell        */
/*  Negative margins cancel the AppShell `padding="xl"` (the Mantine      */
/*  --app-shell-padding var) so the dfl sits flush to the header + nav.   */
/* ===================================================================== */
.pde-fullbleed {
    margin: calc(var(--app-shell-padding, 2rem) * -1);
    height: calc(100vh - 70px);
    overflow: hidden;
    position: relative;
}
.pde-fullbleed > .dash-flex-layout,
.pde-fullbleed .dash-dock-container {
    position: relative;
    width: 100%;
    height: 100%;
}
/* The game drives tab selection (DNA milestone → ⚡ Evolve; Equip → World) by
   clicking the flexlayout tab button from JS — the slim strip stays visible so
   the two surfaces read clearly while staying flush to the header/navbar. */
.pde-fullbleed .flexlayout__tabset { border: none !important; }
.pde-fullbleed .flexlayout__tab { overflow: hidden; }

/* ADAPT drawer: fill the available height (mantine's content sizing otherwise
   leaves a short, vertically-centered panel). Mobile = 88vh bottom sheet; md-xl =
   flush from the 70px header to the bottom. The responsive callback sets which
   edge it pulls from; this just guarantees the height. */
.pde-adapt-content { height: 88vh !important; align-self: stretch !important; margin: 0 !important; }
@media (min-width: 768px) {
    .pde-adapt-content { height: calc(100vh - 70px) !important; }
}

/* HUD: pulse the Adapt button when a DNA milestone is reached ("you can evolve now").
   Milestones no longer pause the game, so this glow is the cue (toggled in the loop cb). */
.pde-can-evolve { animation: pde-evolve-pulse 1.1s ease-in-out infinite; border-radius: 8px; }
@keyframes pde-evolve-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(51, 153, 255, 0); }
    50%      { box-shadow: 0 0 0 4px rgba(51, 153, 255, 0.5); }
}

/* ---------------- accessibility (2026-06-09 a11y pass) ---------------- */
/* visually-hidden (screen-reader-only) utility — the game page h1 uses this */
.pde-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* WCAG AA contrast: Mantine's light-mode dimmed gray (#868e96 = 3.32:1 on white)
   fails AA for normal text — darken the dimmed var in the light scheme only
   (dark-scheme dimmed is fine). Lifts every c="dimmed" Text app-wide. */
:root[data-mantine-color-scheme="light"] { --mantine-color-dimmed: #5a646e; }

/* brand #3399ff on white = 2.94:1 — darken the header title in light scheme */
:root[data-mantine-color-scheme="light"] #dash-docs-title { color: #1971c2 !important; }

/* game HUD variant="light" buttons measured 2.3-3.2:1 in light scheme — darken
   the label color only (backgrounds/sizes unchanged; dark scheme already passes) */
:root[data-mantine-color-scheme="light"] #pde-view-toggle  { color: #066649 !important; }
:root[data-mantine-color-scheme="light"] #pde-pause-toggle { color: #a33800 !important; }
:root[data-mantine-color-scheme="light"] #pde-speed-toggle { color: #1864ab !important; }
:root[data-mantine-color-scheme="light"] #pde-export-btn   { color: #862e9c !important; }

/* keyboard affordance for the dfl tab buttons (made focusable by assets/a11y.js) */
.flexlayout__tab_button:focus-visible {
    outline: 2px solid #3399ff; outline-offset: -2px; border-radius: 4px;
}

/* a11y round-2 (adversarial review): remaining light-scheme AA failures */
:root[data-mantine-color-scheme="light"] #pde-ai-toggle { color: #364fc7 !important; }
/* lifts ALL gray variant="light" badges (backend badge, strategy badges) to ~7.4:1 */
:root[data-mantine-color-scheme="light"] { --mantine-color-gray-light-color: var(--mantine-color-gray-7); }

/* skip link — first tab stop, visible only on focus (57 stops precede game content) */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 9999;
    background: #1971c2; color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0;
    font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ================= 2plot.ai Petri Dish — home page (2026-06-09 rebrand) ===== */
.home-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--mantine-radius-lg);
    min-height: 480px;
    isolation: isolate;
    padding: clamp(20px, 4vw, 48px);
    display: flex;
    align-items: center;
    border: 1px solid light-dark(rgba(51, 142, 234, 0.22), rgba(153, 170, 255, 0.14));
    background: radial-gradient(circle at 60% 42%,
        light-dark(#eef5ff, #0a1018) 0%,
        light-dark(#dbe8f7, #05080d) 78%);
}
.home-hero-dish { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.home-cell {
    position: absolute;
    object-fit: contain;
    animation: home-drift 14s ease-in-out infinite;
}
/* PhyloPic specimen art is solid BLACK — invert to white in dark mode so the
   hero animation reads. (light-dark() can't be used here: it's a <color>-only
   function, invalid inside filter:, and the whole declaration gets dropped.) */
:root[data-mantine-color-scheme="dark"] .home-cell {
    filter: brightness(0) invert(0.92);
}
@keyframes home-drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%      { transform: translate(14px, -18px) rotate(8deg); }
    50%      { transform: translate(-10px, -6px) rotate(-6deg); }
    75%      { transform: translate(8px, 14px) rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
    .home-cell { animation: none; }
}
.home-hero-scrim {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--mantine-color-body) 86%, transparent) 0%,
        color-mix(in srgb, var(--mantine-color-body) 62%, transparent) 48%,
        color-mix(in srgb, var(--mantine-color-body) 18%, transparent) 100%);
}
.home-hero-content { position: relative; z-index: 2; width: 100%; }
.home-glass {
    background: color-mix(in srgb, var(--mantine-color-body) 72%, transparent) !important;
    backdrop-filter: blur(6px);
}
.home-feature-card {
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.home-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--mantine-color-brand-5);
    box-shadow: var(--mantine-shadow-sm);
}
.home-jump-link {
    display: block;
    padding: 6px 8px;
    border-radius: var(--mantine-radius-sm);
    transition: background-color 120ms ease;
}
.home-jump-link:hover { background-color: var(--mantine-color-default-hover); }

/* --- Explore cards: faint drifting specimen vignette (same drift as the hero,
       slower; brightens a touch on hover). Decorative — copy stays on top. --- */
.home-feature-card { position: relative; overflow: hidden; }
.home-card-cell {
    position: absolute;
    right: -14px;
    bottom: -16px;
    width: 112px;
    height: 112px;
    object-fit: contain;
    opacity: 0.10;
    pointer-events: none;
    animation: home-drift 18s ease-in-out infinite;
    transition: opacity 150ms ease;
}
:root[data-mantine-color-scheme="dark"] .home-card-cell {
    filter: brightness(0) invert(0.92);
    opacity: 0.14;
}
.home-feature-card:hover .home-card-cell { opacity: 0.22; }

/* --- "How a run works": a second, fainter ambient band — drifting plankton
       motes behind glass step cards (the hero's quieter echo) --- */
.home-loop-band {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: var(--mantine-radius-lg);
    border: 1px solid light-dark(rgba(51, 142, 234, 0.16), rgba(153, 170, 255, 0.10));
    background: radial-gradient(circle at 28% 18%,
        light-dark(#f2f8ff, #0a1018) 0%,
        light-dark(#e6effb, #06090e) 82%);
    padding: clamp(16px, 3vw, 36px);
}
.home-loop-content { position: relative; z-index: 1; }
.home-plankton {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle,
        light-dark(rgba(51, 153, 255, 0.55), rgba(130, 188, 255, 0.5)) 0%,
        transparent 72%);
    animation: home-plankton 26s ease-in-out infinite;
}
@keyframes home-plankton {
    0%, 100% { transform: translate(0, 0); }
    33%      { transform: translate(20px, -26px); }
    66%      { transform: translate(-16px, 14px); }
}
.home-loop-art {
    display: block;
    width: 100%;
    height: 84px;
    object-fit: contain;
}
@media (prefers-reduced-motion: reduce) {
    .home-card-cell, .home-plankton { animation: none; }
}

/* Match-report specimen sprites: black PhyloPic art → white in dark mode.
   !important: the inline drop-shadow filter would otherwise win over this class.
   (Gemini data-URI sprites are colored — the Python side skips the class for those.) */
:root[data-mantine-color-scheme="dark"] .pde-specimen-sprite {
    filter: brightness(0) invert(0.92) drop-shadow(0 0 8px rgba(255, 255, 255, 0.12)) !important;
}

/* 🏆 Match report: sections fade in when the server callback replaces the
   content (pairs with the dcc.Loading skeleton in _report_tab) */
#pde-report-content > * { animation: pde-report-fadein 0.5s ease both; }
@keyframes pde-report-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    #pde-report-content > * { animation: none; }
}
