/* ============================================
 * 툴박스 (tools.hedvion.com) — 디자인 토큰
 * 모던/차분 톤. 도구 사이트라 컨버전·신뢰감 강조.
 * ============================================ */
:root {
  --bg: #f7f9fc;
  --bg-soft: #eef2f8;
  --bg-card: #ffffff;
  --fg: #0f172a;
  --fg-soft: #334155;
  --fg-mute: #64748b;
  --accent: #2563eb;            /* primary blue */
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-cta: #f97316;        /* orange CTA — 변환 버튼 */
  --accent-cta-hover: #ea580c;
  --success: #16a34a;
  --danger: #dc2626;
  --border: #e2e8f0;
  --border-soft: #eef1f5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.14);
  --max: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Pretendard';
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ============ Header ============ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(180%) blur(12px);
}
.site-header .container {
  display: flex; align-items: center; gap: 28px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 22px;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}
.brand-name { color: var(--fg); }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav-link {
  font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--fg-soft);
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.hamburger {
  display: none;
  background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px 8px;
  margin-left: auto;
}

/* ============ Main ============ */
.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* ============ Hero (home) ============ */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff;
  padding: 56px 32px;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 120%; height: 200%;
  background: radial-gradient(ellipse at top, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
}
.hero p {
  margin: 0; font-size: 18px; opacity: 0.95;
  position: relative;
}
.hero-badges {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 22px;
  position: relative;
}
.hero-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* ============ Section / Heading ============ */
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .emoji { font-size: 26px; }
.section-intro {
  color: var(--fg-mute);
  margin: -8px 0 20px;
  font-size: 15px;
}

/* ============ Tool Card Grid (home) ============ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--shadow-sm);
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  color: inherit;
}
.tool-card-icon {
  font-size: 28px;
  line-height: 1;
}
.tool-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--fg-mute);
  margin: 0;
  line-height: 1.5;
}

/* ============ Tool Page ============ */
.tool-header {
  text-align: center;
  padding: 24px 0 8px;
}
.tool-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.tool-header p {
  color: var(--fg-mute);
  font-size: 16px;
  margin: 0;
  max-width: 640px;
  margin: 0 auto;
}
.breadcrumb {
  font-size: 13px;
  color: var(--fg-mute);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--fg-soft); }
.breadcrumb-sep { margin: 0 6px; opacity: 0.5; }

/* ============ Dropzone ============ */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--bg-card);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.dropzone:hover, .dropzone.dragover {
  background: var(--accent-soft);
  border-color: var(--accent-hover);
}
.dropzone-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.dropzone-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
.dropzone-sub {
  color: var(--fg-mute);
  font-size: 14px;
  margin: 0;
}
.dropzone input[type=file] {
  display: none;
}

/* ============ CTA Button ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  border: none;
  transition: background .15s ease, transform .1s ease;
}
.btn-primary {
  background: var(--accent-cta);
  color: #fff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover { background: var(--accent-cta-hover); color: #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: var(--fg-mute); box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-soft);
  color: var(--fg);
}
.btn-secondary:hover { background: var(--border); color: var(--fg); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #15803d; color: #fff; }

.btn-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 20px;
}

/* ============ File List ============ */
.file-list {
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.file-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.file-item-icon { font-size: 20px; }
.file-item-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-item-size {
  color: var(--fg-mute);
  font-size: 13px;
}
.file-item-remove {
  background: none; border: none;
  color: var(--fg-mute);
  font-size: 18px; line-height: 1;
  padding: 4px 8px;
}
.file-item-remove:hover { color: var(--danger); }

/* ============ Status / Progress ============ */
.status {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 14px;
}
.status.working {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.status.success {
  background: #dcfce7;
  color: #15803d;
}
.status.error {
  background: #fee2e2;
  color: var(--danger);
}

/* ============ Ad Slot wrapper ============
 * ⚠️ :has(:empty) 류 선택자 절대 금지 — 광고 비동기 로드 직전 빈 상태를
 *    영구 빈 슬롯으로 오인해 광고 전체가 사라짐 (ssul 사례 2026-05-19)
 */
.adslot-wrap {
  margin: 24px auto;
  text-align: center;
  min-height: 90px;
  max-width: 100%;
}
.adslot-wrap.adslot-inline {
  margin: 32px auto;
}

/* ============ Content / SEO body ============ */
.tool-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  line-height: 1.75;
}
.tool-body h2 {
  font-size: 20px;
  margin: 28px 0 12px;
  font-weight: 700;
}
.tool-body h2:first-child { margin-top: 0; }
.tool-body h3 {
  font-size: 16px;
  margin: 18px 0 8px;
  font-weight: 700;
}
.tool-body p { color: var(--fg-soft); margin: 0 0 12px; }
.tool-body ol, .tool-body ul {
  color: var(--fg-soft);
  padding-left: 22px;
}
.tool-body li { margin-bottom: 6px; }

/* ============ FAQ ============ */
.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 8px;
}
.faq summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::after {
  content: '+';
  font-size: 20px;
  color: var(--accent);
  transition: transform .15s ease;
}
.faq details[open] summary::after {
  content: '−';
}
.faq p {
  margin: 12px 0 0;
  color: var(--fg-soft);
  font-size: 14px;
}

/* ============ Related tools ============ */
.related-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.related-tool {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; align-items: center; gap: 10px;
  transition: border-color .15s ease, transform .1s ease;
}
.related-tool:hover {
  border-color: var(--accent);
  color: inherit;
}
.related-tool-icon { font-size: 22px; }
.related-tool-text { font-size: 14px; font-weight: 600; }

/* ============ Footer ============ */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 40px 0 24px;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
}
.site-footer h4 {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--fg);
  font-weight: 700;
}
.site-footer p, .site-footer ul {
  color: var(--fg-mute);
  font-size: 13px;
  margin: 0;
  padding: 0;
  line-height: 1.7;
}
.site-footer ul { list-style: none; }
.site-footer ul a { color: var(--fg-mute); }
.site-footer ul a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  color: var(--fg-mute);
  font-size: 12px;
  text-align: center;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .hero { padding: 36px 20px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .tool-header h1 { font-size: 24px; }
  .site-nav { display: none; flex-direction: column; width: 100%; }
  .site-nav.open { display: flex; }
  .hamburger { display: block; }
  .site-header .container { flex-wrap: wrap; gap: 12px; }
  .footer-cols { grid-template-columns: 1fr; gap: 20px; }
  .dropzone { padding: 28px 16px; }
  .dropzone-icon { font-size: 36px; }
}
