/* ==========================================================================
   onboarding.css - Production styles for the First Voyage onboarding module
   Prefix: ob- (onboarding)
   Derived from fv-lab.css Labs 08, 09, 10, 11
   ========================================================================== */

/* ── Container ─────────────────────────────────────────────────────────── */
.ob-module {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(197, 160, 89, 0.25);
    outline: 1px solid rgba(197, 160, 89, 0.08);
    outline-offset: 4px;
    position: relative;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    color: var(--text-primary);
    container-type: inline-size;
    container-name: ob-panel;
    margin-bottom: var(--space-lg);
}
.ob-module::before,
.ob-module::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: rgba(197, 160, 89, 0.35);
    border-style: solid;
}
.ob-module::before {
    top: -2px;
    left: -2px;
    border-width: 1px 0 0 1px;
}
.ob-module::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 1px 1px 0;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.ob-header {
    padding: var(--space-lg);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
}
.ob-header > div:first-child {
    min-width: 0;
    flex: 1;
}
.ob-title {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: var(--font-size-2xl);
    margin: 0 0 2px;
}
.ob-subtitle {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    font-style: italic;
    margin: 0;
}
.ob-arc-counter {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── Header left column - allow shrink on wide viewports ───────────── */
.ob-header > div:first-child {
    min-width: 0;
    flex: 1;
}

/* ── Two-column layout ────────────────────────────────────────────────── */
.ob-cols {
    display: flex;
    gap: 0;
    background: rgba(197, 160, 89, 0.045);
    border: 1px solid rgba(197, 160, 89, 0.22);
    border-left: none;
    border-right: none;
    border-bottom: none;
    overflow: hidden;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.ob-left {
    flex: 1;
    min-width: 0;
    padding: var(--space-lg);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.ob-right {
    width: 280px;
    flex-shrink: 0;
    padding: var(--space-lg);
}

/* ── Step detail card ─────────────────────────────────────────────────── */
.ob-move-label {
    font-size: var(--font-size-sm);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}
.ob-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: var(--space-lg) var(--space-md);
}
.ob-card-name {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.ob-card-desc {
    font-size: var(--font-size-md);
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.5;
}
.ob-cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}
.ob-cta-row .mkt-detail-cta {
    width: auto;
    min-width: 202px;
    text-decoration: none;
    text-align: center;
}
.dispatch-vision-img {
    width: 100%;
    margin-top: 0;
    margin-bottom: 4rem;
    display: block;
}
.ob-place {
}
.ob-place--clickable {
    border-bottom: 1px solid #897041;
    padding-bottom: 1px;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}
.ob-place--clickable:hover {
    color: var(--gold, #e3c47a);
    border-bottom-color: var(--gold, #e3c47a);
}

/* ── Why This Matters ─────────────────────────────────────────────────── */
.ob-why-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 15px 0 15px 0;
}
.ob-why-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Section label ────────────────────────────────────────────────────── */
.ob-section-label {
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

/* ── Location + progress row ──────────────────────────────────────────── */
.ob-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
}
.ob-location {
    font-size: var(--font-size-sm);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ob-progress-text {
    font-size: var(--font-size-sm);
    letter-spacing: 0.14em;
    color: var(--text-muted);
}
.ob-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: var(--space-sm);
}
.ob-progress-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.ob-next-line {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 20px;
}
.ob-next-line strong {
    color: var(--text-secondary);
}

/* ── Path label ───────────────────────────────────────────────────────── */
.ob-path-label {
    font-size: var(--font-size-sm);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 var(--space-lg) 0;
}

/* ── State variants ───────────────────────────────────────────────────── */
.ob-selected {
    background: rgba(197, 160, 89, 0.06);
    border-left-color: var(--gold) !important;
}
.fv-step--future.ob-selected {
    border-left-color: #50493b !important;
}
.fv-step--done.ob-selected {
    border-left-color: #305c46 !important;
}
.ob-muted {
    opacity: 0.45;
}
.ob-preview-banner {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 7px;
    font-style: italic;
}
.ob-preview-banner strong {
    color: var(--gold);
    font-style: normal;
    margin-left: 1px;
}
.ob-card--preview {
    border-color: rgba(255, 255, 255, 0.04);
}
.ob-bar--preview {
    background: rgba(255, 255, 255, 0.04);
}
.ob-label--preview {
    color: var(--text-muted);
    opacity: 0.6;
}
.ob-label--complete {
    color: rgba(80, 200, 160, 0.7);
}
.ob-card--complete {
    border-color: rgba(80, 200, 160, 0.15);
}
.ob-completed-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(80, 200, 160, 0.85);
    background: rgba(80, 200, 160, 0.08);
    border: 1px solid rgba(80, 200, 160, 0.2);
    border-radius: 3px;
    padding: 2px 8px;
    margin-bottom: var(--space-sm);
}
.ob-fill--complete {
    background: rgba(80, 200, 160, 0.65);
}

/* ── Step marker overrides (inside .ob-module) ────────────────────────── */
.ob-module .fv-step-label {
    font-size: var(--font-size-base);
}
.ob-module .fv-step-sublabel {
    font-size: var(--font-size-base);
}
.ob-module .fv-step--future .fv-step-marker,
.ob-module .fv-step--future .fv-step-label,
.ob-module .fv-step--future .fv-step-sublabel {
    opacity: 0.5;
}
.ob-module .fv-step--done .fv-step-marker {
    background: rgb(92 197 89 / 15%);
    border-color: rgb(89 197 104 / 40%);
    color: rgb(89 197 144 / 90%);
}
.ob-module .fv-step-marker-icon {
    display: block;
    width: 12px;
    height: 12px;
}

/* ── Arc Complete state ───────────────────────────────────────────────── */
.ob-arc-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(197, 160, 89, 0.9);
    background: rgba(197, 160, 89, 0.06);
    border: 1px solid rgba(197, 160, 89, 0.25);
    border-radius: 3px;
    padding: 3px 10px;
    margin-bottom: var(--space-md);
}
.ob-congrats {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}
.ob-summary {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.ob-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: var(--space-md) 0;
}
.ob-rewards {
    display: flex;
    gap: 8px;
    width: 100%;
}
.ob-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    background: rgba(197, 160, 89, 0.04);
    border: 1px solid rgba(197, 160, 89, 0.15);
    border-radius: var(--radius-sm);
}
.ob-badge-emblem {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-md);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 50%;
    background: rgba(197, 160, 89, 0.06);
    color: var(--gold);
    flex-shrink: 0;
}
.ob-coin-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}
.ob-badge-info {
    min-width: 0;
}
.ob-badge-label {
    font-size: var(--font-size-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ob-badge-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gold);
    line-height: 1.7;
}
.ob-unlocks {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ob-unlock-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--font-size-base);
    color: rgba(80, 200, 160, 0.75);
}
.ob-unlock-row::before {
    content: '→';
    color: rgba(80, 200, 160, 0.45);
    flex-shrink: 0;
}
.ob-cta-wrap {
    margin-top: var(--space-lg);
}
.ob-cta-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 8px 20px;
    background: rgba(197, 160, 89, 0.12);
    border: 1px solid rgba(197, 160, 89, 0.35);
    color: var(--gold);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}
