/* ==========================================
   KNOWLEDGE PATH SYSTEM — GOD MODE V2
   ==========================================
   Enhancements over V1:
   1.  @property for animatable gradient vars
   2.  #pathView: layered grid + radial vignette + accent glow
   3.  path-card: multi-layer shadow, glass inset, stagger entry anim
   4.  path-card::before: prismatic 3-color bar instead of flat accent
   5.  path-card::after: corner notch refined with glow + scale anim
   6.  path-card hover: deep lift shadow with accent bloom
   7.  badge: pill shape, glow ring, tabular-nums
   8.  path-start btn: gradient fill, shimmer sweep, spring active
   9.  Timeline: spine connector line with gradient + travel dot
   10. path-step: glass card with left rail glow, spring hover
   11. step-index: gradient fill, glow ring, spring scale hover
   12. step-open: refined ghost→fill transition with glow
   13. path-view-title: gradient separator rule + reveal animation
   14. Dark mode: comprehensive obsidian overrides for all surfaces
   15. Mobile: refined breakpoints, safe insets, touch targets
   ========================================== */

/* ==========================================
   @PROPERTY — Animatable custom properties
   ========================================== */
@property --path-shimmer {
  syntax: '<percentage>';
  inherits: false;
  initial-value: -120%;
}

@property --card-glow-opacity {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

/* ==========================================
   KEYFRAMES
   ========================================== */
@keyframes pathCardEntry {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pathStepEntry {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pathViewReveal {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmerSweep {
    from { left: -120%; }
    to   { left: 180%; }
}

@keyframes spineTravel {
    0%   { top: 0%;   opacity: 0; transform: translateX(-50%) scale(0.5); }
    6%   { opacity: 1; transform: translateX(-50%) scale(1); }
    93%  { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { top: 100%; opacity: 0; transform: translateX(-50%) scale(0.5); }
}

@keyframes spinePulse {
    0%, 100% { opacity: 0.22; }
    50%       { opacity: 0.55; }
}

@keyframes indexPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.22); }
    100% { transform: scale(1.12); }
}

@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
    50%       { box-shadow: 0 0 10px 2px rgba(99, 102, 241, 0.18); }
}

@keyframes cardBarReveal {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}

/* ==========================================
   1. CONTAINER
   ========================================== */
#pathView {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 65;
    background: var(--bg-primary);
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    scroll-behavior: smooth;

    /* Layered grid: radial vignette + major + minor lines */
    background-image:
        /* Depth vignette */
        radial-gradient(ellipse 90% 70% at 50% 50%, transparent 40%, rgba(0,0,0,0.022) 100%),
        /* Accent-tinted major grid */
        linear-gradient(rgba(var(--accent-primary-rgb, 8,145,178), 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-primary-rgb, 8,145,178), 0.04) 1px, transparent 1px),
        /* Neutral minor grid */
        linear-gradient(rgba(0, 0, 0, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.018) 1px, transparent 1px);
    background-size:
        100% 100%,
        120px 120px,
        120px 120px,
        30px 30px,
        30px 30px;

    box-shadow: inset 0 0 100px rgba(var(--accent-primary-rgb, 8,145,178), 0.025);
}

#pathView::-webkit-scrollbar { width: 5px; }
#pathView::-webkit-scrollbar-track { background: transparent; }
#pathView::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--border-medium), var(--border-light));
    border-radius: 9999px;
    background-clip: content-box;
}
#pathView::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--border-dark), var(--border-medium));
    background-clip: content-box;
}

/* ==========================================
   2. GALLERY GRID
   ========================================== */
