
/* =========================================
   LOST DIMENSION - 404 PAGE
   Persian Edition
   ========================================= */

/* 1. Global */

:root {
    --bg: #080a18;
    --bg-light: #10152b;
    --surface: #11172c;

    --primary: #8b65ff;
    --secondary: #39c9ff;
    --purple-light: #c2a7ff;

    --text: #f4f2ff;
    --text-muted: #969ab5;

    --border: rgba(159, 137, 255, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

button,
a {
    font: inherit;
}

button {
    border: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 2. Main Layout */

.page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(
            ellipse at 72% 48%,
            rgba(68, 49, 145, 0.15),
            transparent 42%
        ),
        radial-gradient(
            ellipse at 20% 80%,
            rgba(27, 105, 154, 0.10),
            transparent 40%
        ),
        #080a18;
}

/* 3. Background */

.background {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.background-glow {
    position: absolute;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.12;
}

.glow-one {
    background: #764aff;
    top: 5%;
    right: 12%;
    animation: glowMoveOne 12s ease-in-out infinite alternate;
}

.glow-two {
    background: #168ecb;
    bottom: -20%;
    left: 5%;
    animation: glowMoveTwo 15s ease-in-out infinite alternate;
}

.background-grid {
    position: absolute;
    inset: 0;
    opacity: 0.14;

    background-image:
        linear-gradient(
            rgba(142, 126, 220, 0.10) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(142, 126, 220, 0.10) 1px,
            transparent 1px
        );

    background-size: 70px 70px;

    mask-image: radial-gradient(
        ellipse at center,
        black 10%,
        transparent 75%
    );
}

.stars,
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.4;
    animation: twinkle var(--duration) ease-in-out infinite alternate;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 12px 3px rgba(57, 201, 255, 0.4);
    opacity: 0;
    animation: particleFloat var(--duration) linear infinite;
}

/* 4. Main Section */

.error-section {
    position: relative;
    z-index: 2;
    width: min(1200px, 90%);
    min-height: 700px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;

    gap: 30px;
    padding: 60px 0;
}

/* 5. Text Content */

.content {
    position: relative;
    z-index: 5;
    text-align: right;
    animation: contentAppear 1s ease both;
}

.top-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 10px 17px;
    margin-bottom: 25px;

    border: 1px solid var(--border);
    border-radius: 50px;

    background: rgba(133, 106, 255, 0.07);
    color: #c1b4f7;

    font-size: 12px;
    letter-spacing: 0.2px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #9b7bff;
    border-radius: 50%;

    box-shadow: 0 0 12px #9b7bff;

    animation: statusPulse 2s infinite;
}

/* 6. Error Number */

.error-number {
    display: flex;
    align-items: center;
    gap: 12px;

    direction: ltr;
    justify-content: flex-end;

    width: fit-content;
    margin-bottom: 18px;

    font-size: clamp(90px, 12vw, 150px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -8px;

    color: transparent;

    background: linear-gradient(
        135deg,
        #ffffff 5%,
        #c6b5ff 35%,
        #8d6bff 65%,
        #42cfff 100%
    );

    -webkit-background-clip: text;
    background-clip: text;

    filter: drop-shadow(0 0 28px rgba(139, 101, 255, 0.18));

    animation: numberAppear 1.2s ease both;
}

.error-number .zero {
    position: relative;
    animation: zeroFloat 5s ease-in-out infinite;
}

/* 7. Text */

.content h1 {
    max-width: 530px;

    font-size: clamp(22px, 2.5vw, 31px);
    line-height: 1.8;
    font-weight: 700;

    color: #f4f2ff;

    margin-bottom: 15px;
}

.description {
    max-width: 490px;

    color: var(--text-muted);

    font-size: 14px;
    line-height: 2.3;

    margin-bottom: 30px;
}

/* 8. Buttons */

.actions {
    display: flex;
    align-items: center;
    gap: 13px;
    flex-wrap: wrap;
}

.button {
    min-height: 52px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding: 0 23px;

    border-radius: 12px;
    cursor: pointer;

    font-size: 13px;
    font-weight: 700;

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button:hover {
    transform: translateY(-4px);
}

.button:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 4px;
}

.button-primary {
    color: #fff;

    background: linear-gradient(
        110deg,
        #7651eb,
        #946dff
    );

    box-shadow:
        0 8px 25px rgba(118, 81, 235, 0.23),
        inset 0 1px rgba(255, 255, 255, 0.2);
}

.button-primary:hover {
    box-shadow:
        0 12px 35px rgba(118, 81, 235, 0.4),
        inset 0 1px rgba(255, 255, 255, 0.2);
}

.button-secondary {
    color: #d5d2eb;

    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.11);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(160, 137, 255, 0.45);
}

/* 9. Footer Note */

.footer-note {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-top: 48px;

    color: #737893;
    font-size: 11px;
}

.footer-line {
    width: 25px;
    height: 1px;
    background: rgba(160, 137, 255, 0.4);
}

/* 10. Portal Scene */

.portal-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;

    max-width: 560px;
    justify-self: center;

    display: flex;
    align-items: center;
    justify-content: center;

    perspective: 1000px;

    animation: portalAppear 1.4s ease both;
}

