:root {
    color-scheme: light;

    --page: #faf9f7;
    --surface: #ffffff;
    --surface-soft: #f5f3f0;
    --surface-raised: #ffffff;
    --line: #e6e1dc;
    --line-strong: #d3cbc3;
    --text: #211f24;
    --muted: #6f6973;
    --faint: #99929b;
    --accent: #6d5bd0;
    --accent-bright: #5745bd;
    --accent-soft: #f0edff;
    --success: #2c9b72;
    --danger: #c94f62;

    --radius-lg: 22px;
    --radius-md: 14px;

    --shadow: 0 20px 60px rgba(48, 40, 34, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;

    color: var(--text);
    background: var(--page);

    font-family:
            Inter,
            ui-sans-serif,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif;

    -webkit-font-smoothing: antialiased;
}

button,
select,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(109, 91, 208, 0.24);
    outline-offset: 3px;
}

.site-header {
    width: min(1040px, calc(100% - 40px));
    height: 76px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--text);
    text-decoration: none;

    font-size: 20px;
    font-weight: 760;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    display: block;
}

.brand-mark img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}

.header-note {
    color: var(--muted);
    font-size: 13px;
}

main {
    width: min(820px, calc(100% - 40px));
    margin: 0 auto;
}

.hero {
    max-width: 680px;
    margin: 80px auto 42px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 18px;

    color: var(--accent-bright);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow span {
    font-size: 13px;
    line-height: 1;
}

.hero h1 {
    margin: 0;

    font-size: clamp(42px, 7vw, 64px);
    line-height: 1.03;
    letter-spacing: -0.055em;
}

.hero p {
    max-width: 600px;
    margin: 22px auto 0;

    color: var(--muted);

    font-size: 16px;
    line-height: 1.7;
}

.converter-card {
    padding: 30px;

    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);

    box-shadow: var(--shadow);
}

.card-heading,
.progress-file,
.file-summary,
.progress-copy {
    display: flex;
    align-items: center;
}

