:root {
    --bg: #080808;
    --bg-soft: #111111;
    --bg-panel: rgba(20, 20, 20, 0.88);
    --text: #f3ede3;
    --muted: #c0b3a0;
    --line: rgba(201, 161, 92, 0.18);
    --accent: #c69a56;
    --accent-strong: #e4c28a;
    --danger: #d86a61;
    --success: #6fc28e;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 24px;
    --radius-sm: 16px;
    --container: 1180px;
    --container-narrow: 760px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(198, 154, 86, 0.14), transparent 24%),
        radial-gradient(circle at bottom left, rgba(198, 154, 86, 0.08), transparent 22%),
        linear-gradient(180deg, #090909 0%, #060606 100%);
    color: var(--text);
    min-height: 100vh;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

code {
    color: var(--accent-strong);
}

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.container.narrow,
.narrow {
    width: min(calc(100% - 2rem), var(--container-narrow));
}

.site-shell {
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(8, 8, 8, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand,
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand img,
.admin-brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.brand strong,
.admin-brand strong {
    display: block;
    color: var(--text);
    font-weight: 600;
}

.top-nav,
.admin-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-nav a,
.admin-nav a,
.text-link,
.danger-link {
    color: var(--muted);
    transition: color 0.2s ease;
}

.top-nav a:hover,
.admin-nav a:hover,
.text-link:hover,
.danger-link:hover {
    color: var(--accent-strong);
}

.hero-section,
.section {
    padding: 4.5rem 0;
}

.alt-section {
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.7), rgba(12, 12, 12, 0.95));
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.hero-grid,
.section-grid,
.cards-grid,
.footer-grid,
.admin-two-col {
    display: grid;
    gap: 1.5rem;
}

.hero-grid,
.section-grid,
.footer-grid,
.admin-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cards-grid.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.inner-panel,
.wallpaper-edit-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.5rem;
}

.soft-border {
    border-color: rgba(228, 194, 138, 0.24);
}

.glow-panel {
    position: relative;
    overflow: hidden;
}

.glow-panel::after {
    content: "";
    position: absolute;
    inset: auto -18% -30% auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 154, 86, 0.25), transparent 72%);
    pointer-events: none;
}

