:root {
    --canvas: #0c0c0e;
    --surface-1: #1a1a1e;
    --surface-2: #28282e;
    --hairline: #2e2e36;
    --hairline-soft: #22222a;
    --ink: #ffffff;
    --ink-muted: #999999;
    --accent-blue: #0099ff;
    --accent-blue-glow: rgba(0, 153, 255, 0.15);
    --accent-blue-ring: 0 0 0 1px rgba(0, 153, 255, 0.15);
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;

    --gradient-violet: linear-gradient(135deg, #6c3bd1, #a855f7);
    --gradient-magenta: linear-gradient(135deg, #c026d3, #e879f9);
    --gradient-orange: linear-gradient(135deg, #ea580c, #fbbf24);
    --gradient-coral: linear-gradient(135deg, #e11d48, #fb7185);

    --rounded-xs: 4px;
    --rounded-sm: 6px;
    --rounded-md: 10px;
    --rounded-lg: 15px;
    --rounded-xl: 20px;
    --rounded-xxl: 30px;
    --rounded-pill: 100px;
    --rounded-full: 9999px;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-focus: var(--accent-blue-ring);

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 15px;
    --space-xl: 20px;
    --space-xxl: 30px;
    --space-xxxl: 40px;

    --bg: var(--canvas);
    --bg-elevated: var(--surface-1);
    --bg-card: var(--surface-1);
    --border: var(--hairline);
    --text: var(--ink);
    --text-muted: var(--ink-muted);
    --accent: var(--accent-blue);
    --accent-glow: var(--accent-blue-glow);
    --radius: var(--rounded-xl);
    --radius-sm: var(--rounded-md);
    --font: var(--font-sans);
    --mono: var(--font-mono);
    --shadow: var(--shadow-lg);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-feature-settings: 'cv01', 'cv05', 'cv09', 'cv11', 'ss03', 'ss07', 'dlig';
    background: var(--canvas);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection {
    background: var(--accent-blue);
    color: var(--ink);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 12, 14, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline-soft);
}

.header-inner {
    max-width: 1199px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}
.brand:hover { text-decoration: none; opacity: 0.9; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 500; letter-spacing: -0.3px; }
.brand-text small { font-size: 0.7rem; color: var(--ink-muted); letter-spacing: 0.04em; text-transform: uppercase; }

/* Nav */
.main-nav { display: flex; gap: 0.25rem; }
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: var(--rounded-pill);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: -0.1px;
    color: var(--ink-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface-1); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--surface-2); color: var(--ink); }

/* Main */
.site-main {
    max-width: 1199px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}

.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -1.5px;
    line-height: 1.1;
}
.page-header p { margin: 0; color: var(--ink-muted); max-width: 640px; font-size: 1rem; line-height: 1.4; }

/* Alert */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--rounded-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: var(--warning);
}

/* Two column workspace */
.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 960px) {
    .workspace { grid-template-columns: 1fr; }
}

.panel {
    background: var(--surface-1);
    border-radius: var(--rounded-xl);
    padding: 1.5rem;
}

.panel h2 {
    margin: 0 0 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.panel-results { min-height: 400px; }

/* Spotlight result card (gradient) */
.panel-results.spotlight {
    background: var(--gradient-violet);
    padding: 2rem;
}
.panel-results.spotlight h2 { color: rgba(255,255,255,0.7); }
.panel-results.spotlight .result-header h3 { color: rgba(255,255,255,0.6); }

.form-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--hairline-soft);
}
.form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.form-section label,
.field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--ink-muted);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-md);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-feature-settings: 'cv01', 'cv05', 'cv09', 'cv11', 'ss03', 'ss07', 'dlig';
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea { min-height: 80px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-focus);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--hairline);
    border-radius: var(--rounded-xl);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-blue);
    background: var(--accent-blue-glow);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-zone p { margin: 0; font-size: 0.875rem; color: var(--ink-muted); }
.upload-zone .hint { font-size: 0.75rem; margin-top: 0.35rem; }

