@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #0a0a0a;
    color: #e5e5e5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 0;
    /* Padding removed due to footer */
}

/* Subtelne, monochromatyczne tło z siatką */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: #050505;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Navbar */
.navbar {
    width: 100%;
    padding: 25px 50px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #222;
    margin-bottom: 40px;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.85);
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* Menu */
.active-screen {
    display: block;
    width: 100%;
    animation: fadeIn 0.4s ease forwards;
}

.hidden-screen {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.main-title {
    font-size: 34px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 50px;
    color: #fff;
    letter-spacing: -0.5px;
}

.menu-cards,
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    /*width: 75%;*/
    margin-top: 30px;
}

.menu-card,
.lesson-card {
    background: #111;
    border: 1px solid #333;
    padding: 40px 30px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    text-align: left;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.menu-card:hover,
.lesson-card:hover {
    transform: translateY(-8px);
    background: #161616;
    border-color: #61afef;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.lesson-card h3 {
    font-size: 24px;
    color: #fff;
    margin: 20px 0 10px;
    font-weight: 700;
}

.lesson-card p {
    font-size: 15px;
    color: #aaa;
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
}

.lesson-number {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    font-family: 'Fira Code', monospace;
}

.lesson-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    background: #222;
    border: 1px solid #333;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #444;
    color: #ccc;
    background: #222;
    font-family: 'Fira Code', monospace;
}

/* Lesson Cards */
.card {
    display: none;
    width: 100%;
}

.active-section {
    display: block;
    animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-effect {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 50px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.card-content h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    color: #fff;
    line-height: 1.3;
}

.card-content h1 span {
    color: #888;
    font-weight: 500;
}

.card-content>p {
    font-size: 15px;
    line-height: 1.7;
    color: #bbb;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s ease;
    outline: none;
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    background: #ddd;
}

.btn-secondary {
    background: transparent;
    color: #aaa;
    border-color: #444;
}

.btn-secondary:hover {
    background: #222;
    color: #fff;
}

.btn-success {
    background: #e5e5e5;
    color: #000;
    border-color: #e5e5e5;
}

.btn-success:hover {
    background: #fff;
}

.buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #222;
}

