:root {
    --ink: #101614;
    --ink-soft: #31423b;
    --paper: #f4f7f1;
    --panel: #ffffff;
    --line: #d9e4d7;
    --teal: #00aaa4;
    --teal-dark: #063f3f;
    --cyan: #43c7ff;
    --electric: #00f5ff;
    --blue: #0577ff;
    --coral: #ff6655;
    --amber: #ffc857;
    --green: #6bd977;
    --shadow: 0 24px 70px rgba(16, 22, 20, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    background:
        linear-gradient(90deg, rgba(6, 63, 63, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
        linear-gradient(180deg, rgba(6, 63, 63, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
        var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: 60;
    background:
        radial-gradient(circle at 16% 20%, rgba(0, 245, 255, 0.08), transparent 26%),
        radial-gradient(circle at 88% 18%, rgba(5, 119, 255, 0.1), transparent 28%),
        repeating-linear-gradient(180deg, rgba(16, 22, 20, 0.018) 0 1px, transparent 1px 8px);
    content: "";
    pointer-events: none;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: var(--progress, 0%);
    height: 4px;
    background: linear-gradient(90deg, var(--electric), var(--blue), var(--amber));
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.52);
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: 72px;
    border-bottom: 1px solid rgba(67, 199, 255, 0.16);
    background:
        linear-gradient(90deg, rgba(244, 247, 241, 0.94), rgba(244, 247, 241, 0.86)),
        rgba(244, 247, 241, 0.92);
    backdrop-filter: blur(18px);
}

.nav-container {
    display: flex;
    width: min(1180px, 90%);
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 950;
    text-decoration: none;
}

.nav-logo-mark {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(67, 199, 255, 0.24);
    border-radius: 10px;
    background: #050b11;
    box-shadow: 0 12px 28px rgba(6, 63, 63, 0.22), 0 0 28px rgba(0, 245, 255, 0.18);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.nav-logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.18);
}

.nav-logo:hover .nav-logo-mark,
.nav-logo:focus-visible .nav-logo-mark {
    transform: rotate(-4deg) translateY(-1px);
    box-shadow: 0 16px 34px rgba(6, 63, 63, 0.3), 0 0 38px rgba(0, 245, 255, 0.28);
}

.nav-breadcrumb {
    color: var(--ink-soft);
    font-size: 0.94rem;
    font-weight: 800;
}

.nav-breadcrumb a {
    color: var(--teal-dark);
    text-decoration: none;
}

.tutorial-hero {
    position: relative;
    overflow: hidden;
    padding: 88px 0 74px;
    background:
        radial-gradient(circle at 18% 20%, rgba(0, 245, 255, 0.18), transparent 26%),
        radial-gradient(circle at 82% 4%, rgba(5, 119, 255, 0.2), transparent 30%),
        linear-gradient(90deg, rgba(67, 199, 255, 0.12) 1px, transparent 1px) 0 0 / 68px 68px,
        linear-gradient(180deg, rgba(67, 199, 255, 0.1) 1px, transparent 1px) 0 0 / 68px 68px,
        #04080d;
    color: #ffffff;
}

.tutorial-hero::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 32%, rgba(0, 245, 255, 0.12) 32.2% 32.5%, transparent 32.7%),
        repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.04) 18px 20px);
    content: "";
    opacity: 0.68;
    animation: tutorialScan 16s linear infinite;
}

.tutorial-hero-inner {
    position: relative;
    display: grid;
    width: min(1180px, 90%);
    grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
    gap: 38px;
    align-items: center;
    margin: 0 auto;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--cyan);
    font-size: 0.82rem;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tutorial-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: 4.3rem;
    line-height: 1;
    letter-spacing: 0;
    text-shadow: 0 0 36px rgba(0, 245, 255, 0.22);
}

.tutorial-hero p:last-child {
    max-width: 720px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.12rem;
}

.tutorial-mission-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 18px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(67, 199, 255, 0.24);
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        rgba(0, 0, 0, 0.44);
    box-shadow: 0 34px 110px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.tutorial-mission-card::before {
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 180deg, transparent, rgba(0, 245, 255, 0.22), transparent);
    content: "";
    animation: logoSweep 9s linear infinite;
}

.tutorial-mission-card img,
.tutorial-mission-card span {
    position: relative;
    z-index: 1;
}

.tutorial-mission-card img {
    width: 170px;
    border-radius: 18px;
    box-shadow: 0 0 54px rgba(0, 245, 255, 0.2);
    animation: logoHover 5.4s ease-in-out infinite;
}

.tutorial-mission-card span {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.86rem;
    font-weight: 950;
    text-align: center;
    text-transform: uppercase;
}

.tutorial-container {
    display: grid;
    width: min(1180px, 90%);
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
    gap: 34px;
    align-items: start;
    margin: 46px auto 78px;
}

.tutorial-sidebar {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 16px;
}

.tutorial-nav,
.other-tutorials,
.tutorial-content article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 42px rgba(16, 22, 20, 0.08);
}

