:root {
    color-scheme: dark;
    --bg: #030407;
    --bg-elevated: rgba(10, 13, 20, 0.84);
    --panel: rgba(11, 15, 24, 0.74);
    --panel-strong: rgba(11, 15, 24, 0.94);
    --border: rgba(204, 214, 229, 0.16);
    --border-strong: rgba(111, 209, 255, 0.4);
    --text: #f3f7fb;
    --muted: #9ba8b8;
    --muted-strong: #bdc8d6;
    --cyan: #6fd1ff;
    --mint: #7cf0b7;
    --violet: #a88cff;
    --rose: #ff8ab3;
    --amber: #f5c766;
    --danger: #ff6f8a;
    --max-width: 1120px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: "Nunito", "Segoe UI Rounded", "Arial Rounded MT Bold", "Segoe UI", Arial, sans-serif;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

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

.site-backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        linear-gradient(115deg, rgba(111, 209, 255, 0.09) 0%, transparent 26%),
        linear-gradient(245deg, rgba(255, 138, 179, 0.08) 0%, transparent 24%),
        linear-gradient(180deg, rgba(5, 6, 10, 0.86) 0%, rgba(8, 10, 16, 0.9) 48%, rgba(3, 4, 7, 0.94) 100%),
        url("assets/space_backdrop.png") center / cover no-repeat,
        #030407;
}

.site-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(3, 4, 7, 0.54) 78%);
    pointer-events: none;
}

.particle-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0.62;
    pointer-events: none;
}

.particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 999px;
    background: var(--color);
    opacity: var(--alpha);
    transform: translate3d(0, 0, 0);
    animation:
        particleFloat var(--duration) ease-in-out var(--delay) infinite,
        particleBlink var(--blink-duration) ease-in-out var(--blink-delay) infinite;
    will-change: transform, opacity;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate3d(var(--mouse-x), var(--mouse-y), 0);
    }
    25% {
        transform: translate3d(calc(var(--mouse-x) + var(--dx-a)), calc(var(--mouse-y) + var(--dy-a)), 0);
    }
    50% {
        transform: translate3d(calc(var(--mouse-x) + var(--dx-b)), calc(var(--mouse-y) + var(--dy-b)), 0);
    }
    75% {
        transform: translate3d(calc(var(--mouse-x) + var(--dx-c)), calc(var(--mouse-y) + var(--dy-c)), 0);
    }
}

@keyframes particleBlink {
    0%, 100% {
        opacity: var(--alpha-low);
    }
    45% {
        opacity: var(--alpha);
    }
    68% {
        opacity: var(--alpha-mid);
    }
}

.site-header {
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 78px;
    padding: 18px clamp(18px, 4vw, 48px);
    background: linear-gradient(180deg, rgba(3, 4, 7, 0.9), rgba(3, 4, 7, 0.42), transparent);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
}

.brand-mark img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: invert(1) brightness(1.35);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1;
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.header-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-nav a,
.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted-strong);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.header-nav a:hover,
.nav-button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 118px 20px 86px;
}

