@font-face {
    font-family: 'Styrene A';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/StyreneA-Medium-Web.woff2') format('woff2');
}

@font-face {
    font-family: 'Styrene B';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/StyreneB-Regular-Web.woff2') format('woff2');
}

@font-face {
    font-family: 'Styrene B';
    font-style: normal;
    font-weight: 500;
    src: url('fonts/StyreneB-Medium-Web.woff2') format('woff2');
}

@font-face {
    font-family: 'Styrene B';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/StyreneB-Medium-Web.woff2') format('woff2');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #141413;
    outline-offset: 3px;
}

/* Remove focus outline when clicking with mouse */
*:focus:not(:focus-visible) {
    outline: none;
}

body {
    font-family: 'Styrene B', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #FAF9F5;
    color: #141413;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.controls-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.01), 0px 4px 4px 0px rgba(0, 0, 0, 0.02), 0px 16px 24px 0px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    cursor: grab;
    user-select: none;
}

.controls-panel h2 {
    font-family: 'Styrene A', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: #141413;
}

.upload-section {
    margin-bottom: 1.5rem;
}

.file-input {
    display: none;
}

.upload-label {
    display: flex;
    height: 3rem;
    padding: 0rem 2rem;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    border-radius: 0.75rem;
    background: #141413;
    color: white;
    cursor: pointer;
    font-family: 'Styrene B', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    transition: background-color 0.2s;
}

.upload-label:hover {
    background: #3D3D3A;
    cursor: pointer;
}

.upload-label:focus-visible {
    outline: 2px solid #141413;
    outline-offset: 3px;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    font-size: 0.875rem;
    font-family: 'Styrene B', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    color: #141413;
    margin-bottom: 0.5rem;
}

.control-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.control-row input[type="range"] {
    flex: 1;
}

.control-row span {
    font-size: 0.8125rem;
    color: #141413;
    min-width: 70px;
    text-align: right;
    white-space: nowrap;
}

.editable-value {
    cursor: text;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.editable-value:hover {
    cursor: text;
}

.editable-value:hover {
    background-color: rgba(20, 20, 19, 0.05);
}

.editable-value:focus {
    background-color: rgba(20, 20, 19, 0.1);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #E8E6DC;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    /* Add padding for larger click area */
    padding: 10px 0;
    margin: -10px 0;
    background-clip: content-box;
}

/* Webkit browsers */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #E8E6DC;
    border-radius: 3px;
    border: none;
}

/* Firefox */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #E8E6DC;
    border-radius: 3px;
    border: none;
}

input[type="range"]:focus-visible {
    outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
    outline: 2px solid #141413;
    outline-offset: 3px;
}

input[type="range"]:focus-visible::-moz-range-thumb {
    outline: 2px solid #141413;
    outline-offset: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #141413;
    cursor: pointer;
    margin-top: -5px; /* (16px - 6px) / 2 = 5px */
}

input[type="range"]::-webkit-slider-thumb:hover {
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #141413;
    cursor: pointer;
    border: none;
}

input[type="range"]::-moz-range-thumb:hover {
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-family: 'Styrene B', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    color: #141413;
    cursor: pointer;
    margin-bottom: 8px;
}

.checkbox-label:last-of-type {
    margin-bottom: 0;
}

.checkbox-description {
    font-size: 0.75rem;
    line-height: 1.3;
    color: rgba(20, 20, 19, 0.6);
    margin-top: 4px;
    margin-bottom: 0;
    margin-left: 28px;
    font-family: 'Styrene B', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid #E8E6DC;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: #141413;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #141413;
    border-color: #141413;
}

.checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid #141413;
    outline-offset: 3px;
    border-color: #141413;
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.svg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FAF9F5;
}

.svg-canvas svg {
    max-width: 80%;
    max-height: 80%;
    height: auto;
    width: auto;
}

.svg-canvas:empty::before {
    content: "Upload an SVG to see the jitter effect";
    color: #141413;
    opacity: 0.5;
    font-size: 1.25rem;
}

.keyboard-hint {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Styrene B', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(20, 20, 19, 0.6);
    text-align: center;
    pointer-events: none;
    user-select: none;
}