:root {
    --brand: lch(71% 29% 258deg);
    --brand-light: lch(85% 20% 258deg);
    --brand-fallback: #6a7aff;
    --surface: #ffffff;
    --surface-soft: #f5f7ff;
    --surface-strong: #eef3ff;
    --text: #243047;
    --muted: #5f6980;
    --border: #d8def4;
    --shadow: 0 24px 50px rgba(62, 92, 170, 0.12);
    font-size: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(137, 164, 255, 0.35), transparent 28%),
        radial-gradient(circle at top right, rgba(196, 214, 255, 0.75), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #f4f7ff 42%, #fbfcff 100%);
}

a, a:hover, a:visited {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid rgba(216, 222, 244, 0.7);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.hero__glow {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.55;
}

.hero__glow--left {
    top: -180px;
    left: -120px;
    background: rgba(118, 145, 255, 0.28);
}

.hero__glow--right {
    right: -100px;
    bottom: -170px;
    background: rgba(175, 195, 255, 0.34);
}

.hero__inner {
    position: relative;
    padding: 28px;
}

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

.brand__logo {
    width: 104px;
    height: auto;
}

.brand__logo-link {
    display: inline-flex;
    align-items: center;
}

.brand__text {
    display: flex;
    flex-direction: column;
}

.brand__eyebrow {
    color: var(--muted);
    font-size: 0.9rem;
}

.brand h1 {
    margin: 0;
    color: var(--brand);
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.hero__lead {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero__kicker {
    margin: 22px 0 0;
    color: var(--brand);
    font-size: 0.96rem;
    font-weight: 700;
}

.stack {
    display: grid;
    gap: 20px;
}

.card {
    border: 1px solid rgba(216, 222, 244, 0.9);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.section-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    color: var(--text);
}

.section-copy {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.workflow {
    overflow: hidden;
}

/* 배속 제어 컴포넌트 */
.control-group {
    margin-bottom: 24px;
}

.control-label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.speed-preset-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.preset-btn {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    border-color: var(--brand);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.preset-btn.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(106, 122, 255, 0.25);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface-soft);
    padding: 16px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.speed-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    outline: none;
    margin: 0;
    cursor: pointer;
}

.speed-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--brand) 0%, var(--brand) var(--slider-progress, 0%), var(--border) var(--slider-progress, 0%), var(--border) 100%);
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin-top: -6px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.speed-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: var(--border);
}

.speed-slider::-moz-range-progress {
    height: 8px;
    border-radius: 999px 0 0 999px;
    background: var(--brand);
}

.speed-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.speed-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.speed-display {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand);
    min-width: 60px;
    text-align: right;
}

.speed-info {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--muted);
}

.dropzone {
    margin-top: 20px;
    border: 3px dashed #aecaef;
    border-radius: 28px;
    padding: 46px 24px;
    background:
        linear-gradient(180deg, rgba(245, 248, 255, 0.96), rgba(238, 244, 255, 0.98)),
        var(--surface-soft);
    text-align: center;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
    cursor: pointer;
}

.dropzone.is-dragover {
    border-color: var(--brand);
    background:
        linear-gradient(180deg, rgba(231, 239, 255, 0.98), rgba(224, 234, 255, 0.98)),
        var(--surface-strong);
    transform: translateY(-1px);
}

.dropzone__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 26px;
    border: none;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(91, 115, 216, 0.22);
}

.dropzone__eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(106, 122, 255, 0.1);
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 700;
}

.dropzone__title {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.dropzone__copy {
    max-width: 580px;
    margin: 0 auto 16px;
    color: var(--muted);
    line-height: 1.6;
}

.dropzone__hint {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.status-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.status-item {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-soft);
}

.status-item strong,
.status-item span {
    display: block;
}

.status-item strong {
    font-size: 0.98rem;
}

.status-item span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.status-item--active {
    border-color: var(--brand);
    background: rgba(106, 122, 255, 0.08);
}

.status-item--done {
    border-color: #a8dcbb;
    background: rgba(227, 250, 236, 0.9);
}

.status-item--error {
    border-color: #f0b9b9;
    background: rgba(255, 241, 241, 0.95);
}

.summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
    padding: 18px;
    border-radius: 24px;
    background: #f7f9ff;
    border: 1px solid var(--border);
}

.summary__label {
    color: var(--muted);
    font-size: 0.9rem;
}

.summary__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand);
}

.status-panel__head {
    margin-bottom: 12px;
}

.status-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 20;
    width: min(720px, calc(100% - 24px));
    transform: translateX(-50%);
    padding: 16px 18px;
    border: 1px solid rgba(106, 122, 255, 0.2);
    border-radius: 20px;
    background: rgba(36, 48, 71, 0.94);
    color: #fff;
    box-shadow: 0 24px 50px rgba(23, 31, 49, 0.28);
    backdrop-filter: blur(16px);
}

.status-toast strong,
.status-toast span {
    display: block;
}

.status-toast strong {
    font-size: 0.96rem;
}

.status-toast span {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.5;
}

.status-toast--error {
    border-color: rgba(255, 100, 100, 0.4);
    background: rgba(80, 20, 20, 0.96);
}

.status-toast--error strong {
    color: #ffb3b3;
}

.progress-bar {
    margin-top: 12px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    transition: width 0.4s ease;
}

.encode-dialog {
    width: min(520px, calc(100% - 32px));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.encode-dialog::backdrop {
    background: rgba(36, 48, 71, 0.5);
    backdrop-filter: blur(4px);
}

.encode-dialog__msg {
    margin: 0 0 24px;
    color: var(--text);
    line-height: 1.65;
}

.encode-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.encode-dialog__btn {
    padding: 12px 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.encode-dialog__btn--primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

@media (max-width: 860px) {
    .summary {
        grid-template-columns: 1fr;
    }

    .hero__inner,
    .panel {
        padding: 22px;
    }
}

@media (max-width: 640px) {
    :root {
        font-size: 16px;
    }

    .page-shell {
        width: min(100% - 20px, 1080px);
        padding-top: 12px;
    }

    .brand {
        gap: 10px;
    }

    .brand__logo {
        width: 84px;
    }

    .dropzone {
        padding: 30px 18px;
    }

    .status-toast {
        top: 10px;
        border-radius: 16px;
    }
}
