/* ── Tutorial Design System ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Kalam:wght@400;700&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
    --color-bg:          #f6f4ee;
    --color-text:        #1a1916;
    --color-text-sec:    #857f74;
    --color-accent:      #2563eb;
    --color-accent-dark: #1d4ed8;
    --color-surface:     #e8e2d8;
    --color-border:      rgba(26,25,22,0.28);
    --color-border-lt:   rgba(26,25,22,0.12);
    --color-success:     #16a34a;
    --color-danger:      #dc2626;
    --shadow-card:       4px 4px 0 var(--color-text);
    --shadow-sm:         2px 2px 0 var(--color-text);
    --font:              'Inter Tight', -apple-system, system-ui, sans-serif;
    --font-hand:         'Kalam', cursive;
    --font-mono:         'JetBrains Mono', monospace;
    --topbar-h:          52px;
    --nav-h:             56px;
}

* { margin:0; padding:0; box-sizing:border-box; }

/* ── Scroll/load reveal ──────────────────────────────────────────── */
.zr-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s cubic-bezier(.2,.8,.2,1), transform .55s cubic-bezier(.2,.8,.2,1);
    transition-delay: calc(var(--i, 0) * 70ms);
    will-change: opacity, transform;
}
.zr-reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .zr-reveal { opacity: 1; transform: none; transition: none; }
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--color-bg) url('/assets/images/paper-bg.png') repeat;
    background-size: 1100px auto;
    color: var(--color-text);
    user-select: none;
}

body::after {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ── Topbar ─────────────────────────────────────────────────────── */
#topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    background: var(--color-bg);
    border-bottom: 1.5px solid var(--color-border);
    z-index: 100;
}

.tb-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}
.tb-logo span { color: var(--color-accent); font-style: italic; }

.tb-logo-crop {
    display: block;
    height: 44px;
    overflow: visible;
    flex-shrink: 0;
    align-self: center;
}
.tb-logo-img {
    display: block;
    height: 44px;
    width: auto;
    margin: 0;
    object-fit: contain;
}

.tb-sep { color: var(--color-border); font-size: 18px; margin: 0 2px; }

.tb-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-sec);
    white-space: nowrap;
}

.tb-spacer { flex: 1; }

.tb-btn {
    height: 30px;
    padding: 0 12px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 7px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: box-shadow .22s cubic-bezier(.2,.8,.2,1), transform .22s cubic-bezier(.2,.8,.2,1);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}
.tb-btn:hover { box-shadow: 4px 4px 0 var(--color-text); transform: translate(-2px,-2px); }
.tb-btn:active { box-shadow: none; transform: translate(2px,2px); }

.tb-btn.accent {
    background: var(--color-accent);
    border-color: var(--color-accent-dark);
    color: #fff;
    box-shadow: 2px 2px 0 var(--color-accent-dark);
}
.tb-btn.accent:hover { box-shadow: 3px 3px 0 var(--color-accent-dark); }

/* ── Slides container ───────────────────────────────────────────── */
#slides {
    position: fixed;
    top: var(--topbar-h);
    bottom: var(--nav-h);
    left: 0; right: 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#slides::-webkit-scrollbar { display: none; }

/* ── Single slide ───────────────────────────────────────────────── */
.slide {
    flex: 0 0 100vw;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.slide-text {
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 48px;
    gap: 16px;
    border-right: 1.5px solid var(--color-border-lt);
}

.slide-vis {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(255,255,255,0.22);
}

[dir="rtl"] .slide-text {
    border-right: none;
    border-left: 1.5px solid var(--color-border-lt);
}

.step-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-sec);
    letter-spacing: .5px;
    text-transform: uppercase;
}
.step-badge .step-num {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font);
    color: var(--color-text);
    line-height: 1;
    letter-spacing: -2px;
}

.slide-title {
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.5px;
}

.slide-desc {
    font-size: clamp(13px, 1.4vw, 15px);
    line-height: 1.65;
    color: var(--color-text-sec);
    max-width: 380px;
}

.slide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.btn-primary {
    height: 38px;
    padding: 0 20px;
    background: var(--color-text);
    border: none;
    border-radius: 9px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    color: var(--color-bg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: opacity .12s;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.18);
}
.btn-primary:hover { opacity: .85; }

.btn-primary.accent {
    background: var(--color-accent);
    box-shadow: 3px 3px 0 var(--color-accent-dark);
}

.btn-secondary {
    height: 38px;
    padding: 0 16px;
    background: transparent;
    border: 1.5px solid var(--color-border);
    border-radius: 9px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background .12s, box-shadow .12s;
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--color-surface); box-shadow: 3px 3px 0 var(--color-text); }

