/* ==========================================================================
   FreeToolDev — Design Tokens
   컨셉: 엔지니어링 블루프린트. "여러 개를 한 번에 처리한다"는 배치(batch)
   개념을 도면/제도 언어로 표현한다.
   ========================================================================== */
:root {
  /* Color */
  --ink-navy: #0E2340;      /* 배경 - 짙은 청사진 네이비 */
  --ink-navy-deep: #081729; /* 더 짙은 섹션 구분용 */
  --blue-line: #3D6E9E;     /* 도면 선/보더 */
  --blue-line-soft: #24405f;
  --paper: #EDEBE2;         /* 밝은 섹션 배경 (도면 위 종이) */
  --paper-dim: #DAD6C7;
  --graphite: #16202C;      /* paper 위 텍스트 */
  --amber: #E8A33D;         /* 강조/CTA - 도장/하이라이트 색 */
  --amber-dim: #C4852A;
  --cyan: #6FE3D9;          /* 데이터/성공 표시, 소량만 */
  --white: #F6F5F0;
  --muted: #9FB2C6;         /* 네이비 배경 위 보조 텍스트 */

  /* Type */
  --font-display: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Layout */
  --max-w: 1120px;
  --radius: 2px; /* 도면 느낌 유지 위해 각짐 */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink-navy);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Blueprint grid background */
.blueprint-bg {
  background-image:
    linear-gradient(var(--blue-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-line-soft) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--blue-line-soft);
  position: sticky;
  top: 0;
  background: rgba(14, 35, 64, 0.92);
  backdrop-filter: blur(6px);
  z-index: 100;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .dot { color: var(--amber); }
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.15s;
}
.main-nav a:hover, .main-nav a.active { color: var(--white); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--ink-navy-deep);
    border-bottom: 1px solid var(--blue-line-soft);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 0; width: 100%; border-bottom: 1px solid var(--blue-line-soft); }
  .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--blue-line);
    color: var(--white);
    font-family: var(--font-display);
    padding: 6px 10px;
    cursor: pointer;
    border-radius: var(--radius);
  }
}

/* ==========================================================================
   Typography
   ========================================================================== */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  display: inline-block;
  margin-bottom: 14px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 16px; line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { color: var(--muted); margin: 0 0 16px; }
