
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #070d18;
    --blue: #69c9ed;
    --cyan: #83e4f4;
    --red: #ed5b61;
    --white: #e9f2f7;
    --muted: #9eafbd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    overflow: hidden;
}

.space-world {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 50% 45%, #172b3d 0%, transparent 58%),
        linear-gradient(180deg, #080e1a, #101b2a 65%, #080e18);
}

/* SPACE BACKGROUND */

.space {
    position: absolute;
    inset: 0;
    z-index: -5;
    overflow: hidden;
    background: #060b16;
}

.stars {
    position: absolute;
    inset: -20%;
    background-repeat: repeat;
    pointer-events: none;
}

.stars-back {
    opacity: .55;
    background-image:
        radial-gradient(1px 1px at 10% 20%, #fff 50%, transparent 100%),
        radial-gradient(1px 1px at 35% 65%, #d9eaff 50%, transparent 100%),
        radial-gradient(1px 1px at 75% 30%, #fff 50%, transparent 100%),
        radial-gradient(2px 2px at 85% 75%, #c6eaff 50%, transparent 100%),
        radial-gradient(1px 1px at 55% 45%, #fff 50%, transparent 100%);
    background-size: 240px 220px;
    animation: starDrift 100s linear infinite;
}

.stars-front {
    opacity: .35;
    background-image:
        radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 100%),
        radial-gradient(1px 1px at 60% 80%, #a7e7ff 50%, transparent 100%),
        radial-gradient(1px 1px at 90% 15%, #fff 50%, transparent 100%);
    background-size: 330px 290px;
    animation: starDrift 150s linear infinite reverse;
}

@keyframes starDrift {
    from { transform: translateY(0); }
    to { transform: translateY(180px); }
}

.nebula {
    position: absolute;
    width: 65vw;
    height: 55vw;
    left: -10%;
    top: -25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(49, 102, 148, .16), transparent 68%);
    filter: blur(35px);
}

/* EARTH */

.earth {
    position: absolute;
    width: clamp(270px, 38vw, 510px);
    aspect-ratio: 1;
    border-radius: 50%;
    top: 7%;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    background:
        radial-gradient(ellipse at 32% 34%, transparent 0 12%, rgba(56, 129, 142, .75) 13% 16%, transparent 17%),
        radial-gradient(ellipse at 63% 48%, #2e7e91 0 9%, transparent 10%),
        radial-gradient(ellipse at 42% 65%, #438b83 0 13%, transparent 14%),
        radial-gradient(circle at 35% 30%, #2d7597, #103451 55%, #071a30 76%);
    box-shadow:
        0 0 35px rgba(76, 169, 221, .2),
        0 0 100px rgba(61, 143, 202, .17),
        inset -35px -18px 65px rgba(0, 0, 0, .8);
    opacity: .88;
    animation: earthFloat 12s ease-in-out infinite alternate;
}

.earth::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        repeating-linear-gradient(160deg, transparent 0 22px, rgba(180, 218, 220, .07) 24px 27px, transparent 31px 48px),
        linear-gradient(100deg, transparent 45%, rgba(0, 0, 0, .78) 100%);
}

.earth-clouds {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 30% 45%, rgba(218, 239, 238, .22), transparent 20%),
        radial-gradient(ellipse at 65% 30%, rgba(218, 239, 238, .17), transparent 17%),
        radial-gradient(ellipse at 54% 70%, rgba(218, 239, 238, .16), transparent 22%);
    filter: blur(9px);
    animation: cloudDrift 28s linear infinite alternate;
}

.earth-glow {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(111, 207, 245, .32);
    box-shadow: 0 0 24px rgba(76, 180, 231, .3);
}

@keyframes earthFloat {
    from { transform: translate(-50%, 0); }
    to { transform: translate(-50%, 13px); }
}

@keyframes cloudDrift {
    from { transform: translateX(-8px); }
    to { transform: translateX(12px); }
}

/* WINDOW */

.station-window {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(66vw, 850px);
    height: 47%;
    min-height: 230px;
    z-index: -3;
    padding: 13px;
    background: linear-gradient(135deg, #6b8290, #172735 25%, #425765 50%, #111e2b);
    clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%);
    box-shadow: 0 10px 45px rgba(0, 0, 0, .5);
}

.window-frame {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%);
    background: #081321;
}

.window-cross {
    position: absolute;
    z-index: 2;
    background: linear-gradient(90deg, #182b3a, #71818c, #182b3a);
    box-shadow: 0 0 10px rgba(0, 0, 0, .6);
}

.window-cross.horizontal {
    width: 100%;
    height: 12px;
    top: 58%;
}

.window-cross.vertical {
    width: 12px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.window-reflection {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(255,255,255,.08), transparent 35%, transparent 70%, rgba(255,255,255,.035));
}

/* STATION INTERIOR */

.station {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(9, 18, 29, .12), rgba(6, 12, 21, .8) 70%),
        linear-gradient(90deg, #111d2a, #293746 18%, transparent 35%, transparent 65%, #293746 82%, #101a27);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* CEILING */

.ceiling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(180deg, #263441, #101c29);
    clip-path: polygon(0 0, 100% 0, 82% 100%, 18% 100%);
    border-bottom: 2px solid rgba(132, 173, 192, .2);
}

.ceiling-panel {
    position: absolute;
    top: 10px;
    height: 55%;
    width: 24%;
    border: 1px solid rgba(142, 174, 191, .15);
    background: linear-gradient(180deg, rgba(5, 13, 22, .2), rgba(100, 132, 151, .08));
    transform: skewX(-18deg);
}

.panel-one { left: 12%; }
.panel-two { right: 12%; }

.ceiling-light {
    position: absolute;
    width: 90px;
    height: 5px;
    left: 50%;
    bottom: 20%;
    transform: translateX(-50%);
    background: #80d9ef;
    box-shadow: 0 0 8px #5ac8e7, 0 0 25px rgba(71, 193, 231, .6);
    opacity: .8;
}

.ceiling-light.light-red {
    left: 23%;
    width: 32px;
    background: #e65a61;
    box-shadow: 0 0 10px #f04b54;
    animation: redBlink 2.5s infinite;
}

@keyframes redBlink {
    0%, 42%, 48%, 100% { opacity: .9; }
    45% { opacity: .12; }
}

/* WALLS */

.left-wall,
.right-wall {
    position: absolute;
    top: 13%;
    height: 68%;
    width: 24%;
    background: linear-gradient(90deg, #0a1420, #263747 65%, #111d2a);
    border: 1px solid rgba(117, 157, 177, .13);
}

.left-wall {
    left: -3%;
    transform: perspective(500px) rotateY(10deg);
}

.right-wall {
    right: -3%;
    transform: perspective(500px) rotateY(-10deg);
    background: linear-gradient(270deg, #0a1420, #263747 65%, #111d2a);
}

.wall-panel {
    position: absolute;
    top: 25%;
    right: 18%;
    width: 100px;
    height: 125px;
    padding: 9px;
    border: 2px solid #465b68;
    background: linear-gradient(135deg, #111e2b, #263b4a);
    box-shadow: 0 8px 20px rgba(0,0,0,.5);
}

.panel-screen {
    height: 75px;
    padding: 9px 6px;
    background: #07151f;
    border: 1px solid #436071;
    box-shadow: inset 0 0 12px rgba(66, 190, 218, .15);
}

.screen-line {
    display: block;
    width: 80%;
    height: 2px;
    margin-bottom: 7px;
    background: #56b5ce;
    opacity: .65;
}

.screen-line.short { width: 45%; }

.screen-status {
    display: block;
    margin-top: 8px;
    color: #e65d64;
    font: 7px monospace;
    direction: ltr;
}

.panel-buttons {
    display: flex;
    gap: 8px;
    margin-top: 9px;
}

.panel-buttons i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d35b60;
    box-shadow: 0 0 7px rgba(211, 91, 96, .5);
}

.panel-buttons i:nth-child(2) { background: #5bb5ce; }
.panel-buttons i:nth-child(3) { background: #d0b36e; }

.wall-stripe {
    position: absolute;
    bottom: 8%;
    right: 10%;
    width: 5px;
    height: 40%;
    background: repeating-linear-gradient(180deg, #e6b54e 0 12px, #222c34 12px 24px);
    opacity: .45;
}

.warning-light {
    position: absolute;
    top: 23%;
    left: 30%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e64f59;
    box-shadow: 0 0 15px #e64f59;
    animation: redBlink 1.8s infinite;
}

.right-panel {
    position: absolute;
    bottom: 22%;
    left: 20%;
    width: 85px;
    height: 110px;
    border: 2px solid #455765;
    background: #172634;
    padding: 13px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.right-panel span {
    height: 3px;
    background: #6ba8bb;
    opacity: .55;
}

/* FLOOR */

.floor {
    position: absolute;
    bottom: -2%;
    left: 0;
    width: 100%;
    height: 28%;
    background:
        linear-gradient(180deg, #293845, #0b131e 80%);
    clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
    border-top: 2px solid rgba(129, 172, 191, .28);
}

.floor::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 95px, rgba(141, 174, 188, .1) 96px 98px);
    transform: perspective(180px) rotateX(25deg);
    transform-origin: top;
}

.floor-line {
    position: absolute;
    top: 25%;
    left: 50%;
    height: 1px;
    background: rgba(126, 169, 188, .22);
    transform: translateX(-50%);
}

.floor-line-one { width: 50%; }
.floor-line-two { top: 55%; width: 75%; }

.floor-glow {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 35%;
    height: 35px;
    background: rgba(73, 182, 211, .12);
    filter: blur(20px);
}

/* ROBOT */

.robot {
    position: absolute;
    bottom: 19%;
    left: 17%;
    width: 64px;
    height: 105px;
    z-index: 2;
    animation: robotIdle 4s ease-in-out infinite;
    filter: drop-shadow(0 5px 8px rgba(0,0,0,.6));
}

.robot-antenna {
    position: absolute;
    top: -13px;
    left: 31px;
    width: 2px;
    height: 16px;
    background: #879ca7;
}

.robot-antenna::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e75a62;
    box-shadow: 0 0 10px #e75a62;
}

.robot-head {
    position: absolute;
    top: 0;
    left: 9px;
    width: 46px;
    height: 34px;
    border-radius: 12px 12px 8px 8px;
    border: 2px solid #758c98;
    background: linear-gradient(145deg, #c0cbd0, #50616e 70%);
}

.robot-eye {
    position: absolute;
    top: 12px;
    left: 16px;
    width: 12px;
    height: 5px;
    border-radius: 5px;
    background: #62d4e7;
    box-shadow: 0 0 10px #62d4e7;
    animation: robotEye 3s infinite;
}

.robot-body {
    position: absolute;
    top: 36px;
    left: 5px;
    width: 54px;
    height: 48px;
    border-radius: 9px;
    border: 2px solid #687d89;
    background: linear-gradient(135deg, #9aaab2, #3c4d59 75%);
}

.robot-indicator {
    position: absolute;
    top: 14px;
    left: 21px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9575e;
    box-shadow: 0 0 8px #d9575e;
    animation: redBlink 2s infinite;
}

.robot-leg {
    position: absolute;
    bottom: 0;
    width: 9px;
    height: 17px;
    background: #536875;
    border-radius: 0 0 4px 4px;
}

.leg-left { left: 16px; }
.leg-right { right: 16px; }

@keyframes robotIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes robotEye {
    0%, 90%, 100% { opacity: 1; }
    94% { opacity: .15; }
}

/* FLOATING PARTICLES */

.floating-particles {
    position: absolute;
    inset: 15% 10% 20%;
    pointer-events: none;
}

.floating-particles i {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #b6e7f1;
    box-shadow: 0 0 8px rgba(121, 212, 234, .7);
    animation: particleDrift 12s ease-in-out infinite;
}

.floating-particles i:nth-child(1) { left: 10%; top: 20%; animation-delay: -2s; }
.floating-particles i:nth-child(2) { left: 25%; top: 65%; animation-delay: -8s; }
.floating-particles i:nth-child(3) { left: 43%; top: 32%; animation-delay: -4s; }
.floating-particles i:nth-child(4) { left: 58%; top: 70%; animation-delay: -10s; }
.floating-particles i:nth-child(5) { left: 75%; top: 24%; animation-delay: -5s; }
.floating-particles i:nth-child(6) { left: 88%; top: 55%; animation-delay: -7s; }
.floating-particles i:nth-child(7) { left: 18%; top: 48%; animation-delay: -3s; }
.floating-particles i:nth-child(8) { left: 35%; top: 80%; animation-delay: -9s; }
.floating-particles i:nth-child(9) { left: 68%; top: 42%; animation-delay: -6s; }
.floating-particles i:nth-child(10) { left: 80%; top: 78%; animation-delay: -1s; }
.floating-particles i:nth-child(11) { left: 50%; top: 15%; animation-delay: -11s; }
.floating-particles i:nth-child(12) { left: 5%; top: 75%; animation-delay: -4s; }

@keyframes particleDrift {
    0%, 100% { transform: translate(0, 0); opacity: .25; }
    50% { transform: translate(25px, -35px); opacity: .9; }
}

.emergency-light {
    position: absolute;
    top: 17%;
    right: 13%;
    width: 65px;
    height: 4px;
    background: #e44e59;
    box-shadow: 0 0 12px #e44e59, 0 0 35px rgba(228, 78, 89, .5);
    animation: redBlink 2s infinite;
}

/* HUD */

.hud {
    position: absolute;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 9px;
    direction: ltr;
    color: rgba(177, 208, 222, .65);
    font: 10px monospace;
    letter-spacing: 2px;
}

.hud-top {
    top: 25px;
    left: 30px;
}

.hud-dot,
.signal-indicator,
.info-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e65b63;
    box-shadow: 0 0 8px #e65b63;
}

.hud-divider {
    color: #5a8295;
}

.signal-status {
    position: absolute;
    z-index: 6;
    top: 25px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #e17b7e;
    font-size: 10px;
    letter-spacing: .3px;
}

.signal-indicator {
    animation: redBlink 1.5s infinite;
}

/* ERROR CONTENT */

.error-content {
    position: absolute;
    z-index: 7;
    top: 51%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(470px, 90%);
    padding: 25px;
    text-align: center;
    color: var(--white);
    text-shadow: 0 3px 15px rgba(0,0,0,.8);
    animation: contentAppear 1.4s ease-out both;
}

@keyframes contentAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -46%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.error-label {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 9px;
    color: #8bc8dd;
    font-size: 12px;
    font-weight: 300;
}

.label-line {
    width: 25px;
    height: 1px;
    background: rgba(114, 200, 225, .55);
}

.error-content h1 {
    direction: ltr;
    font-family: Arial, sans-serif;
    font-size: clamp(85px, 11vw, 125px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: 8px;
    color: #d8f1f8;
    text-shadow:
        0 0 18px rgba(99, 201, 232, .3),
        0 5px 30px rgba(0, 0, 0, .8);
}

.error-content h2 {
    margin: 3px 0 12px;
    font-size: clamp(18px, 2.3vw, 23px);
    font-weight: 600;
    color: #f0f5f7;
}

.error-content p {
    max-width: 365px;
    margin: 0 auto;
    color: #d1dce2;
    font-size: 13px;
    font-weight: 300;
    line-height: 2.2;
    text-shadow: 0 2px 8px #000;
}

/* BUTTONS */

.action-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 24px;
}

.action-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 17px;
    border: 1px solid rgba(105, 194, 220, .5);
    border-radius: 4px;
    color: #d9f0f6;
    background: rgba(10, 27, 40, .78);
    backdrop-filter: blur(8px);
    font-family: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: .3s ease;
}

.action-button:hover {
    transform: translateY(-3px);
    border-color: #8be3f4;
    background: rgba(33, 89, 111, .55);
    box-shadow: 0 0 20px rgba(82, 193, 224, .18);
}

.button-icon {
    font-size: 19px;
    line-height: 1;
    color: #80d8ec;
}

.back-button {
    border-color: rgba(195, 207, 215, .3);
    color: #d4dce2;
    background: rgba(20, 28, 39, .72);
}

.back-button .button-icon {
    color: #c2d1dc;
}

.back-button:hover {
    border-color: #c0d6e1;
    background: rgba(55, 72, 88, .55);
}

/* BOTTOM INFO */

.bottom-info {
    position: absolute;
    z-index: 7;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: max-content;
    max-width: 95%;
    color: rgba(173, 197, 208, .55);
    font: 9px monospace;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.info-dot {
    width: 5px;
    height: 5px;
    background: #64bfd8;
    box-shadow: 0 0 8px #64bfd8;
}

.info-divider {
    color: rgba(105, 194, 220, .4);
}

/* SCREEN EFFECTS */

.scanline {
    position: absolute;
    z-index: 8;
    inset: 0;
    pointer-events: none;
    opacity: .12;
    background: repeating-linear-gradient(
        180deg,
        transparent 0,
        transparent 3px,
        rgba(170, 215, 230, .08) 4px
    );
}

.vignette {
    position: absolute;
    z-index: 5;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(2, 7, 14, .5), transparent 25%, transparent 75%, rgba(2, 7, 14, .5)),
        linear-gradient(0deg, rgba(2, 7, 14, .65), transparent 30%, transparent 75%, rgba(2, 7, 14, .35));
}

/* RESPONSIVE */

@media (max-width: 768px) {
    .earth {
        top: 8%;
        width: 340px;
    }

    .station-window {
        width: 85vw;
        height: 39%;
    }

    .left-wall,
    .right-wall {
        width: 28%;
    }

    .robot {
        left: 10%;
        transform: scale(.85);
        transform-origin: bottom left;
    }

    .error-content {
        top: 53%;
        width: 94%;
        padding: 15px;
    }

    .error-content h1 {
        font-size: clamp(78px, 16vw, 105px);
    }

    .error-content p {
        font-size: 12px;
    }

    .hud-top {
        top: 17px;
        left: 16px;
        font-size: 8px;
    }

    .signal-status {
        top: 17px;
        right: 16px;
        font-size: 9px;
    }

    .bottom-info {
        bottom: 14px;
        font-size: 8px;
        gap: 7px;
    }
}

@media (max-width: 480px) {
    .earth {
        width: 280px;
        top: 8%;
    }

    .station-window {
        width: 94vw;
        height: 34%;
        min-height: 190px;
    }

    .ceiling {
        height: 12%;
    }

    .left-wall,
    .right-wall {
        width: 30%;
        top: 11%;
        height: 65%;
    }

    .wall-panel {
        transform: scale(.72);
        transform-origin: top right;
        right: 8%;
    }

    .right-panel {
        transform: scale(.72);
        transform-origin: bottom left;
    }

    .robot {
        left: 7%;
        bottom: 17%;
        transform: scale(.68);
        transform-origin: bottom left;
    }

    .error-content {
        top: 53%;
        width: 96%;
        padding: 10px;
    }

    .error-label {
        font-size: 10px;
        gap: 7px;
    }

    .label-line {
        width: 16px;
    }

    .error-content h1 {
        font-size: 76px;
        letter-spacing: 5px;
    }

    .error-content h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .error-content p {
        font-size: 11px;
        line-height: 2;
        max-width: 300px;
    }

    .action-buttons {
        gap: 8px;
        margin-top: 17px;
    }

    .action-button {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 10px;
        gap: 6px;
    }

    .button-icon {
        font-size: 16px;
    }

    .hud-top {
        top: 13px;
        left: 12px;
        gap: 6px;
        font-size: 7px;
        letter-spacing: 1px;
    }

    .signal-status {
        top: 13px;
        right: 12px;
        gap: 6px;
        font-size: 8px;
    }

    .bottom-info {
        bottom: 12px;
        font-size: 7px;
        letter-spacing: .6px;
        gap: 6px;
    }

    .emergency-light {
        right: 8%;
        width: 38px;
    }
}

@media (max-height: 650px) and (min-width: 769px) {
    .earth {
        width: 300px;
    }

    .station-window {
        height: 38%;
    }

    .error-content {
        top: 52%;
    }

    .error-content h1 {
        font-size: 75px;
    }

    .error-content p {
        line-height: 1.8;
    }

    .action-buttons {
        margin-top: 13px;
    }

    .action-button {
        min-height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
