:root {
  color-scheme: light;
  --cream: #fffaf3;
  --card: #ffffff;
  --soft: #fbf4e8;
  --ink: #1d1a29;
  --muted: #686274;
  --line: #ece3d8;
  --violet: #6a4fd6;
  --violet-soft: #f0ecfc;
  --green: #1e9e5f;
  --green-soft: #e6f7ee;
  --amber: #b36b00;
  --amber-soft: #fff3d9;
  --danger: #c63636;
  --danger-soft: #fdeaea;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font: 15.5px/1.6 var(--font);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.22em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
h1, h2, h3, p, ul { margin: 0; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -120px; z-index: 60;
  background: #fff; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
}
.skip:focus { top: 12px; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

/* 상단 바 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 250, 243, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
  height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand-group { display: flex; align-items: center; gap: 14px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.03em; text-decoration: none;
}
.brand img { border-radius: 9px; box-shadow: 0 3px 10px rgba(214, 140, 30, 0.22); }
.brand-home { font-size: 13px; color: var(--muted); text-decoration: none; }
.brand-home:hover { color: var(--ink); }

.topbar nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px;
  border-radius: 99px; font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.nav-link:hover { background: var(--soft); }
.nav-cta {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px;
  border-radius: 99px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.nav-cta:hover { background: #332d45; }
.nav-user {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 4px 12px 4px 6px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--card); cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.nav-user img { border-radius: 50%; }
.nav-logout-hint { color: var(--muted); font-weight: 500; font-size: 12px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 650; text-decoration: none; cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #332d45; }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--soft); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--report { color: var(--muted); }
.link-btn { background: none; border: none; color: var(--violet); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

/* 히어로 */
.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px;
  padding: 28px 0 22px; align-items: stretch;
}
.hero__copy {
  background: linear-gradient(145deg, #fff5e2, #ffffff);
  border: 1px solid var(--line); border-radius: 22px; padding: 28px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.hero__copy h1 { font-size: clamp(24px, 3vw, 32px); line-height: 1.25; letter-spacing: -0.03em; }
.hero__copy p { color: var(--muted); font-size: 15.5px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hero__rules {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px;
}
.hero__rules h2 { font-size: 16px; margin-bottom: 10px; }
.hero__rules ul { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 14px; }
.hero__rules li strong { color: var(--ink); }

/* 툴바 & 필터 */
.catalog { padding-top: 8px; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 650; cursor: pointer;
}
.tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab-count { font-size: 12px; opacity: 0.78; }
.controls { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; min-width: 240px; }
.search-wrap { flex: 1; max-width: 300px; }
.search-wrap input {
  width: 100%; min-height: 38px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
#sort-select {
  min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip {
  min-height: 32px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip.is-active { background: var(--violet-soft); border-color: var(--violet); color: var(--violet); }

/* 카드 그리드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(29, 26, 41, 0.06); }
.card__link { display: block; padding: 18px 18px 12px; text-decoration: none; flex: 1; }
.card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card__avatar { flex: none; width: 52px; height: 52px; }
.card__skill-icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px;
  background: var(--soft); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em;
}
.card__titles { min-width: 0; flex: 1; }
.card__top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.card__title { font-size: 17px; font-weight: 750; line-height: 1.3; }
.card__role { font-size: 13px; color: var(--muted); }
.card__summary { font-size: 14px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 14px; border-top: 1px solid var(--soft); font-size: 13px; color: var(--muted);
}
.card__author { font-weight: 600; }
.card__stats { display: flex; align-items: center; gap: 10px; }
.stat-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted);
}
.stat-btn:hover { background: var(--soft); color: var(--ink); }
.stat-btn.is-liked { color: #d6456b; background: #fdeef2; border-color: #f8cbd7; }
.stat-item { display: inline-flex; align-items: center; gap: 4px; }

.kind-pill, .cat-pill, .verified-badge, .status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
}
.kind-pill--agent { background: #fdf0d5; color: #8c5200; }
.kind-pill--skill { background: #e8effc; color: #2b4fa8; }
.cat-pill { background: var(--soft); color: var(--muted); }
.verified-badge { background: var(--green-soft); color: var(--green); }
.status-pill { background: var(--green-soft); color: var(--green); }
.status-pill--hidden { background: var(--danger-soft); color: var(--danger); }

/* 상세 페이지 */
.breadcrumb { padding: 18px 0 8px; font-size: 14px; color: var(--muted); }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.caution-banner {
  background: var(--amber-soft); border: 1px solid #f0d49a; color: #663d00;
  border-radius: 14px; padding: 14px 16px; margin: 10px 0 16px;
  display: flex; flex-direction: column; gap: 4px; font-size: 14px;
}
.caution-banner--danger { background: var(--danger-soft); border-color: #f1bcbc; color: #7a1c1c; }
.detail-head {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px;
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 20px;
}
.detail-head__left { display: flex; gap: 18px; align-items: flex-start; flex: 1; min-width: 260px; }
.detail-avatar { flex: none; width: 88px; height: 88px; }
.detail-skill-icon {
  flex: none; width: 80px; height: 80px; border-radius: 18px;
  background: var(--soft); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; color: var(--muted);
}
.detail-head h1 { font-size: 26px; margin: 4px 0; }
.detail-role { font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.detail-summary { color: var(--ink); margin-bottom: 10px; }
.detail-meta { font-size: 13px; color: var(--muted); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.owner-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.detail-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 22px; margin-top: 16px;
}
.detail-box h2 { font-size: 17px; margin-bottom: 10px; }
.detail-box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.detail-box__head h2 { margin: 0; }
.guide-note { color: var(--muted); font-size: 14.5px; }
.sample-line { margin-top: 10px; padding: 10px 12px; background: var(--soft); border-radius: 10px; font-size: 14px; }
.code-box {
  margin: 0; padding: 16px; border-radius: 12px; background: #fbf8f3; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  max-height: 560px; overflow: auto;
}
.extra-list { display: flex; flex-direction: column; gap: 10px; }
.extra-item summary { cursor: pointer; padding: 8px 0; }

/* 올리기 & 폼 */
.auth-gate, .notice-card {
  max-width: 620px; margin: 36px auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.auth-gate__rules { width: 100%; background: var(--soft); border-radius: 14px; padding: 16px 18px; margin-top: 6px; }
.auth-gate__rules h2 { font-size: 15px; margin-bottom: 8px; }
.auth-gate__rules ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }

.submit-wrap { max-width: 780px; margin: 24px auto 0; }
.submit-head { margin-bottom: 16px; }
.submit-head h1 { font-size: 26px; margin-bottom: 4px; }
.submit-head p { color: var(--muted); font-size: 14.5px; }
.submit-form {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.kind-switch { display: flex; gap: 8px; }
.kind-fixed { font-size: 14.5px; color: var(--muted); }
.dropzone {
  border: 2px dashed #d6c9b8; border-radius: 14px; padding: 18px; text-align: center;
  background: var(--soft); transition: border-color 140ms ease, background-color 140ms ease;
}
.dropzone.is-drag { border-color: var(--violet); background: var(--violet-soft); }
.dropzone p { margin-bottom: 4px; font-size: 14.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field > span, .field__head > span { font-weight: 650; }
.field__head { display: flex; justify-content: space-between; align-items: center; }
.field input[type="text"], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.field textarea { font-family: var(--mono); font-size: 13.5px; line-height: 1.5; }
.byte-meter { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.face-picker {
  display: flex; align-items: center; gap: 18px; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: #fdfaf5;
}
.face-picker__preview { flex: none; width: 76px; height: 76px; }
.face-picker__controls { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot {
  width: 28px; height: 28px; padding: 2px; border-radius: 50%;
  border: 2px solid transparent; background: #fff; cursor: pointer; display: grid; place-items: center;
}
.color-dot.is-active { border-color: var(--ink); }
.color-dot__swatch { width: 20px; height: 20px; border-radius: 50%; display: block; }
.color-dot__swatch[data-swatch="#F9B544"] { background: #F9B544; }
.color-dot__swatch[data-swatch="#F2C35E"] { background: #F2C35E; }
.color-dot__swatch[data-swatch="#FFA77A"] { background: #FFA77A; }
.color-dot__swatch[data-swatch="#FFA3A8"] { background: #FFA3A8; }
.color-dot__swatch[data-swatch="#F7A6CF"] { background: #F7A6CF; }
.color-dot__swatch[data-swatch="#D6A6E3"] { background: #D6A6E3; }
.color-dot__swatch[data-swatch="#BFA4EE"] { background: #BFA4EE; }
.color-dot__swatch[data-swatch="#9FAEF5"] { background: #9FAEF5; }
.color-dot__swatch[data-swatch="#9CC8EC"] { background: #9CC8EC; }
.color-dot__swatch[data-swatch="#86C3C6"] { background: #86C3C6; }
.color-dot__swatch[data-swatch="#8FD0A8"] { background: #8FD0A8; }
.color-dot__swatch[data-swatch="#C9DD78"] { background: #C9DD78; }

.form-msg { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.form-msg--error { background: var(--danger-soft); color: #7a1c1c; border: 1px solid #f1bcbc; }
.form-msg--ok { background: var(--green-soft); color: #12613a; border: 1px solid #b5e3ca; }
.submit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* 내 글 관리 */
.mine-wrap { max-width: 820px; margin: 24px auto 0; }
.mine-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mine-list { display: flex; flex-direction: column; gap: 12px; }
.mine-row {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.mine-row h3 { font-size: 17px; margin: 4px 0; }
.mine-row h3 a { text-decoration: none; }
.mine-row__actions { display: flex; gap: 8px; flex: none; }

/* 모달 · 빈 상태 · 푸터 */
.modal { border: none; border-radius: 18px; padding: 0; width: min(460px, calc(100% - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22); }
.modal::backdrop { background: rgba(29, 26, 41, 0.48); }
.modal__box { padding: 22px; display: flex; flex-direction: column; gap: 12px; background: var(--card); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.empty-box {
  grid-column: 1 / -1; background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 36px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.muted { color: var(--muted); font-size: 13.5px; }
.footer {
  margin-top: 52px; padding: 28px 0 42px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
}
.footer__links { display: flex; gap: 14px; }

@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .face-picker { flex-direction: column; align-items: flex-start; }
  .mine-row { flex-direction: column; align-items: flex-start; }
  .topbar__inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
}