/* Portal Shadow */

.portal-shadow {
    position: absolute;
    width: 55%;
    height: 10%;

    bottom: 15%;

    background: #050714;
    filter: blur(35px);
    border-radius: 50%;

    opacity: 0.9;
}

/* Portal Outer */

.portal {
    position: relative;

    width: 54%;
    aspect-ratio: 0.73 / 1;

    display: flex;
    align-items: center;
    justify-content: center;

    transform: rotateY(-12deg);

    animation: portalFloat 6s ease-in-out infinite;
}

.portal-outer {
    position: relative;
    width: 100%;
    height: 100%;

    border-radius: 50%;

    background: linear-gradient(
        145deg,
        rgba(177, 150, 255, 0.9),
        rgba(101, 73, 218, 0.65) 35%,
        rgba(44, 187, 255, 0.65) 75%,
        rgba(119, 85, 255, 0.9)
    );

    padding: 7px;

    box-shadow:
        0 0 20px rgba(144, 104, 255, 0.7),
        0 0 55px rgba(120, 86, 255, 0.45),
        0 0 120px rgba(55, 180, 255, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.45);

    animation: portalGlow 4s ease-in-out infinite alternate;
}

.portal-ring {
    position: absolute;
    inset: 0;

    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;

    pointer-events: none;
}

.ring-one {
    transform: scale(1.07);
    opacity: 0.5;
}

.ring-two {
    transform: scale(1.15);
    opacity: 0.25;
}

.ring-three {
    transform: scale(1.25);
    opacity: 0.12;
}

/* Portal Core */

.portal-core {
    position: relative;
    width: 100%;
    height: 100%;

    border-radius: 50%;
    overflow: hidden;

    background:
        radial-gradient(
            ellipse at 50% 45%,
            #2d2363 0%,
            #11132d 40%,
            #080a18 78%
        );

    box-shadow:
        inset 0 0 35px rgba(0, 0, 0, 0.8),
        inset 0 0 15px rgba(163, 137, 255, 0.4);
}

.core-light {
    position: absolute;
    width: 70%;
    height: 90%;

    left: 15%;
    top: 5%;

    border-radius: 50%;

    background: linear-gradient(
        180deg,
        rgba(103, 82, 255, 0.1),
        rgba(64, 190, 255, 0.65),
        rgba(151, 98, 255, 0.1)
    );

    filter: blur(28px);

    animation: coreLight 5s ease-in-out infinite alternate;
}

