/* Global Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-white);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* scroll-behavior: smooth; DISABLED to prevent visible jumps on load */
    touch-action: manipulation;
    /* Disables double-tap to zoom globally on iOS */
}

@media (pointer: coarse) and (max-width: 900px) {
    html,
    body {
        /* Fixed attachment causes white repaint gaps during drag-scroll on some phones. */
        background-attachment: scroll;
        background-color: #020617;
    }
}

h1,
h2,
h3,
h4,
.brand-text {
    font-family: 'Unbounded', sans-serif;
    color: var(--text-white);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

img,
video,
canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

/* Hide ugly browser broken-image placeholders in app UI hotspots.
   Valid images still appear normally once src resolves. */
.sketch-recent-thumb:not([src]),
.sketch-recent-thumb[src=""],
#qe-thumb-img:not([src]),
#qe-thumb-img[src=""],
#qe-output-img:not([src]),
#qe-output-img[src=""] {
    visibility: hidden;
}

/* Header / recents strip: hide broken-image icon until a real decode succeeds (.is-rendered from JS). */
.sketch-recents-strip .sketch-recent-thumb:not(.is-rendered) {
    opacity: 0;
    pointer-events: none;
}

.sketch-recents-strip .sketch-recent-thumb.is-rendered {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.12s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

/* Grainy Texture Overlay - DISABLED as per user request */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: none;
    /* Disabled */
    opacity: 0;
    /* Disabled */
    pointer-events: none;
    z-index: 9999;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--desktop);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

section {
    padding: var(--space-12) 0;
}

@media (max-width: 768px) {
    section {
        padding: var(--space-8) 0;
    }
}

/* Unified glossy sliders (all pages) */
input[type="range"],
.tg-sidebar-slider,
.qe-range-slider,
.qe-m-slider,
#mp-mobile-tool-strip .qe-m-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 7px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(34, 197, 94, 0.12) 0%, rgba(2, 6, 23, 0.04) 100%),
        linear-gradient(90deg, rgba(16, 185, 129, 0.82) 0%, rgba(16, 185, 129, 0.74) 52%, rgba(13, 45, 38, 0.74) 100%);
    border: 1px solid rgba(16, 185, 129, 0.28);
    box-shadow:
        inset 0 1px 1px rgba(34, 197, 94, 0.16),
        inset 0 -1px 2px rgba(2, 6, 23, 0.56),
        0 2px 8px rgba(2, 6, 23, 0.3);
}

input[type="range"]::-webkit-slider-thumb,
.tg-sidebar-slider::-webkit-slider-thumb,
.qe-range-slider::-webkit-slider-thumb,
.qe-m-slider::-webkit-slider-thumb,
#mp-mobile-tool-strip .qe-m-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(220, 252, 231, 0.88);
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.96) 0%, rgba(236, 253, 245, 0.9) 24%, rgba(16, 185, 129, 0.82) 54%, rgba(34, 197, 94, 0.9) 74%, rgba(13, 45, 38, 0.95) 100%);
    box-shadow:
        0 5px 14px rgba(2, 6, 23, 0.44),
        0 0 14px rgba(34, 197, 94, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset -6px -8px 12px rgba(13, 45, 38, 0.24),
        inset 5px 7px 9px rgba(255, 255, 255, 0.18);
}

input[type="range"]::-webkit-slider-thumb:hover,
.tg-sidebar-slider::-webkit-slider-thumb:hover,
.qe-range-slider::-webkit-slider-thumb:hover,
.qe-m-slider::-webkit-slider-thumb:hover,
#mp-mobile-tool-strip .qe-m-slider::-webkit-slider-thumb:hover {
    box-shadow:
        0 6px 16px rgba(2, 6, 23, 0.52),
        0 0 18px rgba(34, 197, 94, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.96),
        inset -6px -8px 12px rgba(13, 45, 38, 0.26),
        inset 5px 7px 9px rgba(255, 255, 255, 0.22);
}

