@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400&display=swap");
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --ink: #171717;
  --body: #4d4d4d;
  --mute: #888888;
  --line: #ebebeb;
  --line-strong: #a1a1a1;
  --canvas: #ffffff;
  --soft: #fafafa;
  --soft-2: #f5f5f5;
  --link: #0070f3;
  --error: #ee0000;
  --error-soft: #f7d4d6;
  --warning-deep: #ab570a;
  --warning-soft: #ffefcf;
  --sans: "Geist", "Pretendard Variable", Pretendard, -apple-system, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ring: 0 0 0 1px rgba(0, 0, 0, 0.08);
  --lift: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 2px rgba(0, 0, 0, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
::selection { background: var(--ink); color: #f2f2f2; }
a { color: inherit; }
img, canvas, video, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  height: 56px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.bar a { text-decoration: none; }
.bar .home { font-weight: 600; letter-spacing: -0.3px; }
.bar .sep { color: var(--line-strong); }
.bar .here { color: var(--body); }
.bar .all { margin-left: auto; color: var(--body); }
.bar .all:hover { color: var(--ink); }

/* page */
.page { width: min(1200px, 100% - 48px); margin: 0 auto; padding: 48px 0 96px; }
.head { margin-bottom: 32px; max-width: 720px; }
.head h1 {
  margin: 0 0 8px;
  font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -1.28px;
}
.head p { margin: 0; color: var(--body); font-size: 16px; line-height: 24px; }

/* workspace: controls left, stage right */
.work {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.work.single { grid-template-columns: minmax(0, 1fr); }
.panel {
  background: var(--canvas);
  border-radius: 8px;
  box-shadow: var(--lift);
  padding: 20px;
}
.panel + .panel { margin-top: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: -0.28px; }
.stage {
  position: relative;
  min-height: 420px;
  background: var(--canvas);
  border-radius: 8px;
  box-shadow: var(--lift);
  overflow: hidden;
}

/* file drop: the empty stage itself */
.drop {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 32px; text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  margin: 12px;
  color: var(--body);
  cursor: pointer;
  transition: background 0.12s;
}
.drop:hover, .drop.over { background: var(--soft); }
.drop strong { color: var(--ink); font-weight: 500; font-size: 16px; }
.drop small { color: var(--mute); font-size: 13px; }
.drop[hidden] { display: none; }
/* Empty state: the dashed drop zone is the only frame, no card around it. */
.stage:has(> .drop:not([hidden])) { background: transparent; box-shadow: none; }
.stage:has(> .drop:not([hidden])) > .drop { margin: 0; background: var(--canvas); }
.stage:has(> .drop:not([hidden])) > .drop:hover, .stage:has(> .drop:not([hidden])) > .drop.over { background: var(--soft-2); }

/* fields */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > span, .label { font-size: 13px; font-weight: 500; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.field output, .value { font-family: var(--mono); font-size: 12px; color: var(--body); font-weight: 400; }
.hint { font-size: 13px; color: var(--mute); line-height: 18px; margin: 0; }
input[type="text"], input[type="search"], input[type="number"], input[type="url"], input[type="password"], select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
}
textarea { height: auto; min-height: 120px; padding: 8px 10px; line-height: 20px; resize: vertical; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }
input[type="range"] { width: 100%; accent-color: var(--ink); }
input[type="color"] { width: 36px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); }

/* segmented choice */
.seg { display: inline-flex; padding: 2px; background: var(--soft-2); border-radius: 6px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--body); font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--canvas); color: var(--ink); box-shadow: var(--ring); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 0; border-radius: 6px;
  background: var(--canvas); color: var(--ink);
  box-shadow: var(--ring);
  font-size: 14px; font-weight: 500; letter-spacing: -0.28px;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
}
.btn:hover { background: var(--soft-2); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #383838; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn.block { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }

/* status line + progress */
.status { font-size: 13px; color: var(--body); min-height: 20px; margin: 12px 0 0; }
.status.error { color: var(--error); }
.progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.15s; }
.progress[hidden] { display: none; }

/* result helpers */
.meta { font-family: var(--mono); font-size: 12px; color: var(--body); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.compare > figure { margin: 0; background: var(--canvas); padding: 12px; }
.compare figcaption { font-size: 12px; color: var(--mute); margin-bottom: 8px; font-family: var(--mono); }
.checker {
  background-color: #fff;
  background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font: 400 12px/16px var(--mono); color: var(--body); background: var(--soft); padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

.foot { width: min(1200px, 100% - 48px); margin: 0 auto; padding: 24px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--body); text-decoration: none; }
.foot a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .page { width: calc(100% - 32px); padding-top: 32px; }
  .head h1 { font-size: 26px; line-height: 32px; letter-spacing: -0.9px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 300px; }
  .bar { padding: 0 16px; }
  .compare { grid-template-columns: 1fr; }
}