.core-stars {
    position: absolute;
    inset: 0;

    background-image:
        radial-gradient(circle at 25% 20%, #fff 1px, transparent 2px),
        radial-gradient(circle at 70% 35%, #c5b4ff 1px, transparent 2px),
        radial-gradient(circle at 45% 65%, #fff 1px, transparent 2px),
        radial-gradient(circle at 78% 78%, #6bdcff 1px, transparent 2px),
        radial-gradient(circle at 20% 80%, #a28aff 1px, transparent 2px);

    background-size: 100% 100%;
    opacity: 0.65;

    animation: starsMove 18s linear infinite;
}

.core-center {
    position: absolute;
    width: 40%;
    height: 60%;

    top: 20%;
    left: 30%;

    border-radius: 50%;

    background: radial-gradient(
        ellipse,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(125, 181, 255, 0.45) 20%,
        rgba(114, 82, 255, 0.2) 55%,
        transparent 75%
    );

    filter: blur(12px);

    animation: centerPulse 3s ease-in-out infinite alternate;
}

/* 11. Orbits */

.portal-orbit {
    position: absolute;
    width: 85%;
    height: 34%;

    border: 1px solid rgba(138, 117, 255, 0.3);
    border-radius: 50%;

    transform: rotate(-28deg);
}

.orbit-one {
    animation: orbitRotate 14s linear infinite;
}

.orbit-two {
    width: 100%;
    height: 45%;

    border-color: rgba(55, 201, 255, 0.17);

    transform: rotate(35deg);
    animation: orbitRotateReverse 18s linear infinite;
}

.orbit-three {
    width: 115%;
    height: 55%;

    border-color: rgba(160, 130, 255, 0.12);

    transform: rotate(-55deg);
    animation: orbitRotate 22s linear infinite;
}

/* 12. Extra Lights */

.portal-light {
    position: absolute;
    width: 14px;
    height: 14px;

    border-radius: 50%;
    background: #fff;

    box-shadow:
        0 0 10px 4px #9a7bff,
        0 0 30px 10px rgba(100, 112, 255, 0.4);

    animation: lightMove 5s ease-in-out infinite;
}

.light-one {
    top: 22%;
    right: 18%;
}

.light-two {
    bottom: 25%;
    left: 15%;

    width: 8px;
    height: 8px;

    animation-delay: -2s;
}

.floating-symbol {
    position: absolute;
    color: #b9a5ff;

    text-shadow: 0 0 15px rgba(150, 120, 255, 0.8);

    animation: symbolFloat 5s ease-in-out infinite;
}

.symbol-one {
    top: 18%;
    left: 22%;
    font-size: 20px;
}

.symbol-two {
    top: 30%;
    right: 12%;
    font-size: 25px;
    animation-delay: -1.5s;
}

.symbol-three {
    bottom: 24%;
    right: 20%;
    font-size: 30px;
    animation-delay: -3s;
}

.symbol-four {
    bottom: 30%;
    left: 18%;
    font-size: 14px;
    animation-delay: -2s;
}

/* 13. Portal Caption */

.portal-caption {
    position: absolute;
    bottom: 7%;

    display: flex;
    align-items: center;
    gap: 12px;

    color: #8987b5;
    font-size: 11px;
    letter-spacing: 1px;
}

.caption-line {
    width: 22px;
    height: 1px;

    background: rgba(143, 119, 255, 0.5);
}

/* 14. Animations */

@keyframes contentAppear {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes numberAppear {
    from {
        opacity: 0;
        transform: scale(0.85);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes portalAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes portalFloat {
    0%, 100% {
        transform: translateY(0) rotateY(-12deg);
    }

    50% {
        transform: translateY(-17px) rotateY(-7deg);
    }
}

@keyframes portalGlow {
    from {
        filter: brightness(0.9);
    }

    to {
        filter: brightness(1.2);
    }
}

@keyframes coreLight {
    from {
        transform: scale(0.85) rotate(-10deg);
        opacity: 0.5;
    }

    to {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
}

@keyframes centerPulse {
    from {
        opacity: 0.4;
        transform: scale(0.85);
    }

    to {
        opacity: 0.9;
        transform: scale(1.15);
    }
}

@keyframes orbitRotate {
    from {
        transform: rotate(-28deg);
    }

    to {
        transform: rotate(332deg);
    }
}

@keyframes orbitRotateReverse {
    from {
        transform: rotate(35deg);
    }

    to {
        transform: rotate(-325deg);
    }
}

@keyframes starsMove {
    from {
        transform: rotate(0deg) scale(1);
    }

    to {
        transform: rotate(360deg) scale(1.1);
    }
}

@keyframes symbolFloat {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-15px);
        opacity: 1;
    }
}

@keyframes lightMove {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-18px);
        opacity: 1;
    }
}

@keyframes zeroFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 12px #9b7bff;
    }

    50% {
        opacity: 0.4;
        box-shadow: 0 0 3px #9b7bff;
    }
}

@keyframes twinkle {
    from {
        opacity: 0.15;
        transform: scale(0.7);
    }

    to {
        opacity: 0.8;
        transform: scale(1.4);
    }
}

@keyframes particleFloat {
    0% {
        transform: translateY(30px) scale(0.5);
        opacity: 0;
    }

    15% {
        opacity: 0.8;
    }

    85% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-120px) scale(1.2);
        opacity: 0;
    }
}

@keyframes glowMoveOne {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-70px, 50px);
    }
}

