:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f8;
  --text: #1a1a1a;
  --text-muted: #666666;
  --border: #e5e5e7;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 680px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.logo span { color: var(--accent); }

.site-nav a {
  margin-left: 20px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 56px 0 24px;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 12px;
}

.hero-sub {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* Tool hub */
.tool-hub .container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding-bottom: 16px;
}

.tool-card {
  flex: 1 1 160px;
  max-width: 220px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.tool-card:hover { border-color: var(--accent); background: var(--bg-alt); }

.tool-card.active {
  border-color: var(--accent);
  background: var(--bg-alt);
}

.tool-card strong { display: block; margin-bottom: 4px; }
.tool-card span { font-size: 0.82rem; color: var(--text-muted); }

/* Tool section */
.tool-section {
  padding: 24px 0 56px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--bg-alt);
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drop-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.editor.hidden,
.drop-zone.hidden { display: none; }

#preview {
  width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  background: #000;
  display: block;
  margin-bottom: 20px;
}

.timeline-wrap { margin-bottom: 24px; }

/* ICO crop */
.crop-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 20px;
  user-select: none;
  touch-action: none;
}

.crop-container img {
  display: block;
  max-width: 100%;
  max-height: 480px;
}

.crop-box {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(37, 99, 235, 0.15);
  cursor: move;
}

.crop-resize {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
}

.size-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.timeline {
  position: relative;
  height: 10px;
  background: var(--border);
  border-radius: 6px;
  margin: 24px 0;
}

.track-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
}

.handle {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.handle:active { cursor: grabbing; }

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.direction-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95rem;
}

.radio-label:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-alt);
}

.arrow-symbol {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #aac1f5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-alt); }

.status {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.progress-wrap {
  margin-top: 8px;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-wrap.hidden { display: none; }

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s;
}

.error-box {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 0.9rem;
}

.error-box.hidden { display: none; }

/* Sequence panel */
.sequence-panel {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.sequence-panel.hidden { display: none; }

.sequence-panel h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.sequence-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 16px;
}

.sequence-track {
  display: flex;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.sequence-block {
  background: var(--accent);
  border-right: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 4px;
}

.sequence-total {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sequence-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.sequence-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.sequence-list .remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
}

/* Content sections */
.content-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.content-section.alt { background: var(--bg-alt); }

.content-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.steps li { margin-bottom: 14px; }

.faq-item { margin-bottom: 24px; }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.faq-item p { color: var(--text-muted); margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer nav { margin-top: 8px; }
.site-footer nav a {
  margin: 0 8px;
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer nav a:hover { text-decoration: underline; }

/* Static pages */
.page-content {
  padding: 56px 0;
}

.page-content h1 { margin-bottom: 24px; }
.page-content h2 { margin-top: 32px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .site-nav a { margin-left: 12px; font-size: 0.85rem; }
  .drop-zone { padding: 40px 16px; }
}
