/* Monochrome tokens match the portfolio. 21st.dev adaptations: COMPONENTS.md. */
:root {
  color-scheme: dark;
  --bg: #080808; --surface: #111; --surface-2: #1c1c1c;
  --white: #fafafa; --off-white: #e5e5e5; --muted: #a1a1a1; --muted-2: #898989;
  --border: #ffffff1a; --border-hover: #ffffff38;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px;
  --font-main: 'Outfit', sans-serif; --font-body: 'Inter', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--white); font-family: var(--font-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: #ffffff15; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
::selection { background: #fff; color: #080808; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 20000; background: #fff; color: #000; padding: 12px; }
.skip-link:focus { top: 16px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.studio-header { max-width: 1440px; margin: auto; padding: 30px 64px; display: flex; justify-content: space-between; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 12px; color: #d4d4d4; transition: color .15s; }
.back-link:hover { color: #fff; }
.studio-brand { font: 600 22px var(--font-main); letter-spacing: -.7px; }
.studio-main { width: calc(100% - 128px); max-width: 1160px; margin: auto; }
.studio-hero { padding: 48px 0 42px; }
.studio-hero h1 { font: 500 clamp(48px, 6vw, 76px)/1.08 var(--font-main); letter-spacing: -.055em; }
.studio-hero p { margin-top: 16px; font-size: 14px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 36px; align-items: stretch; }
.upload-panel, .settings-panel { min-width: 0; }
.panel-heading { padding-bottom: 16px; }
.panel-heading h2 { font-size: 14px; font-weight: 500; letter-spacing: -.2px; }
.upload-panel { display: flex; flex-direction: column; }
/* ReUI Card upload: bordered dropzone, drag feedback, file selection, metadata. */
.source-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; flex: 1; min-height: 350px; padding: 28px; border: 1px dashed #ffffff30; border-radius: 12px; background: #0e0e0e; color: var(--white); user-select: none; transition: border-color .15s, background-color .15s; }
.source-upload:hover, .source-upload.drag-over { border-color: #ffffff80; background-color: #141414; }
.source-upload-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 10px; background: #171717; color: #d4d4d4; }
.source-upload-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.source-upload-text { font-size: 14px; font-weight: 500; }
.source-upload-text span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.source-upload-hint { margin-top: 24px; color: var(--muted-2); font-size: 11px; }
.source-upload.has-image { background-size: contain; background-repeat: no-repeat; background-position: center; border-style: solid; }
.source-upload.has-image > * { display: none; }
.upload-footer { min-height: 56px; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.upload-footer > div { min-width: 0; }
#source-name { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
/* shadcn/ui Button: primary and outline variants ported to native controls. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; min-height: 40px; border-radius: 7px; border: 1px solid transparent; font-size: 12px; font-weight: 500; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn-primary { background: #fafafa; color: #0a0a0a; box-shadow: 0 1px 2px #0003; }
.btn-primary:hover { background: #ddd; }
.btn-secondary { color: #ededed; background: transparent; border-color: #ffffff26; }
.btn-secondary:hover { background: #ffffff08; border-color: #ffffff50; }
button:disabled { opacity: .45; cursor: wait; }
.settings-content { border-top: 1px solid var(--border); }
/* Origin UI Tabs: line and hover [Vercel], adapted to plain HTML/JS. */
.mode-toggle-switch { display: flex; gap: 22px; border-bottom: 1px solid var(--border); }
.mode-btn { position: relative; border: none; background: none; color: var(--muted); min-height: 48px; padding: 0 3px; font-size: 12px; }
.mode-btn::after { content: ''; position: absolute; height: 2px; bottom: -1px; left: 0; right: 0; background: transparent; }
.mode-btn.active { color: #fff; }
.mode-btn.active::after { background: #fff; }
.mode-btn:hover { color: #fff; }
.settings-description { margin: 18px 0 24px; min-height: 36px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.field-label { display: block; font-size: 12px; font-weight: 500; color: #e5e5e5; }
.color-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.color-picker-preview { display: flex; align-items: center; gap: 10px; }
.color-picker-preview-dot { width: 28px; height: 28px; border: 1px solid #ffffff35; border-radius: 6px; }
.color-picker-preview-hex { font: 12px ui-monospace, SFMono-Regular, monospace; color: #d4d4d4; }
.count-fields { display: flex; gap: 10px; margin-top: 10px; }
.count-fields select, .count-fields input { width: 100%; min-width: 0; min-height: 40px; padding: 9px 12px; border: 1px solid #ffffff26; border-radius: 7px; background: #111; color: #fff; font-size: 12px; }
.count-error { color: #fff; font-size: 11px; line-height: 1.6; }
.count-input-error { outline: 1px solid #fff; }
#start-color-row { margin-top: 20px; }
.strength-control { margin-top: 24px; }
.strength-heading { display: flex; align-items: center; justify-content: space-between; }
.strength-value { font-size: 12px; font-variant-numeric: tabular-nums; color: #d4d4d4; }
.strength-row { padding: 15px 0 8px; display: flex; }
.strength-row input { width: 100%; margin: 0; height: 5px; accent-color: #fff; cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 11px; }
.generate-button { width: 100%; margin-top: 27px; min-height: 42px; }
#colorize-status { min-height: 36px; margin-top: 12px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.results-section { margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--border); }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.results-heading h2 { font: 500 24px var(--font-main); letter-spacing: -.6px; }
#result-count { margin-left: 7px; font: 12px var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.results-empty { min-height: 110px; display: grid; place-items: center; border-radius: 10px; background: #0d0d0d; border: 1px solid #ffffff0d; padding: 20px; text-align: center; font-size: 12px; color: var(--muted-2); }
.projects-grid, .single-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-card, .single-card { position: relative; border: 1px solid var(--border); border-radius: 10px; background: #111; overflow: hidden; cursor: pointer; transition: border-color .15s; }
.project-card:hover, .single-card:hover { border-color: var(--border-hover); }
.project-image, .single-card-thumb { display: block; width: 100%; height: auto; aspect-ratio: 1.6; object-fit: contain; background: #0d0d0d; }
.project-content, .single-card-info { padding: 16px; }
.project-title, .single-card-title { font-size: 13px; font-weight: 500; }
.project-description, .single-card-meta { margin-top: 6px; font-size: 11px; color: var(--muted); }
.single-card-info { padding-right: 54px; }
.single-card-swatch { position: absolute; bottom: 20px; right: 16px; width: 23px; height: 23px; border-radius: 5px; border: 1px solid var(--border); }
.project-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.project-content .project-buttons { margin-top: 15px; }
.variant-color { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 11px ui-monospace, monospace; color: var(--muted); }
.variant-color-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); }
.studio-footer { margin-top: 58px; padding: 24px 0; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted-2); }
/* Dialogs share the same neutral surfaces. Only the selected color has color. */
.color-picker-modal, .lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: #000b; backdrop-filter: blur(12px); overscroll-behavior: contain; }
.color-picker-dialog { width: min(100%, 500px); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid var(--border-hover); border-radius: 14px; background: #151515; padding: 24px; box-shadow: 0 2px 10px #0003, 0 24px 70px #0008; }
.color-picker-header { margin-bottom: 24px; }
.color-picker-title { font-size: 16px; font-weight: 500; }
.color-picker-layout { display: flex; justify-content: center; gap: 24px; align-items: flex-start; }
.preset-column { display: grid; grid-template-columns: repeat(4, 26px); gap: 5px; max-height: 240px; overflow-y: auto; padding: 3px; }
.preset-swatch { width: 26px; height: 26px; border: 1px solid #ffffff25; border-radius: 5px; padding: 0; }
.preset-swatch.selected { outline: 2px solid #fff; outline-offset: 1px; }
.wheel-column { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.picker-canvases { display: flex; gap: 10px; }
.color-picker-plane-wrap { position: relative; width: 240px; height: 240px; border-radius: 6px; overflow: hidden; cursor: crosshair; touch-action: none; }
#color-picker-canvas { display: block; }
.color-picker-cursor { position: absolute; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #0009; transform: translate(-50%, -50%); pointer-events: none; }
.hue-strip-wrap { position: relative; width: 24px; height: 240px; cursor: crosshair; touch-action: none; }
#color-hue-canvas { display: block; border-radius: 5px; }
.hue-cursor { position: absolute; left: -3px; width: 30px; height: 5px; border: 1px solid #fff; background: #0005; transform: translateY(-50%); pointer-events: none; }
.color-swatch-wrap { display: flex; align-items: center; gap: 10px; }
.color-swatch { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border-hover); }
.color-swatch-name { width: 110px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--border-hover); border-radius: 6px; background: #0d0d0d; color: #fff; font: 13px ui-monospace, monospace; text-transform: uppercase; }
.color-swatch-name[aria-invalid='true'] { outline: 1px solid #fff; }
.color-picker-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.lightbox { z-index: 999; background: #000e; }
.lightbox-inner { max-width: calc(100vw - 100px); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lightbox-image { display: block; max-width: 100%; max-height: 65dvh; object-fit: contain; border-radius: 8px; }
.lightbox-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.lightbox-counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox-slider-group { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.lightbox-slider-group input { width: 100px; accent-color: #fff; }
.lightbox-slider-val { min-width: 36px; font-variant-numeric: tabular-nums; }
.lightbox-close, .lightbox-nav-btn { position: fixed; width: 44px; height: 44px; display: grid; place-items: center; background: #171717; color: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 24px; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-nav-btn { top: 50%; transform: translateY(-50%); }
.lightbox-nav-btn.prev { left: 16px; }.lightbox-nav-btn.next { right: 16px; }
.loading-spinner { width: 13px; height: 13px; display: inline-block; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1000px) { .studio-header { padding: 24px 32px; } .studio-main { width: calc(100% - 64px); } .workspace { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 28px; } }
@media (max-width: 700px) { .studio-header { padding: 18px 20px; } .studio-main { width: calc(100% - 40px); } .studio-hero { padding: 34px 0 34px; } .studio-hero h1 { font-size: 54px; }.workspace { grid-template-columns: 1fr; gap: 28px; } .source-upload { min-height: 280px; } .settings-description { min-height: 0; } .settings-content { padding-bottom: 0; } .btn, .mode-btn, .back-link { min-height: 44px; } .count-fields input, .count-fields select, .color-swatch-name { font-size: 16px; } .strength-row input { height: 24px; } .projects-grid, .single-results { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; } .results-heading { flex-wrap: wrap; } .results-section { margin-top: 36px; } .studio-footer { margin-top: 40px; } .color-picker-modal { padding: 12px; } .color-picker-dialog { padding: 20px; } .color-picker-layout { flex-direction: column-reverse; align-items: center; gap: 20px; } .preset-column { grid-template-columns: repeat(6, 44px); gap: 6px; max-height: 150px; } .preset-swatch { width: 44px; height: 44px; border-width: 7px; border-color: #151515; border-radius: 11px; } .lightbox-inner { max-width: calc(100vw - 90px); } }
@media (max-width: 370px) { .preset-column { grid-template-columns: repeat(5, 44px); } .projects-grid, .single-results { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Reserve the same image and metadata space while variants are generated. */
.result-skeleton { border: 1px solid var(--border); border-radius: 10px; background: #111; overflow: hidden; }
.skeleton-image { width: 100%; aspect-ratio: 1.6; background: #191919; }
.skeleton-info { padding: 16px; }
.skeleton-line { height: 19.5px; width: 58%; border-radius: 4px; background: #202020; }
.skeleton-line-short { height: 16.5px; width: 34%; margin-top: 6px; }
.skeleton-line-color { height: 16px; width: 42%; margin-top: 10px; }
.skeleton-action { width: 141px; max-width: 100%; height: 40px; margin-top: 15px; border-radius: 7px; background: #202020; }
.skeleton-shimmer { position: relative; overflow: hidden; }
.skeleton-shimmer::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #ffffff07, transparent); transform: translateX(-100%); animation: skeleton-shimmer 1.8s ease-in-out infinite; }
@keyframes skeleton-shimmer { to { transform: translateX(100%); } }
@media (max-width: 700px) { .skeleton-action { height: 44px; } }
@media (prefers-reduced-motion: reduce) { .skeleton-shimmer::after { animation: none; transform: none; background: #ffffff03; } }
