
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

@import url('https://cooperfont.vercel.app/fonts.min.css');

:root {
    /* Brand Theme Solid Colors (No Gradients) */
    --accent-cyan: #00b8d4;
    --accent-purple: #8b5cf6;
    --accent: var(--accent-purple);

    /* Semantic Colors */
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.08);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.08);

    /* Layout Tokens */
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Cooper', Georgia, serif;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;
    --transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;

    /* Dark Theme Variables (Default) */
    --bg: #0d0d0e;
    --surface: #141416;
    --surface-hover: #1b1b1e;
    --surface-solid: #18181b;
    --border: #232326;
    --border-hover: #333338;
    --text: #ececed;
    --text-secondary: #9a9a9f;
    --text-muted: #5e5e64;

    /* Canvas Checkerboard Pattern */
    --checkerboard: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
}

[data-theme="light"] {
    /* Light Theme Variables */
    --bg: #fafafa;
    --surface: #f4f4f6;
    --surface-hover: #eaeaea;
    --surface-solid: #ffffff;
    --border: #e2e2e7;
    --border-hover: #d1d1d6;
    --text: #1c1c1e;
    --text-secondary: #7c7c80;
    --text-muted: #aeaea2;

    --checkerboard: repeating-conic-gradient(rgba(0, 0, 0, 0.03) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

/* ==========================================================================
   HEADER / NAVIGATION
   ========================================================================== */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    transition: var(--transition);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 840px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}

.nav-brand img {
    height: 20px;
    width: 20px;
    object-fit: contain;
}

.logo-icon {
    height: 20px;
    width: 20px;
    flex-shrink: 0;
}

.logo-icon.footer-logo {
    height: 18px;
    width: 18px;
}

.logo-icon rect {
    fill: var(--text);
    transition: var(--transition);
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.nav-logo span {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 3px;
}

.hdr-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
}

.theme-toggle {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    color: var(--text);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle re-icon {
    font-size: 22px;
    width: 22px;
    height: 22px;
    display: flex;
}

.hdr-github-link,
.hdr-npm-link {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
    text-decoration: none;
}

.hdr-github-link:hover,
.hdr-npm-link:hover {
    color: var(--text);
}

.hdr-github-link svg,
.hdr-npm-link svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.hdr-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-right: 4px;
}

.hdr-nav-link:hover {
    color: var(--text);
    background: var(--surface);
}

.hdr-github-link re-icon {
    font-size: 22px;
    width: 22px;
    height: 22px;
    display: flex;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    text-align: center;
    padding: 56px 0 32px;
    max-width: 580px;
    margin: 0 auto;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--text);
}

.hero h1 span.accent-text {
    color: var(--accent);
}

.hero-sub {
    font-size: clamp(13px, 2vw, 15px);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
}

.section-label {
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ==========================================================================
   UPLOAD ZONE
   ========================================================================== */

.upload-zone {
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    background: var(--surface);
    transition: var(--transition);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--accent);
    transition: var(--transition);
}

.upload-icon svg {
    width: 20px;
    height: 20px;
}

.upload-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.upload-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover .upload-btn {
    background: var(--accent);
    color: #fff;
}

.upload-btn svg {
    width: 14px;
    height: 14px;
}

#fileInput {
    display: none;
}

/* ==========================================================================
   EDITOR / WORKSPACE LAYOUT
   ========================================================================== */

.editor-layout {
    display: none;
}

/* ==========================================================================
   COMPARISON SLIDER
   ========================================================================== */

.comp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.comp-meta-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.meta-pill {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
}

.meta-pill.savings {
    color: var(--green);
    background: var(--green-bg);
}

.meta-pill.bigger {
    color: var(--red);
    background: var(--red-bg);
}

.comp-box {
    background: var(--checkerboard);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    user-select: none;
    touch-action: none;
    width: 100%;
    max-height: 60vh;
}

.comp-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.comp-after,
.comp-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.comp-after {
    z-index: 1;
}

.comp-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.comp-after img,
.comp-before img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.comp-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: var(--accent);
    z-index: 10;
    pointer-events: none;
}

.comp-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-solid);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.comp-handle::before,
.comp-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.comp-handle::before {
    border-right: 5px solid var(--text-secondary);
    left: 6px;
}

.comp-handle::after {
    border-left: 5px solid var(--text-secondary);
    right: 6px;
}

.comp-label {
    position: absolute;
    bottom: 8px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    z-index: 15;
    pointer-events: none;
}

.comp-label.left {
    left: 8px;
}

