:root {
    --bg: #10100f;
    --surface: #181817;
    --surface-soft: #20201e;
    --surface-raised: #272725;
    --line: rgba(255, 255, 255, 0.09);
    --text: #f4f1eb;
    --muted: #aaa69e;
    --faint: #74716b;
    --accent: #d48644;
    --accent-bright: #edaa67;
    --accent-deep: #8c4b23;
    --danger: #e07169;
    --success: #7cb98b;
    --radius: 18px;
    --heading: "Space Grotesk", sans-serif;
    --body: "DM Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 84% 5%, rgba(140, 75, 35, 0.16), transparent 27rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%) 0 0 / 24px 24px,
        var(--bg);
    font-family: var(--body);
}

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

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

button {
    cursor: pointer;
}

.site-header,
.page-shell {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 118px;
    border-bottom: 1px solid var(--line);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.header-actions form {
    margin: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    display: block;
    width: 92px;
    height: 92px;
    border: 1px solid rgba(237, 170, 103, 0.58);
    border-radius: 18px;
    background: #050302;
    object-fit: cover;
    box-shadow:
        0 0 0 4px rgba(212, 77, 25, 0.08),
        0 0 28px rgba(237, 92, 19, 0.38);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font: 700 16px/1.1 var(--heading);
    letter-spacing: -0.4px;
}

.brand small {
    margin-top: 4px;
    color: var(--faint);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.page-shell {
    padding-block: 58px 72px;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    transition: 180ms ease;
}

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

.button-primary {
    background: var(--accent);
    color: #21150e;
}

.button-primary:hover {
    background: var(--accent-bright);
}

.button-subtle {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.035);
}

.button-subtle:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
}

.button-icon {
    font-size: 21px;
    font-weight: 400;
    line-height: 0;
}

.intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 36px;
    margin-bottom: 42px;
}

.eyebrow {
    margin: 0 0 11px;
    color: var(--accent-bright);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: var(--heading);
}

.intro h1 {
    margin-bottom: 0;
    font-size: clamp(37px, 5vw, 58px);
    letter-spacing: -2.8px;
    line-height: 0.99;
}

.intro h1 span {
    color: var(--accent);
}

.intro-copy {
    max-width: 385px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.featured {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.72fr);
    overflow: hidden;
    margin-bottom: 65px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.featured-player {
    min-height: 390px;
    background: #080808;
}

.featured-player video,
.featured-player iframe,
.edit-preview video,
.edit-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.featured-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 36px;
}

.featured-content h2 {
    margin-bottom: 5px;
    font-size: 31px;
    letter-spacing: -1.2px;
}

.featured-song {
    color: var(--muted);
    font-size: 15px;
}

.metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 13px 0 18px;
}

.metadata span,
.card-style {
    border: 1px solid rgba(212, 134, 68, 0.28);
    border-radius: 99px;
    color: var(--accent-bright);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 8px;
    text-transform: uppercase;
}

.featured-notes {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.featured-actions {
    display: flex;
    gap: 17px;
    margin-top: 13px;
}

.featured-actions form {
    margin: 0;
}

.text-link {
    border: 0;
    padding: 0;
    background: none;
    color: var(--accent-bright);
    font-size: 13px;
    font-weight: 700;
}

.text-link:hover {
    text-decoration: underline;
}

.text-danger {
    color: var(--danger);
}

.empty-hero,
.empty-results {
    padding: 54px 20px;
    margin-bottom: 64px;
    border: 1px dashed rgba(212, 134, 68, 0.32);
    border-radius: var(--radius);
    background: rgba(212, 134, 68, 0.035);
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin: 0 auto 15px;
    border: 1px solid rgba(212, 134, 68, 0.45);
    border-radius: 50%;
    color: var(--accent);
    font-size: 15px;
    padding-left: 3px;
}

.empty-hero h2 {
    margin-bottom: 8px;
}

.empty-hero p,
.empty-results p {
    color: var(--muted);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: 25px;
    letter-spacing: -0.8px;
}

.section-heading h2 span {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    margin-left: 5px;
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--muted);
    font: 700 11px/1 var(--body);
    vertical-align: 3px;
}

.filters {
    display: flex;
    gap: 9px;
}

.search-field {
    display: flex;
    min-width: 265px;
    align-items: center;
    gap: 5px;
    padding-left: 12px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    color: var(--faint);
}

.search-field input,
.filters select {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
}

.search-field input {
    width: 100%;
    padding: 10px 11px 10px 3px;
}

.filters select {
    min-width: 136px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
}

.filters option {
    background: var(--surface);
}

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

.video-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: 180ms ease;
}

.video-card:hover {
    border-color: rgba(212, 134, 68, 0.38);
    transform: translateY(-3px);
}

.video-card.is-active {
    border-color: rgba(212, 134, 68, 0.56);
}

.card-preview {
    position: relative;
    display: block;
    height: 174px;
    overflow: hidden;
    background: #090909;
}

.card-preview::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.65));
    content: "";
}

.card-preview video,
.card-preview img {
    width: 100%;
    height: 100%;
    opacity: 0.72;
    object-fit: cover;
}

.play-button {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.5);
    font-size: 13px;
    padding-left: 3px;
    transform: translate(-50%, -50%);
}

