@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f6f9fc;
  --surface-dark: #0a2540;
  --text: #0a2540;
  --text-2: #425466;
  --text-3: #8898aa;
  --border: #e3e8ee;
  --primary: #635bff;
  --primary-hover: #4f46e5;
  --accent-purple: #9333ea;
  --accent-pink: #ff5a5f;
  --accent-cyan: #00d4ff;
  --accent-orange: #ffb74d;
  --success: #24b47e;
  --error: #e25950;
  --shadow-sm: 0 1px 3px rgba(50, 50, 93, 0.08);
  --shadow-md: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 35px rgba(50, 50, 93, 0.12), 0 5px 15px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 30px 60px rgba(50, 50, 93, 0.15), 0 18px 36px rgba(0, 0, 0, 0.08);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
::selection { background: var(--primary); color: white; }

/* ========== NAV ========== */
nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
nav .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em;
}
.logo:hover { color: var(--text); }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.4);
  color: white;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: var(--font);
}
.nav-links {
  display: flex; gap: 28px; align-items: center;
  font-size: 15px; font-weight: 500;
}
.nav-links a { color: var(--text-2); text-decoration: none; transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-lang {
  display: inline-flex; align-items: center; gap: 10px;
  padding-left: 22px; margin-left: 6px;
  border-left: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
}
.nav-lang a { color: var(--text-3); }
.nav-lang a.active { color: var(--primary); font-weight: 600; }

/* Hamburger toggle (mobile only) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  transition: background 0.12s;
  flex-shrink: 0;
  font-family: inherit;
}
.nav-toggle:hover { background: var(--surface-alt); }
.hero-wrap .nav-toggle { color: white; }
.hero-wrap .nav-toggle:hover { background: rgba(255,255,255,0.12); }

/* ========== HERO WRAP (dark mesh) ========== */
.hero-wrap {
  position: relative; overflow: hidden;
  background-color: #0a2540;
  background-image:
    radial-gradient(at 18% 28%, rgba(99, 91, 255, 0.65) 0, transparent 55%),
    radial-gradient(at 85% 18%, rgba(255, 90, 95, 0.45) 0, transparent 55%),
    radial-gradient(at 52% 92%, rgba(0, 212, 255, 0.4) 0, transparent 55%),
    radial-gradient(at 82% 78%, rgba(147, 51, 234, 0.5) 0, transparent 55%);
  color: white;
}
.hero-wrap nav {
  background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: none; position: relative;
}
.hero-wrap .logo { color: white; }
.hero-wrap .nav-links a { color: rgba(255,255,255,0.75); }
.hero-wrap .nav-links a:hover,
.hero-wrap .nav-links a.active { color: white; }
.hero-wrap .nav-lang { border-left-color: rgba(255,255,255,0.15); }
.hero-wrap .nav-lang a { color: rgba(255,255,255,0.5); }
.hero-wrap .nav-lang a.active { color: white; font-weight: 600; }

/* ========== HERO ========== */
.hero {
  padding: 56px 0 48px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-wrap .hero {
  padding: 96px 0 140px;
  text-align: left;
}
.hero h1 {
  font-size: clamp(36px, 5.5vw, 68px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 0 0 20px;
  color: var(--text);
}
.hero-wrap .hero h1 {
  color: white;
  font-size: clamp(44px, 7.2vw, 92px);
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 16ch;
  margin-bottom: 28px;
}
.gradient-text {
  background: linear-gradient(90deg, #a5b4fc 0%, #e0aaff 50%, #fda4af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--text-2);
  max-width: 54ch;
  margin: 0 auto 28px;
  line-height: 1.55;
}
.hero-wrap .hero .lead {
  color: rgba(255,255,255,0.8);
  margin: 0 0 40px;
  max-width: 50ch;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
}
.badges {
  display: flex; gap: 24px; flex-wrap: wrap;
  justify-content: center;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
}
.hero-wrap .badges {
  justify-content: flex-start;
  color: rgba(255,255,255,0.85);
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  color: inherit;
}
.badge::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--success);
}
.badge.success::before { background: var(--success); }
.badge.primary::before { background: var(--primary); }
.badge.warm::before { background: var(--accent-pink); }

/* ========== SECTIONS ========== */
section { padding: 96px 0; position: relative; }
section h2 {
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 16px;
  max-width: 20ch;
}
section .section-sub {
  color: var(--text-2); font-size: 17px;
  margin: 0 0 48px; max-width: 54ch;
  line-height: 1.55;
}
.section-label {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

/* ========== TOOL GRID ========== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.tool-link {
  display: flex; flex-direction: column; gap: 14px;
  padding: 32px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-decoration: none; color: inherit;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s, border-color 0.2s;
  position: relative; overflow: hidden;
}
.tool-link::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--accent-pink));
  opacity: 0; transition: opacity 0.2s;
}
.tool-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  text-decoration: none;
}
.tool-link:hover::before { opacity: 1; }
.tool-link .tool-content {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
}
.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
  margin-bottom: 4px;
}
.tool-title {
  font-size: 20px; font-weight: 700;
  margin: 0; letter-spacing: -0.015em;
  color: var(--text);
}
.tool-desc {
  font-size: 15px; color: var(--text-2);
  margin: 0; line-height: 1.55;
}
.tool-tag {
  font-size: 12px; font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ========== FEATURES ========== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.feature { padding: 0; }
.feature-num {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: white;
  display: grid; place-items: center;
  margin-bottom: 22px;
  font-weight: 700; font-size: 18px;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.25);
}
.feature h3 {
  font-size: 21px; font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0; color: var(--text-2);
  font-size: 16px; line-height: 1.55;
}

/* ========== TOOL CARD (tool pages) ========== */
.tool-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-alt);
}
.drop:hover, .drop.drag {
  border-color: var(--primary);
  background: #eef2ff;
}
.drop-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: white;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.3);
}
.drop-label { font-size: 17px; font-weight: 600; color: var(--text); }
.drop-sub { font-size: 14px; color: var(--text-2); margin-top: 8px; }
input[type="file"].hidden { display: none; }

