/* assets/css/systems/compass-landing.css */

.compass-landing {
    --compass-ink: var(--jex-ext-dark-slate);
    --compass-line: color-mix(in srgb, var(--md-sys-color-outline-variant) 72%, transparent);
    --compass-signal: var(--md-sys-color-tertiary);
}

.compass-hero-section .ac-showcase-row {
    gap: 72px;
}

/* Hero 視覺（cp_render_hero_visual）：SVG 版型與動畫都內嵌在 helper，外層只管尺寸 */
.cp-hero-visual {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
}
.cp-hv-svg {
    display: block;
    width: 100%;
    height: 100%;
    letter-spacing: 0;
}

.compass-assessments-section {
    scroll-margin-top: 80px;
}

/* 原 assessments 區的 badge 12px／title 歸零覆寫已成為全站標準（見 archcross-landing.css 節奏規則），不再需要 scoped 版本 */

/* =========================================
   定調句（Statement．深色滿版帶）
   夾在 Hero 與評鑑主題兩個淺色區之間，做出明暗節奏
========================================= */

.compass-statement-section {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    background: var(--md-sys-color-inverse-surface);
}

.compass-statement-section .ac-huge-statement {
    color: var(--md-sys-color-inverse-on-surface);
}

.compass-explainer-section {
    background: color-mix(in srgb, var(--md-sys-color-surface) 60%, transparent);
}

.compass-explainer-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 56px;
    align-items: center;
}

.compass-explainer-copy .ac-section-title {
    text-align: left;
}

.compass-explainer-copy p {
    margin: 24px 0 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1.12rem;
    line-height: 1.85;
}

.compass-explainer-list {
    display: grid;
    gap: 14px;
}

.compass-explainer-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--compass-line);
    border-radius: var(--ac-radius-md);
    background: var(--md-sys-color-surface);
    box-shadow: var(--md-sys-elevation-1);
}

.compass-explainer-step > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--md-sys-shape-corner-full);
    background: color-mix(in srgb, var(--md-sys-color-primary) 12%, var(--md-sys-color-surface));
    color: var(--md-sys-color-primary);
    font-size: 0.86rem;
    font-weight: 900;
}

.compass-explainer-step h3 {
    margin: 0 0 8px;
    color: var(--compass-ink);
    font-size: 1.15rem;
    letter-spacing: 0;
}

.compass-explainer-step p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.72;
}

.compass-features-section {
    background: var(--md-sys-color-surface-container-lowest);
}

/* 評鑑主題（Topic Cards．沿用 Coach 選教練卡視覺）
   結構與 hover 手感摘錄自 jexcoach-landing.css 的 .jc-coach-card，
   以 compass 命名空間承接；頭像位改為主題編號徽章，設計中主題按鈕 disable */

.compass-topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
    margin-top: clamp(24px, 4vw, 44px);
}

.compass-topic-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--ac-radius-lg);
    box-shadow: var(--md-sys-elevation-1);
    transition:
        translate 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        scale 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s ease,
        border-color 0.4s ease,
        background 0.4s ease;
}

.compass-topic-card.is-upcoming {
    border-style: dashed;
    background: color-mix(in srgb, var(--md-sys-color-surface) 55%, transparent);
    box-shadow: none;
}

.compass-topic-card:not(.is-upcoming):hover {
    translate: 0 -8px;
    scale: 1.02;
    background: var(--md-sys-color-surface-container);
    border-color: var(--ac-fg);
    box-shadow:
        var(--md-sys-elevation-4),
        0 0 24px -6px color-mix(in srgb, var(--ac-fg) 25%, transparent);
}

/* .compass-topic-card__header 已拉齊為共用 .ac-card-header（見 archcross-landing.css） */

.compass-topic-card__index {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 20%;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 2rem;
    font-weight: 900;
}

.compass-topic-card.is-upcoming .compass-topic-card__index {
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
}

.compass-topic-card__title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.compass-topic-card__title h3 {
    margin: 0;
    color: var(--ac-fg);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
}

.compass-topic-card.is-upcoming h3 {
    color: var(--md-sys-color-on-surface-variant);
}