input[type="range"]::-moz-range-track,
.tg-sidebar-slider::-moz-range-track,
.qe-range-slider::-moz-range-track,
.qe-m-slider::-moz-range-track,
#mp-mobile-tool-strip .qe-m-slider::-moz-range-track {
    height: 7px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    background:
        linear-gradient(180deg, rgba(34, 197, 94, 0.12) 0%, rgba(2, 6, 23, 0.04) 100%),
        linear-gradient(90deg, rgba(16, 185, 129, 0.82) 0%, rgba(16, 185, 129, 0.74) 52%, rgba(13, 45, 38, 0.74) 100%);
    box-shadow:
        inset 0 1px 1px rgba(34, 197, 94, 0.16),
        inset 0 -1px 2px rgba(2, 6, 23, 0.56),
        0 2px 8px rgba(2, 6, 23, 0.3);
}

input[type="range"]::-moz-range-thumb,
.tg-sidebar-slider::-moz-range-thumb,
.qe-range-slider::-moz-range-thumb,
.qe-m-slider::-moz-range-thumb,
#mp-mobile-tool-strip .qe-m-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(220, 252, 231, 0.88);
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.96) 0%, rgba(236, 253, 245, 0.9) 24%, rgba(16, 185, 129, 0.82) 54%, rgba(34, 197, 94, 0.9) 74%, rgba(13, 45, 38, 0.95) 100%);
    box-shadow:
        0 5px 14px rgba(2, 6, 23, 0.44),
        0 0 14px rgba(34, 197, 94, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset -6px -8px 12px rgba(13, 45, 38, 0.24),
        inset 5px 7px 9px rgba(255, 255, 255, 0.18);
}

/* Keep brush sliders identical across phone + iPad */
.qe-m-slider,
#mp-mobile-tool-strip .qe-m-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 7px !important;
}

/* Desktop consistency: keep slider knob contained inside track */
@media (min-width: 1025px) {
    .tg-strength-slider,
    .tg-sidebar-slider {
        -webkit-appearance: none;
        appearance: none;
        height: 14px;
        border-radius: 999px;
        background:
            linear-gradient(180deg, rgba(34, 197, 94, 0.16) 0%, rgba(2, 6, 23, 0.06) 100%),
            linear-gradient(90deg, rgba(16, 185, 129, 0.9) 0%, rgba(16, 185, 129, 0.78) 52%, rgba(13, 45, 38, 0.72) 100%);
        border: 1px solid rgba(16, 185, 129, 0.36);
        box-shadow:
            inset 0 1px 1px rgba(34, 197, 94, 0.2),
            inset 0 -1px 2px rgba(2, 6, 23, 0.58),
            0 4px 12px rgba(2, 6, 23, 0.34);
    }

    .tg-strength-slider::-webkit-slider-thumb,
    .tg-sidebar-slider::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        border: 1px solid rgba(15, 23, 42, 0.9);
        background:
            radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.98) 45%, rgba(226, 232, 240, 0.95) 75%, rgba(203, 213, 225, 0.92) 100%);
        box-shadow:
            0 4px 10px rgba(2, 6, 23, 0.35),
            0 0 0 1px rgba(15, 23, 42, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 1),
            inset -3px -4px 6px rgba(148, 163, 184, 0.35);
        cursor: pointer;
    }

    .tg-strength-slider::-moz-range-track,
    .tg-sidebar-slider::-moz-range-track {
        height: 14px;
        border-radius: 999px;
        border: 1px solid rgba(16, 185, 129, 0.36);
        background:
            linear-gradient(180deg, rgba(34, 197, 94, 0.16) 0%, rgba(2, 6, 23, 0.06) 100%),
            linear-gradient(90deg, rgba(16, 185, 129, 0.9) 0%, rgba(16, 185, 129, 0.78) 52%, rgba(13, 45, 38, 0.72) 100%);
        box-shadow:
            inset 0 1px 1px rgba(34, 197, 94, 0.2),
            inset 0 -1px 2px rgba(2, 6, 23, 0.58),
            0 4px 12px rgba(2, 6, 23, 0.34);
    }

    .tg-strength-slider::-moz-range-thumb,
    .tg-sidebar-slider::-moz-range-thumb {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        border: 1px solid rgba(15, 23, 42, 0.9);
        background:
            radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 0.98) 45%, rgba(226, 232, 240, 0.95) 75%, rgba(203, 213, 225, 0.92) 100%);
        box-shadow:
            0 4px 10px rgba(2, 6, 23, 0.35),
            0 0 0 1px rgba(15, 23, 42, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 1),
            inset -3px -4px 6px rgba(148, 163, 184, 0.35);
        cursor: pointer;
    }
}