.image-preview {
    margin-top: 1rem;
    border-radius: var(--rounded-md);
    overflow: hidden;
    border: 1px solid var(--hairline);
    display: none;
}
.image-preview.visible { display: block; }
.image-preview img { width: 100%; display: block; max-height: 280px; object-fit: contain; background: #000; }

/* Radio / chip groups */
.chip-group, .radio-bullets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip-group label,
.radio-bullets label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-pill);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-muted);
    cursor: pointer;
    text-transform: none;
    letter-spacing: -0.1px;
    margin: 0;
    transition: all 0.15s;
    font-family: var(--font-sans);
    font-feature-settings: 'cv01', 'cv05', 'cv09', 'cv11', 'ss03', 'ss07', 'dlig';
}

.chip-group label:hover,
.radio-bullets label:hover {
    border-color: var(--accent-blue);
}

.chip-group input,
.radio-bullets input { display: none; }

.chip-group input:checked + span,
.radio-bullets input:checked + span,
.chip-group label:has(input:checked),
.radio-bullets label:has(input:checked) {
    background: var(--surface-2);
    border-color: var(--hairline);
    color: var(--ink);
}

.select-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .select-row { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: -0.14px;
    border: none;
    border-radius: var(--rounded-pill);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    line-height: 1;
}

.btn-primary {
    background: var(--ink);
    color: var(--canvas);
    width: 100%;
    margin-top: 1rem;
}
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-copy {
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    color: var(--ink-muted);
    border-radius: var(--rounded-pill);
    cursor: pointer;
    margin-left: auto;
    letter-spacing: -0.1px;
}
.btn-copy:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-copy.copied { border-color: var(--success); color: var(--success); }

/* Results */
.result-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--hairline-soft);
}
.result-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.result-header h3 {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
}

.result-content {
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-md);
    padding: 1rem;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.result-content.mono {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.result-image {
    border-radius: var(--rounded-md);
    overflow: hidden;
    border: 1px solid var(--hairline);
    background: #000;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.result-image img { width: 100%; display: block; }
.result-image .placeholder {
    padding: 2rem;
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--ink-muted);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--hairline);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.result-block-image + .result-block-image {
    margin-top: 0.25rem;
}

.img-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.result-image:hover .img-actions { opacity: 1; }

.btn-img-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    border-radius: var(--rounded-sm);
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.15s;
}
.btn-img-action:hover {
    background: var(--accent-blue);
    color: #fff;
    text-decoration: none;
}

.result-image { position: relative; }

.results-intro {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: var(--ink-muted);
}

.error-msg {
    color: var(--error);
    font-size: 0.875rem;
    padding: 1rem;
    background: rgba(248, 113, 113, 0.08);
    border-radius: var(--rounded-md);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.site-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--hairline-soft);
    color: var(--ink-muted);
    font-size: 0.8rem;
}
.site-footer p { margin: 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: var(--rounded-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
select, textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--hairline) var(--canvas);
}

/* Proportion visual chips */
.proporcion-group { display: flex; flex-direction: column; gap: 0.75rem; }
.proporcion-section { display: flex; flex-direction: column; gap: 0.35rem; }
.prop-label {
    font-size: 0.65rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.proporcion-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: var(--rounded-md);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 58px;
}
.proporcion-chip:hover { border-color: var(--accent-blue); }
.proporcion-chip:has(input:checked) {
    background: var(--surface-2);
    border-color: var(--hairline);
}
.proporcion-chip input { display: none; }
.proporcion-rect {
    display: block;
    background: var(--ink-muted);
    border-radius: 2px;
    opacity: 0.4;
}
.proporcion-chip:has(input:checked) .proporcion-rect {
    background: var(--ink);
    opacity: 0.7;
}
.chip-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--ink-muted);
    line-height: 1;
}
.proporcion-chip:has(input:checked) .chip-label { color: var(--ink); }

/* Gradient spotlight card for atmosphere */
.spotlight-card {
    background: var(--gradient-violet);
    border-radius: var(--rounded-xxl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.spotlight-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.8px;
    color: var(--ink);
}
.spotlight-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.75);
}
