
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --sky: #a9d9ed;
    --cream: #f8eedb;
    --coral: #f28b78;
    --mint: #a8d8b9;
    --yellow: #f5c85b;
    --purple: #b9a3db;
    --blue: #75b7dc;
    --ink: #345b78;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--cream);
}

body {
    min-height: 100vh;
    font-family: 'Vazirmatn', sans-serif;
    background: var(--cream);
    color: var(--ink);
    overflow-x: hidden;
}

button,
a {
    font: inherit;
}

.postcard {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    overflow: hidden;
    padding: 30px 20px;
    background: linear-gradient(
        180deg,
        #a9d9ed 0%,
        #c5e7ec 48%,
        #f8eedb 100%
    );
}

/* SKY */

.sky {
    position: absolute;
    inset: 0;
    z-index: -3;
    overflow: hidden;
}

.sun {
    position: absolute;
    width: 120px;
    height: 120px;
    top: 8%;
    right: 16%;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe89b, #f5c85b);
    box-shadow:
        0 0 0 18px rgba(255, 232, 155, .13),
        0 0 0 38px rgba(255, 232, 155, .09),
        0 15px 45px rgba(238, 177, 83, .2);
    animation: sun-float 6s ease-in-out infinite;
}

.sun-face {
    position: absolute;
    width: 40px;
    height: 12px;
    left: 50%;
    top: 57%;
    transform: translate(-50%, -50%);
    border-bottom: 2px solid rgba(167, 112, 54, .5);
    border-radius: 50%;
}

@keyframes sun-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.sun-rays {
    position: absolute;
    top: 8%;
    right: 16%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 1px dashed rgba(245, 200, 91, .3);
    animation: rotate-sun 40s linear infinite;
}

@keyframes rotate-sun {
    to { transform: rotate(360deg); }
}

/* CLOUDS */

.cloud {
    position: absolute;
    width: 150px;
    height: 35px;
    background: #fffdf6;
    border-radius: 50px;
    opacity: .85;
    filter: drop-shadow(0 7px 0 rgba(111, 168, 194, .1));
    animation: cloud-move 35s ease-in-out infinite alternate;
}

.cloud span {
    position: absolute;
    bottom: 8px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #fffdf6;
}

.cloud span:nth-child(1) {
    left: 18px;
}

.cloud span:nth-child(2) {
    left: 52px;
    bottom: 18px;
    width: 70px;
    height: 70px;
}

.cloud span:nth-child(3) {
    right: 12px;
}

.cloud-one {
    top: 20%;
    left: 8%;
}

.cloud-two {
    top: 37%;
    right: 5%;
    transform: scale(.75);
    animation-delay: -12s;
}

.cloud-three {
    top: 10%;
    left: 48%;
    transform: scale(.55);
    animation-delay: -20s;
}

@keyframes cloud-move {
    from { translate: -15px 0; }
    to { translate: 35px 5px; }
}

/* BIRDS */

.birds {
    position: absolute;
    top: 30%;
    left: 20%;
    color: #628fa5;
}

.birds span {
    position: absolute;
    font-size: 25px;
    font-weight: 700;
}

.birds span:nth-child(1) {
    left: 0;
    top: 10px;
}

.birds span:nth-child(2) {
    left: 40px;
    top: -10px;
    transform: scale(.7);
}

.birds span:nth-child(3) {
    left: 75px;
    top: 15px;
    transform: scale(.85);
}

/* PARTICLES */

.sky-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff7d6;
    box-shadow: 0 0 10px rgba(255, 255, 255, .5);
    animation: particle-float 5s ease-in-out infinite alternate;
}

@keyframes particle-float {
    from {
        transform: translateY(0) scale(.8);
        opacity: .3;
    }
    to {
        transform: translateY(-22px) scale(1.2);
        opacity: .9;
    }
}

/* WORLD */

.world {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

/* HILLS */

.hill {
    position: absolute;
    bottom: 20%;
    width: 120%;
    left: -10%;
    border-radius: 50% 50% 0 0;
}

.hill-back {
    height: 260px;
    bottom: 19%;
    background: #c3e4d1;
    transform: rotate(-4deg);
}

.hill-middle {
    height: 210px;
    bottom: 13%;
    background: #9ed2b7;
    transform: rotate(3deg);
    box-shadow: 0 -10px 0 rgba(255,255,255,.12);
}

.hill-front {
    height: 170px;
    bottom: -3%;
    background: #77bd9c;
    transform: rotate(-2deg);
    box-shadow: 0 -12px 0 rgba(255,255,255,.12);
}

/* BALLOON */

.balloon-wrap {
    position: absolute;
    top: 17%;
    left: 19%;
    width: 150px;
    height: 230px;
    animation: balloon-float 5s ease-in-out infinite;
}

@keyframes balloon-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-17px) rotate(3deg); }
}

