:root {
  --ink: #14213d;
  --muted: #64748b;
  --line: #dce5f0;
  --paper: #ffffff;
  --wash: #f4f8fc;
  --blue: #1565d8;
  --blue-dark: #0f4ca4;
  --mint: #13b8a6;
  --danger: #c83b4d;
  --shadow: 0 18px 48px rgba(20, 33, 61, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(21, 101, 216, .10), transparent 28rem),
    linear-gradient(180deg, #f9fcff 0, var(--wash) 32rem, #fff 100%);
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 229, 240, .86);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: -.04em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), #3388f6);
  box-shadow: 0 8px 18px rgba(21, 101, 216, .28);
  font-size: .78rem;
  letter-spacing: -.05em;
}

.main-nav { display: flex; flex-wrap: wrap; gap: 5px; }
.main-nav a {
  padding: 8px 11px;
  border-radius: 9px;
  color: #43516a;
  font-size: .9rem;
  font-weight: 650;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--blue);
  background: #eaf3ff;
}

.page-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 80px;
}

.intro { max-width: 760px; margin-bottom: 26px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  margin-bottom: 12px;
  border: 1px solid #bed6f6;
  border-radius: 999px;
  color: var(--blue-dark);
  background: #eff6ff;
  font-size: .82rem;
  font-weight: 750;
}
h1, h2, h3 { line-height: 1.28; letter-spacing: -.045em; }
h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.15rem); }
h2 { margin: 0 0 15px; font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { margin: 0 0 8px; font-size: 1.05rem; }
.lead { margin: 0; color: #526078; font-size: 1.04rem; }

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  color: #08796d;
  font-size: .9rem;
  font-weight: 700;
}
.privacy-note::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(19, 184, 166, .12);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, .75fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.upload-panel { padding: 22px; }
.settings-panel {
  position: sticky;
  top: 90px;
  padding: 22px;
}

.dropzone {
  min-height: 240px;
  padding: 30px;
  border: 2px dashed #b9c9dd;
  border-radius: 17px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(145deg, #f9fbff, #f2f7fd);
  transition: border-color .18s, background .18s, transform .18s;
}
.dropzone.is-over {
  border-color: var(--blue);
  background: #eaf3ff;
  transform: translateY(-2px);
}
.drop-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--blue);
  background: #e4f0ff;
  font-size: 1.8rem;
  font-weight: 300;
}
.dropzone strong { display: block; margin-bottom: 5px; font-size: 1.08rem; }
.dropzone p { margin: 0 0 17px; color: var(--muted); font-size: .9rem; }

