:root {
    color-scheme: dark;
    --bg: #060607;
    --surface: rgba(18, 18, 20, 0.72);
    --surface-soft: rgba(255, 255, 255, 0.045);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.2);
    --text: rgba(248, 248, 250, 0.94);
    --muted: rgba(218, 218, 224, 0.62);
    --faint: rgba(218, 218, 224, 0.42);
    --accent: #d84f4f;
    --accent-soft: rgba(216, 79, 79, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background:
        linear-gradient(135deg, rgba(216, 79, 79, 0.14), transparent 34%),
        linear-gradient(315deg, rgba(255, 255, 255, 0.075), transparent 28%),
        var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.55;
}

.workspace {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100% - 36px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 46px 0;
    display: grid;
    align-content: center;
    gap: 26px;
}

.topbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.course {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

h1 {
    margin: 0;
    font-size: clamp(62px, 12vw, 132px);
    line-height: 0.9;
    font-weight: 650;
    letter-spacing: 0;
}

.student-info {
    margin: 0;
    min-width: 260px;
    display: grid;
    gap: 12px;
}

.student-info div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.student-info dt {
    color: var(--faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.student-info dd {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.workbench {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.encoder-form {
    display: grid;
}

.upload-area {
    position: relative;
    min-height: 292px;
    padding: 34px;
    display: grid;
    place-items: center;
    text-align: center;
    cursor: pointer;
    background:
        linear-gradient(135deg, var(--accent-soft), transparent 48%),
        var(--surface-soft);
    border-bottom: 1px solid var(--line);
    transition: background 0.2s ease;
}

.upload-area:hover {
    background:
        linear-gradient(135deg, rgba(216, 79, 79, 0.26), transparent 48%),
        var(--surface-hover);
}

.upload-area input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-size: 40px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.055);
}

.upload-title {
    display: block;
    font-size: 28px;
    font-weight: 620;
}

.upload-meta {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 18px;
    padding: 22px;
}

.field {
    display: grid;
    gap: 9px;
}

.field span,
.result-line span {
    color: var(--faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    padding: 0 14px;
    color: var(--text);
    background: rgba(4, 4, 5, 0.7);
    outline: none;
}

select:focus {
    border-color: rgba(216, 79, 79, 0.64);
}

.submit-button {
    min-height: 48px;
    border: 1px solid rgba(216, 79, 79, 0.7);
    padding: 0 28px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: rgba(216, 79, 79, 0.24);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.submit-button:hover {
    border-color: rgba(216, 79, 79, 0.95);
    background: rgba(216, 79, 79, 0.34);
}

.result-line {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    border-top: 1px solid var(--line);
}

.result-line div {
    min-height: 88px;
    padding: 20px 22px;
    display: grid;
    align-content: center;
    gap: 8px;
    border-right: 1px solid var(--line);
}

.result-line div:last-child {
    border-right: 0;
}

.result-line strong {
    font-size: 18px;
    font-weight: 560;
}

@media (max-width: 820px) {
    .workspace {
        min-height: auto;
        padding: 28px 0;
    }

    .topbar {
        display: grid;
        align-items: start;
    }

    .student-info {
        min-width: 0;
        width: 100%;
    }

    .settings-row,
    .result-line {
        grid-template-columns: 1fr;
    }

    .result-line div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .result-line div:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 520px) {
    .workspace {
        width: min(100% - 22px, 1080px);
    }

    .upload-area {
        min-height: 238px;
        padding: 26px 18px;
    }

    .upload-title {
        font-size: 23px;
    }
}
