:root {
    --bg: #07040c;
    --bg-soft: #0f0917;
    --panel: #160d23;
    --panel-2: #21112f;
    --panel-3: #2c1640;
    --ink: #fff7ff;
    --muted: #d8c8e6;
    --soft: #a998bb;
    --pink: #ff62b6;
    --pink-2: #ff2f8e;
    --lilac: #c59cff;
    --purple: #7b3cff;
    --violet: #4a1d73;
    --mint: #61f2d5;
    --yellow: #ffe071;
    --danger: #ff7aa9;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 98, 182, 0.42);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(135deg, rgba(255, 98, 182, 0.22), transparent 34%),
        linear-gradient(220deg, rgba(123, 60, 255, 0.24), transparent 42%),
        var(--bg);
    background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

body::after {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(180deg, rgba(7, 4, 12, 0.1), rgba(7, 4, 12, 0.95)),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 4px);
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.skip-link {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 40;
    padding: 10px 14px;
    color: var(--bg);
    background: var(--mint);
    border-radius: var(--radius);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-shell {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 4, 12, 0.88);
    backdrop-filter: blur(18px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: max-content;
    gap: 10px;
    font-weight: 900;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--bg);
    font-size: 0.9rem;
    font-weight: 1000;
    background: linear-gradient(135deg, var(--pink), var(--lilac));
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(255, 98, 182, 0.48);
}

.brand-text {
    font-size: 1.08rem;
    letter-spacing: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    padding: 9px 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 850;
    text-decoration: none;
    border-radius: var(--radius);
}

.user-ribbon {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.user-ribbon strong {
    color: var(--mint);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.nav-cta {
    color: var(--bg) !important;
    background: var(--mint) !important;
}

.app-hero {
    display: grid;
    align-items: center;
    min-height: calc(100vh - 74px);
    padding: 42px 0 54px;
    gap: 36px;
    grid-template-columns: minmax(0, 0.98fr) minmax(350px, 0.78fr);
}

.compact-hero {
    min-height: auto;
    padding-top: 46px;
}

.landing-hero {
    min-height: calc(100vh - 74px);
}

.hero-copy-panel {
    max-width: 720px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    gap: 8px;
    padding: 7px 10px;
    color: var(--yellow);
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
    border: 1px solid rgba(255, 224, 113, 0.36);
    border-radius: var(--radius);
    background: rgba(255, 224, 113, 0.08);
}

.app-hero h1,
.section-heading h2 {
    margin: 14px 0 12px;
    line-height: 1.04;
    letter-spacing: 0;
}

.app-hero h1 {
    max-width: 760px;
    font-size: 3.65rem;
}

.hero-copy {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    gap: 8px;
    color: var(--ink);
    font-weight: 950;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.075);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.button-primary {
    color: #160516;
    background: linear-gradient(135deg, var(--pink), var(--lilac));
    border-color: transparent;
    box-shadow: 0 18px 36px rgba(255, 47, 142, 0.32);
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
    outline: 2px solid var(--mint);
    outline-offset: 3px;
}

.button:disabled {
    opacity: 0.68;
    cursor: wait;
}

.phone-shell {
    position: relative;
    width: min(100%, 420px);
    justify-self: end;
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 98, 182, 0.22), rgba(123, 60, 255, 0.12)),
        var(--panel);
    box-shadow: var(--shadow);
}

.phone-shell::before {
    position: absolute;
    inset: 8px;
    pointer-events: none;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}

.phone-top,
.avatar-row,
.app-stat-grid,
.console-card {
    position: relative;
    z-index: 1;
}

.phone-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 14px;
    color: var(--soft);
    font-size: 0.78rem;
    font-weight: 900;
}

.signal-dot {
    width: 9px;
    height: 9px;
    background: var(--mint);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(97, 242, 213, 0.82);
}

.battery {
    color: var(--yellow);
}

.avatar-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(7, 4, 12, 0.56);
}

.moon-avatar {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    color: var(--bg);
    font-size: 2rem;
    background: var(--pink);
    border: 2px solid var(--lilac);
    border-radius: 8px;
}

.mini-label {
    margin: 0 0 2px;
    color: var(--mint);
    font-size: 0.82rem;
    font-weight: 950;
    text-transform: uppercase;
}

.avatar-row h2 {
    margin: 0;
    font-size: 1.35rem;
}

.xp-track {
    height: 12px;
    margin: 14px 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.28);
}

.xp-track span {
    display: block;
    height: 100%;
    min-width: 7%;
    background: linear-gradient(90deg, var(--mint), var(--pink), var(--yellow));
}

.xp-fill-0 {
    width: 7%;
}

.xp-fill-10 {
    width: 10%;
}