.button {
  min-height: 46px;
  padding: 10px 17px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  transition: transform .15s, background .15s, opacity .15s;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(21, 101, 216, .25);
  outline-offset: 2px;
}
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: var(--blue); background: #eaf3ff; }
.button-ghost { color: #43516a; background: #edf2f7; }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.button-wide { width: 100%; }

.file-list { display: grid; gap: 10px; margin-top: 16px; }
.file-row {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  background: #fff;
}
.file-thumb {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--wash);
}
.file-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: #eaf3ff;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: -.03em;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .91rem; }
.file-meta { color: var(--muted); font-size: .78rem; }
.remove-file {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: #7b8799;
  background: #f2f5f8;
  font-size: 1.15rem;
}
.remove-file:hover { color: var(--danger); background: #fff0f2; }

.setting-group { margin: 0 0 19px; }
.setting-label { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 750; }
.setting-hint { margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.input-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.input-row span { color: #94a3b8; }
input[type="number"], select, input[type="color"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd7e5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
input[type="number"], select { padding: 9px 11px; }
input[type="color"] { padding: 4px; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-value {
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 7px;
  text-align: center;
  color: var(--blue-dark);
  background: #eaf3ff;
  font-size: .82rem;
  font-weight: 800;
}
.check-row { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }

.status {
  min-height: 26px;
  margin: 12px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .86rem;
}
.status.error { color: var(--danger); }
.status.success { color: #08796d; font-weight: 700; }

.video-preview-wrap {
  display: none;
  margin-top: 16px;
}
.video-preview-wrap.is-visible { display: block; }
.video-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 15px;
  background: #0b1220;
}
.video-summary {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.summary-chip {
  padding: 4px 9px;
  border-radius: 999px;
  color: #43516a;
  background: #edf3f9;
  font-size: .78rem;
  font-weight: 700;
}
.progress-wrap {
  display: none;
  margin-top: 13px;
}
.progress-wrap.is-visible { display: block; }
.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .8rem;
}
.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}
.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint));
  transition: width .2s linear;
}
.support-note {
  padding: 11px 12px;
  border-radius: 11px;
  color: #526078;
  background: #f4f7fb;
  font-size: .78rem;
  line-height: 1.5;
}

.background-controls {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 9px;
  align-items: center;
}
.background-controls input[type="color"]:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.preview-wrap {
  display: none;
  margin-top: 18px;
}
.preview-wrap.is-visible { display: block; }
.preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.preview-head strong { font-size: .95rem; }
.preview-head span { color: var(--muted); font-size: .78rem; }
.transparent-stage {
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: crosshair;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e6ebf1 25%, transparent 25%),
    linear-gradient(-45deg, #e6ebf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6ebf1 75%),
    linear-gradient(-45deg, transparent 75%, #e6ebf1 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.transparent-stage:focus-visible {
  outline: 3px solid rgba(21, 101, 216, .25);
  outline-offset: 2px;
}
.transparent-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 430px;
  width: auto;
  height: auto;
  box-shadow: 0 8px 24px rgba(20, 33, 61, .12);
}
.selected-color-note {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.profile-editor-wrap {
  display: none;
  margin-top: 18px;
}
.profile-editor-wrap.is-visible { display: block; }
.profile-stage {
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 17px;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e6ebf1 25%, transparent 25%),
    linear-gradient(-45deg, #e6ebf1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6ebf1 75%),
    linear-gradient(-45deg, transparent 75%, #e6ebf1 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.profile-stage.is-dragging { cursor: grabbing; }
.profile-stage:focus-visible {
  outline: 3px solid rgba(21, 101, 216, .25);
  outline-offset: 2px;
}
.profile-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.profile-help {
  margin: 10px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
}
.inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.inline-actions .button { min-height: 40px; padding: 8px 12px; font-size: .84rem; }

.tool-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 30px 0 54px;
}
.tool-link {
  min-height: 92px;
  padding: 15px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .78);
}
.tool-link:hover { border-color: #8eb9ee; background: #fff; box-shadow: 0 10px 24px rgba(20,33,61,.08); }
.tool-link b { display: block; margin-bottom: 3px; font-size: .92rem; }
.tool-link span { color: var(--muted); font-size: .78rem; line-height: 1.45; }

.content-section {
  padding: 30px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.84);
}
.content-section p { color: #526078; }
.steps {
  margin: 0;
  padding-left: 22px;
  color: #526078;
}
.steps li + li { margin-top: 7px; }
.faq { display: grid; gap: 12px; }
.faq details { padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.faq summary { cursor: pointer; font-weight: 750; }
.faq p { margin: 9px 0 0; }

.legal-page { max-width: 820px; }
.legal-page section { margin-top: 32px; }
.legal-page p, .legal-page li { color: #526078; }
.legal-page a:not(.button) { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.contact-card {
  padding: 26px;
  border: 1px solid #bed6f6;
  border-radius: 20px;
  background: linear-gradient(145deg, #fff, #f2f7fd);
}
.contact-address {
  display: inline-block;
  font-size: 1.08rem;
  font-weight: 800;
}
.contact-card p { margin: 20px 0 0; }

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}
.footer-inner {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: .82rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 15px; }
.footer-links a:hover { color: var(--blue); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hidden { display: none !important; }

@media (max-width: 820px) {
  .header-inner { padding: 10px 0; align-items: flex-start; flex-direction: column; gap: 7px; }
  .site-header { position: static; }
  .main-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .main-nav a { white-space: nowrap; }
  .page-shell { padding-top: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .settings-panel { position: static; }
  .tool-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .header-inner, .page-shell, .footer-inner { width: min(100% - 22px, 1040px); }
  .upload-panel, .settings-panel { padding: 15px; }
  .dropzone { min-height: 220px; padding: 22px 14px; }
  .tool-links { grid-template-columns: 1fr 1fr; }
  .content-section { padding: 22px 18px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
