@font-face {
    font-family: Onest;
    src: url("./onest-cyrillic.woff2") format("woff2");
    font-display: swap;
    font-weight: 100 900;
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: Onest;
    src: url("./onest-latin.woff2") format("woff2");
    font-display: swap;
    font-weight: 100 900;
}
:root {
    color-scheme: dark;
    --bg: #171816;
    --panel: #20211e;
    --ink: #f2f1e8;
    --muted: #a1a399;
    --yellow: #e5f15b;
    --line: #393b33;
    font-family: Onest, Arial, sans-serif;
    font-synthesis: none;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}
button,
input,
a {
    -webkit-tap-highlight-color: transparent;
}
button,
input {
    font: inherit;
}
button,
a,
input {
    touch-action: manipulation;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: default;
}
button {
    color: inherit;
}
a {
    color: inherit;
    text-decoration: none;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 5px;
}
[hidden] {
    display: none !important;
}
button:disabled {
    opacity: 0.38;
}
p,
h1,
h2 {
    margin: 0;
}
.page {
    max-width: 1160px;
    margin: auto;
    padding: 0 40px;
}
.studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 48px;
    padding: 56px 0 28px;
}
.photo-section {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.dropzone {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1c1e18;
    border: 1px solid #43473a;
    border-radius: 3px;
    overflow: hidden;
    isolation: isolate;
    min-height: 0;
}
.grid {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.67;
}
.empty {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 24px;
}
.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 3px;
    min-height: 54px;
    font-weight: 650;
    font-size: 16px;
    transition:
        background 0.15s,
        transform 0.15s;
}
.button-yellow {
    background: var(--yellow);
    color: #20230e;
}
.button-yellow:not(:disabled):hover {
    background: #f1ff68;
}
.button:not(:disabled):active {
    transform: translateY(1px);
}
.upload-button {
    padding: 0 27px;
    margin: 0;
}
.upload-button span {
    font-size: 24px;
    font-weight: 400;
}
#preview {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    outline-offset: -4px;
}
.dropzone.has-photo {
    background: #10110e;
}
.processing {
    position: absolute;
    z-index: 3;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: var(--bg);
    font-size: 14px;
    white-space: nowrap;
}
.drag-message {
    display: none;
    position: absolute;
    inset: 0;
    background: #dfe96ded;
    z-index: 5;
    align-items: center;
    justify-content: center;
    color: #20230e;
    font-size: 24px;
    font-weight: 650;
}
.is-dragging .drag-message {
    display: flex;
}
.photo-bottom {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: flex-start;
    padding-top: 18px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}