.xp-fill-20 {
    width: 20%;
}

.xp-fill-30 {
    width: 30%;
}

.xp-fill-40 {
    width: 40%;
}

.xp-fill-50 {
    width: 50%;
}

.xp-fill-60 {
    width: 60%;
}

.xp-fill-70 {
    width: 70%;
}

.xp-fill-80 {
    width: 80%;
}

.xp-fill-90 {
    width: 90%;
}

.xp-fill-100 {
    width: 100%;
}

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

.app-stat {
    min-height: 84px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
}

.app-stat span {
    display: block;
    color: var(--mint);
    font-size: 1.35rem;
    font-weight: 1000;
}

.app-stat small {
    color: var(--muted);
    font-size: 0.78rem;
}

.console-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #08050d;
}

.console-card img {
    width: 100%;
    max-height: 205px;
    object-fit: contain;
}

.console-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.global-flashes {
    margin-top: -18px;
    margin-bottom: 24px;
}

.content-band {
    padding: 72px 0;
    border-top: 1px solid var(--line);
}

.first-band {
    border-top: 0;
    padding-top: 48px;
}

.auth-layout {
    display: grid;
    align-items: center;
    min-height: calc(100vh - 130px);
    padding: 54px 0;
    gap: 28px;
    grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
}

.auth-layout .section-heading h1,
.app-section-grid .section-heading h1,
.apapacho-layout .section-heading h1 {
    margin: 14px 0 12px;
    font-size: 2.3rem;
    line-height: 1.04;
    letter-spacing: 0;
}

.auth-card {
    max-width: 520px;
    justify-self: end;
    width: 100%;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
}

.auth-switch a {
    color: var(--mint);
    font-weight: 900;
}

.app-section-grid {
    display: grid;
    align-items: start;
    gap: 28px;
    grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
}

.reverse-grid {
    grid-template-columns: minmax(0, 1.22fr) minmax(260px, 0.78fr);
}

.section-heading {
    max-width: 740px;
}

.sticky-copy {
    position: sticky;
    top: 96px;
}

.section-heading h2 {
    font-size: 2.25rem;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.app-card,
.tip-card,
.recent-card,
.apapacho-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 98, 182, 0.12), rgba(123, 60, 255, 0.08)),
        var(--panel);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
}

.form-card {
    padding: 22px;
    border-color: var(--line-strong);
}

.form-grid {
    display: grid;
    gap: 16px;
}

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

.full-span {
    grid-column: 1 / -1;
}

.field label,
.field span,
.chip-field legend {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 950;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 50px;
    padding: 0 13px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0c0711;
}

.field textarea {
    min-height: 118px;
    padding: 12px 13px;
    resize: vertical;
}

.field input[type="range"] {
    padding: 0;
    accent-color: var(--pink);
    background: transparent;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--mint);
    outline: 2px solid rgba(97, 242, 213, 0.25);
}

.range-output {
    color: var(--muted) !important;
    font-size: 0.84rem !important;
    font-weight: 800 !important;
}

.field-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.chip-field {
    padding: 0;
    margin: 18px 0;
    border: 0;
}

.chip-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chip {
    min-height: 44px;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 900;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
}

.chip input:checked + span {
    color: #160516;
    background: var(--lilac);
    border-color: var(--lilac);
}

.chip input:focus-visible + span {
    outline: 2px solid var(--mint);
    outline-offset: 3px;
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
}

.submit-row .button {
    border: 0;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.flash-success {
    color: #08110e;
    background: var(--mint);
}

.flash-error {
    color: var(--ink);
    background: rgba(255, 47, 142, 0.18);
    border-color: rgba(255, 47, 142, 0.54);
}

.mini-console {
    display: grid;
    width: min(100%, 250px);
    margin-top: 22px;
    padding: 12px;
    gap: 8px;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0b0711;
}

.mini-console span {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--pink);
}

.mini-console span:nth-child(2) {
    background: var(--lilac);
}

.mini-console span:nth-child(3) {
    background: var(--mint);
}

.mini-console span:nth-child(4) {
    background: var(--yellow);
}

.recent-stack {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.recent-card {
    padding: 13px;
}

.recent-card strong,
.recent-card span {
    display: block;
}

.recent-card strong {
    color: var(--mint);
    font-size: 0.94rem;
}

.recent-card span {
    color: var(--muted);
    font-size: 0.88rem;
}

.tip-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tip-card {
    min-height: 245px;
    padding: 18px;
}

.action-card {
    color: inherit;
    text-decoration: none;
}

.action-card:hover,
.action-card:focus-visible {
    border-color: var(--mint);
    outline: 2px solid rgba(97, 242, 213, 0.28);
    outline-offset: 3px;
    transform: translateY(-1px);
}

.pixel-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #160516;
    font-weight: 1000;
    border-radius: var(--radius);
    background: var(--yellow);
    box-shadow:
        6px 0 0 rgba(255, 98, 182, 0.55),
        0 6px 0 rgba(197, 156, 255, 0.55);
}