.card-style {
    position: absolute;
    z-index: 1;
    bottom: 11px;
    left: 11px;
    background: rgba(8, 8, 8, 0.6);
}

.card-content {
    padding: 17px;
}

.card-content h3 {
    overflow: hidden;
    margin-bottom: 5px;
    font-size: 16px;
    letter-spacing: -0.4px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-content h3 a:hover {
    color: var(--accent-bright);
}

.card-content p {
    overflow: hidden;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    margin-bottom: 22px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13px;
}

.flash-success {
    border-color: rgba(124, 185, 139, 0.35);
    background: rgba(124, 185, 139, 0.1);
    color: #9ad2a7;
}

.flash-error {
    border-color: rgba(224, 113, 105, 0.35);
    background: rgba(224, 113, 105, 0.1);
    color: #ef9690;
}

.flash button {
    border: 0;
    background: none;
    color: inherit;
    font-size: 20px;
}

.upload-dialog {
    width: min(680px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.upload-dialog::backdrop {
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(4px);
}

.upload-form {
    padding: 27px;
}

.dialog-heading,
.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dialog-heading h2 {
    margin-bottom: 19px;
    font-size: 28px;
}

.close-button {
    align-self: start;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
}

.drop-zone {
    display: flex;
    min-height: 132px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 19px;
    border: 1px dashed rgba(212, 134, 68, 0.55);
    border-radius: 12px;
    background: rgba(212, 134, 68, 0.055);
    color: var(--muted);
    cursor: pointer;
    text-align: center;
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.drop-zone strong {
    color: var(--text);
    font-size: 13px;
}

.drop-zone small {
    color: var(--faint);
    font-size: 11px;
}

.drop-icon {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #24160e;
    font-size: 18px;
    line-height: 1;
}

.youtube-field {
    display: flex;
    min-height: 132px;
    align-items: stretch;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 19px;
    padding: 22px;
    border: 1px dashed rgba(212, 134, 68, 0.55);
    border-radius: 12px;
    background: rgba(212, 134, 68, 0.055);
}

.youtube-field strong {
    color: var(--text);
    font-size: 13px;
}

.youtube-field input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 13px 14px;
}

.youtube-field small {
    color: var(--faint);
    font-size: 11px;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    padding: 10px 11px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 13px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: rgba(212, 134, 68, 0.7);
}

.dialog-actions {
    justify-content: end;
    gap: 9px;
    margin-top: 20px;
}

.edit-shell {
    max-width: 1050px;
}

.edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.78fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.edit-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #080808;
}

.edit-preview video,
.edit-preview iframe {
    min-height: 380px;
}

.edit-preview p {
    margin: 12px;
    color: var(--faint);
    font-size: 11px;
    text-align: center;
}

.edit-form {
    padding: 30px;
}

.edit-form h1 {
    margin-bottom: 21px;
    font-size: 29px;
    letter-spacing: -1px;
}

.auth-shell {
    width: min(440px, calc(100% - 28px));
    margin: 0 auto;
    padding: 52px 0;
}

.auth-shell > .brand {
    width: max-content;
    margin: 0 auto 28px;
}

.auth-card {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.auth-card h1 {
    margin-bottom: 24px;
    font-size: 28px;
    letter-spacing: -1px;
}

.auth-card form {
    display: grid;
    gap: 15px;
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-back {
    display: block;
    margin-top: 22px;
    text-align: center;
}

.auth-help {
    display: block;
    margin-top: 18px;
    color: var(--accent-bright);
    font-size: 13px;
    text-align: center;
}

.auth-help + .auth-back {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .featured,
    .edit-layout {
        grid-template-columns: 1fr;
    }

    .featured-player {
        min-height: 300px;
    }

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

    .edit-preview video {
        min-height: 290px;
    }
}

@media (max-width: 680px) {
    .site-header,
    .page-shell {
        width: min(100% - 28px, 560px);
    }

    .site-header {
        min-height: 94px;
    }

    .brand-logo {
        width: 68px;
        height: 68px;
        border-radius: 14px;
    }

    .brand {
        gap: 10px;
    }

    .brand small {
        display: none;
    }

    .header-actions {
        gap: 6px;
    }

    .header-actions .button {
        min-height: 38px;
        padding-inline: 12px;
        font-size: 11px;
    }

    .page-shell {
        padding-block: 39px 50px;
    }

    .intro {
        display: block;
        margin-bottom: 28px;
    }

    .intro h1 {
        font-size: 39px;
        letter-spacing: -2px;
    }

    .intro-copy {
        margin: 17px 0 0;
        font-size: 14px;
    }

    .featured {
        margin-bottom: 46px;
    }

    .featured-player {
        min-height: 215px;
    }

    .featured-content {
        padding: 24px;
    }

    .featured-content h2 {
        font-size: 25px;
    }

    .section-heading {
        display: block;
    }

    .filters {
        flex-wrap: wrap;
        margin-top: 15px;
    }

    .search-field {
        width: 100%;
        min-width: 0;
    }

    .filters select {
        flex: 1;
    }

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

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

    .field-wide {
        grid-column: auto;
    }

    .upload-form {
        padding: 20px;
    }
}
