/* ============================================================
   사무공간 놀이터 (Office Playground) — 공용 디자인 시스템
   순수 CSS, 의존성 0. 모든 페이지가 이 파일 하나를 공유한다.
   class 이름은 "공용 계약"이다 — 툴 페이지는 여기 정의된 것만 쓴다.
   ============================================================ */

:root {
  /* refined "warm paper" palette — soft sage-green accent, calm earth tones */
  --bg:        #f2efe8;
  --bg-grid:   rgba(120, 108, 86, 0.035);
  --surface:   #fbf9f4;
  --surface-2: #efeade;
  --ink:       #262420;
  --muted:     #8c867a;
  --line:      #e6e0d3;
  --line-2:    #d6ccb9;

  --accent:    #95bc8f;   /* soft sage green — primary action */
  --accent-ink:#233018;   /* deep forest ink on accent (accent is light) */
  --accent-2:  #c89a4e;   /* muted ochre — secondary accent */
  --ok:        #3a9468;
  --warn:      #c2901f;
  --bad:       #c4493f;

  /* category tints (calm earth tones) */
  --cat-notes:   #d8c391;
  --cat-convert: #9bbcb1;
  --cat-prod:    #d2a59e;
  --cat-doc:     #aab2c4;
  --cat-image:   #a9c2a3;
  --cat-pdf:     #cda196;
  --cat-calc:    #ccbd84;
  --cat-dev:     #a3acbb;
  --cat-gen:     #bda9c2;
  --cat-fun:     #d8ab8e;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow:    0 1px 2px rgba(50,42,28,.05), 0 4px 16px rgba(50,42,28,.07);
  --shadow-sm: 0 1px 2px rgba(50,42,28,.06);
  --ring:      0 0 0 3px rgba(149,188,143,.32);

  --font: "Pretendard", "Apple SD Gothic Neo", "Segoe UI", system-ui, -apple-system, "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "D2Coding", ui-monospace, "Consolas", monospace;
}

[data-theme="dark"] {
  --bg:        #1a1815;
  --bg-grid:   rgba(255, 244, 222, 0.028);
  --surface:   #24221d;
  --surface-2: #2c2922;
  --ink:       #e8e3d7;
  --muted:     #968f84;
  --line:      #34302a;
  --line-2:    #433e35;
  --accent:    #9ec496;
  --accent-2:  #cda659;
  --cat-notes:   #b7a16d;
  --cat-convert: #7e9b91;
  --cat-prod:    #b08680;
  --cat-doc:     #8b93a6;
  --cat-image:   #8aa182;
  --cat-pdf:     #ab8175;
  --cat-calc:    #aa9c66;
  --cat-dev:     #848d9c;
  --cat-gen:     #9c8aa3;
  --cat-fun:     #b48a72;
  --shadow:    0 1px 2px rgba(0,0,0,.28), 0 6px 20px rgba(0,0,0,.32);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--bg-grid) 1px, transparent 1px);
  background-size: 26px 26px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- layout shells ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.tool-wrap { max-width: 920px; margin: 0 auto; padding: 0 20px 64px; }

/* ---------- app header (hub + tools share) ---------- */
.app-bar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.app-bar__in {
  max-width: 1120px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand__mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 9px; font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.brand__title { font-size: 17px; }
.brand__sub { color: var(--muted); font-weight: 600; font-size: 12px; }
.app-bar__spacer { flex: 1; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--line-2);
  appearance: none; cursor: pointer; font: inherit; font-weight: 650;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--b); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform .06s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.icon-btn {
  width: 38px; height: 38px; padding: 0; justify-content: center;
  border-radius: 10px;
}

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 650; color: var(--muted); }
.input, .textarea, .select {
  font: inherit; color: var(--ink); width: 100%;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.mono, .input.mono, .textarea.mono { font-family: var(--mono); font-size: 13.5px; }

/* ---------- panels / cards ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.panel + .panel { margin-top: 16px; }
.panel__title { margin: 0 0 12px; font-size: 15px; font-weight: 750; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .spacer { flex: 1; }

/* ---------- helpers ---------- */
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--surface-2); border: 1px solid var(--line);
}
hr.sep { border: none; border-top: 1px dashed var(--line-2); margin: 16px 0; }

/* ---------- tool page header ---------- */
.tool-head { padding: 26px 0 18px; }
.tool-head__top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tool-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.tool-head__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.tool-head p { margin: 8px 0 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 650; font-size: 14px; }
.back-link:hover { color: var(--ink); }

/* ---------- toast ---------- */
#pg-toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 999; pointer-events: none;
}
.toast {
  pointer-events: auto; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-weight: 650; font-size: 14px;
  box-shadow: var(--shadow); animation: toast-in .18s ease;
}
.toast.ok  { background: var(--ok);  color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   HUB (index.html)
   ============================================================ */
.hero { padding: 40px 0 18px; }
.hero h1 { margin: 0; font-size: clamp(28px, 5vw, 44px); letter-spacing: -.03em; line-height: 1.08; }
.hero h1 .wink { display: inline-block; transform: rotate(8deg); }
.hero p { margin: 14px 0 0; color: var(--muted); font-size: 16px; max-width: 52ch; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 10px; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}
.search input { border: none; outline: none; background: transparent; font: inherit; width: 100%; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  cursor: pointer; padding: 7px 13px; border-radius: 999px; font-weight: 650; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); transition: all .12s ease;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.tool-grid {
  display: grid; gap: 16px; margin: 18px 0 56px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tile {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: inherit; padding: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: var(--tile-hue, var(--accent));
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.tile__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--tile-hue, var(--accent)) 30%, var(--surface));
}
.tile__name { font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.tile__desc { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.tile__cat { margin-top: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.foot { color: var(--muted); font-size: 13px; padding: 30px 0 50px; border-top: 1px dashed var(--line-2); }

@media (max-width: 560px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .tile { padding: 14px; }
}

/* ============================================================
   GENERATED SEO content (.tool-seo) — How-to / FAQ / related
   ============================================================ */
.tool-seo { margin-top: 44px; padding-top: 26px; border-top: 1px dashed var(--line-2); }
.tool-seo:empty { display: none; }
.tool-seo h2 { font-size: 18px; margin: 28px 0 10px; letter-spacing: -.01em; }
.tool-seo h2:first-child { margin-top: 0; }
.tool-seo p, .tool-seo li, .tool-seo dd { color: var(--muted); max-width: 72ch; }
.tool-seo ol, .tool-seo ul { padding-left: 20px; }
.tool-seo li { margin: 7px 0; }
.tool-seo .faq { display: grid; gap: 2px; }
.tool-seo .faq dt { font-weight: 700; color: var(--ink); margin-top: 16px; }
.tool-seo .faq dd { margin: 5px 0 0; }
.tool-seo .related ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.tool-seo .related a { text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; font-size: 14px; color: var(--ink); }
.tool-seo .related a:hover { background: var(--surface-2); }
