:root {
    --bg: #040404;
    --bg-soft: #0d0d0d;
    --panel: rgba(12, 12, 12, 0.9);
    --panel-strong: rgba(18, 18, 18, 0.98);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f5f5f5;
    --muted: #a7a7a7;
    --accent: #d5ff5f;
    --accent-strong: #f1ffbe;
    --danger: #ff7272;
    --shadow: rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(213, 255, 95, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.06), transparent 26%),
        linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
    pointer-events: none;
}

body[data-state="booting"] {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

.shell {
    width: min(920px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.topbar,
.profile-card,
.editor-card {
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: 0 24px 60px var(--shadow);
    backdrop-filter: blur(18px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 28px;
}

.topbar h1,
.section-head h3,
.profile-copy h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.topbar h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.72rem;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ghost-button,
.primary-button,
.field input,
.field textarea {
    font: inherit;
}

.ghost-button,
.primary-button {
    appearance: none;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

.primary-button {
    border: 1px solid transparent;
    background: var(--accent);
    color: #050505;
    font-weight: 700;
}

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

.profile-card {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 28px;
    margin-top: 22px;
    padding: 28px;
    border-radius: 32px;
}

.avatar-frame {
    position: relative;
    width: 168px;
    height: 168px;
    border-radius: 28px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(213, 255, 95, 0.9), rgba(255, 255, 255, 0.16));
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 27px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #191919, #090909);
}

.profile-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.profile-copy h2 {
    font-size: clamp(1.8rem, 3.2vw, 2.5rem);
}

.profile-bio {
    margin: 14px 0 0;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
}

.profile-username,
.section-note,
.status-line {
    color: var(--muted);
}

.profile-username {
    margin: 14px 0 0;
}

.editor-card {
    margin-top: 22px;
    padding: 28px;
    border-radius: 32px;
    background: var(--panel-strong);
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.section-note {
    margin: 0;
    font-size: 0.92rem;
}

.profile-form {
    margin-top: 24px;
}

.field {
    display: block;
}

.field + .field {
    margin-top: 18px;
}

.field span {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-size: 0.92rem;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
}

.field textarea {
    resize: vertical;
    min-height: 136px;
}

.field input:focus,
.field textarea:focus {
    border-color: rgba(213, 255, 95, 0.5);
    box-shadow: 0 0 0 3px rgba(213, 255, 95, 0.08);
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.status-line {
    margin: 0;
    min-height: 24px;
}

.status-line.is-error {
    color: var(--danger);
}

.status-line.is-success {
    color: var(--accent);
}

@media (max-width: 720px) {
    .shell {
        width: min(100vw - 20px, 920px);
        padding: 20px 0 40px;
    }

    .topbar,
    .profile-card,
    .editor-card {
        border-radius: 24px;
    }

    .topbar,
    .section-head,
    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

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

    .avatar-frame {
        width: 132px;
        height: 132px;
    }
}
