@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --blue-700: #204a6e;
    --blue-600: #4d8fc4;
    --blue-500: #8cc0ea;
    --red-500: #c86f66;
    --bg: #0b1016;
    --surface: rgba(13, 19, 29, 0.82);
    --panel: rgba(17, 24, 35, 0.86);
    --panel-strong: rgba(15, 21, 31, 0.94);
    --input: #131c29;
    --border: rgba(148, 163, 184, 0.16);
    --border-bright: rgba(148, 163, 184, 0.28);
    --text: #d7e0ea;
    --text-dim: #8a98aa;
    --text-bright: #f4f7fb;
    --accent: #8cc0ea;
    --accent-2: #a9d2ef;
    --danger: #f08a7d;
    --warning: #f4c15d;
    --alias: #f0a6ff;
    --shadow-sm: 0 18px 40px rgba(0, 0, 0, 0.24);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 36px 90px rgba(0, 0, 0, 0.42);
    --sans: 'Exo 2', system-ui, sans-serif;
    --body: 'Source Sans 3', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
    background:
        radial-gradient(circle at top left, rgba(77, 143, 196, 0.15), transparent 28%),
        radial-gradient(circle at top right, rgba(200, 111, 102, 0.08), transparent 22%),
        linear-gradient(145deg, rgba(10, 16, 24, 0.98), rgba(8, 12, 18, 0.98)),
        var(--bg);
    background-attachment: fixed;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: '';
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 80%);
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    color: var(--text-bright);
}

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

button,
.button {
    cursor: pointer;
}

.topbar {
    position: sticky;
    top: 1rem;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: calc(100% - 2rem);
    max-width: 1440px;
    min-height: 74px;
    margin: 1rem auto 0;
    padding: 0.8rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand:hover {
    color: var(--text-bright);
}

.logo-text {
    font-family: var(--sans);
    font-size: 2.1rem;
    font-weight: 300;
    letter-spacing: -0.06em;
    line-height: 1;
}

.logo-blue {
    color: var(--blue-500);
}

.logo-red {
    color: var(--danger);
}

.project-title {
    padding-left: 1rem;
    color: var(--text-dim);
    font-size: 0.77rem;
    font-style: italic;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-left: 1px solid var(--border-bright);
}

.nav,
.actions,
.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.nav {
    justify-content: center;
}

.nav > a,
.link-button {
    padding: 0.45rem 0.7rem;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.86rem;
    font-weight: 700;
    background: transparent;
    border: 0;
    border-radius: 999px;
    transition: color 150ms ease, background 150ms ease;
}

.nav > a:hover,
.nav > a[aria-current='page'],
.link-button:hover {
    color: var(--text-bright);
    background: rgba(140, 192, 234, 0.09);
}

.nav form {
    margin: 0;
}

.nav-user {
    margin-right: 0.25rem;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.account {
    display: flex;
    padding: 0.45rem 0.55rem;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.account-profile {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 700;
}

.account-profile:hover {
    color: var(--text-bright);
}

.account-profile span:last-child {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-avatar {
    display: grid;
    flex: 0 0 auto;
    object-fit: cover;
    place-items: center;
    border-radius: 50%;
}

.account-avatar--initial {
    color: #fff;
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
}

.account form {
    display: flex;
    margin: 0;
}

.account-logout {
    padding: 0.42rem 0.8rem;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.77rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.account-logout:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-bright);
}

.shell {
    width: calc(100% - 2rem);
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.75rem 0 4rem;
}

.page-heading {
    display: flex;
    margin-bottom: 1.35rem;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.page-heading h1,
.auth-panel h1,
.welcome-panel h1 {
    margin: 0;
    color: var(--text-bright);
    font-family: var(--sans);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.page-heading h1 {
    font-size: clamp(2rem, 5vw, 3.35rem);
}

.page-heading p,
.welcome-panel p,
.auth-panel p {
    color: var(--text-dim);
}

.page-heading p {
    max-width: 660px;
    margin: 0.55rem 0 0;
    font-size: 1.04rem;
}

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 40px;
    padding: 0.62rem 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    background: rgba(19, 28, 41, 0.78);
    border: 1px solid var(--border-bright);
    border-radius: 999px;
    transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    color: var(--text-bright);
    background: rgba(27, 39, 56, 0.92);
    border-color: rgba(140, 192, 234, 0.48);
    transform: translateY(-1px);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    border-color: rgba(140, 192, 234, 0.42);
    box-shadow: 0 12px 28px rgba(32, 74, 110, 0.35);
}

.button-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #5d9dd0, #28577e);
    box-shadow: 0 15px 34px rgba(32, 74, 110, 0.44);
}

.button-danger {
    color: #ffc1b9;
    background: rgba(200, 111, 102, 0.1);
    border-color: rgba(240, 138, 125, 0.34);
}

.button-danger:hover {
    color: #ffe2de;
    background: rgba(200, 111, 102, 0.18);
    border-color: rgba(240, 138, 125, 0.6);
}

.button-small {
    min-height: 34px;
    padding: 0.5rem 0.76rem;
    font-size: 0.8rem;
}

.button--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
    border-color: rgba(140, 192, 234, 0.42);
    box-shadow: 0 12px 28px rgba(32, 74, 110, 0.35);
}

.button--primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #5d9dd0, #28577e);
    box-shadow: 0 15px 34px rgba(32, 74, 110, 0.44);
}

.button--danger {
    color: #ffc1b9;
    background: rgba(200, 111, 102, 0.1);
    border-color: rgba(240, 138, 125, 0.34);
}

.button--danger:hover {
    color: #ffe2de;
    background: rgba(200, 111, 102, 0.18);
    border-color: rgba(240, 138, 125, 0.6);
}

.button--quiet {
    background: rgba(19, 28, 41, 0.58);
}

.button--small {
    min-height: 34px;
    padding: 0.5rem 0.76rem;
    font-size: 0.8rem;
}

.welcome-panel,
.auth-panel,
.paste-card,
.stat,
.notice,
.owner-bar,
.table-wrap,
.paste-content {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.welcome-panel,
.auth-panel {
    padding: clamp(1.4rem, 4vw, 2.6rem);
    border-radius: 26px;
}

.welcome-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(77, 143, 196, 0.18), transparent 38%),
        var(--panel);
}

