*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
    --bg: #070908;
    --surface: #0c0f0e;
    --surface-2: #121614;
    --ink: #e8ece6;
    --mute: #7f8a84;
    --faint: #4a534e;
    --line: rgba(232, 236, 230, .12);
    --line-2: rgba(232, 236, 230, .22);
    --brand: #12d87e;
    --accent: #12d87e;
    --sans: 'Archivo', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --dock-h: 56px;
}

html, body { height: 100%; }

body {
    font-family: var(--sans);
    font-stretch: 100%;
    background: var(--bg);
    color: var(--ink);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.label {
    font-family: var(--mono);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mute);
}

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

#scene.dragging { cursor: grabbing; }
#scene.pointing { cursor: pointer; }

/* ============ Buttons ============ */

.btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 15px 18px;
    border-radius: 2px;
    font-weight: 600;
    font-size: .95rem;
    transition: background .15s, color .15s, border-color .15s;
}

.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); }
.btn.line { border: 1px solid var(--line-2); color: var(--ink); }
.btn.line:hover { border-color: var(--ink); }
.btn .with-icon { display: flex; align-items: center; gap: 10px; }

.btn:disabled {
    cursor: not-allowed;
    background: transparent;
    color: var(--mute);
    border: 1px dashed var(--line-2);
}

/* ============ Loader ============ */

.loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    background: var(--bg);
    transition: opacity .8s var(--ease), visibility .8s;
}

.loader.done { opacity: 0; visibility: hidden; }

.loader-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--mute);
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.loader-bar { height: 1px; background: var(--line); }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s var(--ease); }

/* ============ Reveal ============ */

.top, .intro, .dock, .hint { opacity: 0; transition: opacity 1s var(--ease), transform 1s var(--ease); }
.intro { transform: translateY(12px); }
body.ready .top, body.ready .intro, body.ready .dock, body.ready .hint { opacity: 1; transform: none; }
body.ready .intro { transition-delay: .4s; }
body.ready .dock { transition-delay: .7s; }
body.ready .hint { transition-delay: 1.2s; }

/* ============ Header ============ */

.top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    pointer-events: none;
}

.top > * { pointer-events: auto; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-stretch: 125%;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.brand img { width: 28px; height: 28px; border-radius: 50%; }

.top-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-family: var(--mono);
    font-size: .76rem;
}

.top-links a, .top-links button {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mute);
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: color .15s, border-color .15s;
}

.top-links a:hover, .top-links button:hover { color: var(--ink); border-bottom-color: var(--ink); }
.top-links .short { display: none; }

/* ============ Intro ============ */

.intro {
    position: fixed;
    left: 32px;
    top: 50%;
    z-index: 10;
    width: 340px;
    translate: 0 -58%;
    pointer-events: none;
}

.kicker {
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--mute);
    margin-bottom: 18px;
}

.kicker::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 10px; background: var(--brand); vertical-align: 1px; }
.kicker strong { color: var(--ink); font-weight: 500; }
.kicker .sep { color: var(--faint); margin: 0 6px; }

.intro h1 {
    font-weight: 800;
    font-stretch: 125%;
    font-size: clamp(2.6rem, 4.4vw, 4.4rem);
    line-height: .92;
    letter-spacing: -.035em;
    margin-bottom: 22px;
}

.intro h1 em { font-style: normal; color: var(--brand); }

.intro .sub {
    font-size: .9rem;
    line-height: 1.55;
    color: var(--mute);
    margin-bottom: 26px;
}

.intro-support {
    padding-top: 18px;
    border-top: 1px solid var(--line);
    pointer-events: auto;
}

.intro-support .label { margin-bottom: 6px; }

.intro-support p:not(.label) {
    font-size: .86rem;
    line-height: 1.5;
    color: var(--mute);
    margin-bottom: 14px;
}

.intro-support .btn { padding: 12px 16px; font-size: .88rem; }

.hint {
    position: fixed;
    right: 32px;
    bottom: calc(var(--dock-h) + 18px);
    z-index: 10;
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--faint);
    pointer-events: none;
}

body.panel-open .intro, body.panel-open .hint { opacity: 0 !important; transition-delay: 0s !important; }

/* ============ Dock ============ */

.dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: stretch;
    height: var(--dock-h);
    padding: 0 32px;
    background: var(--bg);
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.filters {
    display: flex;
    gap: 22px;
    padding-right: 28px;
    margin-right: 28px;
    border-right: 1px solid var(--line);
}

.filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--mute);
    transition: color .15s;
}