.path-gallery {
    display: grid;
    font-family: var(--font-family);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 24px 20px 60px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* ==========================================
   3. CARD DESIGN — Prismatic lift card
   ========================================== */
.path-card {
    background: var(--bg-secondary, #fff);
    border: 1.5px solid var(--border-light);
    border-radius: 18px;
    padding: 26px;
    cursor: pointer;
    transition:
        transform 0.32s cubic-bezier(0.25, 1, 0.5, 1),
        box-shadow 0.32s ease,
        border-color 0.22s ease,
        background 0.22s ease;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.04),
        0 4px 10px rgba(0,0,0,0.05),
        inset 0 1px 0 rgba(255,255,255,0.8);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    isolation: isolate;

    /* Stagger entry animation */
    opacity: 0;
    animation: pathCardEntry 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.path-card:nth-child(1) { animation-delay: 0.05s; }
.path-card:nth-child(2) { animation-delay: 0.10s; }
.path-card:nth-child(3) { animation-delay: 0.15s; }
.path-card:nth-child(4) { animation-delay: 0.20s; }
.path-card:nth-child(5) { animation-delay: 0.25s; }
.path-card:nth-child(6) { animation-delay: 0.30s; }
.path-card:nth-child(7) { animation-delay: 0.35s; }
.path-card:nth-child(8) { animation-delay: 0.40s; }

/* Glass highlight overlay */
.path-card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(255,255,255,0.5) 0%,
        rgba(255,255,255,0.1) 30%,
        transparent 55%
    );
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
    transition: opacity var(--transition-base, 200ms ease);
}

/* Shimmer sweep pseudo — fires on hover */
.path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255,255,255,0.5) 50%,
        transparent 80%
    );
    transform: skewX(-18deg);
    pointer-events: none;
    z-index: 2;
    transition: left 0s;
}

.path-card:hover::before {
    animation: shimmerSweep 0.65s ease forwards;
}

/* Prismatic top accent bar */
.path-card-bar {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(
        90deg,
        var(--accent-primary, #0891b2) 0%,
        var(--accent-secondary, #6366f1) 55%,
        var(--accent-tertiary, #8b5cf6) 100%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.36s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
    z-index: 3;
}

.path-card:hover .path-card-bar { transform: scaleX(1); }

/* Corner tech notch */
.path-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 22px; height: 22px;
    border-top: 2.5px solid rgba(var(--accent-secondary-rgb, 99,102,241), 0.55);
    border-right: 2.5px solid rgba(var(--accent-secondary-rgb, 99,102,241), 0.55);
    border-top-right-radius: 18px;
    opacity: 0;
    transition:
        opacity 0.24s ease,
        transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.24s ease;
    transform: scale(0.5) translate(4px, -4px);
    pointer-events: none;
    z-index: 3;
}

.path-card:hover::after {
    opacity: 1;
    transform: scale(1) translate(0, 0);
    box-shadow: 4px -4px 12px rgba(var(--accent-secondary-rgb, 99,102,241), 0.2);
}

.path-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--accent-secondary-rgb, 99,102,241), 0.3);
    box-shadow:
        0 20px 48px rgba(var(--accent-secondary-rgb, 99,102,241), 0.14),
        0 8px 16px rgba(0,0,0,0.06),
        0 0 0 1px rgba(var(--accent-secondary-rgb, 99,102,241), 0.1),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

.path-card:active { transform: translateY(-3px); }

.path-card:focus-visible {
    outline: 2px solid var(--accent-secondary, #6366f1);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(var(--accent-secondary-rgb, 99,102,241), 0.14);
}

/* ==========================================
   4. TYPOGRAPHY
   ========================================== */
.path-title {
    font-size: clamp(1.05rem, 2.5vw, 1.2rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.028em;
    line-height: 1.25;
    position: relative;
    z-index: 4;
}

.path-desc {
    font-size: clamp(0.82rem, 1.2vw, 0.92rem);
    color: var(--text-tertiary);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 4;
}

.path-meta {
    align-self: flex-end;
    margin-bottom: 6px;
    position: relative;
    z-index: 4;
}

/* Badge — pill chip */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent-secondary, #6366f1);
    padding: 4px 11px;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    font-variant-numeric: tabular-nums;
    transition:
        background var(--transition-fast, 120ms ease),
        box-shadow var(--transition-fast, 120ms ease);
    animation: badgeGlow 3s ease-in-out infinite;
}

.badge::before {
    content: '';
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent-secondary, #6366f1);
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.65);
    flex-shrink: 0;
}

.path-card:hover .badge {
    background: rgba(99, 102, 241, 0.13);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.18);
}