.ob-cta-btn:hover {
    background: rgba(197, 160, 89, 0.22);
    border-color: var(--gold);
}
.ob-cta-btn--scroll {
    margin-top: var(--space-md);
}
.ob-path-footer {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: var(--font-size-xs);
    color: rgba(80, 200, 160, 0.55);
    text-align: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Responsive - single-column + compact path strip ─────────────────── */
@container ob-panel (max-width: 560px) {
    .ob-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .ob-header > div:first-child {
        flex: 1 1 100%;
    }
    .ob-arc-counter {
        order: -1;
        margin-bottom: 4px;
    }
    .ob-cols {
        flex-direction: column;
    }
    .ob-left {
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        width: 100%;
        box-sizing: border-box;
    }
    .ob-right {
        width: auto;
        order: -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: var(--space-md);
    }
    .ob-right .ob-path-label {
        display: none;
    }
    .ob-right .ob-path-footer {
        display: none;
    }
    .ob-right .fv-step {
        flex-direction: row;
        gap: 6px;
        padding: 5px 10px;
        font-size: var(--font-size-sm);
        border-left: none;
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.03);
    }
    .ob-right .fv-step--active {
        background: rgba(197, 160, 89, 0.08);
    }
    .ob-right .fv-step--done {
        background: rgb(92 197 89 / 6%);
    }
    .ob-right .fv-step .fv-step-marker {
        width: 20px;
        height: 20px;
        font-size: var(--font-size-xs);
    }
}