.comp-label.right {
    right: 8px;
}

.comp-drag {
    position: absolute;
    inset: 0;
    z-index: 20;
    cursor: ew-resize;
    background: transparent;
}

.comp-hint {
    text-align: center;
    margin-top: 8px;
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.fullscreen-btn {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 25;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent);
}

/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */

.progress-wrap {
    display: none;
    height: 3px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: var(--radius-sm);
    transition: width 0.2s ease;
}

/* ==========================================================================
   FORMAT PRESET PILLS
   ========================================================================== */

.preset-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.preset-chip {
    height: 32px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.preset-chip:hover:not(.active) {
    border-color: var(--border-hover);
    color: var(--text);
}

.preset-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ==========================================================================
   SETTINGS CARD & CONTROLS GRID
   ========================================================================== */

.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ctrl-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ctrl-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Custom Select styling */
.select-wrap {
    position: relative;
    width: 100%;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4.5px solid var(--text-secondary);
    pointer-events: none;
}

.ctrl-select {
    width: 100%;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 28px 8px 10px;
    transition: var(--transition);
}

.ctrl-select:focus {
    border-color: var(--accent);
}

.ctrl-select option {
    background: var(--surface-solid);
    color: var(--text);
}

/* Quality slider range styling */
.quality-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quality-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.quality-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: var(--radius-sm);
    background: var(--border);
    outline: none;
    cursor: pointer;
    margin: 6px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface-solid);
    border: 1.5px solid var(--accent);
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--accent);
}

input[type="range"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Resize Inputs */
.resize-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.resize-input {
    width: 100%;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    font-family: var(--font);
    font-size: 12px;
    color: var(--text);
    outline: none;
    text-align: center;
    transition: var(--transition);
}

.resize-input:focus {
    border-color: var(--accent);
}

.resize-sep {
    font-size: 12px;
    color: var(--text-muted);
}

.lock-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-solid);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.lock-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.lock-btn.locked {
    border-color: var(--accent);
    color: var(--accent);
}

.lock-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Flip Layout */
.flip-row {
    display: flex;
    gap: 4px;
}

.toggle-btn {
    flex: 1;
    height: 32px;
    padding: 0 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-solid);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.toggle-btn:hover:not(.active) {
    border-color: var(--border-hover);
    color: var(--text);
}

.toggle-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.toggle-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Rotate buttons */
.rotate-row {
    display: flex;
    gap: 4px;
}

.rotate-btn {
    flex: 1;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-solid);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.rotate-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Image stats bar */
.stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 80px;
}

.stat-key {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-val {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--text);
}

/* ==========================================================================
   ACTIONS DOCK
   ========================================================================== */

.action-dock {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-purple);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

/* ==========================================================================
   FULLSCREEN MODAL COMPARISON
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay.open {
    display: flex;
}

.modal-inner {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.modal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}

.modal-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Modal Tabbed View Options */
.modal-view-tabs {
    display: flex;
    gap: 4px;
}

.modal-tab {
    height: 28px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.modal-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.modal-comp-box {
    flex: 1;
    overflow: hidden;
    background: var(--checkerboard);
    position: relative;
    user-select: none;
    touch-action: none;
}

.modal-comp-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.modal-comp-after,
.modal-comp-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-comp-after {
    z-index: 1;
}

.modal-comp-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.modal-comp-after img,
.modal-comp-before img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.modal-comp-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: var(--accent);
    z-index: 10;
    pointer-events: none;
}

.modal-comp-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-solid);
    border: 1px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-comp-handle::before,
.modal-comp-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.modal-comp-handle::before {
    border-right: 5px solid var(--text-secondary);
    left: 8px;
}

.modal-comp-handle::after {
    border-left: 5px solid var(--text-secondary);
    right: 8px;
}

.modal-comp-drag {
    position: absolute;
    inset: 0;
    z-index: 20;
    cursor: ew-resize;
    background: transparent;
}

.modal-comp-label {
    position: absolute;
    bottom: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    z-index: 15;
    pointer-events: none;
}

.modal-comp-label.left {
    left: 12px;
}

.modal-comp-label.right {
    right: 12px;
}

/* Modal Single Viewports */
.modal-single {
    flex: 1;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--checkerboard);
}

.modal-single img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-single.active {
    display: flex;
}

.modal-comp-box.hidden {
    display: none;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--text);
    color: var(--bg);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    border: 1px solid var(--border);
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */

