:root {
    --dark: #061a2d;
    --primary: #0b5fa5;
    --secondary: #00a8cc;
    --light: #f4f8fb;
    --white: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --border: #d9e2ec;
    --success: #15803d;
    --danger: #b91c1c;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.7;
}

.container {
    width: min(1120px, 92%);
    margin: auto;
}


/* HERO */

.hero {
    padding: 100px 20px;
    text-align: center;
    color: white;

    background:
        radial-gradient(
            circle at top right,
            rgba(0, 168, 204, 0.35),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #061a2d,
            #0b5fa5
        );
}

.eyebrow {
    display: inline-block;
    padding: 7px 15px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 30px;
    font-size: 0.78rem;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 5rem);
    margin: 20px 0 10px;
}

.hero-text {
    max-width: 720px;
    margin: auto;
    font-size: 1.15rem;
    opacity: 0.9;
}


/* BUTTONS */

.primary-btn {
    margin-top: 25px;
    padding: 14px 25px;

    border: none;
    border-radius: 10px;

    background: var(--secondary);
    color: white;

    font-size: 1rem;
    font-weight: bold;

    cursor: pointer;

    transition: transform 0.2s;
}

.primary-btn:hover {
    transform: translateY(-3px);
}


/* NAVIGATION */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 14px;
    overflow-x: auto;
}

.navbar a {
    text-decoration: none;
    color: var(--primary);
    font-weight: bold;
    white-space: nowrap;
}


/* MAIN */

main {
    padding: 45px 0;
}

.card {
    margin-bottom: 25px;
    padding: 35px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.card h2 {
    margin-top: 5px;
    color: var(--primary);
}

.section-number {
    color: var(--secondary);
    font-weight: bold;
    letter-spacing: 2px;
}


/* HIGHLIGHT */

.highlight-box,
.interactive-info {
    margin-top: 25px;
    padding: 20px;

    background: #eefaff;
    border-left: 5px solid var(--secondary);
    border-radius: 12px;
}


/* INTERNET DIAGRAM */

.internet-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    margin-top: 40px;
}

.edge,
.router {
    text-align: center;
}

.node {
    font-size: 3rem;
}

.router {
    font-size: 2.5rem;
}

.router span {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
}

.link {
    color: var(--secondary);
    font-size: 1.5rem;
}

.diagram-caption {
    text-align: center;
    color: var(--muted);
    font-weight: bold;
}


/* PACKET SWITCHING */

.packet-flow {
    text-align: center;
    margin: 30px 0;
}

.message-box {
    display: inline-block;
    padding: 15px 25px;

    background: #eaf3ff;
    border: 1px solid var(--border);
    border-radius: 12px;

    font-weight: bold;
}

.flow-arrow {
    font-size: 2rem;
    color: var(--secondary);
}

.packet-group {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.packet-group span {
    padding: 12px 18px;
    border-radius: 10px;

    background: var(--primary);
    color: white;

    font-weight: bold;
}


/* COMPARISON */

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.comparison-card {
    padding: 25px;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: #fafcff;
}

.comparison-card h3 {
    color: var(--primary);
}


/* ROUTER EXPLORER */

.router-explorer {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.router-step {
    padding: 12px 18px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: white;
    color: var(--text);

    font-weight: bold;
    cursor: pointer;
}

.router-step.active,
.router-step:hover {
    background: var(--primary);
    color: white;
}


/* LAYERS */

.layer-stack {
    max-width: 700px;
    margin: 30px auto;
}

.layer {
    width: 100%;
    margin-bottom: 8px;
    padding: 18px 22px;

    border: none;
    border-radius: 10px;

    color: white;
    text-align: left;

    cursor: pointer;

    display: flex;
    justify-content: space-between;
    align-items: center;

    transition: transform 0.2s;
}

.layer:hover {
    transform: translateX(8px);
}

.application {
    background: #4f46e5;
}

.transport {
    background: #2563eb;
}

.network {
    background: #0891b2;
}

.link-layer {
    background: #059669;
}

.physical {
    background: #64748b;
}

.layer small {
    opacity: 0.85;
}


/* ENCAPSULATION */

.encapsulation-demo {
    max-width: 800px;
    margin: 35px auto;
    text-align: center;
}

.step-label {
    font-weight: bold;
    color: var(--muted);
}

.data-box {
    padding: 18px;
    border-radius: 10px;

    color: white;
    font-weight: bold;
}

.application-data {
    background: #4f46e5;
}

.transport-data {
    background: #2563eb;
}

.network-data {
    background: #0891b2;
}

.link-data {
    background: #059669;
}

.data-box span,
.data-box em,
.data-box strong {
    margin-left: 10px;
    padding: 5px 8px;

    background: rgba(255, 255, 255, 0.18);
    border-radius: 5px;

    font-style: normal;
}

.encapsulation-arrow {
    font-size: 2rem;
    color: var(--secondary);
}


/* SIMULATOR */

.simulator-section {
    text-align: center;
}

.journey {
    display: flex;
    align-items: center;
    justify-content: center;

    margin: 45px 0;

    position: relative;
}

.journey-device,
.journey-router {
    min-width: 70px;
    font-size: 2.5rem;
}

.journey-device p,
.journey-router p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: bold;
}

.journey-line {
    width: 14%;
    height: 5px;

    background: var(--border);
    position: relative;
}

.packet {
    position: absolute;

    left: 0;
    top: 50%;

    transform: translate(-50%, -50%);

    font-size: 1.8rem;
}

.packet.move {
    animation: travel 4s linear forwards;
}

@keyframes travel {

    0% {
        left: 0;
    }

    100% {
        left: 550%;
    }

}

.status {
    font-weight: bold;
    color: var(--muted);
}


/* CHALLENGE */

.challenge-section {
    text-align: center;
}

.challenge-question {
    max-width: 750px;
    margin: 25px auto;
    font-size: 1.1rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quiz-btn {
    padding: 15px;

    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;

    font-weight: bold;
    cursor: pointer;
}

.quiz-btn:hover {
    background: #eef8fc;
}

.quiz-result {
    min-height: 40px;
    margin-top: 20px;

    font-weight: bold;
}

.correct {
    color: var(--success);
}

.incorrect {
    color: var(--danger);
}


/* REFLECTION */

.reflection {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--dark),
            var(--primary)
        );
}

.reflection h2 {
    color: white;
}

blockquote {
    margin: 25px 0;
    padding-left: 20px;

    border-left: 4px solid var(--secondary);

    font-size: 1.2rem;
    font-style: italic;
}

.reflection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.reflection-grid div {
    padding: 15px;

    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}


/* FOOTER */

footer {
    padding: 40px 0;

    text-align: center;

    background: var(--dark);
    color: #dce7f2;
}

.footer-title {
    color: white;
    font-weight: bold;
}

.copyright {
    opacity: 0.7;
}


/* RESPONSIVE */

@media (max-width: 800px) {

    .comparison-grid,
    .reflection-grid {
        grid-template-columns: 1fr;
    }

    .internet-diagram {
        flex-wrap: wrap;
    }

    .journey {
        transform: scale(0.8);
    }

    .layer {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

}

@media (max-width: 550px) {

    .card {
        padding: 22px;
    }

    .packet-group {
        flex-direction: column;
        align-items: center;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .router-explorer {
        flex-direction: column;
    }

    .journey {
        transform: scale(0.58);
        margin: 10px 0;
    }

}