.filter sup { font-size: .62rem; color: var(--faint); }
.filter.active sup { color: var(--mute); }
.filter:hover { color: var(--ink); }
.filter.active { color: var(--ink); }
.filter.active::after, .item.front::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 2px;
    background: var(--ink);
}

.items {
    display: flex;
    gap: 26px;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}

.items::-webkit-scrollbar { display: none; }
.items li { display: flex; }

.item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    color: var(--mute);
    transition: color .15s;
}

.item .num { color: var(--faint); }
.item .new { font-size: .6rem; color: var(--brand); }
.item:hover { color: var(--ink); }
.item.front { color: var(--ink); }
.item.front::after { background: var(--brand); }

/* ============ Panel ============ */

.panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: var(--dock-h);
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: 440px;
    background: var(--surface);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform .55s var(--ease);
}

.panel.open { transform: none; }

.panel-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 52px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--mute);
}

.close {
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--mute);
    display: flex;
    gap: 8px;
    padding: 6px 0;
    transition: color .15s;
}

.close:hover { color: var(--ink); }

.panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 32px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}

.panel.open .panel-scroll > * { animation: rise .5s var(--ease) both; }
.panel.open .panel-scroll > :nth-child(2) { animation-delay: .04s; }
.panel.open .panel-scroll > :nth-child(3) { animation-delay: .08s; }
.panel.open .panel-scroll > :nth-child(4) { animation-delay: .12s; }
.panel.open .panel-scroll > :nth-child(n+5) { animation-delay: .16s; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.p-media {
    aspect-ratio: 16 / 9;
    margin-bottom: 20px;
    background: var(--surface-2);
    overflow: hidden;
}

.p-media img { width: 100%; height: 100%; object-fit: cover; }

.p-meta {
    display: flex;
    gap: 14px;
    font-family: var(--mono);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mute);
}

.p-meta span + span::before { content: '/'; margin-right: 14px; color: var(--faint); }

.p-name {
    font-weight: 800;
    font-stretch: 125%;
    font-size: 2.1rem;
    line-height: 1;
    letter-spacing: -.03em;
    margin: 10px 0 12px;
}

.p-desc {
    font-size: .92rem;
    line-height: 1.55;
    color: var(--mute);
}

.p-block { margin-top: 26px; }
.p-block .label { margin-bottom: 10px; }

/* Plans as a price table */
.opt-group {
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 14px 0 6px;
}

.opt { display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }

.opt-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    column-gap: 14px;
    padding: 13px 12px;
    border-top: 1px solid var(--line);
    transition: background .15s;
}

.opt:last-child .opt-row { border-bottom: 1px solid var(--line); }
.opt:hover .opt-row { background: var(--surface-2); }

.opt-box {
    width: 14px;
    height: 14px;
    border: 1px solid var(--line-2);
    display: grid;
    place-items: center;
}

.opt-box::after { content: ''; width: 6px; height: 6px; background: var(--accent); transform: scale(0); transition: transform .15s; }

.opt input:checked + .opt-row { background: var(--surface-2); }
.opt input:checked + .opt-row .opt-box { border-color: var(--ink); }
.opt input:checked + .opt-row .opt-box::after { transform: scale(1); }
.opt input:focus-visible + .opt-row { outline: 1px solid var(--ink); outline-offset: -1px; }

.opt-label { font-weight: 600; font-size: .92rem; }
.opt-label em { font-style: normal; font-family: var(--mono); font-size: .66rem; font-weight: 500; color: var(--accent); margin-left: 8px; text-transform: uppercase; }
.opt-note { grid-column: 2; font-size: .76rem; color: var(--mute); }
.opt-price { grid-row: 1; grid-column: 3; font-family: var(--mono); font-size: .9rem; }

.p-total {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    margin: 26px 0 14px;
}

.p-total .label { grid-column: 1 / -1; margin-bottom: 4px; }

.p-total strong {
    font-weight: 700;
    font-stretch: 125%;
    font-size: 2.2rem;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.p-total small { font-family: var(--mono); font-size: .74rem; color: var(--mute); padding-bottom: 4px; }

#pExtra { margin-top: 8px; }

/* Features */
.f-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.f-head .label { margin: 0; }
.f-head .label span { color: var(--faint); margin-left: 6px; }

.f-head input {
    width: 150px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    background: none;
    color: var(--ink);
    font-family: var(--mono);
    font-size: .76rem;
    outline: none;
}

.f-head input:focus { border-bottom-color: var(--ink); }
.f-head input::placeholder { color: var(--faint); }

.f-cat h4 {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: .68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--mute);
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--line);
}