.slide-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-sec);
    letter-spacing: .3px;
    margin-top: 4px;
}
.slide-hint .hint-dot { width:5px; height:5px; border-radius:50%; background:var(--color-accent); display:inline-block; }

/* ── Bottom nav ─────────────────────────────────────────────────── */
#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--color-bg);
    border-top: 1.5px solid var(--color-border);
    z-index: 100;
}

.nav-btn {
    height: 36px;
    padding: 0 18px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: box-shadow .12s, transform .12s;
    box-shadow: var(--shadow-sm);
}
.nav-btn:hover { box-shadow: 3px 3px 0 var(--color-text); transform: translate(-1px,-1px); }
.nav-btn:active { box-shadow: none; transform: translate(2px,2px); }
.nav-btn:disabled { opacity: .3; pointer-events: none; box-shadow: none; }
.nav-btn.nav-next {
    background: var(--color-accent);
    border-color: var(--color-accent-dark);
    color: #fff;
    box-shadow: 2px 2px 0 var(--color-accent-dark);
}
.nav-btn.nav-next:hover { box-shadow: 3px 3px 0 var(--color-accent-dark); }

.dots {
    display: flex;
    align-items: center;
    gap: 7px;
}
.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-border);
    border: 1.5px solid var(--color-border);
    cursor: pointer;
    transition: background .2s, transform .2s, width .2s;
}
.dot.active {
    background: var(--color-text);
    border-color: var(--color-text);
    width: 22px;
    border-radius: 4px;
}

/* ── Hero slide (slide 0) ───────────────────────────────────────── */
.slide.hero-slide .slide-text {
    flex: 1;
    border: none;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 60px 80px;
    gap: 20px;
}
[dir="rtl"] .slide.hero-slide .slide-text { border: none; }

.hero-kicker {
    font-family: var(--font-hand);
    font-size: 16px;
    color: var(--color-accent);
}
.hero-title {
    font-size: clamp(32px, 5vw, 60px);
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.05;
}
.hero-sub {
    font-size: clamp(14px, 1.6vw, 18px);
    color: var(--color-text-sec);
    max-width: 520px;
    line-height: 1.6;
}
.hero-start-btn {
    height: 46px;
    padding: 0 28px;
    background: var(--color-accent);
    border: none;
    border-radius: 11px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--color-accent-dark);
    transition: box-shadow .12s, transform .12s;
    margin-top: 8px;
}
.hero-start-btn:hover { box-shadow: 5px 5px 0 var(--color-accent-dark); transform: translate(-2px,-2px); }

.hero-steps-preview {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.hero-step-chip {
    padding: 5px 13px;
    border-radius: 6px;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-sec);
    box-shadow: var(--shadow-sm);
}

/* ── Visual: KF path ────────────────────────────────────────────── */
.vis-cam-path {
    width: 100%;
    max-width: 380px;
    position: relative;
}
.vis-kf-strip-demo {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--color-text);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}
.vis-kf-strip-demo .kf-label-d {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-bg);
    opacity: .7;
    margin-right: 10px;
    flex-shrink: 0;
}
.vis-kf-strip-demo .kf-mode-d {
    display: flex;
    gap: 4px;
    margin-right: 10px;
}
.kf-mode-chip {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6);
}
.kf-mode-chip.on { background: var(--color-accent); color:#fff; }
.vis-kf-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.vis-kf-dot-btn {
    width: 22px; height: 22px;
    border-radius: 5px;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-mono);
    font-weight: 700;
}
.vis-kf-dot-btn.active { background: var(--color-accent); border-color: var(--color-accent); color:#fff; }
.vis-kf-line-d {
    height: 1.5px;
    width: 14px;
    background: rgba(255,255,255,0.2);
}
.vis-kf-add {
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    font-size: 9px;
    font-weight: 700;
    margin-left: 8px;
}
.vis-kf-play {
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--color-accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    margin-left: 4px;
}
.vis-orbit-diagram {
    display: flex;
    justify-content: center;
}

/* ── Visual: Obj gizmo ──────────────────────────────────────────── */
.vis-obj-gizmo {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.vis-gizmo-modes {
    display: flex;
    gap: 8px;
}
.vis-gizmo-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.vis-gizmo-btn.on {
    border-color: var(--color-accent);
    background: #eff6ff;
    box-shadow: 3px 3px 0 var(--color-accent);
}
.vis-gizmo-btn .gb-label {
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
}
.vis-traj {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border-lt);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.vis-traj-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--color-text-sec);
    border: 2px solid var(--color-text);
}
.vis-traj-dot.active { background: var(--color-accent); border-color: var(--color-accent); }
.vis-traj-line {
    flex: 1;
    height: 1.5px;
    background: var(--color-border);
    position: relative;
}
.vis-traj-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 30%;
    width: 40%;
    height: 1.5px;
    background: var(--color-accent);
    transform: translateY(-50%);
}

