/* Guía de uso de YourNovel.app — estilo propio, coherente con la marca. */

:root {
    --bg: #050505;
    --panel: #0d0d12;
    --card: #13131a;
    --border: rgba(255, 255, 255, 0.1);
    --border-soft: rgba(255, 255, 255, 0.06);
    --text: #e2e2e8;
    --muted: #9a9aa8;
    --dim: #6b6b78;
    --indigo: #6366f1;
    --fuchsia: #d946ef;
    --accent-grad: linear-gradient(90deg, #6366f1, #d946ef);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Top bar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}

.brand-mark {
    font-size: 18px;
}

.topbar-title {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

.menu-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ---------- Progress bar ---------- */

.progress-track {
    height: 3px;
    width: 100%;
    background: var(--border-soft);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-grad);
    transition: width 0.25s ease;
}

/* ---------- Layout ---------- */

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 0;
}

.toc {
    border-right: 1px solid var(--border-soft);
    background: var(--panel);
    overflow-y: auto;
    padding: 18px 12px 60px;
}

.toc-inner {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.toc-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
    font-weight: 700;
    padding: 0 10px;
    margin-bottom: 8px;
}

.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 10px;
    color: var(--muted);
    font-size: 13.5px;
    cursor: pointer;
    line-height: 1.35;
}

.toc-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.toc-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
}

.toc-item-index {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--dim);
}

.toc-item.active .toc-item-index {
    background: var(--accent-grad);
    color: #fff;
}

/* ---------- Stage ---------- */

.stage {
    padding: 28px 32px 60px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.slide-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
    font-weight: 700;
    color: var(--fuchsia);
    margin: 0 0 8px;
}

.slide-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.slide-body {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 68ch;
    margin: 0 0 22px;
}

.viewport {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.slide-image {
    display: block;
    width: 100%;
    height: auto;
}

.hotspot-layer {
    position: absolute;
    inset: 0;
}

/* ---------- Hotspots ---------- */

.hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-grad);
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18), 0 6px 16px rgba(0, 0, 0, 0.4);
    animation: hotspot-pulse 2.4s ease-in-out infinite;
    z-index: 5;
    padding: 0;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-open {
    animation: none;
    box-shadow: 0 0 0 8px rgba(217, 70, 239, 0.28), 0 6px 16px rgba(0, 0, 0, 0.5);
}

@keyframes hotspot-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18), 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0.05), 0 6px 16px rgba(0, 0, 0, 0.4);
    }
}

.hotspot-tooltip {
    position: absolute;
    transform: translate(-50%, 0);
    top: calc(100% + 12px);
    left: 50%;
    width: min(280px, 70vw);
    background: #17171f;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    z-index: 10;
}

.hotspot-tooltip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #17171f;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.hotspot-tooltip.flip-up {
    top: auto;
    bottom: calc(100% + 12px);
}

.hotspot-tooltip.flip-up::before {
    top: auto;
    bottom: -6px;
    transform: translateX(-50%) rotate(225deg);
}

.hotspot-tooltip strong {
    display: block;
    color: #fff;
    font-size: 13px;
    margin-bottom: 4px;
}

/* ---------- Nav row ---------- */

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 22px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.nav-btn-primary {
    background: var(--accent-grad);
    border: none;
}

.nav-count {
    color: var(--dim);
    font-size: 13px;
    font-weight: 600;
}

.toc-backdrop {
    display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: flex;
    }

    .toc {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, 82vw);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 60;
        padding-top: 70px;
    }

    .toc.open {
        transform: translateX(0);
    }

    .toc-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 50;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .toc-backdrop.open {
        opacity: 1;
        pointer-events: auto;
    }

    .stage {
        padding: 20px 16px 40px;
    }

    .slide-title {
        font-size: 21px;
    }
}