.compass-topic-card__status {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border: 1px solid color-mix(in srgb, var(--md-sys-color-on-surface-variant) 30%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 12%, transparent);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.compass-topic-card__status.is-open {
    border-color: color-mix(in srgb, var(--compass-signal) 30%, transparent);
    background: color-mix(in srgb, var(--compass-signal) 15%, transparent);
    color: color-mix(in srgb, var(--compass-signal) 78%, var(--compass-ink));
}

.compass-topic-card__body {
    display: grid;
    gap: 14px;
    flex-grow: 1;
    align-content: start;
}

.compass-topic-card__body > p {
    margin: 0;
    line-height: 1.6;
    color: var(--ac-fg-muted);
}

.compass-topic-card__dimensions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.compass-topic-card__dimensions li {
    padding: 7px 12px;
    border-radius: var(--md-sys-shape-corner-full);
    background: color-mix(in srgb, var(--md-sys-color-primary) 10%, var(--md-sys-color-surface-container-low));
    color: var(--md-sys-color-on-surface);
    font-size: 0.8rem;
    font-weight: 700;
}

.compass-topic-card__meta {
    font-size: 0.85rem;
    font-weight: 650;
}

/* .compass-topic-card__footer 已拉齊為共用 .ac-card-footer（見 archcross-landing.css） */
/* .compass-btn-sm 已拉齊為共用 .ac-btn-sm（見 archcross-landing.css） */

.ac-card-footer .ac-btn[aria-disabled="true"] {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.55;
}

.compass-usecases-section {
    background: color-mix(in srgb, var(--md-sys-color-surface) 60%, transparent);
}

.compass-closing-actions {
    justify-content: center;
}

@media (max-width: 1080px) {
    .compass-hero-section .ac-showcase-row {
        gap: 52px;
    }

    .compass-explainer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .compass-explainer-step {
        grid-template-columns: 1fr;
    }

    .compass-topic-card {
        padding: 26px;
    }
}

/* =========================================
   Feature Switcher（摘錄自 jexstudio-landing.css）
   以 .compass-landing 為 scope 前綴
========================================= */

.compass-landing .jxs-feature-switcher {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 1.35fr);
    gap: clamp(24px, 3vw, 48px);
    align-items: stretch;
    margin-top: clamp(24px, 4vw, 48px);
}

/* --- 左側 nav --- */
.compass-landing .jxs-switch-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.compass-landing .jxs-switch-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 16px;
    padding: 18px 20px 18px 22px;
    background: transparent;
    border: none;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    color: var(--ac-fg);
    transition: background 0.3s ease, color 0.3s ease;
    overflow: hidden;
    font-family: inherit;
}

.compass-landing .jxs-switch-item:hover {
    background: color-mix(in srgb, var(--jex-ext-glass-sky) 50%, transparent);
}

.compass-landing .jxs-switch-item.is-active {
    background: var(--jex-ext-glass-sky);
}

.compass-landing .jxs-switch-index {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--ac-fg-muted);
    line-height: 1;
    transition: color 0.3s ease;
}

.compass-landing .jxs-switch-item.is-active .jxs-switch-index {
    color: var(--jex-ext-dark-slate);
}

.compass-landing .jxs-switch-text {
    display: block;
    min-width: 0;
}

.compass-landing .jxs-switch-title {
    display: block;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ac-fg);
    margin-bottom: 4px;
}

.compass-landing .jxs-switch-desc {
    display: block;
    font-size: 0.93rem;
    line-height: 1.65;
    color: var(--ac-fg-muted);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, margin-top 0.3s ease;
}

.compass-landing .jxs-switch-item.is-active .jxs-switch-desc {
    max-height: 120px;
    opacity: 1;
    margin-top: 6px;
}

.compass-landing .jxs-switch-progress {
    position: absolute;
    left: 22px;
    right: 20px;
    bottom: 10px;
    height: 2px;
    background: color-mix(in srgb, var(--ac-fg) 8%, transparent);
    border-radius: 2px;
    overflow: hidden;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.compass-landing .jxs-switch-item.is-active .jxs-switch-progress {
    transform: scaleX(1);
}

.compass-landing .jxs-switch-item.is-active .jxs-switch-progress::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--ac-primary), var(--ac-secondary));
    transform: scaleX(0);
    transform-origin: left center;
    animation: compass-switch-progress 5.5s linear forwards;
}

@keyframes compass-switch-progress {
    0%   { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* --- 右側 stage --- */
.compass-landing .jxs-switch-stage {
    position: relative;
    min-height: 420px;
    background: linear-gradient(135deg,
        var(--jex-ext-frost-grey) 0%,
        var(--jex-ext-muted-slate) 100%);
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--jex-ext-dark-slate) 25%, transparent);
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 20px 60px color-mix(in srgb, var(--jex-ext-dark-slate) 22%, transparent);
}