/* ── Visual: Cinematic presets grid ─────────────────────────────── */
.vis-cinematic {
    width: 100%;
    max-width: 380px;
}
.vis-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.vis-preset-card {
    padding: 12px 10px;
    background: #fff;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    color: var(--color-text);
}
.vis-preset-card:nth-child(1) { border-color: var(--color-accent); box-shadow: 2px 2px 0 var(--color-accent); }
.vis-preset-card svg { opacity: .7; }
.vis-flyby-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--color-text);
    color: var(--color-bg);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    margin-bottom: 10px;
}
.vis-flyby-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.vis-flyby-mini {
    flex: 1;
    padding: 8px 6px;
    background: var(--color-text);
    color: var(--color-bg);
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* ── Visual: Lighting ───────────────────────────────────────────── */
.vis-lighting {
    width: 100%;
    max-width: 360px;
}
.vis-light-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.vis-light-card {
    padding: 14px;
    border-radius: 11px;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    font-size: 11px;
    font-weight: 700;
}
.vis-light-card .lc-color {
    width: 24px; height: 24px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid rgba(0,0,0,0.1);
}
.vis-light-types {
    display: flex;
    gap: 6px;
}
.vis-light-type-btn {
    flex: 1;
    padding: 8px 6px;
    border-radius: 8px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* ── Visual: Export ─────────────────────────────────────────────── */
.vis-export {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vis-export-row {
    display: flex;
    gap: 8px;
}
.vis-export-btn {
    flex: 1;
    padding: 14px 16px;
    border-radius: 11px;
    border: 2px solid var(--color-border);
    background: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.vis-export-btn.rec {
    background: var(--color-text);
    color: var(--color-bg);
    box-shadow: var(--shadow-card);
}
.vis-export-btn .rec-circle {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ef4444;
}
.vis-res-chips, .vis-fps-chips {
    display: flex;
    gap: 6px;
}
.vis-chip {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--shadow-sm);
    color: var(--color-text-sec);
}
.vis-chip.sel {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
    box-shadow: var(--shadow-card);
}
.vis-section-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--color-text-sec);
    margin-bottom: -4px;
}

/* ── Hero divider ───────────────────────────────────────────────── */
.slide-divider {
    width: 40px; height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
}

/* ── Mobile fallback (portrait) ─────────────────────────────────── */
@media (max-width: 680px) or (orientation: portrait) {
    :root {
        --topbar-h: 56px;
        --nav-h: 66px;
    }
    body {
        min-height: 100dvh;
    }
    #topbar {
        height: var(--topbar-h);
        gap: 6px;
        padding: 0 12px;
        overflow: visible;
        direction: ltr;
    }
    .tb-logo-img { height: 30px; }
    .tb-logo-crop { height: 30px; }
    .tb-sep {
        display: none;
    }
    .tb-spacer {
        display: none;
    }
    .tb-title {
        display: none;
    }
    .tb-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 11px;
        flex-shrink: 0;
    }
    #topbar .tb-btn.accent {
        display: none;
    }
    .tb-btn svg {
        width: 11px;
        height: 11px;
    }
    #slides {
        top: var(--topbar-h);
        bottom: var(--nav-h);
        align-items: stretch;
    }
    .slide {
        flex-direction: column;
        min-height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .slide-text {
        flex: 0 0 auto;
        padding: 22px 18px 14px;
        gap: 12px;
        border-right: none;
        border-bottom: 1.5px solid var(--color-border-lt);
    }
    [dir="rtl"] .slide-text { border-left: none; border-bottom: 1.5px solid var(--color-border-lt); }
    .slide-vis {
        flex: 1 0 auto;
        min-height: 260px;
        padding: 18px;
        align-items: flex-start;
    }
    .step-badge {
        font-size: 10px;
    }
    .step-badge .step-num {
        font-size: 28px;
        letter-spacing: -1px;
    }
    .slide-title {
        font-size: clamp(22px, 8vw, 30px);
        line-height: 1.08;
    }
    .slide-desc {
        font-size: 14px;
        line-height: 1.55;
        max-width: none;
    }
    .slide-hint {
        font-size: 12px;
    }
    .slide-actions {
        gap: 9px;
    }
    .btn-primary,
    .btn-secondary,
    .hero-start-btn {
        min-height: 44px;
    }
    .slide.hero-slide .slide-text {
        min-height: 100%;
        padding: 44px 20px;
        justify-content: center;
        align-items: flex-start;
        text-align: left;
    }
    [dir="rtl"] .slide.hero-slide .slide-text {
        align-items: flex-end;
        text-align: right;
    }
    .hero-title {
        width: 100%;
        max-width: 350px;
        font-size: clamp(34px, 10.5vw, 44px);
        line-height: 1.02;
        overflow-wrap: break-word;
    }
    .hero-sub {
        width: 100%;
        max-width: 340px;
        font-size: 15px;
        line-height: 1.5;
    }
    .hero-steps-preview {
        width: min(100%, 340px);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .hero-step-chip {
        padding: 6px 10px;
        font-size: 10px;
        text-align: center;
        min-width: 0;
    }
    #bottom-nav {
        height: var(--nav-h);
        padding: 8px 10px max(8px, env(safe-area-inset-bottom));
        gap: 8px;
    }
    .nav-btn {
        height: 42px;
        padding: 0 12px;
        font-size: 12px;
        min-width: 76px;
        justify-content: center;
    }
    .dots {
        flex: 1;
        justify-content: center;
        gap: 6px;
        min-width: 0;
    }
    .dot {
        width: 8px;
        height: 8px;
    }
    .dot.active {
        width: 20px;
    }
    .vis-cam-path, .vis-obj-gizmo, .vis-cinematic, .vis-lighting, .vis-export {
        max-width: 100%;
    }
    .vis-kf-strip-demo {
        overflow-x: auto;
        padding: 9px 10px;
    }
    .vis-kf-strip-demo .kf-label-d {
        display: none;
    }
    .vis-kf-line-d {
        width: 10px;
    }
    .vis-preset-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 420px) {
    .tb-spacer {
        min-width: 0;
    }
    .tb-btn {
        padding: 0 9px;
    }
    #topbar .tb-btn:not(.accent) {
        max-width: 94px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .slide-text {
        padding: 20px 16px 13px;
    }
    .slide-vis {
        padding: 16px;
    }
    .slide-actions > * {
        flex: 1 1 100%;
        justify-content: center;
    }
    .vis-export-row,
    .vis-light-types {
        flex-direction: column;
    }
    .vis-res-chips,
    .vis-fps-chips {
        flex-wrap: wrap;
    }
    .nav-btn {
        min-width: 66px;
        padding: 0 10px;
    }
    .nav-btn span {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* -- Responsive hardening -------------------------------------------------- */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
#topbar,
#bottom-nav {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.tb-logo,
.tb-title,
.tb-btn,
.nav-btn,
.dots,
.slide,
.slide-text,
.slide-vis,
.slide-actions,
.hero-steps-preview,
.vis-cam-path,
.vis-obj-gizmo,
.vis-cinematic,
.vis-lighting,
.vis-export,
.vis-kf-strip-demo,
.vis-kf-dots,
.vis-gizmo-modes,
.vis-traj,
.vis-preset-grid,
.vis-flyby-row,
.vis-light-grid,
.vis-light-types,
.vis-export-row,
.vis-res-chips,
.vis-fps-chips {
    min-width: 0;
}
.tb-title,
.nav-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.slide {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
}
.slide-text,
.slide-title,
.slide-desc,
.slide-hint,
.hero-title,
.hero-sub,
.vis-preset-card,
.vis-light-card,
.vis-light-type-btn,
.vis-export-btn,
.vis-chip {
    overflow-wrap: anywhere;
}
.slide-vis {
    overflow: hidden;
}
.btn-primary,
.btn-secondary,
.hero-start-btn {
    max-width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
}
.hero-steps-preview {
    flex-wrap: wrap;
    justify-content: center;
}
.hero-step-chip,
.vis-preset-card,
.vis-light-card,
.vis-light-type-btn,
.vis-export-btn,
.vis-chip {
    min-width: 0;
}

@media (max-width: 1024px) and (min-width: 681px) {
    .slide-text {
        flex-basis: 48%;
        padding: 32px clamp(24px, 4vw, 40px);
    }
    .slide-vis {
        padding: 24px;
    }
    .vis-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hero-steps-preview {
        max-width: 620px;
    }
}

@media (max-width: 680px), (orientation: portrait) {
    #topbar {
        max-width: 100%;
    }
    .tb-btn:not(.accent) {
        max-width: 112px;
    }
    .slide {
        width: 100%;
        max-width: 100%;
    }
    .slide-vis svg {
        max-width: 100%;
        height: auto;
    }
    .vis-flyby-row,
    .vis-res-chips,
    .vis-fps-chips {
        flex-wrap: wrap;
    }
    .vis-flyby-mini,
    .vis-chip {
        flex: 1 1 calc(50% - 6px);
    }
    .vis-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .hero-steps-preview,
    .vis-preset-grid,
    .vis-light-grid {
        grid-template-columns: 1fr;
    }
    .nav-btn {
        min-width: 0;
    }
}
