:root {
  --umi-ivory-0: oklch(0.99 0.012 72);
  --umi-ivory-1: oklch(0.965 0.018 70);
  --umi-ink: oklch(0.22 0.025 40);
  --umi-muted: oklch(0.49 0.018 45);
  --umi-line: oklch(0.88 0.022 65);
  --umi-coral: oklch(0.67 0.19 22);
  --umi-coral-deep: oklch(0.57 0.19 22);
  --umi-coral-soft: oklch(0.95 0.045 28);
  --umi-sage: oklch(0.57 0.09 150);
  --umi-sage-soft: oklch(0.95 0.03 145);
  --umi-focus: oklch(0.67 0.19 22 / 0.38);
  --umi-radius-sm: 12px;
  --umi-radius-md: 20px;
  --umi-radius-lg: 28px;
  --umi-shadow-1: 0 1px 2px oklch(0.22 0.025 40 / 0.06), 0 12px 36px oklch(0.22 0.025 40 / 0.07);
  --umi-shadow-2: 0 2px 4px oklch(0.22 0.025 40 / 0.07), 0 24px 64px oklch(0.22 0.025 40 / 0.11);
  --bg: var(--umi-ivory-1);
  --panel: var(--umi-ivory-0);
  --ink: var(--umi-ink);
  --muted: var(--umi-muted);
  --line: var(--umi-line);
  --accent: var(--umi-coral);
  --accent-soft: var(--umi-coral-soft);
  --sage: var(--umi-sage);
  --sage-soft: var(--umi-sage-soft);
}

html {
  background: var(--bg);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 8%, oklch(0.93 0.045 28 / 0.6), transparent 22rem),
    radial-gradient(circle at 91% 28%, oklch(0.94 0.035 145 / 0.55), transparent 26rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans JP", "Segoe UI", sans-serif;
}

button,
input,
select,
[role="button"] {
  min-height: 44px;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--umi-focus);
  outline-offset: 3px;
}

.app-header {
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 64px);
  border-bottom-color: oklch(0.22 0.025 40 / 0.08);
  background: oklch(0.99 0.012 72 / 0.9);
  box-shadow: 0 8px 32px oklch(0.22 0.025 40 / 0.035);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
}

.brand-lockup {
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 14px 14px 14px 5px;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.12), 0 7px 18px oklch(0.22 0.025 40 / 0.16);
  font-size: 19px;
  letter-spacing: -0.05em;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.67 0.19 22 / 0.18);
}