.footer-wrap {
    margin-top: auto;
    background: var(--bg);
    transition: var(--transition);
}

footer {
    max-width: 840px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ft-logo {
    font-family: var(--font-heading);
    font-size: 16px;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.ft-logo span {
    color: var(--accent);
}

.ft-copy {
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.ft-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.ft-link:hover {
    color: var(--accent);
}

.ft-link svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */

@media(max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .nav {
        height: 56px;
        padding: 0 16px;
    }

    .theme-toggle,
    .hdr-github-link {
        padding: 8px;
    }

    .theme-toggle svg,
    .theme-toggle re-icon {
        width: 26px;
        height: 26px;
        font-size: 26px;
    }

    .hdr-github-link svg,
    .hdr-github-link re-icon {
        width: 26px;
        height: 26px;
        font-size: 26px;
    }

    .hero {
        padding: 40px 0 24px;
    }

    .card {
        padding: 16px;
    }

    .controls-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .action-dock {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px;
        gap: 8px;
    }

    .fullscreen-btn {
        display: flex;
    }

    .modal-overlay {
        padding: 8px;
    }

    .modal-inner {
        height: calc(100vh - 24px);
    }

    .modal-topbar {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-title {
        font-size: 14px;
    }

    .modal-view-tabs {
        width: 100%;
        order: 3;
        justify-content: space-between;
    }

    .modal-tab {
        flex: 1;
        text-align: center;
        height: 28px;
        font-size: 10px;
    }
}

@media(max-width: 480px) {
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .preset-chip {
        flex: 1;
        min-width: 60px;
        text-align: center;
        padding: 0;
        font-size: 11px;
    }

    .stats-bar {
        grid-template-columns: 1fr 1fr;
        display: grid;
        gap: 8px;
    }

    .stat-item {
        min-width: unset;
    }

    .upload-zone {
        padding: 32px 16px;
    }
}

/* ==========================================================================
   BULK WORKSPACE FILE CARDS & CONTROLS
   ========================================================================== */

.files-list-container {
    display: none;
    width: 100%;
}

.file-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.file-card:hover {
    border-color: var(--border-hover);
}

.file-card-title {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.remove-file-btn {
    transition: var(--transition);
}

.remove-file-btn:hover {
    color: var(--red) !important;
}

.quality-card-slider input[type="range"] {
    margin: 4px 0;
}

.quality-val {
    font-weight: 700;
    color: var(--accent);
}

.card-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.card-download-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================================
   INFO / SEO SECTIONS (FEATURES, HOWTO, ACCORDION FAQ)
   ========================================================================== */

.info-section {
    margin-top: 64px;
    border-top: 1px solid var(--border);
    padding-top: 48px;
    margin-bottom: 64px;
}

.info-group {
    margin-bottom: 56px;
}

.info-group:last-child {
    margin-bottom: 0;
}

.info-title {
    font-family: var(--font-heading);
    font-size: clamp(20px, 3.5vw, 24px);
    font-weight: 500;
    margin-bottom: 28px;
    text-align: center;
    color: var(--text);
}

/* Features Grid styling */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature-card-seo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.feature-card-seo:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.feature-seo-icon {
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.feature-seo-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
}

.feature-seo-icon re-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    display: flex;
    color: var(--accent);
}

.feature-card-seo h3 {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card-seo p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* How-To Steps styling */
.howto-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.howto-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    position: relative;
    transition: var(--transition);
}

.howto-step:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.step-num {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    transition: var(--transition);
}

.howto-step:hover .step-num {
    background: var(--accent);
    color: #fff;
}

.step-content h3 {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    margin-top: 16px;
}

.step-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FAQ Accordion styling */
.faq-accordion {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-item.active {
    border-color: var(--accent);
}

.faq-trigger {
    width: 100%;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.faq-trigger:hover {
    background: var(--surface-hover);
}

.faq-icon {
    font-size: 16px;
    color: var(--text-secondary);
    transition: transform 0.2s ease, color 0.2s ease;
    user-select: none;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--accent);
}

.faq-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.faq-content {
    padding: 0 24px 20px 24px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Info Section Responsive Queries */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .howto-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .info-section {
        margin-top: 48px;
        padding-top: 36px;
        margin-bottom: 48px;
    }

    .info-group {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .howto-steps {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .faq-trigger {
        padding: 16px 20px;
        font-size: 13px;
    }

    .faq-content {
        padding: 0 20px 16px 20px;
    }
}

/* =============================================
   SITE FOOTER
   ============================================= */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 52px 24px 32px;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 48px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-tagline {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 260px;
    margin: 0;
}

.footer-col-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 14px 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.18s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.footer-gh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.18s ease;
}

.footer-gh:hover {
    color: var(--accent);
}

.footer-gh re-icon {
    font-size: 16px;
    line-height: 1;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
        padding: 40px 20px 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
        align-items: center;
        text-align: center;
    }

    .footer-tagline {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 32px 16px 20px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 16px 16px;
    }
}

/* ==========================================================================
   DOCUMENTATION PAGE (DOCS)
   ========================================================================== */

.docs-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

.docs-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 16px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    list-style: none;
}

.docs-quick-nav a {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.docs-quick-nav a:hover {
    color: var(--text);
}

.docs-content {
    min-width: 0;
    margin-top: 40px;
    margin-bottom: 80px;
}

.docs-section {
    margin-bottom: 56px;
    scroll-margin-top: 100px;
}

.docs-section h1 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 40px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.docs-section h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 26px;
    margin-top: 40px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.docs-section h3 {
    font-size: 18px;
    font-weight: 500;
    margin-top: 24px;
    margin-bottom: 12px;
}

.docs-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 15px;
}

.docs-section a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.4);
    transition: var(--transition);
}

.docs-section a:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

.docs-section p code,
.docs-section li code {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--text); /* Neutralized */
}

.docs-section ul,
.docs-section ol {
    margin-left: 24px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 15px;
}

.docs-section li {
    margin-bottom: 8px;
}

/* Callouts / Alerts - Soft and simple */
.docs-alert {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.docs-alert-title {
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-alert.note {
    background: var(--surface);
    border-left: 3px solid var(--border-hover);
}
.docs-alert.note .docs-alert-title {
    color: var(--text);
}

.docs-alert.tip {
    background: var(--surface);
    border-left: 3px solid var(--green);
}
.docs-alert.tip .docs-alert-title {
    color: var(--green);
}

.docs-alert.warning {
    background: var(--surface);
    border-left: 3px solid var(--red);
}
.docs-alert.warning .docs-alert-title {
    color: var(--red);
}

/* Code Blocks */
.code-wrapper {
    position: relative;
    margin-bottom: 24px;
}

pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    margin: 0;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13.5px;
    line-height: 1.5;
}

pre code {
    color: var(--text);
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.code-wrapper:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

/* Simple Code Tokens Syntax Highlighting */
.tok-comment { color: var(--text-muted); font-style: italic; }
.tok-keyword { color: var(--text-secondary); font-weight: 600; } /* Neutralized */
.tok-string { color: var(--text-secondary); } /* Neutralized */
.tok-fn { color: var(--text); } /* Neutralized */
.tok-var { color: var(--text); } /* Neutralized */
.tok-tag { color: var(--text-secondary); }
.tok-attr { color: var(--text-muted); }

/* Tables in Docs */
.docs-table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.docs-table th,
.docs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.docs-table th {
    background: var(--surface);
    font-weight: 600;
    color: var(--text);
}

.docs-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   MOBILE FULL SCREEN MENU OVERLAY & RESPONSIVE NAV
   ========================================================================== */

/* Responsive visibility helpers */
.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Scroll Lock State */
body.menu-open {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Mobile Hamburger & Close Toggle Buttons */
.mobile-menu-toggle {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    color: var(--text);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-menu-toggle .icon-hamburger {
    fill: currentColor;
}

.mobile-menu-toggle .icon-close {
    display: none;
    fill: none;
    stroke: currentColor;
}

/* Swap icons when open */
body.menu-open .mobile-menu-toggle .icon-hamburger {
    display: none !important;
}

body.menu-open .mobile-menu-toggle .icon-close {
    display: block !important;
}

/* Mobile Nav Fullscreen Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);
    background: var(--bg);
    z-index: 99;
    display: none;
    flex-direction: column;
    padding: 32px 24px;
    border-top: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(-8px);
}

body.menu-open .mobile-nav-overlay {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-link {
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.mobile-nav-link:hover {
    color: var(--accent);
}

.mobile-nav-link svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-nav-link:hover svg {
    color: var(--accent);
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Mobile Theme Toggle Button styling */
.theme-toggle-mobile {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    transition: var(--transition);
    margin-top: 12px;
}

.theme-toggle-mobile:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.theme-toggle-mobile re-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Media query to trigger mobile layout collapse */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }

    .mobile-nav-overlay {
        top: 56px;
        height: calc(100vh - 56px);
    }
}