/* Line-by-Line Breakdown */
.line-by-line {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.code-row {
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
}

.code-header {
    background: #161616;
    padding: 14px 20px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #fff;
    border-bottom: 1px solid #333;
}

.code-desc {
    padding: 20px;
    font-size: 14.5px;
    color: #bbb;
    line-height: 1.7;
}

.code-desc b {
    color: #fff;
    font-weight: 600;
}

/* "Po ludzku" box */
.po-ludzku {
    margin-top: 15px;
    padding: 15px;
    background: #1a1a1a;
    border-left: 3px solid #666;
    font-size: 14px;
    color: #ddd;
    line-height: 1.6;
    border-radius: 0 4px 4px 0;
}

.po-ludzku b {
    color: #fff;
}

/* Syntax IDE One Dark */
.keyword {
    color: #c678dd;
    font-weight: bold;
}

.string {
    color: #98c379;
}

.function {
    color: #61afef;
}

.class {
    color: #e5c07b;
    font-weight: bold;
}

.number {
    color: #d19a66;
}

.built_in {
    color: #56b6c2;
}

.code-inline {
    font-family: 'Fira Code', monospace;
    background: #222;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    border: 1px solid #444;
}

/* Animations Container */
.anim-box {
    background: #0a0a0a;
    border-radius: 6px;
    padding: 30px;
    margin: 30px 0;
    border: 1px solid #333;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.anim-desc {
    font-size: 13px !important;
    color: #777 !important;
    margin-top: 25px !important;
    margin-bottom: 0 !important;
    font-weight: 500;
}

/* ========================================= */
/* KLASY ANIMACJI (Z akcentami IDE)          */
/* ========================================= */

/* P0 Theory Perceptron */
.perceptron-diagram {
    display: flex;
    align-items: center;
    gap: 20px;
}

.p-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.p-in-node {
    width: 30px;
    height: 30px;
    background: #222;
    border: 1px solid #61afef;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    line-height: 28px;
    color: #61afef;
    animation: pulseNode 3s infinite alternate;
}

.p-lines {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    border-right: 1px dashed #666;
    height: 100px;
    margin-right: 10px;
}

.p-soma {
    width: 90px;
    height: 90px;
    background: #111;
    border: 2px solid #c678dd;
    color: #c678dd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 0 15px rgba(198, 120, 221, 0.2);
}

.p-arrow {
    color: #666;
    font-size: 20px;
    animation: glowArrow 1.5s infinite alternate;
}

.p-out {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #98c379;
    color: #98c379;
    font-weight: bold;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

@keyframes glowArrow {
    from {
        color: rgba(255, 255, 255, 0.2);
        transform: translateX(0);
    }

    to {
        color: #fff;
        transform: translateX(5px);
    }
}

/* P1 Random Weights */
.rand-weights {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.w-cube {
    width: 60px;
    height: 60px;
    background: #222;
    border: 1px solid #56b6c2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #56b6c2;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    animation: floatCube 3s infinite ease-in-out alternate;
}

.w-cube:nth-child(2) {
    animation-delay: 1s;
}

.w-cube:nth-child(3) {
    animation-delay: 2s;
}

@keyframes floatCube {
    0% {
        transform: translateY(0) scale(1) rotate(-3deg);
    }

    100% {
        transform: translateY(-10px) scale(1.05) rotate(3deg);
    }
}

/* P2 Step Function */
.step-anim {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.step-bar-bg {
    width: 300px;
    height: 16px;
    background: #222;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.step-bar-fill {
    height: 100%;
    width: 0%;
    background: #61afef;
    animation: fillBar 4s infinite;
}

.step-result {
    padding: 12px 24px;
    font-size: 18px;
    font-weight: 800;
    border-radius: 4px;
    background: #111;
    color: #fff;
    border: 1px solid #444;
}

.step-res-1 {
    border-color: #98c379;
    color: #98c379;
    animation: popIn 4s infinite;
}

@keyframes fillBar {
    0% {
        width: 0%;
    }

    50% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

@keyframes popIn {

    0%,
    45% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    50%,
    95% {
        opacity: 1;
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(152, 195, 121, 0.3);
    }

    100% {
        opacity: 0.3;
        transform: scale(0.95);
    }
}

/* P4 Error Update */
.update-anim {
    display: flex;
    gap: 30px;
    font-size: 18px;
    font-family: 'Fira Code', monospace;
    font-weight: bold;
}

.w-old {
    color: #666;
    text-decoration: line-through;
}

.w-new {
    color: #e5c07b;
    animation: wUpdatePulse 1.5s infinite alternate;
}

@keyframes wUpdatePulse {
    from {
        transform: scale(1);
        text-shadow: none;
    }

    to {
        transform: scale(1.1);
        text-shadow: 0 0 10px #e5c07b;
    }
}

/* P6 XOR Problem */
.xor-grid-wrap {
    width: 140px;
    height: 140px;
    border: 1px solid #555;
    position: relative;
    border-radius: 8px;
}

.xor-p {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    border: 1px solid #fff;
}

.x-00 {
    bottom: 10%;
    left: 10%;
    background: #333;
    color: #fff;
}

.x-11 {
    top: 10%;
    right: 10%;
    background: #333;
    color: #fff;
}

.x-01 {
    top: 10%;
    left: 10%;
    background: #e06c75;
    color: #fff;
    border-color: #e06c75;
}

.x-10 {
    bottom: 10%;
    right: 10%;
    background: #e06c75;
    color: #fff;
    border-color: #e06c75;
}

.xor-line {
    position: absolute;
    width: 150%;
    height: 2px;
    background: #61afef;
    top: 50%;
    left: -25%;
    transform-origin: center;
    animation: xorStruggle 3s infinite;
}

@keyframes xorStruggle {
    0% {
        transform: rotate(20deg) translateY(-20px);
    }

    50% {
        transform: rotate(-45deg) translateY(0px);
    }

    100% {
        transform: rotate(20deg) translateY(30px);
    }
}

/* P7 Race */
.race-anim {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.race-track {
    width: 100%;
    height: 36px;
    background: #111;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid #333;
}

.runner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px;
    color: #000;
    font-weight: bold;
    font-size: 12px;
    line-height: 34px;
    text-align: right;
    padding-right: 15px;
    white-space: nowrap;
}

.r-sk {
    background: #61afef;
    color: #fff;
    width: 0%;
    animation: runFast 2s infinite;
}

.r-my {
    background: #888;
    color: #fff;
    width: 0%;
    animation: runSlow 2s infinite;
}

@keyframes runFast {
    0% {
        width: 0%;
    }

    10% {
        width: 100%;
    }

    100% {
        width: 100%;
    }
}

@keyframes runSlow {
    0% {
        width: 0%;
    }

    80% {
        width: 100%;
    }

    100% {
        width: 100%;
    }
}

/* P8 CM Grid */
.cm-mat {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 400px;
    border: 1px solid #333;
    background: #111;
}

.cm-c {
    padding: 20px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
}

.cm-ok {
    color: #aaa;
    border-bottom: 1px solid #333;
}

.cm-err {
    color: #fff;
    border-bottom: 1px solid #333;
}

.cm-fn {
    position: relative;
    animation: falseAlarm 1s infinite alternate;
    color: #e06c75;
}

@keyframes falseAlarm {
    from {
        background: #111;
        box-shadow: none;
    }

    to {
        background: #4c1d24;
        box-shadow: inset 0 0 10px rgba(224, 108, 117, 0.2);
    }
}

/* M0 Theory MLP */
.mlp-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}

.layer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.mnode {
    width: 30px;
    height: 30px;
    background: #111;
    border: 1px solid #666;
    border-radius: 50%;
    font-size: 10px;
    text-align: center;
    line-height: 28px;
    color: #fff;
}

.l-hid1 .mnode,
.l-hid2 .mnode {
    border-color: #c678dd;
    background: #222;
    animation: blinkLayers 2s infinite alternate;
}

.l-hid2 .mnode {
    animation-delay: 1s;
}

.l-out .mnode {
    border-color: #98c379;
    background: #222;
    color: #98c379;
    font-weight: bold;
}

@keyframes blinkLayers {
    from {
        box-shadow: 0 0 2px #c678dd;
        transform: scale(0.95);
    }

    to {
        box-shadow: 0 0 10px #c678dd;
        transform: scale(1.05);
    }
}

/* M1 MLP Gears */
.gears-anim {
    display: flex;
    align-items: center;
    gap: 30px;
}

.gear {
    font-size: 50px;
    display: inline-block;
}

.gear-tf {
    animation: spinTF 4s linear infinite;
    filter: drop-shadow(0 0 5px #e5c07b);
}

.gear-k {
    animation: spinK 6s linear infinite;
    filter: drop-shadow(0 0 5px #e06c75);
}

@keyframes spinTF {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinK {
    100% {
        transform: rotate(-360deg);
    }
}

/* M2 MLP Dense Web */
.dense-web {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.col-nodes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.node {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eef;
    box-shadow: 0 0 8px #61afef;
    animation: pulseNode 2s infinite alternate;
}

@keyframes pulseNode {
    from {
        opacity: 0.5;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1.2);
    }
}

.lines-conn {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(97, 175, 239, 0), rgba(97, 175, 239, 0.5), rgba(97, 175, 239, 0));
    position: relative;
    overflow: hidden;
}

.lines-conn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background: #61afef;
    filter: blur(1px);
    animation: shoot 1s infinite linear;
}

@keyframes shoot {
    0% {
        left: -20px;
    }

    100% {
        left: 100%;
    }
}

/* M3 Softmax Anim */
.softmax-anim {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 800;
    font-size: 18px;
}

.sm-raw {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #888;
    font-family: 'Fira Code', monospace;
}

.sm-perc {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #98c379;
    animation: glowSm 2s infinite alternate;
    font-family: 'Fira Code', monospace;
}

@keyframes glowSm {
    from {
        text-shadow: 0 0 2px #98c379;
    }

    to {
        text-shadow: 0 0 8px #98c379;
        transform: scale(1.05);
    }
}

/* M5 Scale Anim */
.scaler-anim {
    display: flex;
    align-items: flex-end;
    gap: 30px;
    height: 120px;
}

.bar-big {
    width: 40px;
    background: #444;
    color: #fff;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    animation: scaleDown 3s infinite alternate cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-small {
    width: 40px;
    background: #888;
    color: #fff;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    animation: scaleUp 3s infinite alternate cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-scaled {
    width: 40px;
    background: #61afef;
    color: #fff;
    height: 60px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
}

.bar-scaled-2 {
    width: 40px;
    background: #61afef;
    color: #fff;
    height: 40px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
}

@keyframes scaleDown {
    0% {
        height: 120px;
        background: #444;
    }

    100% {
        height: 60px;
        background: #61afef;
        color: #fff;
    }
}

@keyframes scaleUp {
    0% {
        height: 20px;
        background: #888;
    }

    100% {
        height: 40px;
        background: #61afef;
        color: #fff;
    }
}

/* M6 Epoch/Loss progress */
.train-sim {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.t-metric {
    display: flex;
    justify-content: space-between;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
}

.m-loss {
    color: #888;
    font-weight: bold;
    animation: numDrop 4s infinite linear;
}

.m-acc {
    color: #98c379;
    font-weight: bold;
    animation: numRise 4s infinite linear;
}

@keyframes numDrop {
    0% {
        content: "1.520"
    }

    100% {
        opacity: 0.3;
    }
}

@keyframes numRise {
    0% {
        content: "30.0%"
    }

    100% {
        opacity: 0.3;
    }
}

/* Interactive Playgrounds */
.playground-wrap {
    background: #0a0a0a;
    padding: 30px;
    border-radius: 6px;
    border: 1px solid #333;
    width: 100%;
}

.slider-lbl {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
}

#pl-val {
    font-family: 'Fira Code', monospace;
    background: #222;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #444;
    color: #fff;
}

input[type=range] {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    margin-bottom: 25px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #61afef;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #000;
    box-shadow: 0 0 10px rgba(97, 175, 239, 0.3);
}

input[type=checkbox] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #61afef;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 12px;
    background: #111;
    border: 1px solid #222;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: 0.2s;
}

.switch-row:hover {
    background: #161616;
    border-color: #444;
}

.lbl-txt {
    font-size: 14px;
    font-weight: 500;
}

.result-box {
    padding: 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    transition: 0.3s ease;
    margin-top: 15px;
    border: 1px solid #444;
    background: #111;
    color: #fff;
}

.yes-go {
    background: #161616;
    border-color: #98c379;
    color: #98c379;
}

.no-go {
    background: #0a0a0a;
    border-color: #333;
    color: #888;
}

/* Footer */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 25px 20px;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    margin-top: 40px;
    border-top: 1px solid #222;
    background: #080808;
    z-index: 10;
    position: relative;
}


/* ===== SITE NAV (Top) ===== */
.site-nav {
    width: 100%;
    padding: 15px 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(5, 5, 5, 0.85);
    border-bottom: 1px solid #222;
}

.nav-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-links a {
    color: #888;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    transition: 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: #222;
}

/* ===== LESSON LAYOUT ===== */
.lesson-hero {
    text-align: center;
    padding: 60px 20px 40px;
}

.lesson-hero-content h1 {
    font-size: 34px;
    font-weight: 800;
    color: #fff;
}
.lesson-layout {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    align-items: start;
}

@media (max-width: 1024px) {
    .lesson-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }

    .lesson-sidebar {
        display: none;
    }

    .lesson-content {
        max-width: 100%;
    }

    .site-nav {
        padding: 10px 20px;
    }
}

.lesson-content {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* ===== TOC SIDEBAR ===== */
.lesson-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-title {
    font-size: 13px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.toc-list {
    list-style: none;
    border-left: 2px solid #222;
}

.toc-list li {
    margin-bottom: 2px;
}

.toc-list a {
    display: block;
    padding: 8px 15px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: 0.2s;
    line-height: 1.4;
}

.toc-list a:hover,
.toc-list a.active {
    color: #61afef;
    border-left-color: #61afef;
    background: #111;
}

.content-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.content-section h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #fff;
}

.content-section h2 {
    font-size: 24px;
    margin-bottom: 25px;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 1px solid #222;
}

/* How to use section */
.how-to-use-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.how-to-use-card {
    padding: 35px;
    text-align: left;
    border-radius: 12px;
}

.how-to-use-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.how-to-use-card p {
    color: #aaa;
    font-size: 15px;
    line-height: 1.6;
}


/* ===== QUIZ SECTION ===== */
.quiz-container {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.quiz-container h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #fff;
}

.text-muted {
    color: #888;
    font-size: 14px;
}

.mt-2 {
    margin-top: 10px;
}

.quiz-question {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 20px;
    margin-top: 25px;
}

.quiz-question p {
    color: #ccc;
    margin-bottom: 15px;
    font-weight: 600;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 15px 20px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #161616;
    color: #aaa;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.quiz-option:hover {
    border-color: #666;
    color: #fff;
    background: #222;
}

.quiz-option.correct {
    border-color: #98c379;
    background: #1a2e1d;
    color: #98c379;
}

.quiz-option.wrong {
    border-color: #e06c75;
    background: #31181a;
    color: #e06c75;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.quiz-feedback {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.success {
    background: #1a2e1d;
    color: #98c379;
    border: 1px solid #98c379;
}

.quiz-feedback.error {
    background: #31181a;
    color: #e06c75;
    border: 1px solid #e06c75;
}

/* ===== ADAPTING PREV/NEXT CLASSES ===== */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid #333;
}

.lesson-nav a {
    padding: 15px 25px;
    border-radius: 4px;
    font-weight: bold;
    background: #fff;
    color: #000;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s;
}

.lesson-nav a:hover {
    background: #ddd;
}

/* P9 Class vs Regression */
.cr-compare { display: flex; gap: 40px; justify-content: center; width: 100%; margin-top:10px; }
.cr-panel { display: flex; flex-direction: column; align-items: center; border: 1px solid #333; border-radius:8px; padding: 20px; width:45%; background: #111; position: relative; height: 180px; }
.cr-title { font-size: 14px; font-weight: bold; color: #888; margin-bottom: 20px;}

/* Classification Anim */
.c-ball { width: 15px; height: 15px; background: #fff; border-radius: 50%; position: absolute; top: 50px; animation: cBounce 3s infinite ease-in-out; }
.c-buckets { display: flex; gap: 20px; position: absolute; bottom: 20px; }
.c-bucket { width: 40px; height: 30px; border: 2px solid; border-top: none; border-radius: 0 0 10px 10px; display: flex; align-items:center; justify-content:center; color:#fff; font-size:12px; font-weight:bold; }

@keyframes cBounce {
   0% { top: 50px; left: 50%; transform: translateX(-50%); }
   40% { top: 120px; left: 30%; transform: translateX(-50%); opacity: 1; }
   50% { top: 120px; left: 30%; transform: translateX(-50%); opacity: 0; }
   51% { top: 50px; left: 50%; transform: translateX(-50%); opacity: 0; }
   60% { top: 50px; left: 50%; transform: translateX(-50%); opacity: 1; }
   90% { top: 120px; left: 70%; transform: translateX(-50%); opacity: 1; }
   100% { top: 120px; left: 70%; transform: translateX(-50%); opacity: 0; }
}

/* Regression Anim */
.r-ball { width: 15px; height: 15px; background: #98c379; border-radius: 50%; position: absolute; left: 50%; transform:translateX(-50%); bottom: 20px; animation: rShoot 3s infinite ease-in-out; z-index:2;}
.r-scale { border-left: 2px dashed #555; height: 100px; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 20px; }
.r-scale::after { content: '94.2'; position: absolute; top: 10px; left: 15px; color: #98c379; font-size: 12px; font-family: monospace; font-weight:bold; opacity:0; animation: rText 3s infinite ease-in-out; }

@keyframes rShoot {
    0% { bottom: 20px; }
    50% { bottom: 100px; }
    100% { bottom: 20px; }
}
@keyframes rText {
    0% { opacity: 0; }
    40% { opacity: 0; }
    50% { opacity: 1; }
    60% { opacity: 0; }
    100% { opacity: 0; }
}

/* P10 Loss Bar Chart */
.loss-anim { display: flex; flex-direction: column; gap:15px; width: 300px; margin-top:20px; }
.loss-row { display: flex; align-items: center; gap: 15px; }
.loss-label { width: 50px; font-size: 12px; font-weight: bold; color: #888; text-align: right; }
.loss-track { flex-grow: 1; height: 12px; background: #222; border-radius: 6px; position: relative; }
.loss-bar { height: 100%; border-radius: 6px; }

.bar-mae { background: #e5c07b; animation: maeGrow 4s infinite linear; }
.bar-mse { background: #e06c75; animation: mseGrow 4s infinite ease-in; }
.bar-hub { background: #61afef; animation: hubGrow 4s infinite ease-in-out; }

@keyframes maeGrow { 0% { width: 0%; } 100% { width: 70%; } }
@keyframes mseGrow { 0% { width: 0%; } 100% { width: 100%; background: #ff4040; box-shadow: 0 0 15px #ff4040; } }
@keyframes hubGrow { 0% { width: 0%; } 100% { width: 60%; } }

/* P11 tf.data Pipeline */
.pipe-anim { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 20px 10px; }
.pipe-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.p-st-title { font-size: 11px; color:#888; text-transform:uppercase; font-weight:bold; }
.p-st-box { width: 60px; height: 60px; border: 1px solid #333; background: #111; border-radius: 8px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;}
.p-arrow { color: #555; font-size: 16px; font-weight: bold; }

.d-item { width: 15px; height: 15px; position: absolute; border-radius:3px; }
.i-red { background: #e06c75; }
.i-blu { background: #61afef; }
.i-grn { background: #98c379; }

/* Raw Data */
.raw-1 { top: 10px; left: 22px; }
.raw-2 { top: 35px; left: 10px; }
.raw-3 { top: 35px; left: 35px; }

/* Shuffle - animate position swaps */
.shuf-1 { animation: s1 2s infinite alternate ease-in-out; }
.shuf-2 { animation: s2 2s infinite alternate ease-in-out; }
.shuf-3 { animation: s3 2s infinite alternate ease-in-out; }

@keyframes s1 { 0% { top: 10px; left: 22px; } 100% { top: 35px; left: 35px; } }
@keyframes s2 { 0% { top: 35px; left: 10px; } 100% { top: 10px; left: 22px; } }
@keyframes s3 { 0% { top: 35px; left: 35px; } 100% { top: 35px; left: 10px; } }

/* Batch - items squeezed together */
.bat-wrap { display: flex; gap: 2px; border: 1px dashed #e5c07b; padding: 2px; border-radius: 4px; animation: bPulse 2s infinite alternate; }
.bat-wrap .d-item { position: relative; width: 12px; height: 12px; }
@keyframes bPulse { from { border-color: transparent; } to { border-color: #e5c07b; } }

/* Prefetch - shooting batch to GPU */
.p-gpu { font-weight: bold; color: #c678dd; font-size: 16px; }
.pref-batch { position: absolute; display: flex; gap:2px; left: -30px; animation: shootGPU 2s infinite linear; }
.pref-batch .d-item { position: relative; width: 8px; height: 8px; }
@keyframes shootGPU { 0% { left: -30px; opacity:1; } 80% { left: 40px; opacity:1; } 100% { left: 40px; opacity:0; } }

@media (max-width: 1024px) {
    .nav-inner {
        padding: 0;
    }
}

@media (max-width: 600px) {
    .cm-mat {
        grid-template-columns: 1fr;
    }

    .glass-effect {
        padding: 20px;
    }

    .card-content h1 {
        font-size: 22px;
    }

    .mlp-diagram {
        flex-direction: column;
        height: 300px;
        justify-content: space-between;
    }

    .layer {
        flex-direction: row;
    }

    .buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
    }

    .site-nav {
        padding: 15px;
    }

    .nav-inner {
        flex-direction: column;
        gap: 15px;
    }

    .nav-logo {
        font-size: 18px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ========================================= */
/* L4: HIPERPARAMETRY ANIMACJE               */
/* ========================================= */

.lr-anim-compare {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

.lr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    width: 30%;
}

/* Learning Rate Bouncing Ball */
.lr-terrain {
    width: 100%;
    height: 100px;
    border-bottom: 3px solid #61afef;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-radius: 0 0 100px 100px; /* shape like a bowl */
    position: relative;
    margin-top: 20px;
    box-shadow: inset 0 -10px 20px rgba(97, 175, 239, 0.1);
}
.lr-title {
    font-size: 11px;
    font-weight: bold;
    color: #bbb;
    margin-bottom: 5px;
}
.lr-ball {
    width: 12px;
    height: 12px;
    background: #e5c07b;
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 10px rgba(229, 192, 123, 0.5);
    left: 10%;
    top: 0;
}

/* Zbyt mały LR: schodzi powoli po zboczu */
.ball-low {
    animation: bounceLow 4s infinite linear;
}
@keyframes bounceLow {
    0% { top: 0px; left: 10%; }
    10% { top: 15px; left: 15%; }
    20% { top: 30px; left: 20%; }
    30% { top: 45px; left: 25%; }
    40% { top: 60px; left: 30%; }
    50% { top: 70px; left: 35%; }
    60% { top: 80px; left: 40%; }
    70% { top: 88px; left: 45%; }
    80% { top: 90px; left: 47%; }
    100% { top: 90px; left: 47%; }
}

/* Optymalny LR: schodzi sprężyście do centrum */
.ball-opt {
    animation: bounceOpt 4s infinite ease-in-out;
}
@keyframes bounceOpt {
    0% { top: 0px; left: 10%; }
    20% { top: 80px; left: 70%; }
    40% { top: 85px; left: 40%; }
    60% { top: 88px; left: 55%; }
    80% { top: 90px; left: 47%; }
    100% { top: 90px; left: 47%; }
}

/* Zbyt duży LR: odbija się chaotycznie z rosnącą amplitudą */
.ball-high {
    animation: bounceHigh 4s infinite linear;
}
@keyframes bounceHigh {
    0% { top: 0px; left: 10%; }
    15% { top: 40px; left: 80%; }
    30% { top: -20px; left: 0%; }
    45% { top: 20px; left: 95%; }
    60% { top: -80px; left: -20%; opacity: 1;}
    100% { top: -80px; left: -20%; opacity: 0; }
}

/* Batch Size Anim */
.bs-line {
    width: 0;
    height: 6px;
    border-radius: 3px;
}
.bs-zigzag {
    animation: zigZag 1.5s infinite linear;
    background: repeating-linear-gradient(45deg, #e06c75, #e06c75 10px, transparent 10px, transparent 20px);
    box-shadow: 0 0 15px rgba(224, 108, 117, 0.4);
}
.bs-smooth {
    animation: smoothLine 3s infinite ease-in-out;
    background: #61afef;
    box-shadow: 0 0 15px rgba(97, 175, 239, 0.4);
}

@keyframes zigZag {
    0% { width: 0%; opacity: 0.8; }
    50% { opacity: 1; }
    100% { width: 100%; opacity: 0.8; }
}
@keyframes smoothLine {
    0% { width: 0%; opacity: 0.8; }
    50% { opacity: 1; }
    100% { width: 100%; opacity: 0.8; }
}

/* Custom Scrollbar for Terminal Logs */
.terminal-log::-webkit-scrollbar {
    width: 6px;
}
.terminal-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.terminal-log::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.terminal-log::-webkit-scrollbar-thumb:hover {
    background: #666;
}

}