:root {
    color-scheme: dark;
    --bg: #07100c;
    --bg-2: #0b1712;
    --card: #0f1d17;
    --card-2: #12241c;
    --line: #1e3a2d;
    --text: #e8f5ee;
    --muted: #8aa99a;
    --accent: #25d366;
    --accent-2: #12b886;
    --danger: #ff8a8a;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(37, 211, 102, .14), transparent 65%),
        radial-gradient(700px 400px at 100% 100%, rgba(18, 184, 134, .08), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.page {
    width: min(100% - 32px, 880px);
    margin: 0 auto;
    padding: 56px 0 40px;
}

.hero {
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04110a;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0;
}

h1 {
    max-width: 14ch;
    margin: 0 0 16px;
    font-size: clamp(2.1rem, 6vw, 3.6rem);
    line-height: 1.02;
    letter-spacing: -.04em;
}

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

.lede {
    max-width: 60ch;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}


.card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 6px);
    background: linear-gradient(180deg, rgba(18, 36, 28, .92), rgba(12, 25, 19, .96));
    box-shadow: var(--shadow);
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 190px;
    padding: 28px 20px;
    border: 1.5px dashed #2a5140;
    border-radius: var(--radius);
    background: rgba(7, 16, 12, .45);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--accent);
    background: rgba(37, 211, 102, .07);
}

.dropzone.is-over {
    transform: scale(1.005);
}

.drop-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 6px;
    color: var(--accent);
}

.drop-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.drop-hint {
    color: var(--muted);
    font-size: .85rem;
}

.editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.preview {
    min-width: 0;
}

.preview video {
    display: block;
    width: 100%;
    max-height: 420px;
    border-radius: 14px;
    background: #000;
}

.file-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.file-name {
    overflow: hidden;
    color: var(--muted);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill {
    flex: none;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #b9d6c7;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}

.controls {
    min-width: 0;
}

.control-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: .82rem;
}

.control-head strong {
    color: var(--text);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

input[type="range"] {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    accent-color: var(--accent);
    cursor: pointer;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
}

.mode {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    border: 0;
}

.mode legend {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .82rem;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 16, 12, .35);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}

.choice:has(input:checked) {
    border-color: rgba(37, 211, 102, .7);
    background: rgba(37, 211, 102, .08);
}

.choice input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.choice strong {
    display: block;
    font-size: .92rem;
}

.choice small {
    display: block;
    color: var(--muted);
    font-size: .76rem;
}

.choice.is-disabled {
    opacity: .38;
    pointer-events: none;
}

.primary {
    width: 100%;
    margin-top: 22px;
    padding: 14px 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04110a;
    font: inherit;
    font-weight: 800;
    letter-spacing: -.01em;
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease;
}

.primary:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.primary:disabled {
    background: #1d3b2d;
    color: #6f8d7e;
    cursor: not-allowed;
}

.progress-card,
.result-card {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 16, 12, .45);
}

.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: .85rem;
}

.progress-head strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #1a3327;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .3s ease;
}

.alert {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 138, 138, .35);
    border-radius: 12px;
    background: rgba(255, 90, 90, .08);
    color: var(--danger);
    font-size: .88rem;
}

.result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.result-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.check {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(37, 211, 102, .16);
    color: var(--accent);
    font-weight: 900;
}

.downloads {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.download {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(18, 36, 28, .55);
    color: var(--text);
    font-size: .88rem;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.download:hover {
    border-color: rgba(37, 211, 102, .6);
    background: rgba(37, 211, 102, .07);
}

.download > span:first-child {
    font-weight: 700;
}

.download-meta {
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: .76rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-button {
    flex: none;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(37, 211, 102, .14);
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
}

.foot {
    margin-top: 22px;
    color: #638073;
    font-size: .76rem;
    text-align: center;
}

.foot p {
    margin: 4px 0;
}

.noscript {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    color: var(--danger);
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 24px, 880px);
        padding-top: 34px;
    }

    .card {
        padding: 16px;
    }

    .editor {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    h1 {
        max-width: 100%;
    }

    .download {
        flex-wrap: wrap;
    }

    .download-meta {
        flex-basis: 100%;
        text-align: left;
    }
}