.hero-art {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-art img {
    border-radius: calc(var(--radius) - 6px);
}

.hero-copy h1,
.release-hero h1,
.install-wrap h1,
.admin-login-wrap h1 {
    margin: 0.35rem 0 1rem;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-copy p,
.release-hero p,
.panel p,
.feature-list,
.footer-grid p,
.footer-grid li,
.wallpaper-meta p,
small {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    display: inline-block;
    color: var(--accent-strong);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
}

.hero-actions,
.card-actions,
.inline-actions,
.form-actions,
.panel-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

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

.button-primary {
    color: #120f0b;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.button-secondary {
    color: var(--text);
    border-color: rgba(228, 194, 138, 0.26);
    background: rgba(255, 255, 255, 0.03);
}

.button-ghost,
.danger-outline {
    border-color: rgba(216, 106, 97, 0.32);
    color: #ffd6d1;
    background: rgba(216, 106, 97, 0.08);
}

.feature-list {
    padding-left: 1.1rem;
    margin: 1rem 0 0;
}

.feature-list li + li {
    margin-top: 0.7rem;
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h2,
.panel h2,
.panel h3,
footer h3,
footer h4 {
    margin: 0.4rem 0 0.6rem;
}

.card-like,
.release-card {
    min-height: 100%;
}

.release-grid {
    align-items: start;
}

.release-hero-simple {
    padding-bottom: 1.5rem;
}

.release-title-panel {
    max-width: 760px;
}

.compact-info {
    background: linear-gradient(180deg, rgba(198, 154, 86, 0.07), rgba(255, 255, 255, 0.02));
}

.project-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.project-card {
    min-height: 100%;
}

.wallpaper-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
    justify-content: center;
}

.wallpaper-card {
    padding: 0;
    overflow: hidden;
}

.preview-frame {
    position: relative;
    background: #050505;
}

.preview-button {
    display: block;
    width: 100%;
    border: 0;
    background: #050505;
    padding: 0;
}

.preview-download {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(228, 194, 138, 0.32);
    background: rgba(10, 10, 10, 0.72);
    color: var(--text);
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.preview-download:hover {
    border-color: rgba(228, 194, 138, 0.56);
    color: var(--accent-strong);
}

.preview-button img,
.wallpaper-edit-preview img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.wallpaper-meta {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    padding: 1rem 1.05rem 1.15rem;
}

.site-footer {
    padding: 2.5rem 0 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer li + li {
    margin-top: 0.6rem;
}

.footer-bottom {
    margin-top: 1rem;
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--muted);
}

.alert {
    border-radius: var(--radius-sm);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    color: #dffae8;
    border-color: rgba(111, 194, 142, 0.34);
    background: rgba(111, 194, 142, 0.12);
}

.alert-error {
    color: #ffe1dc;
    border-color: rgba(216, 106, 97, 0.34);
    background: rgba(216, 106, 97, 0.12);
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid > div,
.form-grid > .form-actions,
.form-grid > .checkbox-row,
.form-grid > .full-width {
    min-width: 0;
}

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

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select,
input[type="file"] {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text);
    padding: 0.9rem 1rem;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(228, 194, 138, 0.5);
    box-shadow: 0 0 0 4px rgba(198, 154, 86, 0.12);
}

textarea {
    resize: vertical;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.empty-state {
    text-align: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.lightbox-panel {
    position: relative;
    z-index: 2;
    width: min(calc(100% - 2rem), 1120px);
    margin: 3vh auto;
    background: #101010;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 1rem;
}

.lightbox-panel img {
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: calc(var(--radius) - 8px);
    background: #0b0b0b;
}

.lightbox-toolbar {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lightbox-toolbar p {
    margin: 0;
    color: var(--muted);
}

.lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1.6rem;
}

.admin-body {
    background: #050505;
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 290px 1fr;
}

.admin-sidebar {
    padding: 1.35rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(13, 13, 13, 0.95), rgba(8, 8, 8, 1));
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-brand {
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1rem;
}

.admin-nav {
    flex-direction: column;
    align-items: stretch;
}

.admin-nav a {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.admin-nav a:hover {
    background: rgba(198, 154, 86, 0.1);
}

.admin-user-card {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-user-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.admin-main {
    padding: 1.75rem;
}

.admin-topbar {
    margin-bottom: 1.25rem;
}

.admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.stat-card h2 {
    font-size: 2.3rem;
}

.panel-header-row {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.table-wrap {
    overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.36rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.status-live {
    color: #dbf7e4;
    border-color: rgba(111, 194, 142, 0.3);
    background: rgba(111, 194, 142, 0.1);
}

.status-draft {
    color: #f2e0bc;
    border-color: rgba(198, 154, 86, 0.28);
    background: rgba(198, 154, 86, 0.08);
}

.inline-actions {
    gap: 0.75rem;
}

.inline-actions form {
    margin: 0;
}

.danger-link {
    background: none;
    border: 0;
    padding: 0;
    font-weight: 600;
}

.admin-wallpaper-list {
    margin-top: 1.5rem;
}

.admin-wallpaper-stack {
    display: grid;
    gap: 1rem;
}

.wallpaper-edit-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    overflow: hidden;
}

.wallpaper-edit-form {
    padding: 1rem;
}

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

.install-wrap,
.admin-login-wrap {
    padding: 6rem 0;
}

.preview-button:hover img,
.wallpaper-edit-preview img:hover {
    transform: scale(1.01);
}

.preview-button img,
.wallpaper-edit-preview img {
    transition: transform 0.24s ease;
}

[hidden] {
    display: none !important;
}

@media (max-width: 980px) {
    .hero-grid,
    .section-grid,
    .footer-grid,
    .admin-two-col,
    .cards-grid.three-up,
    .admin-shell,
    .wallpaper-edit-card {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .admin-main {
        padding-top: 1rem;
    }
}

@media (max-width: 720px) {
    .nav-row,
    .panel-header-row,
    .hero-actions,
    .card-actions,
    .footer-bottom,
    .wallpaper-meta,
    .inline-actions,
    .lightbox-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid,
    .compact-form,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .hero-section,
    .section {
        padding: 3.2rem 0;
    }

    .brand img,
    .admin-brand img {
        width: 46px;
        height: 46px;
    }

    .admin-main {
        padding: 1rem;
    }
}

@media (max-width: 720px) {
    .preview-download {
        top: 0.7rem;
        right: 0.7rem;
        min-height: 36px;
        padding: 0.52rem 0.8rem;
    }
}
