/* STUDIO 100 공통 스타일: 홈 화면과 모든 도구 페이지의 머리말·꼬리말 (scripts/build-site.mjs가 연결해요) */
:root {
  --s1-bg: #0b1120;
  --s1-surface: #111a2c;
  --s1-surface-2: #16213a;
  --s1-line: #22304a;
  --s1-ink: #e8edf6;
  --s1-muted: #8b98ae;
  --s1-faint: #5d6a80;
  --s1-accent: #6b9bff;
  --s1-focus: #9dbcff;
  --s1-radius: 14px;
  --s1-bar-h: 56px;
}

body {
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.s1-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 도구 페이지 위쪽 막대 ---------- */
.s1-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--s1-bar-h);
  background: rgba(11, 17, 32, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--s1-line);
}
.s1-bar-in {
  max-width: 1120px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 14px;
}
.s1-spacer { height: var(--s1-bar-h); width: 100%; flex: none; }

.s1-logo {
  color: var(--s1-ink); text-decoration: none; font-weight: 900; letter-spacing: -0.02em; font-size: 17px;
  display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap;
}
.s1-logo b { color: var(--s1-accent); font-weight: 900; }
.s1-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--s1-muted); }
.s1-crumb::before { content: "/"; color: var(--s1-faint); }
.s1-crumb a { color: var(--s1-muted); text-decoration: none; white-space: nowrap; }
.s1-crumb a:hover { color: var(--s1-ink); }
.s1-find {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--s1-line); background: var(--s1-surface);
  color: var(--s1-ink); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.s1-find:hover { border-color: #33476b; background: var(--s1-surface-2); }
.s1-find svg { width: 16px; height: 16px; }

/* ---------- 도구 페이지 아래쪽 (관련 도구 + 꼬리말) ---------- */
.s1-end { width: 100%; max-width: 1120px; margin: 72px auto 0; padding: 0 4px; align-self: center; }
.s1-related h2 { margin: 0 0 14px; font-size: 17px; font-weight: 800; color: var(--s1-ink); letter-spacing: -0.02em; }
.s1-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.s1-related a {
  display: block; padding: 14px 16px; border-radius: 12px; text-decoration: none;
  background: var(--s1-surface); border: 1px solid var(--s1-line);
}
.s1-related a:hover { border-color: #33476b; background: var(--s1-surface-2); }
.s1-related b { display: block; color: var(--s1-ink); font-size: 15px; font-weight: 700; }
.s1-related span { display: block; margin-top: 4px; color: var(--s1-muted); font-size: 13px; line-height: 1.5; }

.s1-foot {
  margin-top: 48px; padding: 28px 0 40px; border-top: 1px solid var(--s1-line);
  color: var(--s1-faint); font-size: 13px; line-height: 1.7; text-align: left;
}
.s1-foot p { margin: 0 0 6px; }
.s1-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px !important; }
.s1-foot a { color: var(--s1-muted); text-decoration: none; }
.s1-foot a:hover { color: var(--s1-ink); }

/* ---------- 홈 화면 ---------- */
.s1-home { margin: 0; background: var(--s1-bg); color: var(--s1-ink); -webkit-font-smoothing: antialiased; }
.s1-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.s1-skip { position: absolute; left: -9999px; top: 8px; }
.s1-skip:focus { left: 12px; z-index: 1000; background: var(--s1-ink); color: var(--s1-bg); padding: 8px 12px; border-radius: 8px; }

.s1-head { position: sticky; top: 0; z-index: 900; background: rgba(11, 17, 32, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--s1-line); }
.s1-head-in { height: var(--s1-bar-h); display: flex; align-items: center; gap: 24px; }
.s1-cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.s1-cats::-webkit-scrollbar { display: none; }
.s1-cats a { flex: none; padding: 7px 11px; border-radius: 9px; color: var(--s1-muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.s1-cats a:hover { color: var(--s1-ink); background: var(--s1-surface); }
.s1-head-about { margin-left: auto; flex: none; color: var(--s1-muted); text-decoration: none; font-size: 14px; }
.s1-head-about:hover { color: var(--s1-ink); }

.s1-hero { padding-top: 72px; padding-bottom: 48px; }
.s1-hero h1 { margin: 0; font-size: clamp(32px, 5.2vw, 56px); line-height: 1.16; font-weight: 800; letter-spacing: -0.045em; }
.s1-hero > p { margin: 18px 0 0; max-width: 40em; color: var(--s1-muted); font-size: 17px; line-height: 1.7; }

.s1-finder { position: relative; margin-top: 36px; max-width: 720px; }
.s1-search {
  display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 18px 0 20px;
  background: var(--s1-surface); border: 1.5px solid var(--s1-line); border-radius: 16px;
}
.s1-search:focus-within { border-color: var(--s1-accent); box-shadow: 0 0 0 4px rgba(107, 155, 255, 0.16); }
.s1-search svg { width: 22px; height: 22px; color: var(--s1-muted); flex: none; }
.s1-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  color: var(--s1-ink); font: inherit; font-size: 18px; font-weight: 500;
}
.s1-search input::placeholder { color: var(--s1-faint); }
.s1-search input::-webkit-search-cancel-button { filter: invert(0.7); }
.s1-search kbd {
  flex: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--s1-muted);
  border: 1px solid var(--s1-line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px;
}
.s1-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 50;
  list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 440px); overflow-y: auto;
  background: #0f1829; border: 1px solid var(--s1-line); border-radius: 14px;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}
.s1-results li { margin: 0; }
.s1-results a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: var(--s1-ink); }
.s1-results a b { font-weight: 700; font-size: 15px; }
.s1-results a span { grid-column: 1; color: var(--s1-muted); font-size: 13px; }
.s1-results a i { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-size: 12px; color: var(--s1-muted); }
.s1-results a[aria-selected="true"], .s1-results a:hover { background: var(--s1-surface-2); }
.s1-empty { padding: 14px 12px; color: var(--s1-muted); font-size: 14px; }
.s1-hint { margin: 12px 2px 0; color: var(--s1-faint); font-size: 13px; }

