.video-tutorials {
    position: relative;
    margin: 0 0 3.5rem;
}

.video-tutorials::before {
    content: "";
    position: absolute;
    inset: -2rem -1rem auto;
    height: 18rem;
    pointer-events: none;
    background: radial-gradient(circle at 22% 20%, rgba(99, 102, 241, 0.17), transparent 58%),
                radial-gradient(circle at 82% 10%, rgba(168, 85, 247, 0.12), transparent 50%);
    filter: blur(10px);
}

.video-tutorial-head,
.written-guide-head {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.4rem;
}

.video-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .65rem;
    color: #a5b4fc;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.video-section-kicker::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: linear-gradient(90deg, #818cf8, transparent);
}

.video-tutorial-head h2,
.written-guide-head h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.video-tutorial-head p,
.written-guide-head p {
    max-width: 30rem;
    margin: 0;
    color: #94a3b8;
    font-size: .86rem;
    line-height: 1.75;
}

.video-tutorial-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.video-tutorial-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 1.25rem;
    background: linear-gradient(155deg, rgba(23, 29, 48, .92), rgba(10, 13, 25, .92));
    box-shadow: 0 1.25rem 3.5rem rgba(0, 0, 0, .22);
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.video-tutorial-card:hover {
    transform: translateY(-5px);
    border-color: rgba(129, 140, 248, .48);
    box-shadow: 0 1.5rem 4rem rgba(24, 28, 55, .45), 0 0 2rem rgba(99, 102, 241, .1);
}

.video-cover-button {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: #05070e;
    cursor: pointer;
}

.video-cover-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .55s ease, filter .35s ease;
}

.video-cover-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 6, 13, .02) 25%, rgba(4, 6, 13, .78) 100%);
}

.video-tutorial-card:hover .video-cover-button img {
    transform: scale(1.035);
    filter: saturate(1.08);
}

.video-play-mark {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 3.6rem;
    height: 3.6rem;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 19, 35, .72);
    box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .35);
    backdrop-filter: blur(10px);
    transform: translate(-50%, -50%);
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.video-play-mark svg {
    width: 1.15rem;
    margin-left: .15rem;
}

.video-cover-button:hover .video-play-mark,
.video-cover-button:focus-visible .video-play-mark {
    transform: translate(-50%, -50%) scale(1.08);
    border-color: rgba(255, 255, 255, .72);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.video-cover-button:focus-visible,
.video-action:focus-visible,
.video-modal-close:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 3px;
}

.video-cover-meta {
    position: absolute;
    z-index: 2;
    right: .8rem;
    bottom: .7rem;
    display: flex;
    gap: .4rem;
}

.video-cover-meta span {
    padding: .28rem .5rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: .45rem;
    color: #e2e8f0;
    background: rgba(5, 7, 14, .78);
    font: 700 .68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    backdrop-filter: blur(8px);
}

.video-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.15rem 1.15rem 1.2rem;
}

.video-card-index {
    margin-bottom: .6rem;
    color: #818cf8;
    font: 800 .68rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .13em;
}

.video-card-body h3 {
    margin: 0 0 .55rem;
    color: #f8fafc;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.video-card-body p {
    flex: 1;
    margin: 0 0 1rem;
    color: #94a3b8;
    font-size: .79rem;
    line-height: 1.7;
}

.video-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .6rem;
}

.video-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    padding: .68rem .85rem;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: .75rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .035);
    font-size: .76rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.video-action-primary {
    border-color: rgba(99, 102, 241, .45);
    color: #fff;
    background: linear-gradient(135deg, rgba(79, 70, 229, .95), rgba(124, 58, 237, .88));
}

.video-action:hover {
    border-color: rgba(165, 180, 252, .55);
    color: #fff;
    background-color: rgba(99, 102, 241, .14);
}

.video-stream-note {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    margin-top: 1rem;
    color: #64748b;
    font-size: .72rem;
}

.video-stream-note i {
    width: .42rem;
    height: .42rem;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 .8rem rgba(52, 211, 153, .55);
}

.written-guide-head {
    align-items: center;
    margin: .5rem 0 1.35rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.video-modal-backdrop[hidden] {
    display: none !important;
}

.video-modal-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: rgba(2, 4, 10, .84);
    backdrop-filter: blur(18px);
}

.video-modal-shell {
    overflow: hidden;
    width: min(62rem, 100%);
    max-height: calc(100vh - 3rem);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 1.35rem;
    background: #090c16;
    box-shadow: 0 2rem 6rem rgba(0, 0, 0, .55), 0 0 3rem rgba(99, 102, 241, .12);
}

.video-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem .9rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.video-modal-title-wrap span {
    display: block;
    margin-bottom: .28rem;
    color: #818cf8;
    font: 800 .63rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .13em;
}

.video-modal-title-wrap h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(.95rem, 2vw, 1.2rem);
    font-weight: 800;
}

.video-modal-close {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .04);
    font-size: 1.35rem;
    cursor: pointer;
}

.video-player-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-player-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    color: #64748b;
    font-size: .72rem;
}

.video-modal-foot-actions {
    display: flex;
    gap: .55rem;
}

.video-modal-foot a {
    text-decoration: none;
}

body.video-modal-open {
    overflow: hidden;
}

#toast {
    z-index: 120 !important;
}

@media (max-width: 820px) {
    .video-tutorial-grid {
        grid-template-columns: 1fr;
    }

    .video-tutorial-head,
    .written-guide-head {
        align-items: flex-start;
        flex-direction: column;
        gap: .65rem;
    }

    .video-tutorial-head p,
    .written-guide-head p {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .video-modal-backdrop {
        align-items: end;
        padding: 0;
    }

    .video-modal-shell {
        width: 100%;
        max-height: 94vh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 1.2rem 1.2rem 0 0;
    }

    .video-modal-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .video-modal-foot-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-tutorial-card,
    .video-cover-button img,
    .video-play-mark {
        transition: none;
    }
}