/* ── Highlight: Edge Trace (card) ─────────────────────────────────────── */
.ob-highlight-card {
    position: relative;
    overflow: hidden;
}

/* Desktop: true border-image trace using @property (Chromium/Firefox) */
.ob-highlight-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border: 2px solid transparent;
    border-image: conic-gradient(
            from var(--ob-trace-angle, 0deg),
            var(--gold) 0%,
            transparent 20%,
            transparent 80%,
            var(--gold) 100%
        )
        1;
    animation: ob-edge-trace 4s linear infinite;
    pointer-events: none;
}
@keyframes ob-edge-trace {
    to {
        --ob-trace-angle: 360deg;
    }
}
@property --ob-trace-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Mobile: simple gold border fallback (iOS Safari doesn't support border-image + @property) */
@media (max-width: 1023px) {
    .ob-highlight-card::after {
        display: none;
    }
    .ob-highlight-card {
        border-color: var(--gold) !important;
    }
}

/* ── Highlight: Objective Pip (button) ────────────────────────────────── */
.ob-highlight-btn {
    position: relative;
}
.ob-highlight-btn::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    animation: ob-pip-pulse 1.8s ease-in-out infinite;
}
@keyframes ob-pip-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.4);
    }
}

/* Nav buttons: anchor pip to the icon - label text is wider than the art,
   so a button-level right edge pushes the dot into the gap between nav items. */
.sidebar-nav-btn.ob-highlight-btn::after,
.mbn-btn.ob-highlight-btn::after {
    display: none;
}
.sidebar-nav-btn.ob-highlight-btn .sidebar-nav-icon,
.mbn-btn.ob-highlight-btn .mbn-icon {
    position: relative;
}
.sidebar-nav-btn.ob-highlight-btn .sidebar-nav-icon::after,
.mbn-btn.ob-highlight-btn .mbn-icon::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    animation: ob-pip-pulse 1.8s ease-in-out infinite;
}

/* ── Highlight: Nav button glow (sidebar + mobile) ─────────────────────── */
.ob-highlight-nav .sidebar-nav-icon,
.ob-highlight-nav .mbn-icon {
    animation: ob-nav-glow 1.8s ease-in-out infinite;
}
@keyframes ob-nav-glow {
    0%,
    100% {
        box-shadow:
            rgb(118 118 118 / 30%) 0 8px 24px,
            rgb(197 160 89 / 15%) 0 1px 3px inset,
            0 0 0 0 rgb(197 160 89 / 0%);
    }
    50% {
        box-shadow:
            rgb(118 118 118 / 30%) 0 8px 24px,
            rgb(197 160 89 / 15%) 0 1px 3px inset,
            0 0 18px 5px rgb(197 160 89 / 55%);
    }
}

/* Mobile: filter pulse on icon art (iOS Safari renders animated box-shadow as a black square) */
@media (max-width: 767px) {
    .ob-highlight-nav .mbn-icon {
        animation: none;
        box-shadow: none;
    }
    .ob-highlight-nav .mbn-icon img {
        animation: ob-nav-glow-mobile 1.8s ease-in-out infinite;
    }
}
@keyframes ob-nav-glow-mobile {
    0%,
    100% {
        filter: brightness(0.75);
    }
    50% {
        filter: brightness(1.2) sepia(0.4) saturate(1.5) drop-shadow(0 0 10px rgb(197 160 89 / 60%));
    }
}