.on-paper p { color: #45505c; }
.on-paper h1, .on-paper h2, .on-paper h3 { color: var(--graphite); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-amber { background: var(--amber); color: var(--ink-navy-deep); font-weight: 700; }
.btn-amber:hover { background: #f0ad51; }
.btn-outline { border-color: var(--blue-line); color: var(--white); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }

/* Outline buttons placed on light/paper backgrounds (panels, cards) need dark text —
   the default white text above is only legible on the navy background. */
.panel .btn-outline,
.section-paper .btn-outline,
.on-paper .btn-outline {
  color: var(--ink-navy);
  border-color: var(--blue-line);
}
.panel .btn-outline:hover,
.section-paper .btn-outline:hover,
.on-paper .btn-outline:hover {
  color: var(--amber-dim);
  border-color: var(--amber-dim);
}
.panel .btn-outline:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 88px 0 70px;
  border-bottom: 1px solid var(--blue-line-soft);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero h1 { margin-bottom: 20px; }
.hero .lede { font-size: 1.05rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* Batch queue visual — signature element */
.batch-panel {
  border: 1px solid var(--blue-line);
  background: var(--ink-navy-deep);
  border-radius: var(--radius);
  padding: 20px;
  font-family: var(--font-display);
  font-size: 0.82rem;
}
.batch-panel .panel-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-bottom: 1px solid var(--blue-line-soft);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.batch-panel .panel-head .count { color: var(--cyan); }
.queue { display: flex; flex-direction: column; gap: 8px; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--blue-line-soft);
  border-radius: var(--radius);
  color: var(--muted);
}
.queue-item .name { flex: 1; color: var(--white); }
.queue-item .status { color: var(--amber); font-size: 0.75rem; }
.queue-item.done .status { color: var(--cyan); }
.queue-item.done { opacity: 0.7; }

/* ==========================================================================
   Sections on paper
   ========================================================================== */
.section-paper {
  background: var(--paper);
  color: var(--graphite);
  padding: 64px 0;
}
.section-navy { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }

/* ==========================================================================
   Tool cards
   ========================================================================== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.tool-card {
  display: block;
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--paper-dim);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(14,35,64,0.12); }
.tool-card .tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--amber-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tool-card h3 { color: var(--graphite); margin: 8px 0 6px; }
.tool-card p { color: #59636d; font-size: 0.92rem; margin: 0; }

/* Category filter (tools index) */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  padding: 8px 14px;
  border: 1px solid var(--blue-line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
}
.section-navy .search-input {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  font-family: var(--font-body);
  border: 1px solid var(--blue-line);
  background: var(--ink-navy-deep);
  color: var(--white);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.filter-chip.active { background: var(--amber); color: var(--ink-navy-deep); border-color: var(--amber); font-weight: 700; }

/* ==========================================================================
   Tool workspace (individual tool pages)
   ========================================================================== */
.tool-page-head { padding: 48px 0 32px; border-bottom: 1px solid var(--blue-line-soft); }
.tool-page-head .eyebrow { margin-bottom: 10px; }
.tool-page-head p { max-width: 62ch; }

.workspace {
  padding: 48px 0 80px;
}
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.workspace-grid-2col { grid-template-columns: 1fr 1fr; }
@media (max-width: 780px) {
  .workspace-grid-2col { grid-template-columns: 1fr; }
}

/* Live progress indicator for batch tools */
.progress-status {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: #59636d;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid #d8d3c2;
  border-top-color: var(--amber-dim);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.progress-status.active .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-row .fstatus.busy { color: var(--amber-dim); }

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .panel { padding: 18px; }
  .hero { padding: 56px 0 40px; }
  .section-paper, .section-navy { padding: 44px 0; }
}
.panel {
  background: var(--white);
  color: var(--graphite);
  border: 1px solid var(--paper-dim);
  border-radius: var(--radius);
  padding: 24px;
}
.panel h3 { color: var(--graphite); font-size: 1rem; margin-bottom: 14px; }

.dropzone {
  border: 2px dashed var(--blue-line);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: #59636d;
  font-family: var(--font-display);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag { border-color: var(--amber-dim); background: #fff8ec; }
.dropzone input { display: none; }

textarea, input[type=text], select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  border: 1px solid #c9c4b3;
  border-radius: var(--radius);
  background: #fff;
  color: var(--graphite);
}
textarea { min-height: 180px; resize: vertical; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }
label { display: block; font-size: 0.82rem; font-weight: 600; color: #45505c; margin-bottom: 6px; }

.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f7f5ee;
  border: 1px solid var(--paper-dim);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.file-row .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsize { color: #8a8578; font-family: var(--font-display); font-size: 0.76rem; }
.file-row .fstatus { font-family: var(--font-display); font-size: 0.72rem; color: var(--amber-dim); }
.file-row.ready .fstatus { color: #2e8b57; }

.toolbar { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.opt-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.opt-row > div { flex: 1; min-width: 140px; }

.result-empty { color: #8a8578; font-size: 0.88rem; font-family: var(--font-display); }

/* ==========================================================================
   Blog
   ========================================================================== */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.post-card {
  text-decoration: none;
  display: block;
  border: 1px solid var(--paper-dim);
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-card .post-meta { padding: 18px 20px 0; font-family: var(--font-display); font-size: 0.72rem; color: var(--amber-dim); text-transform: uppercase; }
.post-card h3 { padding: 6px 20px 0; color: var(--graphite); }
.post-card p { padding: 0 20px 20px; color: #59636d; font-size: 0.9rem; }
.article { max-width: 720px; margin: 0 auto; padding: 56px 24px 100px; color: var(--graphite); background: var(--paper); }
.article h1 { color: var(--graphite); }
.article p { color: #3a4450; font-size: 1.02rem; }
.article .post-meta { font-family: var(--font-display); font-size: 0.78rem; color: var(--amber-dim); margin-bottom: 20px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--blue-line-soft);
  padding: 40px 0;
  background: var(--ink-navy-deep);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-grid .col h4 {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.footer-grid .col a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 4px 0;
}
.footer-grid .col a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--blue-line-soft);
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-display);
}

/* Utility */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.badge-cyan { color: var(--cyan); font-family: var(--font-display); font-size: 0.75rem; }
