/* Zippytools — paper & ink neo-utility look, electric yellow accent */

@font-face {
  font-family: 'Bricolage';
  src: url('/assets/fonts/bricolage.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #faf7f0;
  --panel: #ffffff;
  --ink: #111014;
  --ink-soft: #4c4a52;
  --line: #111014;
  --zap: #f5d90a;
  --zap-soft: #fdf3b3;
  --ok: #1a7f37;
  --err: #c9313d;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 10px;
  --font-display: 'Bricolage', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-body: ui-sans-serif, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
}

[data-theme='dark'] {
  --paper: #16151a;
  --panel: #201f26;
  --ink: #f2efe6;
  --ink-soft: #b3b0bc;
  --line: #f2efe6;
  --zap: #f5d90a;
  --zap-soft: #3a3413;
  --shadow: 4px 4px 0 #000;
  --shadow-sm: 3px 3px 0 #000;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo { font-family: var(--font-display); letter-spacing: -0.01em; }

a { color: inherit; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1060px; margin: 0 auto; padding: 18px 20px;
}
.logo {
  font-weight: 800; font-size: 1.35rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 2px;
}
.logo-bolt {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; margin-right: 8px;
  background: var(--ink); color: var(--zap);
  border-radius: 8px; font-size: 1rem;
}
.site-nav { display: flex; align-items: center; gap: 10px; }
.nav-link {
  text-decoration: none; font-weight: 600; font-size: 0.9rem;
  border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px;
  background: var(--panel);
}
.nav-link:hover { background: var(--zap-soft); }
.theme-toggle {
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel); color: var(--ink);
  font-size: 1rem; line-height: 1;
}
.theme-toggle:hover { background: var(--zap-soft); }

/* ---------- layout ---------- */
.site-main { max-width: 1060px; margin: 0 auto; padding: 8px 20px 60px; }

.hero { text-align: center; padding: 34px 0 10px; }
.hero-title {
  font-size: clamp(1.9rem, 5vw, 3.1rem); font-weight: 800; margin: 0 0 12px;
  line-height: 1.15;
}
.hero-sub { color: var(--ink-soft); max-width: 620px; margin: 0 auto 26px; }

.tool-search {
  width: min(560px, 100%); padding: 13px 18px; font-size: 1rem;
  border: 2px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
  outline: none;
}
.tool-search:focus { box-shadow: 4px 4px 0 var(--zap); border-color: var(--ink); }
.no-results { color: var(--ink-soft); margin-top: 18px; }

.cat-section { margin-top: 40px; }
.cat-title {
  font-size: 1.15rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; display: inline-block;
  background: var(--zap); color: #111014; padding: 3px 12px;
  border: 2px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-sm);
  margin: 0 0 18px;
}

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}
.tool-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--panel); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tool-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--zap), 6px 6px 0 2px var(--ink);
}
.tool-icon { font-size: 1.5rem; }
.tool-card-name { font-weight: 700; }
.tool-card-tag { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4; }

/* ---------- tool page ---------- */
.tool-page, .static-page { max-width: 780px; margin: 0 auto; }
.crumbs { font-size: 0.85rem; color: var(--ink-soft); margin: 8px 0 20px; }
.crumbs a { color: inherit; }
.tool-title {
  font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin: 0 0 6px;
  display: flex; align-items: center; gap: 12px;
}
.tool-icon-lg {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  font-size: 1.5rem; background: var(--zap); border: 2px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-sm); flex: none;
}
.tool-tagline { color: var(--ink-soft); margin: 0 0 22px; }

.tool-box {
  background: var(--panel); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.privacy-note { font-size: 0.82rem; color: var(--ink-soft); margin: 12px 0 34px; }

.tool-about, .tool-faq, .tool-related { margin-top: 38px; }
.tool-about h2, .tool-faq h2, .tool-related h2 { font-size: 1.25rem; }
.tool-about p { color: var(--ink-soft); }

.faq-item {
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 10px; padding: 0 16px;
}
.faq-item summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.faq-item p { color: var(--ink-soft); margin-top: 0; }

/* ---------- form primitives ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 5px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row .field { flex: 1; min-width: 130px; margin-bottom: 0; }
.row + .row, .row + .btn-row, .btn-row + .row { margin-top: 14px; }

input[type='text'], input[type='number'], input[type='date'], input[type='search'],
input[type='url'], select, textarea {
  width: 100%; padding: 10px 12px; font-size: 0.95rem; font-family: inherit;
  border: 2px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.5; }
textarea.plain { font-family: var(--font-body); font-size: 0.95rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--zap); outline-offset: 1px; }
input[type='range'] { width: 100%; accent-color: var(--zap); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--ink); width: 15px; height: 15px; }
input[type='color'] { border: 2px solid var(--line); border-radius: 8px; height: 44px; width: 64px; padding: 2px; background: var(--paper); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; margin-right: 14px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
button.btn, a.btn {
  font-family: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  padding: 10px 18px; border: 2px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-decoration: none; display: inline-block;
}
button.btn:hover, a.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
button.btn:active, a.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary { background: var(--zap); color: #111014; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; box-shadow: none; }

.result {
  margin-top: 16px; padding: 14px 16px; border: 2px dashed var(--line);
  border-radius: 8px; background: var(--zap-soft); font-weight: 600;
  overflow-wrap: anywhere;
}
.result:empty { display: none; }
.result .big { font-size: 1.5rem; font-weight: 800; font-family: var(--font-display); }
.result-mono { font-family: var(--font-mono); font-weight: 400; font-size: 0.88rem; }
.msg-err { color: var(--err); font-weight: 600; }
.msg-ok { color: var(--ok); font-weight: 600; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; margin-top: 16px;
}
.stat {
  border: 2px solid var(--line); border-radius: 8px; padding: 10px;
  text-align: center; background: var(--paper);
}
.stat b { display: block; font-size: 1.35rem; font-family: var(--font-display); }
.stat span { font-size: 0.78rem; color: var(--ink-soft); }

.big-time {
  font-family: var(--font-display); font-weight: 800; text-align: center;
  font-size: clamp(3rem, 12vw, 5rem); letter-spacing: 0.02em; margin: 10px 0;
  font-variant-numeric: tabular-nums;
}

.drop-zone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 30px; text-align: center; color: var(--ink-soft); cursor: pointer;
  background: var(--paper);
}
.drop-zone.drag { background: var(--zap-soft); }
.preview-img { max-width: 100%; border: 2px solid var(--line); border-radius: 8px; margin-top: 14px; }

.swatch { width: 100%; height: 64px; border: 2px solid var(--line); border-radius: 8px; margin-top: 10px; }

/* ---------- static pages / footer ---------- */
.static-page h1 { font-size: 1.9rem; }
.static-page h2 { font-size: 1.2rem; margin-top: 28px; }
.static-page p, .static-page li { color: var(--ink-soft); }

.ad-slot { margin: 26px auto; text-align: center; min-height: 90px; }

.site-footer {
  border-top: 2px solid var(--line); margin-top: 30px;
  padding: 28px 20px 40px; text-align: center;
}
.footer-note { color: var(--ink-soft); font-size: 0.85rem; max-width: 520px; margin: 0 auto 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 12px; }
.footer-nav a { font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-copy { font-size: 0.8rem; color: var(--ink-soft); margin: 0; }

@media (max-width: 560px) {
  .tool-box { padding: 16px; }
  .site-header { padding: 14px 16px; }
}