.file-count-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; gap: 10px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.file-count { font-size: 14px; font-weight: 500; color: var(--text); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px; margin-top: 18px;
  max-height: 300px; overflow-y: auto;
  padding: 2px;
}
.thumb {
  position: relative; aspect-ratio: 1;
  border-radius: 10px; overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .size {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  font-size: 10px; padding: 3px 5px;
  background: rgba(10, 37, 64, 0.85); color: white;
  border-radius: 4px; text-align: center; font-weight: 500;
}
.thumb .status-dot {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--text-3); transition: background 0.2s;
}
.thumb.done .status-dot { background: var(--success); }
.thumb.error .status-dot { background: var(--error); }
.thumb.loading {
  background: linear-gradient(90deg, var(--surface-alt) 25%, #e9eef5 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.file-list {
  display: flex; flex-direction: column;
  max-height: 320px; overflow-y: auto;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.file-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.file-item:last-child { border-bottom: none; }
.file-item.done { background: #ecfdf5; }
.file-item.error { background: #fef2f2; }
.file-icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--surface-alt); color: var(--text-2);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  font-family: ui-monospace, monospace;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-status { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.file-dot {
  width: 9px; height: 9px; border-radius: 999px;
  background: var(--text-3); flex-shrink: 0;
}
.file-item.done .file-dot { background: var(--success); }
.file-item.error .file-dot { background: var(--error); }

/* ========== SETTINGS / FIELDS ========== */
.settings {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px; margin-top: 28px;
}
.settings.two { grid-template-columns: 1fr 1fr; }
.settings.four { grid-template-columns: repeat(4, 1fr); }
.field label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
}
.field input[type="number"],
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: white;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
}
.field textarea {
  resize: vertical; min-height: 90px;
  font-family: ui-monospace, monospace;
  font-size: 14px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.12);
}
.field input[type="range"] { width: 100%; accent-color: var(--primary); }
.field input[type="color"] {
  width: 100%; height: 44px; padding: 3px;
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; background: white;
}
.quality-row { display: flex; align-items: center; gap: 12px; }
.quality-val {
  font-size: 14px; color: var(--text);
  min-width: 44px; text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.hint {
  font-size: 13px; color: var(--text-2);
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--surface-alt);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  line-height: 1.5;
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.ratio-btn {
  padding: 12px 10px;
  border: 1px solid var(--border);
  background: white; color: var(--text-2);
  font-size: 14px; font-weight: 600;
  border-radius: 8px; cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.ratio-btn:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}
.ratio-btn.active {
  background: var(--primary); color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.3);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-height: 84px;
}
.preset-btn:hover:not(.active) {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.preset-btn.active {
  border-color: rgba(99, 91, 255, 0.35);
  background: linear-gradient(180deg, rgba(99, 91, 255, 0.08) 0%, rgba(255, 255, 255, 1) 72%);
  box-shadow: 0 10px 24px rgba(99, 91, 255, 0.12);
}
.preset-btn .p-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.preset-btn .p-meta {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.45;
}

/* ========== ANCHOR GRID (crop position) ========== */
.anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 180px;
}
.anchor-btn {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.12s;
  padding: 0;
  font-family: inherit;
  min-height: 42px;
}
.anchor-btn::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--text-3);
  transition: background 0.12s;
}
.anchor-btn.a-tl::before { top: 22%; left: 22%; }
.anchor-btn.a-tc::before { top: 22%; left: 50%; margin-left: -4px; }
.anchor-btn.a-tr::before { top: 22%; right: 22%; }
.anchor-btn.a-ml::before { top: 50%; left: 22%; margin-top: -4px; }
.anchor-btn.a-mc::before { top: 50%; left: 50%; margin: -4px 0 0 -4px; }
.anchor-btn.a-mr::before { top: 50%; right: 22%; margin-top: -4px; }
.anchor-btn.a-bl::before { bottom: 22%; left: 22%; }
.anchor-btn.a-bc::before { bottom: 22%; left: 50%; margin-left: -4px; }
.anchor-btn.a-br::before { bottom: 22%; right: 22%; }
.anchor-btn:hover:not(.active) { border-color: var(--primary); }
.anchor-btn:hover:not(.active)::before { background: var(--primary); }
.anchor-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 91, 255, 0.3);
}
.anchor-btn.active::before { background: white; }