.hero-content {
    width: min(900px, 100%);
    text-align: center;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(64px, 14vw, 156px);
    line-height: 0.9;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-copy {
    width: min(730px, 100%);
    margin: 28px auto 0;
    color: var(--muted-strong);
    font-size: clamp(17px, 2.1vw, 22px);
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #061015;
    background: linear-gradient(135deg, var(--cyan), var(--mint));
}

.button-secondary,
.button-ghost {
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.button-secondary:hover,
.button-ghost:hover {
    border-color: var(--border-strong);
    background: rgba(111, 209, 255, 0.1);
}

.section {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 86px 0;
}

.section-heading {
    width: min(760px, 100%);
    margin-bottom: 28px;
}

.section-heading h2,
.modal h2 {
    margin: 0;
    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.02;
}

.section-heading p,
.modal-note {
    color: var(--muted-strong);
    line-height: 1.65;
}

.section-heading > p:last-child {
    margin: 18px 0 0;
    max-width: 680px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.feature-card {
    min-height: 232px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.075), transparent 46%),
        var(--panel);
    backdrop-filter: blur(14px);
    transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.feature-card:hover {
    border-color: rgba(111, 209, 255, 0.34);
    background:
        linear-gradient(145deg, rgba(111, 209, 255, 0.11), transparent 48%),
        rgba(12, 17, 27, 0.82);
    transform: translateY(-3px);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border: 1px solid rgba(111, 209, 255, 0.28);
    border-radius: 8px;
    background: rgba(111, 209, 255, 0.1);
    color: var(--cyan);
    font-weight: 900;
}

.feature-card:nth-child(2n) .feature-icon {
    border-color: rgba(124, 240, 183, 0.24);
    background: rgba(124, 240, 183, 0.09);
    color: var(--mint);
}

.feature-card:nth-child(3n) .feature-icon {
    border-color: rgba(245, 199, 102, 0.26);
    background: rgba(245, 199, 102, 0.09);
    color: var(--amber);
}

.feature-card h3 {
    margin: 0;
    font-size: 20px;
}

.feature-card p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.58;
}

.user-panel-section {
    padding-top: 28px;
}

.panel-shell {
    min-height: calc(100vh - 118px);
    padding-top: 118px;
}

.panel-hero {
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 0;
}

.panel-hero h1 {
    margin: 0;
    font-size: clamp(44px, 8vw, 88px);
    line-height: 0.94;
    text-transform: uppercase;
}

.panel-status {
    margin: 18px 0 0;
    color: var(--muted-strong);
    font-size: 17px;
}

.user-panel-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1.28fr);
    gap: 14px;
}

.user-panel-block {
    min-height: 190px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(11, 15, 24, 0.74);
    backdrop-filter: blur(14px);
}

.user-panel-block h3 {
    margin: 0;
    font-size: 24px;
}

.user-panel-block p {
    color: var(--muted);
}

.panel-info {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(245, 199, 102, 0.24);
    border-radius: 6px;
    background: rgba(245, 199, 102, 0.07);
    color: #dfd0a7;
    font-size: 14px;
    line-height: 1.55;
}

.panel-role-line {
    margin: 8px 0 10px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border: 1px solid rgba(204, 214, 229, 0.18);
    border-radius: 999px;
    background: rgba(155, 168, 184, 0.1);
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.role-subscriber {
    border-color: rgba(124, 240, 183, 0.34);
    background: rgba(124, 240, 183, 0.1);
    color: var(--mint);
}

.role-admin {
    border-color: rgba(255, 111, 138, 0.38);
    background: rgba(255, 111, 138, 0.1);
    color: #ff9aac;
}

.panel-label {
    margin: 0 0 12px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.panel-form {
    margin-top: 18px;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    width: min(var(--max-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 42px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.site-footer span:first-child {
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.modal-root {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: 18px;
}

.modal-root.is-open {
    display: grid;
}

.modal-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(14px);
}

.modal {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(8, 11, 18, 0.96);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.modal-close::before,
.modal-close::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 17px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-close:hover {
    border-color: rgba(255, 138, 179, 0.48);
    background: rgba(255, 138, 179, 0.1);
}

.modal h2 {
    margin-bottom: 20px;
    font-size: 34px;
}

.modal-note {
    margin: -8px 0 20px;
    padding: 12px 14px;
    border: 1px solid rgba(245, 199, 102, 0.2);
    border-radius: 6px;
    background: rgba(245, 199, 102, 0.07);
    color: #dfd0a7;
    font-size: 14px;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    display: grid;
    gap: 7px;
}

.auth-form label span {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-form input {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
}

.auth-form input:focus {
    border-color: var(--border-strong);
}

.form-status {
    min-height: 22px;
    margin: 0;
    color: var(--amber);
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 860px) {
    .site-header {
        align-items: flex-start;
        min-height: 72px;
        padding: 16px 18px;
    }

    .header-nav a {
        display: none;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-panel-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 620px) {
    .brand-subtitle {
        display: none;
    }

    .hero {
        min-height: 94vh;
        padding-top: 112px;
    }

    .panel-shell {
        padding-top: 106px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .button {
        width: 100%;
    }

    .section {
        width: min(100% - 28px, var(--max-width));
        padding: 62px 0;
    }

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

    .feature-card {
        grid-column: auto;
        min-height: 0;
    }

    .modal {
        padding: 24px;
    }
}

@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;
    }
}