.tutorial-nav,
.other-tutorials {
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.tutorial-nav::before,
.other-tutorials::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--electric), var(--blue), var(--amber));
    content: "";
}

.tutorial-nav h3,
.other-tutorials h3 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.tutorial-nav ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tutorial-nav a,
.other-tutorials a {
    display: block;
    border-radius: 8px;
    color: var(--ink-soft);
    font-weight: 820;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tutorial-nav a {
    padding: 9px 10px;
}

.other-tutorials {
    display: grid;
    gap: 10px;
}

.other-tutorials a {
    padding: 10px 12px;
    background: #f7fbf6;
}

.tutorial-nav a:hover,
.tutorial-nav a:focus-visible,
.tutorial-nav a.is-active,
.other-tutorials a:hover,
.other-tutorials a:focus-visible {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.12), rgba(255, 200, 87, 0.12));
    color: var(--teal-dark);
    transform: translateX(4px);
}

.tutorial-content article {
    overflow: hidden;
    padding: 38px;
}

.tutorial-content article > h1 {
    margin: 0 0 12px;
    font-size: 2.7rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 34px;
}

.article-meta span {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7fbf6;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 800;
}

.tutorial-content section {
    position: relative;
    padding: 30px 0;
    border-top: 1px solid var(--line);
}

.tutorial-content section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.tutorial-content h2 {
    margin: 0 0 14px;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.tutorial-content h3 {
    margin: 24px 0 10px;
    font-size: 1.18rem;
}

.tutorial-content p,
.tutorial-content li,
.tutorial-content td {
    color: var(--ink-soft);
}

.components-list {
    display: grid;
    gap: 8px;
    padding-left: 22px;
}

.info-box,
.warning-box,
.success-box,
.circuit-diagram {
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    padding: 18px 18px 18px 20px;
    border: 1px solid rgba(0, 170, 164, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(0, 245, 255, 0.08), rgba(255, 255, 255, 0.62)),
        #f8fbf7;
}

.warning-box {
    border-color: rgba(255, 200, 87, 0.36);
    background: linear-gradient(135deg, rgba(255, 200, 87, 0.16), rgba(255, 255, 255, 0.72)), #fffaf0;
}

.success-box {
    border-color: rgba(107, 217, 119, 0.42);
    background: linear-gradient(135deg, rgba(107, 217, 119, 0.16), rgba(255, 255, 255, 0.74)), #f7fff7;
}

.circuit-diagram {
    display: grid;
    gap: 8px;
    background:
        linear-gradient(90deg, rgba(0, 170, 164, 0.12) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(180deg, rgba(0, 170, 164, 0.1) 1px, transparent 1px) 0 0 / 22px 22px,
        #0e1b18;
}

.circuit-diagram p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 780;
}

.code-block {
    position: relative;
    margin: 20px 0;
    overflow: hidden;
    border: 1px solid rgba(67, 199, 255, 0.22);
    border-radius: 8px;
    background: #07111d;
    box-shadow: inset 0 0 38px rgba(0, 245, 255, 0.08);
}

.code-block::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--electric), var(--blue), var(--amber));
    content: "";
}

.code-block pre {
    margin: 0;
    overflow-x: auto;
    padding: 26px 18px 18px;
}

.code-block code {
    color: #d7f9ff;
    font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: 0.93rem;
}

.copy-code {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    transition: background 160ms ease, transform 160ms ease;
}

.copy-code:hover,
.copy-code:focus-visible {
    background: rgba(0, 245, 255, 0.18);
    transform: translateY(-1px);
}

.functions-table {
    width: 100%;
    margin: 18px 0;
    overflow: hidden;
    border-collapse: collapse;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.functions-table th,
.functions-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.functions-table th {
    background: #0e1b18;
    color: #ffffff;
}

.functions-table tr:hover td {
    background: rgba(0, 245, 255, 0.05);
}

.footer {
    padding: 28px 0;
    background: var(--ink);
    color: rgba(255, 255, 255, 0.78);
}

.footer .container {
    width: min(1180px, 90%);
    margin: 0 auto;
}

.footer p {
    margin: 0;
}

@keyframes logoSweep {
    to {
        transform: rotate(360deg);
    }
}

@keyframes logoHover {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes tutorialScan {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 180px 0, 90px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 980px) {
    .tutorial-hero-inner,
    .tutorial-container {
        grid-template-columns: 1fr;
    }

    .tutorial-sidebar {
        position: static;
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    .nav-container {
        min-height: 66px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding: 10px 0;
    }

    .tutorial-hero {
        padding: 62px 0 54px;
    }

    .tutorial-hero h1 {
        font-size: 3rem;
    }

    .tutorial-content article {
        padding: 24px;
    }

    .tutorial-content article > h1 {
        font-size: 2.1rem;
    }

    .tutorial-content h2 {
        font-size: 1.65rem;
    }
}

@media (max-width: 430px) {
    .nav-logo-mark {
        width: 40px;
        height: 40px;
    }

    .tutorial-hero h1 {
        font-size: 2.45rem;
    }

    .tutorial-mission-card {
        padding: 18px;
    }
}
