/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-code: #1e1e2e;
    --text-primary: #e4e4ef;
    --text-secondary: #9494a8;
    --text-muted: #5e5e72;
    --accent: #7c5cff;
    --accent-glow: rgba(124, 92, 255, 0.3);
    --accent-secondary: #ff6b9d;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --radius: 12px;
    --radius-sm: 8px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-primary);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== BACK TO BLOG ===== */
.back-to-blog {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}

.back-to-blog:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.hero-img-container {
    position: absolute;
    inset: 0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.4) saturate(1.2);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        var(--bg-primary) 0%,
        rgba(10, 10, 15, 0.8) 30%,
        rgba(10, 10, 15, 0.3) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 1.5rem;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.35rem 0.9rem;
    background: rgba(124, 92, 255, 0.15);
    border: 1px solid rgba(124, 92, 255, 0.3);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

/* ===== NAV / TOC ===== */
.toc {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.toc.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.toc-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    overflow-x: auto;
}

.toc-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    white-space: nowrap;
}

.toc-links {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
}

.toc-links a {
    padding: 0.4rem 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}

.toc-links a:hover,
.toc-links a.active {
    color: var(--text-primary);
    background: rgba(124, 92, 255, 0.15);
}

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ===== INTRO ===== */
.intro {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.intro h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.intro p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== DISCLAIMER ===== */
.disclaimer-card {
    border-color: var(--danger);
    background: rgba(248, 113, 113, 0.05);
    text-align: center;
}

.disclaimer-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.disclaimer-card h2 {
    justify-content: center;
    color: var(--danger);
    margin-bottom: 1rem;
}

.disclaimer-card p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 0.8rem;
}

.disclaimer-card em {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== CARDS / SECTIONS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    transition: border-color 0.3s;
}

.card:hover {
    border-color: var(--border-light);
}

.card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.card p strong {
    color: var(--text-primary);
}

.section-divider {
    margin-top: 3rem !important;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* ===== STEP BADGE ===== */
.step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* ===== IMAGE PLACEHOLDERS ===== */
.img-placeholder {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1.5rem 0;
    border: 2px dashed var(--border-light);
    background: var(--bg-code);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-placeholder img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}

.img-placeholder img[src*="PLACEHOLDER"],
.img-placeholder img:not([src]) {
    display: none;
}

.img-note {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-style: italic;
}

/* ===== COST TABLE ===== */
.cost-table {
    margin: 1.5rem 0;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.cost-row:hover {
    background: var(--bg-card-hover);
}

.cost-row:last-of-type {
    border-bottom: none;
}

.cost-item {
    font-weight: 600;
    color: var(--text-primary);
}

.cost-price {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
}

.cost-detail {
    padding: 0 1.2rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cost-total {
    margin-top: 0.5rem;
    border-top: 2px solid var(--accent);
    border-bottom: none;
    padding-top: 1.2rem;
}

.cost-total .cost-item {
    font-size: 1.1rem;
}

.cost-total .cost-price {
    font-size: 1.2rem;
}

/* ===== STB LIST ===== */
.stb-list {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.stb-item {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem 1.5rem;
    position: relative;
}

.stb-item.stb-active {
    border-color: var(--success);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
}

.stb-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.stb-badge.info {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.stb-item h3 {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
}

.stb-item p {
    margin: 0;
    font-size: 0.9rem;
}

/* ===== CODE BLOCKS ===== */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    white-space: nowrap;
}

/* ===== STEPS LIST ===== */
.steps-list {
    margin: 1.5rem 0;
}

.step-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.step-item:last-child {
    border-bottom: none;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 2px;
}

.step-item p {
    margin: 0;
    flex: 1;
}

/* ===== VIDEO EMBED ===== */
.video-embed {
    position: relative;
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.video-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
}

/* ===== TIP / WARNING BOXES ===== */
.tip-box, .warning-box, .note-box {
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tip-box {
    background: rgba(74, 222, 128, 0.08);
    border-left: 4px solid var(--success);
    color: var(--text-secondary);
}

.warning-box {
    background: rgba(248, 113, 113, 0.08);
    border-left: 4px solid var(--danger);
    color: var(--text-secondary);
}

.note-box {
    background: rgba(124, 92, 255, 0.08);
    border-left: 4px solid var(--accent);
    color: var(--text-secondary);
}

/* ===== SSH GRID ===== */
.ssh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.ssh-card {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
}

.ssh-card h4 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.ssh-card small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== CHECK LIST ===== */
.check-list {
    list-style: none;
    margin: 1.5rem 0;
}

.check-list li {
    padding: 0.6rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-secondary);
}

.check-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* ===== BUTTON LINK ===== */
.btn-link {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 0.5rem;
}

.btn-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* ===== FINAL NOTE ===== */
.final-note {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), rgba(255, 107, 157, 0.1));
    border-radius: var(--radius);
}

/* ===== SUPPORT BOX ===== */
.support-box {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.support-box p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.support-btn {
    font-size: 1.05rem;
    padding: 0.85rem 2rem;
}

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-credit {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
}

.footer-year {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== SCROLL TOP ===== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 99;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero {
        height: 55vh;
        min-height: 400px;
    }

    .hero-content {
        padding: 2rem 1.5rem;
    }

    .card {
        padding: 1.8rem 1.2rem;
    }

    .toc-inner {
        padding: 0.6rem 1rem;
        gap: 0.8rem;
    }

    .toc-label {
        display: none;
    }

    .cost-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .ssh-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 1rem 1rem 3rem;
    }

    .card h2 {
        font-size: 1.3rem;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
