/* ==========================================================================
   Diagnostack — base stylesheet
   Single file, no build step. Edit colors in the :root block below.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-card: #ffffff;
  --text: #1a1d21;
  --text-soft: #5b6270;
  --text-faint: #8a919e;
  --border: #e3e6ea;
  --accent: #1f6feb;
  --accent-soft: #eaf1fe;
  --warn-bg: #fff8e6;
  --warn-border: #f0d089;
  --radius: 10px;
  --maxw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --bg-soft: #1b1f24;
    --bg-card: #1b1f24;
    --text: #e8eaed;
    --text-soft: #a7aeb9;
    --text-faint: #7d848f;
    --border: #2b3138;
    --accent: #6aa5ff;
    --accent-soft: #1c2a41;
    --warn-bg: #2a2415;
    --warn-border: #5c4c1f;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* --- Header ------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}
.logo {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }

.nav { display: flex; gap: 20px; align-items: center; }
.nav a {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
}
.nav a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; width: 100%; font-size: 16px; }
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.hero h1 {
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.hero p {
  font-size: 18px;
  color: var(--text-soft);
  margin: 0;
  max-width: 620px;
}

/* --- Post list ---------------------------------------------------------- */
.section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
  margin: 48px 0 18px;
}

.card-list { display: grid; gap: 14px; }

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card p {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.6;
}
.meta {
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

/* --- Article ------------------------------------------------------------ */
.article { padding: 40px 0 20px; }
.article header { margin-bottom: 28px; }
.article h1 {
  font-size: 32px;
  line-height: 1.28;
  letter-spacing: -0.03em;
  margin: 10px 0 14px;
}
.lede {
  font-size: 18.5px;
  color: var(--text-soft);
  line-height: 1.65;
  margin: 0 0 18px;
}
.byline {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.byline strong { color: var(--text-soft); font-weight: 600; }

.article-body h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin: 44px 0 12px;
  line-height: 1.3;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 19px;
  margin: 30px 0 8px;
  line-height: 1.4;
}
.article-body p { margin: 0 0 18px; }
.article-body ul,
.article-body ol { margin: 0 0 20px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { font-weight: 650; }

.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
  font-size: 16px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 32px;
}
.toc strong {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 5px; font-size: 15.5px; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 15.5px;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--bg-soft); font-weight: 650; }

.table-scroll { overflow-x: auto; margin-bottom: 24px; }
.table-scroll table { margin-bottom: 0; }

/* --- Ad slots ----------------------------------------------------------- */
/* 광고가 실제로 들어오기 전에는 아무것도 렌더링하지 않습니다.
   AdSense 가 <ins> 를 주입하면 그때만 라벨과 여백이 생깁니다.
   (정책: 광고는 메뉴/콘텐츠로 오인될 수 있게 배치하면 안 됩니다) */
.ad-slot {
  margin: 36px 0;
}
.ad-slot:has(ins) {
  position: relative;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-slot:has(ins)::before {
  content: "Advertisement";
  position: absolute;
  top: 0;
  left: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --- Prev/next + related ------------------------------------------------ */
.related { border-top: 1px solid var(--border); margin-top: 48px; padding-top: 8px; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 36px 0 48px;
  background: var(--bg-soft);
  font-size: 14.5px;
  color: var(--text-soft);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--text-soft); }
.footer-links a:hover { color: var(--accent); }
.copyright { font-size: 13.5px; color: var(--text-faint); }

/* --- Static pages ------------------------------------------------------- */
.page { padding: 44px 0 20px; }
.page h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 8px; }
.page .updated { color: var(--text-faint); font-size: 14px; margin: 0 0 30px; }
.page h2 { font-size: 21px; margin: 36px 0 10px; letter-spacing: -0.01em; }
.page h3 { font-size: 17.5px; margin: 24px 0 6px; }
.page p { margin: 0 0 16px; }
.page ul { margin: 0 0 18px; padding-left: 22px; }
.page li { margin-bottom: 7px; }

/* --- Contact form ------------------------------------------------------- */
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.form-note { font-size: 14px; color: var(--text-faint); margin-top: 14px; }

/* --- Utility ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

.breadcrumb { font-size: 14px; color: var(--text-faint); margin-bottom: 4px; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--accent); }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 27px; }
  .hero p { font-size: 16.5px; }
  .article h1, .page h1 { font-size: 26px; }
  .article-body h2 { font-size: 21px; margin-top: 36px; }
  .lede { font-size: 17px; }
}

/* --- Figures / screenshots --------------------------------------------- */
.article-body figure {
  margin: 28px 0;
}
.article-body figure img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.article-body figcaption {
  font-size: 14.5px;
  color: var(--text-faint);
  line-height: 1.55;
  margin-top: 9px;
}