.balloon {
    position: absolute;
    top: 0;
    left: 10px;
    width: 130px;
    height: 155px;
    overflow: hidden;
    border-radius: 50% 50% 46% 46%;
    background: linear-gradient(90deg, #e97b70, #f5a18a 48%, #e97870);
    box-shadow:
        inset -10px -8px 0 rgba(180, 87, 82, .1),
        0 12px 18px rgba(74, 112, 126, .15);
}

.balloon::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    width: 22px;
    height: 25px;
    transform: translateX(-50%);
    background: #d86f67;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.balloon-panel {
    position: absolute;
    top: 0;
    height: 100%;
    width: 25%;
    border-radius: 50%;
    opacity: .5;
}

.panel-one {
    left: 0;
    background: #f9c5a4;
}

.panel-two {
    left: 25%;
    background: #f7a48e;
}

.panel-three {
    left: 50%;
    background: #e66f73;
}

.panel-four {
    right: 0;
    background: #c95e6c;
}

.balloon-shine {
    position: absolute;
    top: 20px;
    left: 22px;
    width: 23px;
    height: 65px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    transform: rotate(18deg);
    filter: blur(3px);
}

.balloon-string {
    position: absolute;
    top: 145px;
    left: 74px;
    width: 2px;
    height: 55px;
    background: #8c7466;
}

.balloon-basket {
    position: absolute;
    top: 196px;
    left: 62px;
    width: 27px;
    height: 22px;
    border-radius: 3px 3px 7px 7px;
    background: linear-gradient(90deg, #a87852, #d4a16c, #956b4c);
    box-shadow: 0 4px 5px rgba(0,0,0,.12);
}

/* PAPER PLANE */

.paper-plane {
    position: absolute;
    top: 30%;
    right: 17%;
    width: 90px;
    height: 65px;
    animation: plane-fly 9s ease-in-out infinite;
}

.plane-wing {
    position: absolute;
    inset: 0;
    background: #fffdf2;
    clip-path: polygon(0 0, 100% 35%, 25% 100%, 39% 52%);
    filter: drop-shadow(0 5px 3px rgba(76, 126, 149, .2));
}

.plane-fold {
    position: absolute;
    top: 23px;
    left: 20px;
    width: 68px;
    height: 1px;
    background: rgba(100, 133, 147, .35);
    transform: rotate(19deg);
}

@keyframes plane-fly {
    0% { transform: translate(0, 0) rotate(-7deg); }
    30% { transform: translate(-35px, -17px) rotate(2deg); }
    65% { transform: translate(-75px, 8px) rotate(-4deg); }
    100% { transform: translate(0, 0) rotate(-7deg); }
}

/* TOWN */

.town {
    position: absolute;
    bottom: 27%;
    left: 50%;
    width: min(760px, 90vw);
    height: 180px;
    transform: translateX(-50%);
}

.house {
    position: absolute;
    bottom: 0;
    width: 90px;
    height: 115px;
    filter: drop-shadow(5px 9px 0 rgba(73, 122, 118, .12));
}

.house-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 82px;
    background: var(--house-color);
    border: 3px solid rgba(255,255,255,.35);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.house-roof {
    position: absolute;
    top: 0;
    left: -8px;
    width: calc(100% + 16px);
    height: 48px;
    background: var(--roof-color);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    filter: drop-shadow(0 4px 0 rgba(0,0,0,.08));
    z-index: 2;
}

.house-window {
    position: absolute;
    top: 19px;
    left: 13px;
    width: 19px;
    height: 25px;
    background: #f8e4a8;
    border: 3px solid rgba(255,255,255,.45);
    border-radius: 10px 10px 2px 2px;
    box-shadow: 0 0 9px rgba(255, 227, 152, .25);
}

.house-door {
    position: absolute;
    bottom: 0;
    right: 13px;
    width: 24px;
    height: 43px;
    background: rgba(92, 82, 76, .48);
    border-radius: 12px 12px 0 0;
}

.house-one {
    left: 1%;
    transform: scale(.82);
    --house-color: #f4b4a3;
    --roof-color: #d97870;
}

.house-two {
    left: 20%;
    transform: scale(1.05);
    --house-color: #f3d18c;
    --roof-color: #e9a85e;
}

.house-three {
    left: 40%;
    transform: scale(.9);
    --house-color: #b7cce9;
    --roof-color: #8d9ecf;
}

.house-four {
    right: 19%;
    transform: scale(1.08);
    --house-color: #f4b3a6;
    --roof-color: #d77d83;
}

.house-five {
    right: 0;
    transform: scale(.83);
    --house-color: #b3d8b6;
    --roof-color: #73ad90;
}

.house-shadow {
    position: absolute;
    bottom: -7px;
    left: -10px;
    width: 110%;
    height: 10px;
    border-radius: 50%;
    background: rgba(58, 105, 85, .16);
    filter: blur(4px);
}

/* TREES */

.trees {
    position: absolute;
    bottom: 22%;
    left: 0;
    width: 100%;
    height: 150px;
}

.tree {
    position: absolute;
    bottom: 0;
    width: 70px;
    height: 130px;
}

.tree-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 70px;
    height: 100px;
    border-radius: 50% 50% 45% 45%;
    background: #5d9f7f;
    box-shadow:
        inset -9px -5px 0 rgba(42, 109, 79, .13),
        5px 8px 0 rgba(67, 132, 100, .15);
}