/* ========== BUTTONS ========== */
.actions {
  display: flex; gap: 12px; margin-top: 28px;
  flex-wrap: wrap;
}
button {
  padding: 12px 24px;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: -0.005em;
}
button:active:not(:disabled) { transform: translateY(1px); }
button.primary {
  background: var(--primary); color: white;
  box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
}
button.primary:hover:not(:disabled) {
  background: #7a73ff;
  box-shadow: 0 6px 20px rgba(99, 91, 255, 0.4);
  transform: translateY(-1px);
}
button.ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
}
button.ghost:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text); border-color: var(--text-3);
}
button:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }

/* ========== PROGRESS / SUMMARY ========== */
.progress-wrap {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px; overflow: hidden;
  margin-top: 20px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  transition: width 0.2s;
  border-radius: 999px;
}
.status {
  font-size: 14px; color: var(--text-2);
  margin-top: 12px; min-height: 18px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 20px;
}
.summary .box {
  background: var(--surface-alt);
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.summary .k {
  color: var(--text-3);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.summary .v {
  font-weight: 700; font-size: 24px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.summary .saved {
  background: linear-gradient(135deg, #eef2ff, #f3e8ff);
  border-color: rgba(99, 91, 255, 0.2);
}
.summary .saved .v { color: var(--primary); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.checkbox-row input {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  margin-top: 24px;
  align-items: start;
}
.studio-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}
.studio-stage {
  background: linear-gradient(180deg, rgba(246, 249, 252, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  min-width: 0;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.preview-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.preview-meta {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.canvas-shell {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(99, 91, 255, 0.26);
  background:
    radial-gradient(circle at top left, rgba(99, 91, 255, 0.08), transparent 38%),
    radial-gradient(circle at bottom right, rgba(255, 90, 95, 0.07), transparent 36%),
    white;
}
.canvas-shell canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  background: white;
  box-shadow: 0 18px 34px rgba(10, 37, 64, 0.14);
  cursor: grab;
  touch-action: none;
}
.canvas-shell canvas.dragging { cursor: grabbing; }
.preview-caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.logo-upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ========== FAQ ========== */
details.faq-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
details.faq-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
details.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 16px;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text);
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: '+';
  color: var(--primary);
  font-size: 24px; font-weight: 300; line-height: 1;
}
details.faq-item[open] summary::after { content: '−'; }
details.faq-item p {
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 15px; line-height: 1.65;
}

/* ========== FOOTER ========== */
footer {
  background: var(--surface-alt);
  padding: 72px 0;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px; flex-wrap: wrap;
}
footer .foot-title {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 4px;
}
footer .foot-desc {
  color: var(--text-2); font-size: 15px;
}
footer .foot-copyright {
  color: var(--text-3); font-size: 12px;
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.foot-meta {
  font-size: 14px; color: var(--text-2);
  text-decoration: none; font-weight: 500;
}
.foot-meta:hover { color: var(--primary); }
.bmc-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.bmc-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.toss-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: #0064ff;
  border: 1px solid #0064ff;
  color: white;
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.toss-btn:hover {
  background: #0052d6;
  border-color: #0052d6;
  color: white;
  box-shadow: 0 4px 14px rgba(0, 100, 255, 0.25);
  transform: translateY(-1px);
  text-decoration: none;
}
.kakao-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: #fee500;
  border: 1px solid #fee500;
  color: #191919;
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.kakao-btn:hover {
  background: #fdd835;
  border-color: #fdd835;
  color: #000;
  box-shadow: 0 4px 14px rgba(254, 229, 0, 0.35);
  transform: translateY(-1px);
  text-decoration: none;
}
[data-show] { display: none; }

/* Donation modal (Toss amount picker) */
.rz-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rz-modal.hidden { display: none; }
.rz-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 37, 64, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.rz-modal-card {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 28px 24px 18px;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  z-index: 1;
}
.rz-modal-card h3 {
  font-size: 20px; font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
}
.rz-modal-sub {
  font-size: 14px; color: var(--text-2);
  margin: 0 0 20px;
}
.rz-amounts {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 10px;
}
.rz-amounts button {
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-size: 16px; font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
  font-family: inherit;
}
.rz-amounts button:hover {
  background: #0064ff; color: white;
  border-color: #0064ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 100, 255, 0.25);
}
.rz-modal-close {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  margin-top: 4px;
}
.rz-modal-close:hover { color: var(--text); }
.rz-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: white;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.rz-qr-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ========== QR LAYOUT ========== */
.qr-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px; align-items: start;
}
.qr-preview {
  display: grid; place-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px; aspect-ratio: 1;
}
.qr-preview-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.qr-preview canvas, .qr-preview svg {
  max-width: 100%; max-height: 100%;
  display: block;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  section { padding: 72px 0; }
  .hero-wrap .hero { padding: 72px 0 100px; }
  .features { grid-template-columns: 1fr; gap: 32px; }
  .tool-card { padding: 28px; }
  .qr-layout { grid-template-columns: 1fr; gap: 24px; }
  .studio-layout { grid-template-columns: 1fr; }
  .canvas-shell { min-height: 340px; }
}
@media (max-width: 720px) {
  .container { padding: 0 24px; }
  nav .inner {
    height: 60px;
    gap: 12px;
  }
  .logo { font-size: 17px; flex-shrink: 0; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: white;
    box-shadow: 0 20px 40px -12px rgba(10, 37, 64, 0.22);
    padding: 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, padding 0.28s ease;
    font-size: 15px;
  }
  nav.open .nav-links {
    max-height: 640px;
    padding: 12px 12px 16px;
  }
  .nav-links a {
    padding: 13px 14px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0;
    transition: background 0.12s;
  }
  .nav-links a:hover { background: var(--surface-alt); }
  .nav-links a.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
  }
  .nav-lang {
    display: flex;
    margin: 14px 6px 2px;
    padding: 4px;
    background: var(--surface-alt);
    border: none;
    border-radius: 10px;
    gap: 0;
    justify-content: stretch;
  }
  .nav-lang a {
    flex: 1;
    padding: 8px 12px;
    border-radius: 7px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    transition: all 0.12s;
  }
  .nav-lang a:hover { color: var(--text); }
  .nav-lang a.active {
    background: white;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(10, 37, 64, 0.08);
  }
  .hero-wrap .nav-links { background: white; }
  .hero-wrap .nav-links a { color: var(--text); }
  .hero-wrap .nav-links a.active { background: #eef2ff; color: var(--primary); }
  .hero-wrap .nav-lang { background: var(--surface-alt); }
  .hero-wrap .nav-lang a { color: var(--text-3); }
  .hero-wrap .nav-lang a.active { background: white; color: var(--text); }

  .hero { padding: 56px 0 40px; }
  .hero-wrap .hero { padding: 56px 0 96px; }
  .hero h1 { font-size: clamp(30px, 7.5vw, 44px); margin-bottom: 18px; }
  .hero-wrap .hero h1 { font-size: clamp(34px, 9vw, 52px); margin-bottom: 24px; }
  .hero .lead { font-size: 15px; line-height: 1.55; margin-bottom: 24px; max-width: none; }
  .hero-wrap .hero .lead { font-size: 16px; margin-bottom: 28px; max-width: none; }
  .badges { gap: 18px; font-size: 13px; justify-content: flex-start; }
  body:not(:has(.hero-wrap)) .badges, .hero:not(.hero-wrap .hero) .badges { justify-content: center; }
  .section-label { font-size: 11px; margin-bottom: 10px; }

  section { padding: 56px 0; }
  section h2 { font-size: clamp(26px, 7vw, 38px); }
  section .section-sub { font-size: 15px; margin-bottom: 32px; }

  .tool-grid { grid-template-columns: 1fr; gap: 14px; }
  .tool-link { padding: 24px; }
  .tool-title { font-size: 18px; }
  .tool-desc { font-size: 14px; }

  .feature h3 { font-size: 19px; }
  .feature p { font-size: 15px; }

  .settings, .settings.two, .settings.four { grid-template-columns: 1fr; gap: 14px; }
  .summary { grid-template-columns: 1fr; gap: 8px; }
  .summary .v { font-size: 20px; }

  .tool-card { padding: 22px; }
  .drop { padding: 40px 20px; }
  .drop-label { font-size: 15px; }
  .drop-icon { width: 48px; height: 48px; }

  .actions { flex-direction: column; gap: 10px; }
  .actions button { width: 100%; }

  details.faq-item { padding: 16px 18px; }
  details.faq-item summary { font-size: 15px; }
  details.faq-item p { font-size: 14px; }

  footer { padding: 36px 0 48px; }
  footer .inner { flex-direction: column; gap: 18px; align-items: stretch; }
  footer .foot-title { font-size: 19px; }
  footer .foot-desc { font-size: 14px; }
  footer .foot-copyright { font-size: 11px; margin-top: 6px; }
  footer .inner > div:last-child {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .bmc-link, .toss-btn, .kakao-btn {
    padding: 9px 14px;
    font-size: 12px;
  }

  .thumbs { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .file-item { padding: 10px 12px; gap: 10px; }
  .file-icon { width: 32px; height: 32px; font-size: 9px; }

  .ratio-grid { grid-template-columns: repeat(4, 1fr); }
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .canvas-shell { min-height: 280px; padding: 14px; }
  .preview-toolbar { flex-direction: column; align-items: stretch; }
  .preview-toolbar button { width: 100%; }
  .logo-upload-row { align-items: stretch; }
}
@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .hero h1 { font-size: 28px; }
  .hero-wrap .hero h1 { font-size: 32px; }
  section h2 { font-size: 24px; }
  .tool-link { padding: 20px; }
  .tool-card { padding: 18px; }
  .drop { padding: 32px 16px; }
  .ratio-grid { grid-template-columns: repeat(3, 1fr); }
  .preset-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 16px; font-size: 12px; }
  .nav-lang { padding-left: 10px; gap: 8px; font-size: 11px; }
  .bmc-link, .toss-btn, .kakao-btn { padding: 8px 12px; font-size: 12px; }
}