.card-heading {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.section-kicker {
    margin: 0 0 6px;

    color: var(--accent-bright);

    font-size: 11px;
    font-weight: 720;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.card-heading h2 {
    margin: 0;

    font-size: 24px;
    letter-spacing: -0.03em;
}

.limit-badge {
    padding: 7px 10px;

    color: var(--muted);

    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);

    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.drop-zone {
    width: 100%;
    min-height: 210px;
    padding: 28px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--text);

    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: #fcfbfa;

    cursor: pointer;

    transition:
            border-color 160ms ease,
            background 160ms ease,
            transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.upload-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 16px;

    display: grid;
    place-items: center;

    color: var(--accent);

    border-radius: 14px;
    background: var(--accent-soft);
}

.upload-icon svg,
.primary-button svg,
.icon-button svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.upload-icon svg {
    width: 24px;
}

.drop-title {
    font-size: 17px;
    font-weight: 700;
}

.drop-copy {
    margin-top: 7px;

    color: var(--muted);
    font-size: 13px;
}

.file-summary,
.progress-file {
    gap: 14px;
    padding: 14px;

    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fcfbfa;
}

.file-summary {
    margin-top: 14px;
}

.file-type-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    color: var(--accent-bright);

    border-radius: 12px;
    background: var(--accent-soft);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.file-details {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-details strong {
    overflow: hidden;

    font-size: 14px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-details span {
    color: var(--muted);
    font-size: 12px;
}

.icon-button {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    color: var(--muted);

    border: 0;
    border-radius: 10px;
    background: transparent;

    cursor: pointer;
}

.icon-button:hover {
    color: var(--danger);
    background: #fff1f3;
}

.icon-button svg {
    width: 19px;
}

.format-row {
    margin: 20px 0;

    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 16px;
}

.format-row label {
    color: var(--text);

    font-size: 13px;
    font-weight: 650;
}

.select-wrap {
    position: relative;
}

.select-wrap select {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 14px;

    color: var(--text);

    border: 1px solid var(--line);
    border-radius: 12px;

    appearance: none;
    background: var(--surface-raised);

    cursor: pointer;
}

.select-wrap select:hover:not(:disabled) {
    border-color: var(--line-strong);
}

.select-wrap select:disabled {
    color: var(--faint);
    background: var(--surface-soft);
    cursor: not-allowed;
}

.select-wrap > svg {
    position: absolute;
    top: 50%;
    right: 14px;

    width: 18px;

    pointer-events: none;

    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;

    transform: translateY(-50%);
}

.primary-button,
.secondary-button {
    min-height: 52px;

    border-radius: 12px;

    font-weight: 720;

    cursor: pointer;

    transition:
            transform 150ms ease,
            background 150ms ease,
            border-color 150ms ease,
            box-shadow 150ms ease;
}

.primary-button {
    width: 100%;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    color: white;

    border: 0;
    background: var(--accent);

    box-shadow: 0 10px 24px rgba(109, 91, 208, 0.18);

    text-decoration: none;
}

.primary-button:hover:not(:disabled) {
    background: var(--accent-bright);
    transform: translateY(-1px);
}

.primary-button:disabled {
    color: #99939b;
    background: #e9e5e2;
    box-shadow: none;
    cursor: not-allowed;
}

.primary-button svg {
    width: 20px;
}

.progress-panel {
    padding-top: 2px;
}

.progress-file {
    margin-bottom: 24px;
}

.steps {
    position: relative;

    margin: 0 0 28px;
    padding: 0;

    display: grid;
    grid-template-columns: repeat(4, 1fr);

    list-style: none;
}

.steps::before {
    content: "";

    position: absolute;
    top: 17px;
    right: 12.5%;
    left: 12.5%;

    height: 1px;
    background: var(--line);
}

.steps li {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.steps li > span {
    width: 35px;
    height: 35px;
    margin-bottom: 9px;

    display: grid;
    place-items: center;

    color: var(--faint);

    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);

    font-size: 12px;
    font-weight: 720;
}

.steps li strong,
.steps li small {
    display: block;
}

.steps li strong {
    color: var(--muted);
    font-size: 12px;
}

.steps li small {
    margin-top: 4px;

    color: var(--faint);
    font-size: 10px;
}

.steps li.active > span {
    color: white;
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.steps li.active strong {
    color: var(--text);
}

.steps li.complete > span {
    color: white;
    border-color: var(--success);
    background: var(--success);
}

.progress-copy {
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 11px;
}

.progress-copy > div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}

.progress-copy > div strong {
    font-size: 14px;
}

.progress-copy span {
    color: var(--muted);
    font-size: 12px;
}

#progress-percent {
    color: var(--accent-bright);
    font-size: 14px;
}

.progress-track {
    height: 8px;
    overflow: hidden;

    border-radius: 999px;
    background: #ebe7e3;
}

.progress-fill {
    width: 0;
    height: 100%;

    border-radius: inherit;
    background: var(--accent);

    transition: width 240ms ease;
}

.progress-fill.indeterminate {
    width: 35%;
    animation: indeterminate 1.25s ease-in-out infinite;
}

@keyframes indeterminate {
    from {
        transform: translateX(-120%);
    }

    to {
        transform: translateX(340%);
    }
}

.ready-actions {
    margin-top: 24px;
}

.ready-actions p {
    margin: 11px 0 0;

    color: var(--muted);

    font-size: 12px;
    text-align: center;
}

.error-box {
    margin-top: 20px;
    padding: 13px 14px;

    color: #8f3040;

    border: 1px solid #efcbd1;
    border-radius: 12px;
    background: #fff2f4;

    font-size: 13px;
    line-height: 1.5;
}

.secondary-button {
    width: 100%;
    margin-top: 13px;

    color: var(--muted);

    border: 1px solid var(--line);
    background: transparent;
}

.secondary-button:hover {
    color: var(--text);
    border-color: var(--line-strong);
    background: var(--surface-soft);
}

.trust-grid {
    margin: 28px 0 80px;
    padding-top: 24px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;

    border-top: 1px solid var(--line);
}

.trust-grid article {
    min-width: 0;

    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.trust-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 9px;
    background: var(--surface-soft);

    font-size: 14px;
}

.trust-grid h3 {
    margin: 0 0 5px;

    font-size: 13px;
}

.trust-grid p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.55;
}

footer {
    width: min(1040px, calc(100% - 40px));
    min-height: 80px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    color: var(--faint);

    border-top: 1px solid var(--line);

    font-size: 12px;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}

@media (max-width: 720px) {
    .site-header {
        height: 70px;
    }

    .header-note {
        display: none;
    }

    .hero {
        margin: 60px auto 36px;
    }

    .hero h1 {
        font-size: clamp(40px, 11vw, 56px);
    }

    .converter-card {
        padding: 24px;
    }

    .format-row {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .trust-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 470px) {
    .site-header,
    main,
    footer {
        width: min(100% - 28px, 1040px);
    }

    .hero {
        margin-top: 48px;
    }

    .hero p {
        font-size: 15px;
    }

    .converter-card {
        padding: 19px;
        border-radius: 18px;
    }

    .card-heading {
        align-items: flex-start;
        gap: 12px;
    }

    .card-heading h2 {
        font-size: 22px;
    }

    .limit-badge {
        font-size: 10px;
    }

    .drop-zone {
        min-height: 185px;
        padding: 22px 14px;
    }

    .drop-title {
        font-size: 15px;
    }

    .steps li small {
        display: none;
    }

    .steps li strong {
        font-size: 10px;
    }

    footer {
        min-height: 92px;

        flex-direction: column;
        justify-content: center;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}