.photo-actions {
    display: flex;
    gap: 19px;
    flex-shrink: 0;
}
.text-button {
    padding: 0 0 4px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: none;
    font-size: 13px;
    white-space: nowrap;
}
.text-button:not(:disabled):hover,
.text-button[aria-pressed="true"] {
    color: var(--yellow);
    border-color: var(--yellow);
}
.controls {
    padding-top: 5px;
}
.intro h1 {
    position: relative;
    font-size: 42px;
    line-height: 1.08;
    letter-spacing: -1.6px;
    font-weight: 650;
    margin: 0 0 18px;
}
.intro h1 > span {
    color: var(--yellow);
}
.intro p {
    font-size: 15px;
    line-height: 1.6;
    color: #b8bab0;
}
fieldset {
    border: 0;
    padding: 0;
    margin: 22px 0 0;
    min-width: 0;
}
.settings-heading {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    margin-bottom: 14px;
}
.reset {
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    padding: 5px 7px;
}
.reset:hover {
    color: var(--yellow);
}
.range-control {
    margin-bottom: 19px;
}
.range-control label {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.range-control output {
    font:
        13px ui-monospace,
        SFMono-Regular,
        monospace;
    color: var(--yellow);
    background: #e5f15b0c;
    padding: 4px 7px;
    min-width: 32px;
    text-align: center;
    border: 1px solid #e5f15b20;
    border-radius: 3px;
}
.range-control input {
    display: block;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 28px;
    background: transparent;
    cursor: pointer;
    margin: 7px 0 0;
    accent-color: var(--yellow);
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 3px;
    background: #515548;
    border-radius: 5px;
}
input[type="range"]::-moz-range-track {
    height: 3px;
    background: #515548;
    border-radius: 5px;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 13px;
    height: 21px;
    border: 2px solid #171816;
    border-radius: 3px;
    background: var(--yellow);
    margin-top: -9px;
    box-shadow: 0 0 0 1px #e5f15b40;
}
input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 18px;
    border: 2px solid #171816;
    border-radius: 3px;
    background: var(--yellow);
}
input[type="range"]:focus-visible {
    outline: 1px solid var(--yellow);
    outline-offset: 4px;
}
.format-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-size: 14px;
    margin: 8px 0 25px;
}
.segmented {
    display: flex;
    background: #10110f;
    border: 1px solid var(--line);
    padding: 3px;
    border-radius: 4px;
    gap: 2px;
}
.segmented button {
    padding: 8px 10px;
    border: 0;
    border-radius: 2px;
    font-size: 12px;
    background: transparent;
    color: var(--muted);
}
.segmented button[aria-pressed="true"] {
    background: #35382e;
    color: var(--ink);
}
fieldset:disabled .range-control,
fieldset:disabled .format-control {
    opacity: 0.5;
}
fieldset:disabled input {
    cursor: default;
}
fieldset:disabled button {
    opacity: 1;
}
.download-button {
    width: 100%;
    justify-content: space-between;
    padding: 0 21px;
    min-height: 57px;
}
.download-button > span {
    font-size: 24px;
    font-weight: 400;
}
.save-section > p {
    font-size: 11px;
    line-height: 1.6;
    color: var(--muted);
    text-align: center;
    margin-top: 12px;
}
.save-section > .error {
    color: #ffb3a3;
    font-size: 14px;
    text-align: left;
}
.footer {
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    min-height: 72px;
    padding: 20px 0;
    color: var(--muted);
}
.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;
}
.noscript {
    position: fixed;
    z-index: 9;
    bottom: 0;
    background: var(--yellow);
    color: #171816;
    padding: 20px;
    width: 100%;
    text-align: center;
}
@media (max-width: 1100px) {
    .page {
        padding: 0 32px;
    }
    .studio {
        gap: 35px;
        grid-template-columns: minmax(0, 1fr) 320px;
    }
    .intro h1 {
        font-size: 37px;
        letter-spacing: -1.6px;
        line-height: 1.08;
        margin: 0 0 18px;
    }
    .photo-bottom {
        flex-direction: column;
        justify-content: flex-end;
    }
    .photo-actions {
        width: 100%;
        justify-content: space-between;
    }
    .empty {
        padding: 18px;
    }
    .dropzone {
        margin-top: 0;
    }
}
@media (max-width: 760px) {
    .page {
        padding: 0 22px;
    }
    .studio {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding: 22px 0 30px;
    }
    .photo-bottom {
        padding-top: 14px;
        justify-content: flex-end;
    }
    .photo-actions {
        justify-content: flex-end;
        gap: 24px;
    }
    .photo-bottom:has(.photo-actions button:disabled) .photo-actions {
        display: none;
    }
    .controls {
        padding: 0;
    }
    .intro {
        position: relative;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--line);
    }
    .intro h1 {
        font-size: 40px;
        letter-spacing: -1.6px;
        margin: 0 0 18px;
        line-height: 1.08;
    }
    .intro p {
        font-size: 14px;
    }
    .intro p br {
        display: none;
    }
    fieldset {
        margin-top: 5px;
    }
    .settings-heading {
        border: 0;
        margin-bottom: 14px;
        justify-content: flex-end;
    }
    .range-control {
        margin-bottom: 19px;
    }
    .range-control label {
        font-size: 15px;
    }
    .range-control input {
        height: 35px;
    }
    .format-control {
        margin-bottom: 25px;
    }
    .segmented button {
        font-size: 13px;
        padding: 9px 13px;
    }
    .footer {
        align-items: flex-end;
        flex-direction: row;
        gap: 18px;
        padding: 24px 0 28px;
        justify-content: flex-end;
    }
}
@media (max-width: 380px) {
    .page {
        padding: 0 16px;
    }
    .upload-button {
        margin-top: 20px;
        margin: 0;
    }
    .intro h1 {
        font-size: 34px;
        letter-spacing: -1.6px;
        line-height: 1.08;
        margin: 0 0 18px;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

@media (max-width: 760px) {
    .photo-section:has(.has-photo) {
        position: sticky;
        top: 0;
        z-index: 4;
        background: var(--bg);
        padding-top: 8px;
        padding-bottom: 12px;
    }
    .photo-section:has(.has-photo) .dropzone {
        max-height: 38svh;
    }
    .photo-section:has(.has-photo) .photo-bottom {
        flex-direction: row;
        align-items: center;
        padding-top: 10px;
        gap: 10px;
    }
    .photo-section:has(.has-photo) .photo-actions {
        width: 100%;
        gap: 14px;
    }
    .photo-section:has(.has-photo) .text-button {
        font-size: 12px;
    }
}

.isty-link {
    display: inline-flex;
    padding: 4px 0;
}

.isty-link img {
    display: block;
    width: 70px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.isty-link:hover img {
    opacity: 1;
}
