/**
 * Katman 1–3 hero — klasik konsol yerine premium “çalışma kapsülü” (CSS 3B)
 * Kod örnekleri ders sayfalarında; banner yalnızca güvenli yüzey + I/O metaforu.
 */

.hero-visual-runtime {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: min(360px, 52vh);
    padding: 0.5rem;
    box-sizing: border-box;
}

.hrt {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1.05;
    max-height: 420px;
}

.hrt-bg-mesh {
    position: absolute;
    inset: -12%;
    background:
        radial-gradient(circle at 30% 20%, rgba(56, 189, 248, 0.14), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(167, 139, 250, 0.12), transparent 42%),
        repeating-linear-gradient(-12deg,
            transparent,
            transparent 18px,
            rgba(148, 163, 184, 0.04) 18px,
            rgba(148, 163, 184, 0.04) 19px);
    pointer-events: none;
    z-index: 0;
    border-radius: 28px;
}

.hrt--l2 .hrt-bg-mesh {
    background:
        radial-gradient(circle at 25% 25%, rgba(192, 132, 252, 0.16), transparent 48%),
        radial-gradient(circle at 75% 60%, rgba(244, 114, 182, 0.1), transparent 45%),
        repeating-linear-gradient(8deg,
            transparent,
            transparent 16px,
            rgba(167, 139, 250, 0.05) 16px,
            rgba(167, 139, 250, 0.05) 17px);
}

/* Katman 3 — ağ / gök hattı (HTTP · DOM · fetch) */
.hrt--l3 .hrt-bg-mesh {
    background:
        radial-gradient(circle at 22% 28%, rgba(56, 189, 248, 0.18), transparent 46%),
        radial-gradient(circle at 78% 65%, rgba(251, 191, 36, 0.12), transparent 44%),
        repeating-linear-gradient(-8deg,
            transparent,
            transparent 17px,
            rgba(56, 189, 248, 0.045) 17px,
            rgba(56, 189, 248, 0.045) 18px);
}

.hrt--l3 .hrt-layer--mid {
    border-color: rgba(56, 189, 248, 0.18);
}

.hrt--l3 .hrt-module {
    border-color: rgba(56, 189, 248, 0.34);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.55),
        0 0 48px rgba(14, 165, 233, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.hrt--l3 .hrt-badge {
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(56, 189, 248, 0.42);
}

.hrt--l3 .hrt-badge i {
    color: #7dd3fc;
}

.hrt--l3 .hrt-module-title span {
    background: linear-gradient(100deg, #fde68a, #38bdf8, #f9a8d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hrt--l3 .hrt-io-slots span {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.3), rgba(14, 165, 233, 0.28));
}

.hrt--l3 .hrt-io-slots span:last-child {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.28), rgba(244, 114, 182, 0.28));
}

.hrt-float {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    perspective-origin: 50% 35%;
}

.hrt-layer {
    position: absolute;
    width: 86%;
    height: 48%;
    left: 7%;
    border-radius: 18px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.75), rgba(8, 10, 22, 0.85));
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    transform-style: preserve-3d;
    pointer-events: none;
}

.hrt-layer--deep {
    bottom: 8%;
    transform: rotateX(62deg) translateZ(-48px) scale(0.92);
    opacity: 0.45;
}

.hrt-layer--mid {
    bottom: 14%;
    transform: rotateX(52deg) translateZ(-22px) scale(0.96);
    opacity: 0.65;
    border-color: rgba(196, 181, 253, 0.15);
}

.hrt-module {
    position: relative;
    width: 92%;
    max-width: 360px;
    padding: 1.35rem 1.25rem 1.5rem;
    border-radius: 20px;
    background: linear-gradient(155deg,
            rgba(22, 26, 48, 0.94) 0%,
            rgba(10, 12, 26, 0.97) 100%);
    border: 1px solid rgba(125, 211, 252, 0.28);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(251, 191, 36, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transform: rotateX(8deg) rotateY(-10deg) translateZ(12px);
    transform-style: preserve-3d;
    animation: hrt-module-float 7s ease-in-out infinite;
}

.hrt--l2 .hrt-module {
    border-color: rgba(196, 181, 253, 0.32);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(139, 92, 246, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

@keyframes hrt-module-float {

    0%,
    100% {
        transform: rotateX(8deg) rotateY(-10deg) translateZ(12px) translateY(0);
    }

    50% {
        transform: rotateX(10deg) rotateY(-6deg) translateZ(18px) translateY(-6px);
    }
}

.hrt-module-glint {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg,
            transparent 35%,
            rgba(255, 255, 255, 0.06) 48%,
            transparent 58%);
    pointer-events: none;
    animation: hrt-glint 5.5s ease-in-out infinite;
}

@keyframes hrt-glint {

    0%,
    100% {
        opacity: 0.35;
        transform: translateX(-8%);
    }

    50% {
        opacity: 0.7;
        transform: translateX(8%);
    }
}

.hrt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbf7d0;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.35);
    margin-bottom: 0.65rem;
}

.hrt-badge i {
    font-size: 0.75rem;
    color: #6ee7b7;
}

.hrt--l2 .hrt-badge {
    color: #fae8ff;
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(192, 132, 252, 0.4);
}

.hrt--l2 .hrt-badge i {
    color: #e9d5ff;
}

.hrt-module-title {
    margin: 0 0 0.45rem;
    font-size: clamp(1.05rem, 2.1vw, 1.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #f8fafc;
}

.hrt-module-title span {
    background: linear-gradient(100deg, #fde68a, #7dd3fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hrt--l2 .hrt-module-title span {
    background: linear-gradient(100deg, #e9d5ff, #f9a8d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hrt-module-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.55;
    color: rgba(186, 198, 226, 0.95);
}

.hrt-module-desc strong {
    color: #e2e8f0;
    font-weight: 700;
}

.hrt-io {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.hrt-io-label {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.85);
}

.hrt-io-slots {
    flex: 1;
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.hrt-io-slots span {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.25), rgba(167, 139, 250, 0.35));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hrt-io-slots span:last-child {
    max-width: 38%;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.25), rgba(251, 113, 133, 0.3));
}

.hrt-orbit {
    position: absolute;
    width: 118%;
    height: 118%;
    left: -9%;
    top: -9%;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 26px;
    transform: rotateX(72deg) translateZ(-60px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

@media (prefers-reduced-motion: reduce) {

    .hrt-module,
    .hrt-module-glint {
        animation: none;
    }

    .hrt-module {
        transform: rotateX(8deg) rotateY(-8deg) translateZ(8px);
    }
}

@media (max-width: 968px) {
    .hero-visual-runtime {
        min-height: 280px;
        margin-top: 0.5rem;
    }

    .hrt {
        max-width: 360px;
    }

    .hrt-module {
        transform: rotateX(5deg) rotateY(-4deg) translateZ(6px);
    }
}