.f-cat h4 span { color: var(--faint); }

.f-list {
    list-style: none;
    columns: 2;
    column-gap: 20px;
    padding-top: 8px;
}

.f-list li {
    break-inside: avoid;
    font-size: .82rem;
    line-height: 1.35;
    padding: 4px 0;
    color: #c4cbc6;
}

.f-list li em { font-style: normal; font-family: var(--mono); font-size: .62rem; color: var(--brand); margin-left: 6px; }
.f-empty { font-family: var(--mono); font-size: .76rem; color: var(--mute); padding: 20px 0; }

/* ============ Support modal ============ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 16px;
    visibility: hidden;
    pointer-events: none;
}

.modal.open { visibility: visible; pointer-events: auto; }

.modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(4, 5, 5, .78);
    opacity: 0;
    transition: opacity .3s;
}

.modal.open .modal-bg { opacity: 1; }

.modal-card {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    opacity: 0;
    transform: translateY(12px);
    transition: transform .4s var(--ease), opacity .3s;
}

.modal.open .modal-card { opacity: 1; transform: none; }
.modal-body { padding: 28px 24px 24px; }

.modal-body h2 {
    font-weight: 800;
    font-stretch: 125%;
    font-size: 1.9rem;
    letter-spacing: -.03em;
    margin-bottom: 10px;
}

.modal-body > p { color: var(--mute); line-height: 1.55; font-size: .92rem; }
.modal-body .btn { margin: 22px 0 10px; }
.modal-body .note { font-family: var(--mono); font-size: .72rem; }

.perks {
    list-style: none;
    counter-reset: perk;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 22px 0 18px;
    border-top: 1px solid var(--line);
}

.perks li {
    counter-increment: perk;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 14px 14px 0;
    font-size: .8rem;
    color: var(--mute);
    border-bottom: 1px solid var(--line);
}

.perks li:nth-child(odd) { border-right: 1px solid var(--line); }
.perks li:nth-child(even) { padding-left: 14px; }
.perks li::before { content: counter(perk, decimal-leading-zero); font-family: var(--mono); font-size: .66rem; color: var(--faint); }
.perks b { color: var(--ink); font-weight: 600; font-size: .88rem; }

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    top: 20px;
    z-index: 60;
    max-width: calc(100% - 32px);
    padding: 11px 16px;
    font-family: var(--mono);
    font-size: .78rem;
    background: var(--ink);
    color: var(--bg);
    transform: translate(-50%, -20px);
    opacity: 0;
    visibility: hidden;
    transition: transform .3s var(--ease), opacity .2s, visibility .3s;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* No WebGL fallback */
body.no-webgl::before {
    content: '';
    position: fixed;
    left: 50%;
    top: 42%;
    width: 200px;
    height: 200px;
    margin: -100px 0 0 -100px;
    border-radius: 50%;
    background: url(LOGO.png) center / cover;
    opacity: .8;
}

/* ============ Responsive ============ */

@media (max-width: 1180px) {
    .intro { width: 290px; }
    .hint { display: none; }
    .top-links .long { display: none; }
    .top-links .short { display: inline; }
}

@media (max-width: 820px) {
    :root { --dock-h: 104px; }

    .top { padding: 14px 16px; }
    .top-links { gap: 18px; }

    .intro {
        left: 16px;
        right: 16px;
        top: 64px;
        width: auto;
        translate: none;
        text-align: center;
    }

    .kicker { margin-bottom: 8px; font-size: .68rem; }
    .intro h1 { font-size: 1.75rem; margin: 0; }
    .intro h1 br { display: none; }
    .intro .sub, .intro-support { display: none; }

    .dock {
        flex-direction: column;
        height: auto;
        padding: 0 16px calc(env(safe-area-inset-bottom));
    }

    .filters {
        height: 48px;
        margin: 0;
        padding: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        justify-content: space-between;
    }

    .filter { flex: 1; justify-content: center; }
    .items { flex: none; height: 56px; gap: 22px; }

    .panel {
        top: auto;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 88vh;
        height: 88svh;
        border-left: 0;
        border-top: 1px solid var(--line-2);
        transform: translateY(100%);
    }

    .panel-scroll { padding: 20px 16px 28px; }
    .p-media { aspect-ratio: auto; height: min(28vh, 52vw); }
    .p-name { font-size: 1.8rem; }
    .f-list { columns: 1; }
    .perks { grid-template-columns: 1fr; }
    .perks li:nth-child(odd) { border-right: 0; }
    .perks li:nth-child(even) { padding-left: 0; }
}

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