:root {
    color-scheme: dark;
    --bg: #050713;
    --bg-elevated: rgba(12, 15, 34, 0.9);
    --panel: rgba(12, 15, 34, 0.82);
    --panel-strong: rgba(12, 15, 34, 0.96);
    --border: rgba(174, 188, 255, 0.15);
    --border-strong: rgba(139, 173, 255, 0.44);
    --text: #f5f7ff;
    --muted: #929bb9;
    --muted-strong: #c4cae4;
    --cyan: #8dc7ff;
    --mint: #7cf0b7;
    --violet: #a894ff;
    --rose: #d889ff;
    --amber: #dcb8ff;
    --danger: #f2778f;
    --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: "Manrope", "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0;
}

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:
        radial-gradient(ellipse at 50% -22%, rgba(142, 111, 255, 0.105) 0%, rgba(90, 155, 255, 0.044) 36%, rgba(142, 111, 255, 0.016) 58%, transparent 78%),
        linear-gradient(180deg, rgba(7, 10, 25, 0.72) 0%, rgba(8, 10, 24, 0.98) 58%, rgba(5, 7, 19, 1) 100%),
        #050713;
}

.site-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(9, 12, 30, 0.08) 0%, transparent 28%, rgba(5, 7, 19, 0.74) 84%);
    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);
    border-bottom: 1px solid rgba(174, 188, 255, 0.08);
    background: rgba(5, 7, 19, 0.7);
    backdrop-filter: blur(16px);
}

.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: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

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

.lucide {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    stroke-width: 2;
}

.header-nav a,
.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    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 {
    border-color: rgba(220, 230, 242, 0.1);
    background: rgba(255, 255, 255, 0.055);
    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.14em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: clamp(56px, 11vw, 122px);
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: 0;
    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;
    gap: 9px;
    min-width: 132px;
    min-height: 44px;
    padding: 12px 18px;
    border-radius: 8px;
    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 .lucide,
.nav-button .lucide {
    width: 17px;
    height: 17px;
}

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

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

.button-secondary:hover,
.button-ghost:hover {
    border-color: var(--border-strong);
    background: rgba(139, 173, 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: 16px;
}

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

.feature-card:hover {
    border-color: rgba(139, 173, 255, 0.3);
    background:
        linear-gradient(145deg, rgba(139, 173, 255, 0.09), transparent 48%),
        rgba(15, 18, 40, 0.9);
    transform: translateY(-2px);
}

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

.feature-icon .lucide {
    width: 22px;
    height: 22px;
}

.feature-card:nth-child(2n) .feature-icon {
    border-color: rgba(168, 148, 255, 0.28);
    background: rgba(168, 148, 255, 0.1);
    color: var(--violet);
}

.feature-card:nth-child(3n) .feature-icon {
    border-color: rgba(216, 137, 255, 0.26);
    background: rgba(216, 137, 255, 0.09);
    color: var(--rose);
}

.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: var(--panel);
    backdrop-filter: blur(10px);
}

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

.product-panel-block {
    min-height: 230px;
}

.product-access-card {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.product-cover {
    width: 100%;
    min-height: 212px;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--border);
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
}

.product-access-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.product-access-copy h3 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.05;
}

.product-meta {
    display: grid;
    width: 100%;
    gap: 10px;
    margin: 18px 0 24px;
}

.product-meta div {
    display: grid;
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.product-meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.product-meta dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.download-loader-button {
    margin-top: auto;
}

.site-footer {
    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 .footer-copy,
.site-footer .footer-brand {
    color: var(--text);
    font-weight: 800;
}

.site-footer .footer-brand {
    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: 10px;
    background: rgba(9, 11, 15, 0.98);
}

.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:not(.input-shell) {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.input-shell {
    position: relative;
    display: block;
}

.input-shell .lucide {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.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-shell input {
    padding-left: 42px;
}

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

.turnstile-field {
    display: flex;
    min-height: 65px;
    align-items: center;
}

.turnstile-field[hidden] {
    display: none;
}

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

    .product-access-card {
        grid-template-columns: 132px minmax(0, 1fr);
    }

    .product-cover {
        min-height: 176px;
    }

}

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

    .product-access-card {
        grid-template-columns: 1fr;
    }

    .product-cover {
        max-height: 280px;
    }

    .product-meta div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

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