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

:root {
    color-scheme: dark;
    --ink: #f3f6ff;
    --muted: #b2bdd2;
    --px: 0px;
    --py: 0px
}

* {
    box-sizing: border-box
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden
}

body {
    font-family: Vazirmatn, Tahoma, sans-serif;
    background: #080f20;
    color: var(--ink)
}

.stage {
    position: relative;
    isolation: isolate;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center
}

.stage::before {
    content: "";
    position: absolute;
    inset: -10%;
    z-index: -4;
    background: radial-gradient(ellipse 44% 47% at 15% 25%, #274b82 0%, transparent 78%), radial-gradient(ellipse 45% 49% at 84% 15%, #49366f 0%, transparent 77%), radial-gradient(ellipse 55% 55% at 56% 88%, #075f68 0%, transparent 74%), #0a1022;
    animation: ambient 14s ease-in-out infinite alternate
}

.aurora {
    position: absolute;
    inset: -15%;
    z-index: -3;
    pointer-events: none;
    transform: translate3d(var(--px), var(--py), 0);
    will-change: transform;
    filter: blur(43px)
}

.orb {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    opacity: .48;
    filter: blur(17px);
    animation: float 13s ease-in-out infinite alternate
}

.orb.a {
    width: 43vw;
    height: 43vw;
    min-width: 340px;
    min-height: 340px;
    top: 4%;
    left: 3%;
    background: radial-gradient(circle, #287cce, transparent 70%)
}

.orb.b {
    width: 38vw;
    height: 38vw;
    min-width: 300px;
    min-height: 300px;
    right: 1%;
    top: 12%;
    background: radial-gradient(circle, #a365c3, transparent 70%);
    animation-delay: -6s
}

.orb.c {
    width: 43vw;
    height: 32vw;
    min-width: 350px;
    min-height: 300px;
    bottom: -5%;
    left: 28%;
    background: radial-gradient(circle, #16b6aa, transparent 60%);
    animation-delay: -9s
}

.grid {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: .28;
    background-image: linear-gradient(#b7d6ff13 1px, transparent 1px), linear-gradient(90deg, #b7d6ff13 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: linear-gradient(to bottom, #000, transparent 94%)
}

.gloss {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(115deg, #ffffff08, transparent 35%, #ffffff07 75%, transparent)
}

header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(24px, 6vw, 95px)
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: #f5f7ff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.6px
}

.brand img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 11px #f3b95b55)
}

.header-note {
    font-size: 12px;
    color: #d1d8e6a6;
    letter-spacing: .1px
}

.login-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 48px;
    padding: 7px 12px 7px 16px;
    border: 1px solid #c8dfff45;
    border-radius: 16px;
    background: linear-gradient(120deg, #274b8266, #49366f66);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 8px 24px #02061530, inset 0 1px 0 #ffffff20;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .2s, box-shadow .2s, transform .2s
}

.login-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(145deg, #e7bc7526, #bc824114);
    color: #efc98b
}

.login-icon svg {
    width: 20px;
    height: 20px
}

.login-arrow {
    width: 16px;
    height: 16px;
    color: #c8e6ff;
    transition: transform .2s
}

.login-button:hover {
    border-color: #efc98b99;
    box-shadow: 0 10px 28px #02061545, 0 0 20px #c8e6ff12, inset 0 1px 0 #ffffff30;
    transform: translateY(-2px)
}

.login-button:hover .login-arrow {
    transform: translateX(-3px)
}

.login-button:focus-visible {
    outline: 2px solid #efc98b;
    outline-offset: 4px
}

.login-button:active {
    transform: translateY(0)
}

main {
    width: min(950px, calc(100% - 42px));
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateY(-1.5vh)
}

.eyebrow {
    font-size: clamp(11px, 1.25vw, 14px);
    color: #d6e3f5b9;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px
}

.spark {
    color: #efc98b;
    font-size: 18px
}

h1 {
    font-size: clamp(44px, 6vw, 78px);
    line-height: 1.3;
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -2px;
    background: linear-gradient(105deg, #fff 25%, #c8e6ff 58%, #ffe0ad 96%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 9px 45px #c4d5ff13
}

.description {
    color: #c4cee0;
    line-height: 2.15;
    font-size: clamp(13px, 1.3vw, 16px);
    font-weight: 400;
    max-width: 680px;
    margin: 0 0 clamp(28px, 5vh, 48px);
    text-wrap: balance
}

.composer {
    position: relative;
    width: 100%;
    height: clamp(170px, 25vh, 210px);
    border: 1px solid #ffffff50;
    border-radius: 28px;
    background: linear-gradient(125deg, #ffffff26, #ffffff0e 52%, #ffffff1a);
    box-shadow: 0 24px 70px #02061550, inset 0 1px 0 #ffffff35;
    backdrop-filter: blur(28px) saturate(145%);
    -webkit-backdrop-filter: blur(28px) saturate(145%);
    text-align: right;
    overflow: hidden;
    transition: border-color .25s, box-shadow .25s
}

.composer:focus-within {
    border-color: #f0d29c99;
    box-shadow: 0 24px 70px #02061550, 0 0 0 3px #eabf7420, inset 0 1px 0 #ffffff35
}

textarea {
    font-family: inherit;
    display: block;
    width: 100%;
    height: calc(100% - 75px);
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font-size: clamp(14px, 1.45vw, 17px);
    padding: 23px 26px 0;
    line-height: 1.9;
    direction: rtl;
    text-align: right
}

textarea::placeholder {
    color: #bfcbe0;
    opacity: .82
}

.composer-footer {
    position: absolute;
    bottom: 14px;
    left: 15px;
    right: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.hint {
    font-size: 12px;
    color: #b8c6da99
}

.go {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid #ffe7ae88;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(145deg, #e7bc75, #bc8241);
    box-shadow: 0 5px 24px #dba95c45;
    color: #142037;
    transition: transform .2s, box-shadow .2s
}

.go:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 30px #dba95c75
}

.go:active {
    transform: scale(.95)
}

.go svg {
    width: 22px;
    height: 22px
}

footer {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    text-align: center;
    color: #c8d2e170;
    font-size: 11px
}

@keyframes ambient {
    from {
        transform: scale(1) rotate(0deg)
    }
    to {
        transform: scale(1.12) rotate(5deg)
    }
}

@keyframes float {
    from {
        transform: translate(-4%, 5%) scale(.9)
    }
    to {
        transform: translate(8%, -6%) scale(1.16)
    }
}

@media (max-width: 850px) {
    .header-note {
        display: none
    }
}

@media (max-width: 600px) {
    header {
        height: 76px;
        padding: 0 22px
    }

    .brand {
        font-size: 19px
    }

    .login-button {
        min-height: 44px;
        gap: 7px;
        padding: 6px 9px;
        border-radius: 14px;
        font-size: 12px
    }

    .login-icon {
        width: 28px;
        height: 28px
    }

    .login-arrow {
        display: none
    }

    .brand img {
        width: 50px;
        height: 50px
    }

    .header-note {
        display: none
    }

    main {
        transform: translateY(-1vh)
    }

    .eyebrow {
        margin-bottom: 14px
    }

    h1 {
        margin-bottom: 12px
    }

    .description {
        max-width: 360px;
        line-height: 2.05;
        margin-bottom: 28px
    }

    .composer {
        border-radius: 23px;
        height: 190px
    }

    .hint {
        font-size: 10px
    }

    footer {
        bottom: 14px;
        font-size: 10px
    }
}

@media (max-height: 560px) {
    header {
        height: 55px
    }

    .brand img {
        width: 45px;
        height: 45px
    }

    main {
        transform: none
    }

    .eyebrow {
        margin-bottom: 2px
    }

    h1 {
        font-size: clamp(30px, 7vh, 50px);
        margin: 0
    }

    .description {
        line-height: 1.55;
        margin-bottom: 12px;
        font-size: 12px
    }

    .composer {
        height: clamp(105px, 29vh, 150px)
    }

    textarea {
        padding-top: 10px;
        height: calc(100% - 50px)
    }

    .composer-footer {
        bottom: 8px
    }

    .go {
        width: 36px;
        height: 36px
    }

    footer {
        display: none
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important
    }
}

/* Motion fix: keep decorative layers visible within the stage stacking context. */
.stage {
    background: #0a1022;
}

.stage::before {
    z-index: 0;
}

.aurora {
    z-index: 1;
    filter: blur(26px);
}

.grid {
    z-index: 2;
}

.gloss {
    z-index: 3;
}

header, main, footer {
    z-index: 4;
}

.orb {
    opacity: .82;
    filter: blur(8px);
}

.orb.a {
    background: radial-gradient(circle, #358de9 0%, #316bdc99 35%, transparent 72%);
}

.orb.b {
    background: radial-gradient(circle, #d17bea 0%, #8d54d999 37%, transparent 72%);
}

.orb.c {
    background: radial-gradient(circle, #23d7c2 0%, #159aa999 40%, transparent 72%);
}