.welcome-panel h1 {
    max-width: 720px;
    font-size: clamp(2.3rem, 6vw, 4.8rem);
}

.welcome-panel p {
    max-width: 670px;
    margin: 1rem 0 1.4rem;
    font-size: 1.08rem;
}

.auth-panel {
    max-width: 570px;
    margin: 1.5rem auto;
    background: var(--panel-strong);
    box-shadow: var(--shadow-lg);
}

.auth-panel h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

.auth-panel > p {
    margin: 0.65rem 0 1.3rem;
}

.stack-form,
.editor-form {
    display: grid;
    gap: 1rem;
}

.stack-form label,
.editor-form label {
    display: grid;
    gap: 0.42rem;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
}

.editor-form {
    padding: clamp(1.1rem, 3vw, 1.5rem);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.form-row {
    display: flex;
    align-items: end;
    gap: 0.85rem;
}

.form-row > label {
    min-width: 150px;
}

.form-row .grow {
    min-width: 220px;
    flex: 1;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.editor-form input,
.editor-form select,
.editor-form textarea {
    width: 100%;
    color: var(--text-bright);
    background: var(--input);
    border: 1px solid var(--border-bright);
    border-radius: 18px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.stack-form input,
.stack-form select,
.editor-form input,
.editor-form select {
    min-height: 48px;
    padding: 0.75rem 0.9rem;
}

.stack-form textarea,
.editor-form textarea {
    min-height: 390px;
    padding: 1rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    tab-size: 4;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.editor-form input:focus,
.editor-form select:focus,
.editor-form textarea:focus {
    background: #162131;
    border-color: rgba(140, 192, 234, 0.75);
    box-shadow: 0 0 0 4px rgba(77, 143, 196, 0.14);
}

.form-actions,
.heading-actions,
.card-actions,
.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.card-actions {
    margin-top: auto;
}

.card-actions form,
.table-actions form {
    margin: 0;
}

.field {
    margin-bottom: 1.05rem;
}

.field label {
    display: block;
    margin-bottom: 0.42rem;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea,
.filters select {
    width: 100%;
    color: var(--text-bright);
    background: var(--input);
    border: 1px solid var(--border-bright);
    border-radius: 18px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input,
.field select {
    min-height: 48px;
    padding: 0.75rem 0.9rem;
}

.field textarea {
    min-height: 390px;
    padding: 1rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 0.92rem;
    line-height: 1.6;
    tab-size: 4;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filters select:focus {
    background: #162131;
    border-color: rgba(140, 192, 234, 0.75);
    box-shadow: 0 0 0 4px rgba(77, 143, 196, 0.14);
}

.field-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.field-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--blue-600);
}

.field-check label {
    margin: 0;
}

.muted,
.meta,
.empty {
    color: var(--text-dim);
}

.notice {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
}

.notice-error {
    color: #ffd2cc;
    background: rgba(200, 111, 102, 0.12);
    border-color: rgba(240, 138, 125, 0.34);
}

.notice-success {
    color: #d1eaff;
    background: rgba(77, 143, 196, 0.13);
    border-color: rgba(140, 192, 234, 0.32);
}

.notice--error {
    color: #ffd2cc;
    background: rgba(200, 111, 102, 0.12);
    border-color: rgba(240, 138, 125, 0.34);
}

.notice--success {
    color: #d1eaff;
    background: rgba(77, 143, 196, 0.13);
    border-color: rgba(140, 192, 234, 0.32);
}

.paste-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 1rem;
}

.paste-card {
    position: relative;
    display: flex;
    min-height: 210px;
    padding: 1.15rem;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.paste-card::before {
    position: absolute;
    top: 0;
    left: 1.1rem;
    width: 52px;
    height: 2px;
    content: '';
    background: linear-gradient(90deg, var(--blue-500), transparent);
}

.paste-card:hover {
    border-color: rgba(140, 192, 234, 0.38);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.paste-card h2 {
    margin: 0.72rem 0 0.45rem;
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 1.15rem;
    line-height: 1.3;
}

.paste-card h2 a {
    color: inherit;
}

.paste-card .meta {
    margin: 0 0 1rem;
    font-size: 0.87rem;
}

.paste-card .actions {
    margin-top: auto;
}

.paste-card > p {
    margin: 0 0 1rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.paste-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.language-badge,
.visibility,
.status {
    display: inline-flex;
    width: fit-content;
    padding: 0.3rem 0.62rem;
    align-items: center;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 999px;
}

.language-badge,
.status--active {
    color: #bfe2fb;
    background: rgba(77, 143, 196, 0.13);
    border: 1px solid rgba(140, 192, 234, 0.24);
}

.visibility {
    color: var(--text-dim);
    background: rgba(148, 163, 184, 0.07);
    border: 1px solid var(--border);
}

.visibility--private {
    color: #f3c0ff;
    background: rgba(240, 166, 255, 0.09);
    border-color: rgba(240, 166, 255, 0.22);
}

.status--deleted {
    color: #ffc2ba;
    background: rgba(200, 111, 102, 0.11);
    border: 1px solid rgba(240, 138, 125, 0.28);
}

.badge {
    display: inline-flex;
    width: fit-content;
    padding: 0.3rem 0.62rem;
    align-items: center;
    color: #bfe2fb;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(77, 143, 196, 0.13);
    border: 1px solid rgba(140, 192, 234, 0.24);
    border-radius: 999px;
}

.badge-private {
    color: #f3c0ff;
    background: rgba(240, 166, 255, 0.09);
    border-color: rgba(240, 166, 255, 0.22);
}

.badge-deleted {
    color: #ffc2ba;
    background: rgba(200, 111, 102, 0.11);
    border-color: rgba(240, 138, 125, 0.28);
}

.owner-bar {
    display: flex;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 18px;
}

.paste-content {
    margin: 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    overflow: auto;
    color: #e5edf7;
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    background: #0d1521;
    border-radius: 22px;
}

.stats {
    display: grid;
    margin-bottom: 1.35rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.stats > div {
    padding: 1.05rem 1.15rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
}

.stats > div strong {
    display: block;
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 1.75rem;
    line-height: 1.1;
}

.stats > div span {
    color: var(--text-dim);
    font-size: 0.84rem;
}

.stat {
    padding: 1.05rem 1.15rem;
    border-radius: 20px;
}

.stat strong {
    display: block;
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 1.75rem;
    line-height: 1.1;
}

.stat span {
    color: var(--text-dim);
    font-size: 0.84rem;
}

.filters {
    margin-bottom: 1rem;
}

.filters a {
    padding: 0.5rem 0.85rem;
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(19, 28, 41, 0.58);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.filters a:hover,
.filters a[aria-current='page'] {
    color: var(--text-bright);
    background: rgba(77, 143, 196, 0.14);
    border-color: rgba(140, 192, 234, 0.38);
}

.filters select {
    width: auto;
    min-height: 40px;
    padding: 0.55rem 2.3rem 0.55rem 0.8rem;
    border-radius: 999px;
}

.table-wrap {
    overflow: auto;
    border-radius: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-dim);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(11, 16, 22, 0.46);
}

tbody tr {
    transition: background 150ms ease;
}

tbody tr:hover {
    background: rgba(77, 143, 196, 0.055);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.inline-form {
    display: inline;
}

.subline {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-dim);
    font-size: 0.79rem;
}

.empty-state {
    padding: 2.4rem 1.2rem;
    text-align: center;
    background: var(--panel);
    border: 1px dashed var(--border-bright);
    border-radius: 24px;
}

.empty-state h1,
.empty-state h2 {
    margin: 0;
    color: var(--text-bright);
    font-family: var(--sans);
}

.empty-state p {
    margin: 0.45rem 0 0;
    color: var(--text-dim);
}

.empty-cell {
    padding: 2rem;
    color: var(--text-dim);
    text-align: center;
}

.empty {
    padding: 2.4rem 1.2rem;
    text-align: center;
    background: var(--panel);
    border: 1px dashed var(--border-bright);
    border-radius: 24px;
}

@media (max-width: 760px) {
    .topbar {
        position: relative;
        top: 0;
        width: calc(100% - 1.5rem);
        margin-top: 0.75rem;
        grid-template-columns: 1fr auto;
        align-items: center;
        border-radius: 20px;
    }

    .nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-user {
        width: 100%;
    }

    .account-profile span:last-child {
        max-width: 82px;
    }

    .project-title {
        display: none;
    }

    .shell {
        width: calc(100% - 1.5rem);
        padding-top: 2rem;
    }

    .page-heading,
    .owner-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .welcome-panel {
        padding: 1.35rem;
    }

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

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

    .field textarea {
        min-height: 310px;
    }

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

    .form-row > label,
    .form-row .grow {
        width: 100%;
        min-width: 0;
    }

    .editor-form textarea {
        min-height: 310px;
    }
}

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