.brand-lockup strong {
  font-size: 18px;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.brand-lockup span:last-child {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.header-tool-button,
.install-button {
  border-color: oklch(0.22 0.025 40 / 0.12);
  border-radius: var(--umi-radius-sm);
  background: oklch(1 0 0 / 0.64);
  transition: transform 180ms ease-out, border-color 180ms ease-out, background 180ms ease-out, box-shadow 180ms ease-out;
}

.header-tool-button:hover,
.install-button:hover {
  border-color: oklch(0.22 0.025 40 / 0.22);
  background: var(--panel);
  box-shadow: 0 8px 20px oklch(0.22 0.025 40 / 0.07);
  transform: translateY(-1px);
}

.page-frame {
  width: min(1360px, calc(100% - 48px));
  padding: clamp(32px, 4vw, 64px) 0 32px;
}

.page-intro {
  position: relative;
  align-items: center;
  gap: 48px;
  margin-bottom: 32px;
}

.page-intro > div:first-child {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.page-intro h1 {
  max-width: 13ch;
  font-size: clamp(36px, 4.8vw, 64px);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -0.06em;
  text-wrap: balance;
}

.page-intro > div:first-child > p:last-child {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.65;
  text-wrap: pretty;
}

.local-processing-note {
  width: min(370px, 100%);
  padding: 16px 18px;
  border: 0;
  border-radius: var(--umi-radius-md);
  background: var(--sage-soft);
  box-shadow: inset 0 0 0 1px oklch(0.57 0.09 150 / 0.16);
  color: oklch(0.42 0.06 150);
  font-size: 12px;
  line-height: 1.65;
}

.local-processing-note strong {
  color: oklch(0.34 0.065 150);
  font-size: 13px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.62fr);
  gap: 24px;
}

.dropzone {
  position: relative;
  isolation: isolate;
  min-height: 610px;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding: 56px 53% 56px 48px;
  border: 0;
  border-radius: var(--umi-radius-lg);
  background-color: var(--panel);
  background-image:
    linear-gradient(90deg, oklch(0.99 0.012 72 / 0.99) 0%, oklch(0.99 0.012 72 / 0.97) 36%, oklch(0.99 0.012 72 / 0.2) 66%, transparent 100%),
    url("./umi-upscale-hero-v2.jpg");
  background-position: center, center;
  background-size: cover, cover;
  box-shadow: var(--umi-shadow-2);
  text-align: left;
  transition: transform 220ms ease-out, box-shadow 220ms ease-out;
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px dashed oklch(0.22 0.025 40 / 0.22);
  border-radius: 20px;
  pointer-events: none;
  transition: border-color 180ms ease-out, background 180ms ease-out;
}

.dropzone:hover,
.dropzone.is-dragging {
  background-color: var(--panel);
  box-shadow: 0 3px 6px oklch(0.22 0.025 40 / 0.08), 0 30px 80px oklch(0.22 0.025 40 / 0.15);
  transform: translateY(-2px);
}

.dropzone:hover::before,
.dropzone.is-dragging::before {
  border-color: var(--accent);
  background: oklch(0.67 0.19 22 / 0.025);
}

.dropzone > * {
  position: relative;
  z-index: 1;
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border: 0;
  border-radius: 20px 20px 20px 7px;
  background: var(--ink);
  color: var(--panel);
  box-shadow: 0 12px 26px oklch(0.22 0.025 40 / 0.18);
}

.dropzone h2 {
  max-width: 13ch;
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.dropzone > p:not(.eyebrow) {
  max-width: 34ch;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.65;
}

.format-row {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 28px;
}

.format-row span {
  min-height: 32px;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.78);
  box-shadow: inset 0 0 0 1px oklch(0.22 0.025 40 / 0.1);
  color: oklch(0.42 0.02 45);
  font-weight: 650;
}

.privacy-footnote,
.alert,
.guide-install-note {
  border: 0;
  border-radius: var(--umi-radius-md);
}

.privacy-footnote {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--sage-soft);
  box-shadow: inset 0 0 0 1px oklch(0.57 0.09 150 / 0.14);
  font-size: 12px;
}

.image-stage-card,
.control-section,
.guide-modal,
.install-help {
  border: 0;
  border-radius: var(--umi-radius-md);
  background: oklch(0.99 0.012 72 / 0.96);
  box-shadow: var(--umi-shadow-1);
}

.image-stage-card {
  overflow: hidden;
  border-radius: var(--umi-radius-lg);
  box-shadow: var(--umi-shadow-2);
}

.file-strip {
  min-height: 72px;
  padding: 14px 18px 14px 22px;
  border-bottom-color: oklch(0.22 0.025 40 / 0.09);
}

.file-strip button,
.guide-header > button {
  border: 0;
  border-radius: var(--umi-radius-sm);
  background: var(--umi-ivory-1);
}

.control-column {
  gap: 16px;
  top: 96px;
}

.control-section {
  padding: 24px;
}

.control-section h2 {
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.mode-grid,
.factor-grid,
.strength-grid {
  margin-top: 20px;
}

.mode-grid > button,
.factor-grid button,
.strength-grid button {
  border-color: oklch(0.22 0.025 40 / 0.1);
  border-radius: var(--umi-radius-sm);
  background: oklch(1 0 0 / 0.68);
  transition: transform 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, box-shadow 160ms ease-out;
}

.mode-grid > button:hover,
.factor-grid button:hover,
.strength-grid button:hover {
  border-color: oklch(0.22 0.025 40 / 0.2);
  box-shadow: 0 8px 18px oklch(0.22 0.025 40 / 0.06);
  transform: translateY(-1px);
}

.mode-grid > button.selected,
.factor-grid button.selected,
.strength-grid button.selected {
  border-color: oklch(0.67 0.19 22 / 0.45);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px oklch(0.67 0.19 22 / 0.14);
}

.mode-grid > button.selected {
  box-shadow: inset 4px 0 0 var(--accent);
}

.mode-icon {
  border-radius: 14px;
}

.output-size {
  border-radius: 999px;
  background: var(--umi-ivory-1);
  font-weight: 700;
}

.primary-button,
.download-button {
  min-height: 52px;
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 0 10px 22px oklch(0.67 0.19 22 / 0.22);
  font-size: 14px;
  transition: transform 160ms ease-out, background 160ms ease-out, box-shadow 160ms ease-out;
}

.primary-button:hover,
.download-button:hover {
  background: var(--umi-coral-deep);
  box-shadow: 0 13px 26px oklch(0.57 0.19 22 / 0.25);
  transform: translateY(-1px);
}

.primary-button:active,
.download-button:active {
  box-shadow: 0 5px 12px oklch(0.57 0.19 22 / 0.2);
  transform: translateY(1px);
}

.primary-button.cancel {
  background: var(--ink);
  box-shadow: 0 10px 22px oklch(0.22 0.025 40 / 0.17);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--umi-ivory-1);
}

.progress-track span {
  border-radius: inherit;
}

.result-actions select,
.reset-button {
  border-color: oklch(0.22 0.025 40 / 0.11);
  border-radius: var(--umi-radius-sm);
}

.guide-backdrop {
  background: oklch(0.18 0.02 40 / 0.76);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.guide-modal {
  overflow: hidden;
  border-radius: var(--umi-radius-lg);
  box-shadow: 0 30px 90px oklch(0.12 0.02 40 / 0.3);
}

.guide-header {
  padding: 32px;
}

.guide-steps {
  padding-inline: 32px;
}

.guide-number {
  font-size: 11px;
}

.guide-icon {
  border-radius: 14px;
}

.fullscreen-backdrop {
  background: oklch(0.15 0.018 40 / 0.96);
}

footer {
  width: min(1360px, calc(100% - 48px));
  padding: 28px 0 40px;
  border-top-color: oklch(0.22 0.025 40 / 0.1);
  font-size: 10px;
}

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

  .control-column {
    position: static;
  }

  .dropzone {
    min-height: 560px;
  }
}

@media (max-width: 720px) {
  body {
    background:
      radial-gradient(circle at 0 5%, oklch(0.93 0.045 28 / 0.62), transparent 18rem),
      var(--bg);
  }

  .app-header {
    min-height: 64px;
    padding: 10px 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px 13px 13px 5px;
  }

  .brand-lockup strong {
    font-size: 15px;
  }

  .page-frame {
    width: min(100% - 24px, 1360px);
    padding-top: 32px;
  }

  .page-intro {
    display: block;
    margin-bottom: 24px;
  }

  .page-intro h1 {
    max-width: none;
    font-size: clamp(36px, 11vw, 48px);
  }

  .local-processing-note {
    margin-top: 20px;
  }

  .dropzone {
    min-height: 620px;
    justify-content: flex-start;
    padding: 42px 28px 350px;
    background-image:
      linear-gradient(180deg, oklch(0.99 0.012 72 / 0.99) 0%, oklch(0.99 0.012 72 / 0.94) 34%, oklch(0.99 0.012 72 / 0.15) 63%, transparent 100%),
      url("./umi-upscale-hero-v2.jpg");
    background-position: center, 70% bottom;
    background-size: cover, auto 66%;
  }

  .dropzone h2 {
    max-width: none;
    font-size: 30px;
  }

  .dropzone > p:not(.eyebrow) {
    font-size: 14px;
  }

  .format-row {
    margin-top: 20px;
  }

  .control-section {
    padding: 20px;
  }

  .guide-modal {
    border-radius: 20px;
  }

  footer {
    width: calc(100% - 24px);
  }
}

@media (max-width: 390px) {
  .brand-lockup span:last-child {
    display: none;
  }

  .dropzone {
    min-height: 600px;
    padding-inline: 24px;
    background-size: cover, auto 60%;
  }

  .format-row span {
    padding-inline: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