/* Start button — gradient fill with shimmer */
.path-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 9999px;
    border: none;
    background: linear-gradient(
        135deg,
        var(--accent-secondary, #6366f1) 0%,
        color-mix(in srgb, var(--accent-secondary, #6366f1) 80%, var(--accent-tertiary, #8b5cf6)) 100%
    );
    color: white;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        transform var(--transition-fast, 120ms ease),
        box-shadow var(--transition-fast, 120ms ease);
    box-shadow:
        0 2px 8px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    z-index: 4;
}

.path-start::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 55%;
    height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.4) 50%, transparent 80%);
    transform: skewX(-18deg);
    pointer-events: none;
    transition: left 0s;
}

.path-start:hover::before {
    animation: shimmerSweep 0.6s ease forwards;
}

.path-start:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 18px rgba(99, 102, 241, 0.42),
        inset 0 1px 0 rgba(255,255,255,0.25);
}

.path-start:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ==========================================
   5. PATH VIEWER — Title bar
   ========================================== */
.path-view-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 820px;
    margin: 0 auto 32px;
    padding: 0 20px 24px;
    position: relative;
    animation: pathViewReveal 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Gradient separator rule */
.path-view-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(
        90deg,
        var(--accent-secondary, #6366f1) 0%,
        var(--accent-primary, #0891b2) 40%,
        rgba(var(--accent-tertiary-rgb, 139,92,246), 0.35) 70%,
        transparent 90%
    );
    transform-origin: left center;
    animation: cardBarReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

/* Ambient glow under rule */
.path-view-title::before {
    content: '';
    position: absolute;
    bottom: -3px; left: 20px;
    width: 50%; height: 6px;
    background: radial-gradient(
        ellipse at left,
        rgba(var(--accent-secondary-rgb, 99,102,241), 0.16),
        transparent 75%
    );
    filter: blur(4px);
    pointer-events: none;
}

/* ==========================================
   6. TIMELINE — Spine + steps
   ========================================== */
.path-steps-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px 80px;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

/* Animated spine line */
.path-steps-container::before {
    content: '';
    position: absolute;
    top: 16px; bottom: 16px;
    left: calc(20px + 16px); /* align to center of step-index */
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--accent-secondary, #6366f1) 8%,
        var(--accent-primary, #0891b2) 50%,
        rgba(var(--accent-tertiary-rgb, 139,92,246), 0.6) 85%,
        transparent 100%
    );
    border-radius: 9999px;
    animation: spinePulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Travelling dot on spine */
.path-steps-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: calc(20px + 16px - 4px); /* center on spine */
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-secondary, #6366f1);
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.18),
        0 0 12px rgba(99, 102, 241, 0.7),
        0 0 24px rgba(99, 102, 241, 0.3);
    animation: spineTravel 3.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================
   7. TIMELINE STEP — Glass card with rail
   ========================================== */
.path-step {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    background: var(--bg-secondary, #fff);
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    border-left: 3.5px solid var(--accent-secondary, #6366f1);
    transition:
        transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.25s ease,
        border-color 0.2s ease,
        background 0.2s ease;
    position: relative;
    z-index: 2;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 4px 8px rgba(0,0,0,0.04),
        inset 0 1px 0 rgba(255,255,255,0.7);
    margin-bottom: 16px;
    /* Stagger entry */
    opacity: 0;
    animation: pathStepEntry 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.path-step:nth-child(1)  { animation-delay: 0.06s; }
.path-step:nth-child(2)  { animation-delay: 0.12s; }
.path-step:nth-child(3)  { animation-delay: 0.18s; }
.path-step:nth-child(4)  { animation-delay: 0.24s; }
.path-step:nth-child(5)  { animation-delay: 0.30s; }
.path-step:nth-child(6)  { animation-delay: 0.36s; }
.path-step:nth-child(7)  { animation-delay: 0.42s; }
.path-step:nth-child(8)  { animation-delay: 0.48s; }
.path-step:nth-child(9)  { animation-delay: 0.54s; }
.path-step:nth-child(10) { animation-delay: 0.60s; }

/* Left rail glow on hover */
.path-step::before {
    content: '';
    position: absolute;
    left: -3.5px; top: 15%; bottom: 15%;
    width: 3.5px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(
        to bottom,
        var(--accent-secondary, #6366f1),
        var(--accent-primary, #0891b2)
    );
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    transition: box-shadow 0.25s ease;
    pointer-events: none;
    border-radius: 0 2px 2px 0;
}

.path-step:hover::before {
    box-shadow: -4px 0 14px rgba(99, 102, 241, 0.45);
}

/* Inner ambient glow on hover */
.path-step::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        to right,
        rgba(99, 102, 241, 0.04) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity var(--transition-fast, 120ms ease);
    pointer-events: none;
}

.path-step:hover::after { opacity: 1; }

.path-step:hover {
    border-color: rgba(var(--accent-secondary-rgb, 99,102,241), 0.45);
    transform: translateX(5px);
    box-shadow:
        0 6px 20px rgba(var(--accent-secondary-rgb, 99,102,241), 0.12),
        0 2px 6px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.8);
    background: var(--bg-secondary, #fff);
}

.path-step:last-child { margin-bottom: 0; }

/* ==========================================
   8. STEP INDEX — Gradient orb
   ========================================== */
.step-index {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--accent-secondary, #6366f1) 0%,
        color-mix(in srgb, var(--accent-secondary, #6366f1) 70%, var(--accent-primary, #0891b2)) 100%
    );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.15),
        0 0 12px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.25);
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease;
    position: relative;
    z-index: 3;
    /* Shine overlay */
    overflow: hidden;
}

.step-index::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.28) 0%, transparent 55%);
    pointer-events: none;
    border-radius: 50%;
}

.path-step:hover .step-index {
    animation: indexPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.22),
        0 0 20px rgba(99, 102, 241, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Step name */
.step-name {
    flex: 1;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.012em;
    line-height: 1.35;
    position: relative;
    z-index: 3;
}

/* ==========================================
   9. STEP OPEN BUTTON — Ghost→fill
   ========================================== */
.step-open {
    padding: 7px 15px;
    border-radius: 9999px;
    border: 1.5px solid var(--border-medium);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    transition:
        background var(--transition-fast, 120ms ease),
        color var(--transition-fast, 120ms ease),
        border-color var(--transition-fast, 120ms ease),
        transform var(--transition-fast, 120ms ease),
        box-shadow var(--transition-fast, 120ms ease);
    flex-shrink: 0;
    position: relative;
    z-index: 3;
    -webkit-tap-highlight-color: transparent;
}

.step-open:hover {
    background: linear-gradient(
        135deg,
        var(--accent-secondary, #6366f1) 0%,
        color-mix(in srgb, var(--accent-secondary, #6366f1) 80%, var(--accent-primary, #0891b2)) 100%
    );
    color: white;
    border-color: transparent;
    transform: scale(1.04);
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.38),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.step-open:active {
    transform: scale(0.97);
    box-shadow: 0 1px 6px rgba(99, 102, 241, 0.25);
}

.step-open:focus-visible {
    outline: 2px solid var(--accent-secondary, #6366f1);
    outline-offset: 2px;
}

/* ==========================================
   10. DARK MODE — Obsidian overrides
   ========================================== */
[data-theme="dark"] #pathView {
    background-image:
        radial-gradient(ellipse 90% 70% at 50% 50%, transparent 40%, rgba(0,0,0,0.2) 100%),
        linear-gradient(rgba(var(--accent-primary-rgb, 8,145,178), 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-primary-rgb, 8,145,178), 0.07) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size:
        100% 100%,
        120px 120px,
        120px 120px,
        30px 30px,
        30px 30px;
    box-shadow: inset 0 0 100px rgba(var(--accent-secondary-rgb, 99,102,241), 0.04);
}

[data-theme="dark"] .path-card {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    box-shadow:
        0 1px 2px rgba(0,0,0,0.5),
        0 4px 12px rgba(0,0,0,0.35),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

[data-theme="dark"] .path-card:hover {
    border-color: rgba(var(--accent-secondary-rgb, 99,102,241), 0.35);
    background: var(--bg-tertiary);
    box-shadow:
        0 20px 48px rgba(var(--accent-secondary-rgb, 99,102,241), 0.18),
        0 8px 16px rgba(0,0,0,0.45),
        0 0 0 1px rgba(var(--accent-secondary-rgb, 99,102,241), 0.12);
}

[data-theme="dark"] .path-card-shine { display: none; }

[data-theme="dark"] .path-title { color: var(--text-primary); }
[data-theme="dark"] .path-desc  { color: var(--text-tertiary); }

[data-theme="dark"] .badge {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .path-start {
    box-shadow:
        0 2px 10px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.12);
}
[data-theme="dark"] .path-start:hover {
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.52),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

[data-theme="dark"] .path-step {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    border-left-color: rgba(var(--accent-secondary-rgb, 99,102,241), 0.55);
    box-shadow:
        0 1px 3px rgba(0,0,0,0.5),
        0 4px 10px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.03);
}

[data-theme="dark"] .path-step:hover {
    background: var(--bg-tertiary);
    border-color: rgba(var(--accent-secondary-rgb, 99,102,241), 0.4);
    box-shadow:
        0 8px 24px rgba(var(--accent-secondary-rgb, 99,102,241), 0.2),
        0 2px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.03);
}

[data-theme="dark"] .step-index {
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.22),
        0 0 18px rgba(99, 102, 241, 0.55),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

[data-theme="dark"] .path-step:hover .step-index {
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.3),
        0 0 28px rgba(99, 102, 241, 0.75),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

[data-theme="dark"] .step-name { color: var(--text-primary); }

[data-theme="dark"] .step-open {
    border-color: var(--border-dark);
    color: var(--text-tertiary);
}
[data-theme="dark"] .step-open:hover {
    box-shadow:
        0 4px 16px rgba(99, 102, 241, 0.45),
        inset 0 1px 0 rgba(255,255,255,0.12);
}

[data-theme="dark"] .path-view-title::after { opacity: 0.72; }
[data-theme="dark"] .path-view-title::before { opacity: 0.55; }

[data-theme="dark"] .path-steps-container::before { opacity: 0.5; }
[data-theme="dark"] .path-steps-container::after {
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.25),
        0 0 20px rgba(99, 102, 241, 0.85),
        0 0 40px rgba(99, 102, 241, 0.4);
}

/* ==========================================
   11. MOBILE — Responsive breakpoints
   ========================================== */
@media (max-width: 768px) {
    #pathView { z-index: 200; }

    .path-gallery {
        grid-template-columns: 1fr;
        padding: 16px 16px 60px;
        gap: 14px;
    }

    .path-card {
        flex-direction: row;
        align-items: center;
        height: auto;
        padding: 16px 18px;
        gap: 14px;
        border-radius: 14px;
    }

    .path-desc { display: none; margin-bottom: 0; }
    .path-meta { display: none; }
    .path-title { font-size: 0.95rem; margin-bottom: 0; }

    .path-start {
        margin-left: auto;
        padding: 8px 16px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }

    .path-view-title {
        padding: 0 16px 20px;
        margin-bottom: 20px;
    }

    .path-steps-container {
        padding: 0 16px 60px;
    }

    /* Spine aligns to mobile index size */
    .path-steps-container::before {
        left: calc(16px + 14px);
    }
    .path-steps-container::after {
        left: calc(16px + 14px - 4px);
    }

    .path-step {
        padding: 14px 16px;
        gap: 14px;
        border-radius: 12px;
        margin-bottom: 14px;
    }

    .step-index {
        width: 28px; height: 28px;
        font-size: 0.78rem;
    }

    .step-name { font-size: 0.9rem; }

    .step-open {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    /* Ensure minimum 44px touch targets */
    .path-start,
    .step-open {
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .path-card { padding: 14px 16px; }
    .path-title { font-size: 0.88rem; }
    .step-name { font-size: 0.85rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .path-card,
    .path-step,
    .step-index,
    .badge {
        animation: none !important;
        opacity: 1 !important;
    }
    .path-steps-container::before,
    .path-steps-container::after {
        animation: none !important;
    }
}