.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 29px;
    width: 12px;
    height: 42px;
    background: #9a7757;
}

.tree-one {
    left: 8%;
    transform: scale(.8);
}

.tree-two {
    right: 8%;
    transform: scale(1.1);
}

.tree-three {
    right: 30%;
    transform: scale(.55);
}

/* FLOWERS */

.flowers {
    position: absolute;
    bottom: 8%;
    left: 0;
    width: 100%;
    height: 50px;
}

.flower {
    position: absolute;
    font-size: 26px;
    animation: flower-sway 3s ease-in-out infinite alternate;
}

.flower-one { left: 10%; color: #f28b78; }
.flower-two { left: 25%; color: #f5c85b; animation-delay: .5s; }
.flower-three { left: 43%; color: #fff0c7; animation-delay: 1s; }
.flower-four { right: 12%; color: #b9a3db; animation-delay: .3s; }
.flower-five { right: 28%; color: #f28b78; animation-delay: .8s; }
.flower-six { right: 45%; color: #f5c85b; animation-delay: 1.2s; }

@keyframes flower-sway {
    from { transform: rotate(-9deg) translateY(0); }
    to { transform: rotate(9deg) translateY(-4px); }
}

/* GRASS */

.grass {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 14%;
    background: linear-gradient(180deg, #8fcba6, #72b58e);
    clip-path: polygon(0 12%, 15% 0, 30% 10%, 48% 0, 65% 12%, 82% 0, 100% 10%, 100% 100%, 0 100%);
    z-index: 2;
}

/* CONTENT */

.content {
    position: relative;
    z-index: 10;
    width: min(100%, 650px);
    margin-top: auto;
    margin-bottom: auto;
    padding-top: 320px;
    text-align: center;
}

.error-number {
    font-size: clamp(76px, 11vw, 118px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 7px;
    color: transparent;
    background: linear-gradient(180deg, #f28b78, #d97870);
    background-clip: text;
    -webkit-background-clip: text;
    filter: drop-shadow(0 5px 0 rgba(199, 113, 103, .13));
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 14px auto 12px;
}

.divider span {
    width: 65px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d69b71);
}

.divider span:last-child {
    transform: rotate(180deg);
}

.divider i {
    color: #e5a45d;
    font-style: normal;
    font-size: 18px;
}

.content h1 {
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 700;
    color: #345b78;
    margin-bottom: 12px;
}

.description {
    color: #496d70;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.9;
    margin-bottom: 6px;
}

.sub-description {
    color: #496d70;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, .45);
}

/* BUTTONS */

.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 27px;
}

.action-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 22px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    transition: .3s ease;
}

.home-button {
    color: #fffdf5;
    background: linear-gradient(135deg, #f28b78, #df756e);
    border: 1px solid rgba(255,255,255,.45);
    box-shadow: 0 6px 15px rgba(222, 117, 110, .22);
}

.home-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(222, 117, 110, .3);
}

.back-button {
    color: #496d70;
    background: rgba(255,255,255,.65);
    border: 1px solid rgba(102, 155, 145, .3);
    box-shadow: 0 5px 15px rgba(75, 122, 116, .08);
}

.back-button:hover {
    background: #fffdf5;
    transform: translateY(-3px);
}

.button-icon {
    font-size: 20px;
    line-height: 1;
}

.footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
    color: rgba(73, 109, 112, .5);
    font-size: 9px;
    letter-spacing: 3px;
    direction: ltr;
}

.footer-note span {
    width: 25px;
    height: 1px;
    background: rgba(73, 109, 112, .3);
}

/* PAPER TEXTURE */

.paper-texture {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: .15;
    background-image:
        radial-gradient(#ffffff 1px, transparent 1px);
    background-size: 7px 7px;
    mix-blend-mode: soft-light;
}

/* RESPONSIVE */

@media (max-width: 700px) {

    .postcard {
        padding: 18px 14px;
    }

    .sun {
        width: 85px;
        height: 85px;
        top: 7%;
        right: 10%;
    }

    .sun-rays {
        width: 85px;
        height: 85px;
        top: 7%;
        right: 10%;
    }

    .balloon-wrap {
        top: 16%;
        left: 8%;
        transform: scale(.75);
        transform-origin: top left;
    }

    .paper-plane {
        top: 29%;
        right: 9%;
        transform: scale(.75);
    }

    .town {
        width: 110%;
        bottom: 26%;
        height: 145px;
    }

    .house {
        transform-origin: bottom center;
    }

    .house-one { transform: scale(.58); }
    .house-two { transform: scale(.72); }
    .house-three { transform: scale(.63); }
    .house-four { transform: scale(.72); }
    .house-five { transform: scale(.58); }

    .trees {
        bottom: 21%;
        transform: scale(.75);
    }

    .hill-back {
        height: 200px;
    }

    .hill-middle {
        height: 160px;
    }

    .hill-front {
        height: 130px;
    }

    .content {
        padding-top: 270px;
    }

    .error-number {
        font-size: clamp(72px, 18vw, 100px);
    }

    .content h1 {
        font-size: 25px;
        margin-bottom: 8px;
    }

    .description {
        font-size: 14px;
    }

    .sub-description {
        font-size: 12px;
    }

    .actions {
        gap: 9px;
        margin-top: 20px;
    }

    .action-button {
        min-height: 45px;
        padding: 0 14px;
        font-size: 12px;
    }

    .footer-note {
        margin-top: 22px;
        font-size: 8px;
    }
}

@media (max-width: 390px) {

    .postcard {
        padding: 12px 10px;
    }

    .balloon-wrap {
        top: 15%;
        left: 4%;
        transform: scale(.6);
    }

    .paper-plane {
        top: 28%;
        right: 5%;
        transform: scale(.65);
    }

    .town {
        bottom: 25%;
        height: 125px;
    }

    .house-one { transform: scale(.48); }
    .house-two { transform: scale(.6); }
    .house-three { transform: scale(.52); }
    .house-four { transform: scale(.6); }
    .house-five { transform: scale(.48); }

    .trees {
        bottom: 20%;
        transform: scale(.65);
    }

    .content {
        padding-top: 240px;
    }

    .error-number {
        font-size: 72px;
        letter-spacing: 5px;
    }

    .divider {
        margin: 9px auto;
    }

    .content h1 {
        font-size: 22px;
    }

    .description {
        font-size: 13px;
        line-height: 1.8;
    }

    .sub-description {
        font-size: 11px;
    }

    .actions {
        flex-direction: column;
        margin-top: 15px;
        gap: 8px;
    }

    .action-button {
        width: min(100%, 260px);
        min-height: 42px;
    }

    .footer-note {
        margin-top: 17px;
        letter-spacing: 2px;
    }
}

/* SHORT SCREENS */

@media (max-height: 700px) and (min-width: 701px) {

    .postcard {
        padding: 15px;
    }

    .content {
        padding-top: 245px;
    }

    .error-number {
        font-size: 78px;
    }

    .actions {
        margin-top: 17px;
    }

    .footer-note {
        margin-top: 17px;
    }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
