* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f8fafc;
    color: #172033;
    line-height: 1.6;
}


/* HERO */

.hero {
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;

    background-image:  radial-gradient(circle at 20% 20%, #c4b5fd 0, transparent 30%),
        radial-gradient(circle at 80% 80%, #67e8f9 0, transparent 30%),
        linear-gradient(135deg, #111827, #312e81);
}

.hero-content {
    max-width: 850px;
}

.badge {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50px;
    color: white;
    font-size: 13px;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.hero h1 {
    color: white;
    font-size: clamp(42px, 7vw, 75px);
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero h1 span {
    color: #c4b5fd;
}

.hero p {
    color: #e0e7ff;
    font-size: 18px;
    max-width: 650px;
    margin: auto;
}

.hero-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 13px 28px;
    background: white;
    color: #312e81;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
}

.hero-btn:hover {
    background: #c4b5fd;
    color: #111827;
}


/* MAIN */

main {
    max-width: 1100px;
    margin: auto;
    padding: 70px 20px;
}

.topic-section {
    margin-bottom: 80px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 25px;
}

.section-title > span {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #312e81;
    color: white;
    border-radius: 15px;
    font-weight: bold;
    font-size: 18px;
}

.section-title h2 {
    font-size: 30px;
    color: #111827;
}

.section-title p {
    color: #64748b;
}


/* DEMO CARDS */

.demo-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

.parent-box {
    background: #ede9fe;
    padding: 30px;
    border-radius: 18px;
}

.parent-box h3 {
    color: #312e81;
}

.inside-box {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
}


/* DESCENDANT */

.parent-box p {
    color: #7c3aed;
    font-weight: bold;
}


/* CHILD */

.parent-list {
    padding: 25px 40px;
    background: #ecfeff;
    border-radius: 15px;
}

.parent-list > li {
    color: #0891b2;
    font-weight: bold;
    margin: 10px;
}

.nested-list {
    background: white;
    padding: 15px;
    margin-top: 15px;
    border-radius: 10px;
}


/* NEXT SIBLING */

.sibling-box {
    padding: 25px;
    background: #fff1f2;
    border-radius: 15px;
}

.sibling-box h3 {
    color: #334155;
}

.sibling-box h3 + p {
    color: #e11d48;
    font-weight: bold;
}


/* SUBSEQUENT SIBLING */

.all-siblings {
    padding: 25px;
    background: #f0fdf4;
    border-radius: 15px;
}

.all-siblings h3 ~ p {
    color: #16a34a;
    font-weight: bold;
    margin-top: 8px;
}


/* CODE LABEL */

.code-label {
    margin-top: 25px;
    padding: 16px 20px;
    background: #111827;
    color: #c4b5fd;
    border-radius: 12px;
    font-family: monospace;
    font-size: 15px;
    overflow-wrap: anywhere;
}


/*  PSEUDO CLASSES */

.pseudo {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.pseudo-card {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    width: 100%;
    min-width: 0;
    flex: 1 1 calc((100% - 40px) / 3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: card-enter 0.6s ease both;
}

.pseudo-card:hover {
    transform: translateY(-8px);
    border-color: #8b5cf6;
    box-shadow: 0 18px 35px rgba(49, 46, 129, 0.16);
}

.icon {
    font-size: 35px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.pseudo-card h3 {
    color: #312e81;
    margin-bottom: 8px;
}

.pseudo-card p {
    color: #64748b;
}


/* :hover */

.pseudo-card button {
    margin-top: 20px;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    background: #312e81;
    color: white;
    cursor: pointer;
}

.pseudo-card button:hover {
    background: #7c3aed;
    transform: scale(1.05);
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.28);
}

/* :focus */

.pseudo-card input {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
}

.pseudo-card input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px #ede9fe;
}


/* :active */

.active-link {
    display: flex;
    align-items: center;
    margin-top: 12px;
    color: #7c3aed;
    font-weight: bold;
}

.active-link:active {
    color: #16a34a;
}


/* :link and :visited */

.state-link {
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
}

.link-demo:link {
    color: #2563eb;
}

.visited-demo:visited {
    color: #9333ea;
}

/* :first-child */

.position-list {
    list-style: none;
    margin-top: 15px;
}

.position-list li {
    padding: 8px;
    background: #f1f5f9;
    margin-bottom: 5px;
    border-radius: 8px;
}

.position-list li:first-child {
    background: #ddd6fe;
    color: #5b21b6;
    font-weight: bold;
}


/* :nth-child */

.skill-list {
    margin-top: 15px;
}

.skill-list div {
    padding: 9px;
    background: #f1f5f9;
    margin-bottom: 6px;
    border-radius: 8px;
}

.skill-list div:nth-child(odd) {
    background: #cffafe;
    color: #0e7490;
    font-weight: bold;
}

/* :last-child */

.last-list {
    list-style: none;
    margin-top: 15px;
}

.last-list li {
    padding: 9px;
    background: #f1f5f9;
    margin-bottom: 5px;
    border-radius: 8px;
}

.last-list li:last-child {
    background: #dcfce7;
    color: #15803d;
    font-weight: bold;
}



/* :lang child*/

.language-demo {
    margin-top: 15px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
}

.language-demo:lang(en) {
    color: #2563eb;
    font-weight: bold;
}

.only-child-demo {
    margin-top: 15px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
}

.only-child-demo p:only-child {
    color: #ea580c;
    font-weight: bold;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FOOTER */

footer {
    text-align: center;
    padding: 30px 20px;
    background: #111827;
    color: #cbd5e1;
}

footer strong {
    color: #c4b5fd;
}


/*  RESPONSIVE */

@media (max-width: 800px) {

    .pseudo-card {
        flex-basis: calc((100% - 20px) / 2);
    }

}

@media (max-width: 550px) {

    main {
        padding: 45px 14px;
    }

    .pseudo-card {
        flex-basis: 100%;
    }

    .pseudo-card {
        padding: 22px;
    }

    .section-title {
        gap: 12px;
    }

    .section-title h2 {
        font-size: 23px;
    }

    .section-title p {
        font-size: 14px;
    }

    .demo-card {
        padding: 20px;
    }

    .code-label {
        padding: 14px 16px;
        font-size: 13px;
    }

    .hero {
        min-height: 420px;
    }

}
