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

:root {
    --bg: #061017;
    --panel: #102734;
    --line: #27485a;
    --text: #e7f6ff;
    --muted: #9dc0cf;
    --accent: #2dd4bf;
    --accent-2: #22d3ee;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top, #123044 0%, var(--bg) 55%);
    color: var(--text);
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    scroll-behavior: smooth;
}

html[lang="ar"] body {
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.lang-gate {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #0c2839 0%, #051019 65%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.lang-gate.hidden {
    display: none;
}

.lang-gate-card {
    width: min(540px, 92%);
    background: rgba(11, 31, 42, 0.96);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
}

.lang-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.lang-btn,
.switch-lang-btn {
    border: 1px solid var(--line);
    background: #143446;
    color: #dff7ff;
    border-radius: 10px;
    padding: 9px 16px;
}

.lab-page {
    display: none;
}

.lab-page.visible {
    display: block;
}

main {
    padding-top: 0;
}

.hero {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(3, 8, 12, .92), rgba(3, 18, 28, .58));
}

.top-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    padding: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    background: rgba(4, 18, 28, 0.78);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.top-nav .station-tab {
    border: 1px solid rgba(255, 255, 255, .2);
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 14px;
    background: rgba(10, 30, 41, 0.5);
    color: var(--text);
    cursor: pointer;
}

.top-nav .station-tab.active {
    border-color: var(--accent);
    background: rgba(18, 61, 79, 0.78);
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25) inset;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-top: calc(18vh + 84px);
    padding-bottom: 10vh;
    max-width: 760px;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 360px);
    gap: 28px;
    align-items: end;
}

.intro-copy {
    align-self: center;
}

.intro-robot-wrap {
    justify-self: end;
}

.intro-robot {
    width: 100%;
    max-height: 430px;
    object-fit: contain;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.45));
}

.eyebrow {
    color: var(--accent);
    letter-spacing: .13em;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin: 0 0 16px;
}

h2 {
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    margin: 0 0 12px;
}

.primary-btn {
    display: inline-block;
    margin-top: 16px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #02252b;
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 700;
}

.station-jump-btn {
    border: 0;
    cursor: pointer;
}

.station {
    padding: 90px 10px;
}

.section-head {
    margin-bottom: 30px;
    max-width: 760px;
}

.section-head p {
    color: var(--muted);
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
}

.hardware-card {
    background: linear-gradient(180deg, rgba(22, 49, 64, .78), rgba(11, 31, 42, .93));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: transform .22s ease, border-color .22s ease;
}

.hardware-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.hardware-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(45, 212, 191, 0.35);
    background: rgba(13, 44, 58, 0.7);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    overflow: hidden;
}

.hardware-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hardware-icon span {
    color: var(--accent);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.hardware-card p {
    color: var(--muted);
    margin: 0;
}

.code-lab {
    background: linear-gradient(180deg, rgba(7, 20, 28, .9), rgba(9, 25, 35, .95));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.code-window {
    background: #07141c;
    border: 1px solid #2f4b5b;
    border-radius: 14px;
    overflow: hidden;
}

.code-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border-bottom: 1px solid #27485a;
    background: #0b1e2b;
}

.code-bar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #385d73;
}

.code-bar span:nth-child(1) {
    background: #f87171;
}

.code-bar span:nth-child(2) {
    background: #facc15;
}

.code-bar span:nth-child(3) {
    background: #4ade80;
}

.code-bar strong {
    margin-inline-start: 8px;
    font-size: 13px;
    color: #9ac1d4;
}

pre {
    margin: 0;
    padding: 20px;
    min-height: 260px;
    color: #a7f3d0;
    font-size: 14px;
    direction: ltr;
    text-align: left;
}

.control-icons {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.control-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}

.control-item i {
    color: var(--accent);
    font-size: 25px;
    margin-bottom: 12px;
}

.control-item p {
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding: 18px 12px 28px;
    text-align: center;
    color: var(--muted);
}

.component-details-page {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(10, 26, 36, 0.9), rgba(6, 20, 30, 0.95));
}

.back-btn {
    border: 1px solid var(--line);
    background: #143446;
    color: #dff7ff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
}

.component-hero {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(260px, 380px) 1fr;
    align-items: start;
}

.component-hero img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #2a4657;
    background: #071219;
}

.component-copy p {
    color: var(--muted);
}

.component-long {
    color: #c8e3f1;
    line-height: 1.9;
    white-space: pre-wrap;
}

@media (max-width: 768px) {

    .container,
    .station.container,
    .code-lab .container,
    .component-details-page {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .top-nav {
        position: relative;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 10px;
        padding: 14px 12px;
    }

    .top-nav .station-tab,
    .top-nav .switch-lang-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    main {
        padding-top: 0;
    }

    .hero-content {
        padding-top: 14vh;
    }

    .station {
        padding: 68px 0;
    }

    .intro-grid {
        grid-template-columns: 1fr;
    }

    .intro-copy {
        text-align: center;
    }

    .intro-copy .primary-btn {
        margin-inline: auto;
        display: inline-block;
    }

    .intro-robot-wrap {
        justify-self: center;
        width: min(74vw, 300px);
        margin-top: 10px;
    }

    .component-hero {
        grid-template-columns: 1fr;
    }

    .component-hero img {
        height: 240px;
    }
}
