:root {
    --ink: #172033;
    --muted: #657086;
    --line: #dce2ea;
    --panel: #ffffff;
    --page: #f5f7fa;
    --accent: #1769aa;
    --accent-dark: #0f4f84;
    --success: #18794e;
    --danger: #b42318;
    --radius: 18px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

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

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand-row {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: white;
    font-weight: 800;
}

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

.brand small {
    color: var(--muted);
    margin-top: 1px;
}

.home-link, .text-button {
    color: var(--accent);
    font-weight: 700;
}

.hero {
    padding: 58px 0 24px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
}

h1 {
    margin: 0;
    font-size: clamp(2.25rem, 7vw, 4.25rem);
    line-height: 1;
    letter-spacing: -.04em;
}

.intro {
    max-width: 680px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.tool-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(20px, 5vw, 40px);
    box-shadow: 0 18px 55px rgba(23, 32, 51, .08);
}

.drop-zone {
    min-height: 250px;
    border: 2px dashed #afbac9;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: .15s ease;
    background: #fafbfd;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--accent);
    background: #f3f8fc;
}

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

.drop-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.drop-subtitle {
    margin-top: 5px;
    color: var(--muted);
}

.drop-note {
    margin-top: 18px;
    color: var(--muted);
    font-size: .88rem;
}

.preview-wrap {
    overflow: hidden;
    border-radius: 14px;
    background: #111;
}

.preview-wrap video {
    width: 100%;
    max-height: 480px;
    display: block;
}

.selected-file {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 2px 22px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.text-button {
    border: 0;
    padding: 4px;
    background: none;
    cursor: pointer;
    white-space: nowrap;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 4px;
}

.field label {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 8px;
    font-weight: 800;
}

.field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #bdc6d3;
    border-radius: 10px;
    background: #fff;
    padding: 0 12px;
    color: var(--ink);
    font: inherit;
}

.field input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

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

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    padding: 0 22px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.primary-button {
    width: 100%;
    margin-top: 28px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
}

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

.secondary-button {
    margin-top: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.message {
    margin-top: 20px;
    border-radius: 10px;
    padding: 12px 14px;
}

.error {
    background: #fff1f0;
    border: 1px solid #f3c2bd;
    color: var(--danger);
}

.working,
.result {
    text-align: center;
    padding: 34px 8px 12px;
}

.working p,
.result p { color: var(--muted); }

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    border: 5px solid #dfe7ef;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.progress-track {
    overflow: hidden;
    height: 8px;
    max-width: 480px;
    margin: 22px auto 0;
    border-radius: 99px;
    background: #e8edf3;
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width .2s ease;
}

.success-mark {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f5ee;
    color: var(--success);
    font-size: 1.8rem;
    font-weight: 900;
}

.result h2 { margin-bottom: 6px; }

.result .primary-button {
    max-width: 340px;
    margin-inline: auto;
}

.result .secondary-button {
    display: flex;
    max-width: 340px;
    margin-inline: auto;
}

.privacy-note {
    max-width: 720px;
    margin: 34px auto 58px;
    text-align: center;
}

.privacy-note h2 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.privacy-note p {
    margin-top: 0;
    color: var(--muted);
}

.site-footer {
    padding: 24px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: .9rem;
}

.hidden { display: none !important; }

.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;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 650px) {
    .brand-row { min-height: 66px; }
    .home-link { font-size: .9rem; }
    .hero { padding-top: 40px; }
    .control-grid { grid-template-columns: 1fr; }
    .tool-card { padding: 18px; }
    .drop-zone { min-height: 210px; padding: 24px 14px; }
    .selected-file { align-items: flex-start; flex-direction: column; gap: 5px; }
}
.selected-file > span { display: flex; flex-direction: column; gap: 2px; }
.selected-file small { color: var(--muted); }