.s1-sec { padding-top: 56px; }
.s1-sec, .s1-hero { scroll-margin-top: 64px; }
.s1-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 18px; }
.s1-sec-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.s1-sec-head p { margin: 0; color: var(--s1-muted); font-size: 14px; }
.s1-count { color: var(--s1-faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.s1-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); align-self: center; flex: none; }

.s1-picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s1-picks a {
  display: flex; flex-direction: column; gap: 6px; min-height: 112px; padding: 18px; border-radius: var(--s1-radius);
  background: var(--s1-surface); border: 1px solid var(--s1-line); text-decoration: none; color: var(--s1-ink);
}
.s1-picks a:hover { border-color: #33476b; background: var(--s1-surface-2); }
.s1-picks small { display: inline-flex; align-items: center; gap: 6px; color: var(--s1-muted); font-size: 12px; font-weight: 600; }
.s1-picks small::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.s1-picks b { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.s1-picks span { color: var(--s1-muted); font-size: 13px; line-height: 1.5; }

.s1-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--s1-line); }
.s1-list li { border-bottom: 1px solid var(--s1-line); }
.s1-list a { display: block; padding: 14px 4px 14px 0; text-decoration: none; color: var(--s1-ink); }
.s1-list a:hover b { color: var(--s1-accent); }
.s1-list b { display: block; font-size: 15px; font-weight: 700; }
.s1-list span { display: block; margin-top: 3px; color: var(--s1-muted); font-size: 13px; line-height: 1.5; padding-right: 16px; }

.s1-notes { margin: 0; display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.s1-notes dt { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.s1-notes dd { margin: 6px 0 0; color: var(--s1-muted); font-size: 14px; line-height: 1.7; }

.s1-home .s1-foot { margin-top: 88px; }

/* ---------- 소개·방침 같은 문서 페이지 ---------- */
.s1-doc { max-width: 760px; padding-top: 56px; }
.s1-doc h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.04em; }
.s1-doc .s1-lead { margin: 14px 0 0; color: var(--s1-muted); font-size: 16px; line-height: 1.8; }
.s1-doc h2 { margin: 44px 0 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.s1-doc p, .s1-doc li { color: #c3cbd8; font-size: 15px; line-height: 1.85; }
.s1-doc p { margin: 12px 0 0; }
.s1-doc ul { margin: 12px 0 0; padding-left: 20px; }
.s1-doc a { color: var(--s1-accent); }
.s1-doc .s1-meta { margin-top: 48px; color: var(--s1-faint); font-size: 13px; }

/* ---------- 공통: 키보드 초점, 반응형, 움직임 줄이기 ---------- */
.s1-bar a:focus-visible, .s1-end a:focus-visible, .s1-home a:focus-visible, .s1-home input:focus-visible {
  outline: 2px solid var(--s1-focus); outline-offset: 2px; border-radius: 8px;
}
.s1-search input:focus-visible { outline: none; }

@media (max-width: 960px) {
  .s1-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s1-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s1-related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s1-notes { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .s1-wrap, .s1-bar-in { padding: 0 16px; }
  .s1-head-in { gap: 14px; }
  .s1-head-about { display: none; }
  .s1-hero { padding-top: 44px; padding-bottom: 28px; }
  .s1-hero > p { font-size: 15px; }
  .s1-search { height: 56px; }
  .s1-search input { font-size: 16px; }
  .s1-search kbd { display: none; }
  .s1-picks { grid-template-columns: 1fr 1fr; gap: 8px; }
  .s1-picks a { min-height: 96px; padding: 14px; }
  .s1-list, .s1-related ul { grid-template-columns: 1fr; }
  .s1-find span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .s1-picks a, .s1-related a, .s1-find { transition: border-color 0.15s ease, background-color 0.15s ease; }
}