.tip-card h3 {
    margin: 20px 0 10px;
    font-size: 1.08rem;
}

.tip-card p {
    margin: 0;
    color: var(--muted);
}

.apapacho-band {
    padding-bottom: 86px;
}

.apapacho-layout {
    display: grid;
    align-items: center;
    gap: 28px;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
}

.apapacho-card {
    position: relative;
    min-height: 360px;
    padding: 28px;
    overflow: hidden;
    border-color: rgba(97, 242, 213, 0.35);
}

.apapacho-card.is-active {
    border-color: var(--mint);
    box-shadow: 0 0 0 4px rgba(97, 242, 213, 0.1), var(--shadow);
}

.apapacho-moon {
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    color: var(--bg);
    font-size: 3.1rem;
    border-radius: 8px;
    background: var(--lilac);
}

.apapacho-card h3 {
    margin: 28px 0 10px;
    font-size: 1.8rem;
}

.apapacho-card p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.heart-row {
    display: flex;
    gap: 10px;
    margin-top: 26px;
}

.heart-row span {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--pink);
}

.heart-row span:nth-child(2) {
    background: var(--lilac);
}

.heart-row span:nth-child(3) {
    background: var(--mint);
}

.heart-row span:nth-child(4) {
    background: var(--yellow);
}

.mobile-tabbar {
    display: none;
}

.site-footer {
    padding: 32px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.footer-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 1040px) {
    .app-hero,
    .app-section-grid,
    .reverse-grid,
    .apapacho-layout,
    .auth-layout {
        grid-template-columns: 1fr;
    }

    .phone-shell,
    .auth-card {
        justify-self: start;
    }

    .sticky-copy {
        position: static;
    }

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

@media (max-width: 720px) {
    body {
        padding-bottom: 82px;
    }

    .site-shell {
        width: min(100% - 22px, 1160px);
    }

    .site-header {
        position: static;
    }

    .nav {
        min-height: 66px;
    }

    .user-ribbon {
        justify-content: flex-start;
        padding-top: 0;
        padding-bottom: 6px;
    }

    .nav-links {
        display: none;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .app-hero {
        min-height: auto;
        padding: 28px 0 36px;
    }

    .auth-layout {
        min-height: auto;
        padding: 34px 0 44px;
    }

    .app-hero h1 {
        font-size: 2.28rem;
    }

    .hero-copy {
        font-size: 1rem;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
        min-height: 54px;
    }

    .phone-shell {
        width: 100%;
        padding: 12px;
    }

    .avatar-row {
        padding: 12px;
    }

    .app-stat-grid {
        grid-template-columns: 1fr;
    }

    .app-stat {
        min-height: 72px;
    }

    .content-band {
        padding: 48px 0;
    }

    .section-heading h2 {
        font-size: 1.72rem;
    }

    .auth-layout .section-heading h1,
    .app-section-grid .section-heading h1,
    .apapacho-layout .section-heading h1 {
        font-size: 1.76rem;
    }

    .form-card,
    .apapacho-card {
        padding: 16px;
    }

    .two-columns,
    .chip-grid,
    .tip-grid {
        grid-template-columns: 1fr;
    }

    .submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .tip-card {
        min-height: auto;
    }

    .apapacho-card {
        min-height: 310px;
    }

    .mobile-tabbar {
        position: fixed;
        right: 10px;
        bottom: 10px;
        left: 10px;
        z-index: 30;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        padding: 8px;
        border: 1px solid var(--line-strong);
        border-radius: 8px;
        background: rgba(12, 7, 17, 0.94);
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(18px);
    }

    .mobile-tabbar a {
        display: grid;
        min-width: 0;
        min-height: 52px;
        place-items: center;
        gap: 2px;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 900;
        text-decoration: none;
        border-radius: 8px;
    }

    .mobile-tabbar a span {
        color: var(--pink);
        font-size: 1rem;
        font-weight: 1000;
    }

    .mobile-tabbar a[aria-current="page"],
    .mobile-tabbar a:focus-visible {
        color: var(--ink);
        background: rgba(255, 255, 255, 0.08);
        outline: 2px solid var(--mint);
        outline-offset: 2px;
    }

    .mobile-tabbar a[aria-current="page"] span {
        color: var(--mint);
    }
}

@media (max-width: 390px) {
    .app-hero h1 {
        font-size: 2rem;
    }

    .avatar-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

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