@keyframes glowMoveTwo {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(60px, -40px);
    }
}

/* 15. Tablet */

@media (max-width: 900px) {

    .error-section {
        width: 92%;
        min-height: auto;
        gap: 10px;
    }

    .portal-scene {
        max-width: 460px;
    }

    .error-number {
        font-size: clamp(85px, 13vw, 120px);
    }

    .content h1 {
        font-size: 24px;
    }

    .description {
        font-size: 13px;
    }

}

/* 16. Mobile */

@media (max-width: 650px) {

    .page {
        min-height: 100svh;
        padding: 30px 0;
    }

    .error-section {
        width: 90%;
        display: flex;
        flex-direction: column-reverse;
        justify-content: center;

        gap: 0;
        padding: 20px 0;
    }

    .portal-scene {
        width: min(100%, 350px);
        margin-bottom: 5px;
    }

    .portal {
        width: 48%;
    }

    .content {
        width: 100%;
        text-align: center;
    }

    .top-label {
        margin-bottom: 18px;
        font-size: 10px;
    }

    .error-number {
        justify-content: center;
        margin: 0 auto 12px;

        font-size: clamp(85px, 23vw, 120px);
        letter-spacing: -5px;
    }

    .content h1 {
        font-size: 21px;
        line-height: 1.9;
        margin-bottom: 10px;
    }

    .description {
        font-size: 12px;
        line-height: 2.2;
        margin: 0 auto 22px;
        max-width: 380px;
    }

    .actions {
        justify-content: center;
        gap: 10px;
    }

    .button {
        min-height: 48px;
        padding: 0 17px;
        font-size: 11px;
    }

    .footer-note {
        justify-content: center;
        margin-top: 30px;
        font-size: 9px;
        gap: 8px;
    }

    .footer-line {
        width: 15px;
    }

    .portal-caption {
        bottom: 4%;
        font-size: 9px;
    }

    .background-glow {
        width: 300px;
        height: 300px;
        filter: blur(80px);
    }

    .background-grid {
        background-size: 45px 45px;
    }

}

/* 17. Small Mobile */

@media (max-width: 380px) {

    .portal-scene {
        width: 95%;
    }

    .content h1 {
        font-size: 19px;
    }

    .description {
        font-size: 11px;
    }

    .button {
        padding: 0 13px;
        font-size: 10px;
    }

}

/* 18. Short Screens */

@media (max-height: 650px) and (min-width: 651px) {

    .error-section {
        min-height: 560px;
        padding: 30px 0;
    }

    .portal-scene {
        max-width: 420px;
    }

}

/* 19. Reduced Motion */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}
