.cm5-root {
    --bg-dark: #202020;
    --bg-darker: #181818;
    --bg-card: #2a2a2a;
    --bg-elevated: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --accent-success: #00e676;
    --accent-warning: #ffc107;
    --border-color: #404040;
    --font-primary: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

.cm5-root .top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(24, 24, 24, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.cm5-root .brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    text-decoration: none;
}

.cm5-root .badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-warning);
    border: 1px solid rgba(255, 193, 7, 0.35);
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.cm5-root .badge:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.cm5-root .hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 120px 32px 80px;
    overflow: hidden;
    background: var(--bg-darker);
}

.cm5-root .hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.cm5-root .hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to right, rgba(24, 24, 24, 0.97) 0%, rgba(24, 24, 24, 0.82) 38%, rgba(24, 24, 24, 0.35) 62%, rgba(24, 24, 24, 0.15) 100%),
        linear-gradient(to top, rgba(24, 24, 24, 0.6) 0%, transparent 40%);
}

.cm5-root .hero-copy {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.cm5-root .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-success);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.cm5-root .hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 20px;
}

.cm5-root .hero-lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 560px;
}

.cm5-root .scroll-hint {
    margin-top: 48px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    animation: cm5-bounce 2s ease infinite;
}

@keyframes cm5-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* Explainer layout */
.cm5-root .explainer {
    position: relative;
}

.cm5-root .explainer-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: hidden;
}

.cm5-root .viewer-panel {
    position: relative;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cm5-root #canvas3d {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.cm5-root .viewer-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(24, 24, 24, 0.92);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: opacity 0.4s ease;
}

.cm5-root .viewer-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.cm5-root .viewer-loading.error {
    color: #ff8a80;
    padding: 24px;
    text-align: center;
    line-height: 1.5;
}

.cm5-root .viewer-label {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(32, 32, 32, 0.9);
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    transition: opacity 0.3s;
}

.cm5-root .board-callouts {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.cm5-root .callout {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.35s ease;
    will-change: transform, opacity;
}

.cm5-root .callout.visible {
    opacity: 1;
}

.cm5-root .callout-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00e676;
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.75);
    animation: cm5-callout-pulse 1.6s ease infinite;
}

.cm5-root .callout-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 30, 18, 0.92);
    border: 1px solid rgba(0, 230, 118, 0.45);
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

@keyframes cm5-callout-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.85; }
}

.cm5-root .progress-dots {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cm5-root .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s, transform 0.3s;
}

.cm5-root .dot.active {
    background: var(--accent-success);
    transform: scale(1.3);
}

.cm5-root .story-panel {
    position: relative;
    padding: 80px 48px;
    overflow: hidden;
    background: var(--bg-dark);
}

.cm5-root .story-step {
    position: absolute;
    inset: 80px 48px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    overflow-y: auto;
}

.cm5-root .story-step.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cm5-root .step-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-success);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.cm5-root .story-step h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.15;
}

.cm5-root .story-step > p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.cm5-root .benefit-list {
    list-style: none;
    margin-bottom: 24px;
}

.cm5-root .benefit-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.cm5-root .benefit-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-success);
}

.cm5-root .stat-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cm5-root .stat {
    flex: 1;
    min-width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.cm5-root .stat.highlight {
    border-color: rgba(0, 230, 118, 0.4);
    background: rgba(0, 230, 118, 0.06);
}

.cm5-root .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.cm5-root .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cm5-root .compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.cm5-root .compare-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.cm5-root .compare-card.adko {
    border-color: rgba(0, 230, 118, 0.35);
}

.cm5-root .compare-card h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cm5-root .compare-card ul {
    list-style: none;
    margin-bottom: 16px;
}

.cm5-root .compare-card li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px solid rgba(64, 64, 64, 0.5);
}

.cm5-root .compare-price {
    font-size: 1.75rem;
    font-weight: 700;
}

.cm5-root .compare-card.traditional .compare-price { color: var(--text-muted); }
.cm5-root .compare-card.adko .compare-price { color: var(--accent-success); }

.cm5-root .compare-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.cm5-root .disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.cm5-root .scroll-track {
    position: relative;
    pointer-events: none;
}

.cm5-root .scroll-segment {
    height: 100vh;
    height: 100dvh;
}