.compass-landing .jxs-switch-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at center, black 30%, transparent 85%);
            mask-image: radial-gradient(ellipse 90% 70% at center, black 30%, transparent 85%);
    opacity: 0.9;
    pointer-events: none;
}

.compass-landing .jxs-switch-panel {
    position: absolute;
    inset: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.compass-landing .jxs-switch-panel.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.compass-landing .jxs-switch-panel[hidden] {
    display: flex;
}

.compass-landing .jxs-scene-svg {
    width: 100%;
    height: auto;
    max-height: 100%;
    filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.22));
}

/* --- Feature Switcher 響應式 --- */
@media (max-width: 1024px) {
    .compass-landing .jxs-feature-switcher {
        grid-template-columns: 1fr;
    }
    .compass-landing .jxs-switch-stage {
        min-height: 340px;
        order: -1;
    }
    .compass-landing .jxs-switch-panel {
        inset: 20px;
    }
}

@media (max-width: 640px) {
    .compass-landing .jxs-switch-item {
        padding: 14px 16px 14px 18px;
    }
    .compass-landing .jxs-switch-stage {
        min-height: 280px;
    }
    .compass-landing .jxs-switch-title {
        font-size: 1rem;
    }
    .compass-landing .jxs-switch-desc {
        font-size: 0.88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .compass-landing .jxs-switch-panel,
    .compass-landing .jxs-switch-desc,
    .compass-landing .jxs-switch-progress,
    .compass-landing .jxs-switch-item.is-active .jxs-switch-progress::before {
        transition: none;
        animation: none;
    }
}

/* =========================================
   Flow Timeline（評鑑流程．時間軸）
   桌機為水平軸線＋節點，窄幅轉直式
========================================= */

.compass-flow-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    padding: 0;
    margin: clamp(28px, 4vw, 52px) 0 0;
    list-style: none;
}

/* 以 wrapper 加權（0,2,0）壓過佈景主題的 .entry-content ol/li（0,1,1），
   否則主題的 list-style 與縮排會滲入，手機單欄時尤其明顯（跑版主因） */
.jex-archcross-landing .compass-flow-track {
    list-style: none;
    padding: 0;
}
.jex-archcross-landing .compass-flow-step {
    list-style: none;
    margin: 0;
}

.compass-flow-track::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 22px;
    right: 22px;
    height: 2px;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--md-sys-color-primary) 50%, transparent),
        color-mix(in srgb, var(--md-sys-color-outline-variant) 85%, transparent)
    );
}

.compass-flow-step {
    position: relative;
    padding-top: 64px;
}

.compass-flow-step__num {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent);
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-primary);
    font-size: 0.88rem;
    font-weight: 900;
}

.compass-flow-step h4 {
    margin: 0 0 10px;
    color: var(--compass-ink);
    font-size: 1.12rem;
    letter-spacing: 0;
}

.compass-flow-step p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.95rem;
    line-height: 1.72;
}

@media (max-width: 900px) {
    .compass-flow-track {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .compass-flow-track::before {
        top: 22px;
        bottom: 22px;
        left: 21px;
        right: auto;
        width: 2px;
        height: auto;
        background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--md-sys-color-primary) 50%, transparent),
            color-mix(in srgb, var(--md-sys-color-outline-variant) 85%, transparent)
        );
    }

    .compass-flow-step {
        padding: 0 0 0 64px;
    }
}

/* ==========================================================================
   信任段（Check It Yourself）
   --------------------------------------------------------------------------
   沿用 .ac-about-section 的深底滿版樣式，但它原本是為「頁尾收束」設計的：
   底部有 -16px 的負 margin 去咬住頁尾。這一段夾在頁面中間，負 margin 會讓
   它壓到下一個淺色區塊上，所以在這裡歸零。
   ========================================================================== */
.compass-trust-section {
    margin-bottom: 0;
    padding-bottom: var(--ac-spacing);
}

/* .ac-about-text 預設 margin-bottom: 48px，是給「一段文字 + 按鈕」用的。
   這裡有兩段連續的文字，段間留 48px 會散掉。 */
.compass-trust-section .ac-about-text:not(:last-child) {
    margin-bottom: 24px;
}

.compass-trust-section .ac-about-text:last-child {
    margin-bottom: 0;
}