.cm5-root .footer {
    padding: 48px 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.cm5-root .footer code {
    font-family: var(--font-mono);
    color: var(--accent-warning);
}

@media (max-width: 900px) {
.cm5-root .top-bar {
        padding: 12px 16px;
    }

.cm5-root .hero {
        min-height: 58dvh;
        padding: 96px 20px 40px;
        align-items: flex-end;
    }

.cm5-root .hero-overlay {
        background:
            linear-gradient(to top, rgba(24, 24, 24, 0.97) 0%, rgba(24, 24, 24, 0.72) 42%, rgba(24, 24, 24, 0.25) 100%);
    }

.cm5-root .hero h1 {
        font-size: clamp(1.85rem, 8vw, 2.6rem);
    }

.cm5-root .hero-lead {
        font-size: 1.05rem;
    }

.cm5-root .scroll-hint {
        margin-top: 28px;
    }

.cm5-root .explainer-sticky {
        grid-template-columns: 1fr;
        /* Percent of sticky height — avoids 45vh+55vh overflowing under the nav */
        grid-template-rows: minmax(180px, 40%) minmax(220px, 60%);
        height: 100dvh;
    }

.cm5-root .viewer-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 0;
    }

.cm5-root .story-panel {
        padding: 20px 16px;
        min-height: 0;
    }

.cm5-root .story-step {
        inset: 16px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

.cm5-root .story-step h2 {
        font-size: 1.35rem;
        margin-bottom: 10px;
    }

.cm5-root .story-step > p {
        font-size: 0.95rem;
        margin-bottom: 14px;
    }

.cm5-root .benefit-list li {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

.cm5-root .compare-grid {
        grid-template-columns: 1fr;
    }

.cm5-root .compare-price {
        font-size: 1.4rem;
    }

.cm5-root .progress-dots {
        flex-direction: row;
        left: 50%;
        top: auto;
        bottom: 12px;
        transform: translateX(-50%);
        z-index: 5;
    }

.cm5-root .viewer-label {
        bottom: 40px;
        font-size: 0.7rem;
        padding: 6px 12px;
        max-width: calc(100% - 24px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

.cm5-root .callout-label {
        display: none;
    }

.cm5-root .scroll-segment {
        height: 100dvh;
    }
}

@media (max-width: 480px) {
.cm5-root .hero {
        min-height: 52dvh;
        padding: 88px 16px 32px;
    }

.cm5-root .explainer-sticky {
        grid-template-rows: minmax(160px, 36%) minmax(240px, 64%);
    }

.cm5-root .stat-row {
        flex-direction: column;
    }

.cm5-root .stat {
        min-width: 0;
    }
}

/* Prefer reduced motion: keep content readable without long scroll scrubbing */
@media (prefers-reduced-motion: reduce) {
.cm5-root .scroll-hint {
        animation: none;
    }

.cm5-root .callout-dot {
        animation: none;
    }
}


/* Embedded in ADKO-pub-page portfolio */
.cm5-root.cm5-embedded {
    display: block;
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: var(--bg-dark);
    overflow-x: clip;
}
.cm5-root.cm5-embedded .top-bar { display: none; }
.cm5-root.cm5-embedded .footer { display: none; }
.cm5-root.cm5-embedded .explainer-sticky {
    top: 72px;
    height: calc(100dvh - 72px);
}
.cm5-root.cm5-embedded .scroll-segment {
    height: calc(100dvh - 72px);
}
.cm5-root.cm5-embedded .hero {
    padding-top: 96px;
}
.cm5-root[hidden] { display: none !important; }

.cm5-inline-close {
    position: fixed;
    top: max(72px, env(safe-area-inset-top, 0px) + 56px);
    right: max(12px, env(safe-area-inset-right, 0px) + 8px);
    z-index: 1100;
    width: 44px;
    height: 44px;
    background: rgba(20, 20, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s, transform 0.25s;
}
.cm5-inline-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

@media (max-width: 900px) {
    .cm5-root.cm5-embedded .explainer-sticky {
        top: 64px;
        height: calc(100dvh - 64px);
        grid-template-rows: minmax(160px, 38%) minmax(220px, 62%);
    }
    .cm5-root.cm5-embedded .scroll-segment {
        height: calc(100dvh - 64px);
    }
    .cm5-root.cm5-embedded .hero {
        min-height: 52dvh;
        padding: 80px 16px 28px;
    }
    .cm5-inline-close {
        top: max(64px, env(safe-area-inset-top, 0px) + 48px);
        width: 40px;
        height: 40px;
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .cm5-root.cm5-embedded .explainer-sticky {
        grid-template-rows: minmax(150px, 34%) minmax(240px, 66%);
    }
}

body.cm5-open {
    overflow-x: hidden;
}
