@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* next/font/google(--font-sans=Noto Sans KR, --font-mono=DM Mono) → registry는 <html> 제어 불가.
   아래 globals :root가 var(--font-*-fallback)을 참조하므로 그 폴백 변수만 실제 폰트로 정의한다. */
:root {
  --font-sans-fallback: 'Noto Sans KR';
  --font-mono-fallback: 'DM Mono';
}

/* pebblesignal · micro-feed / changelog stream
   Palette: pebble gray + soft pebble + signal-blue dot + ink. Understated, tiny. */

:root {
  --ink: #1f2328;
  --muted: #6b7280;
  --pebble: #9aa1ab;
  --pebble-mid: #6b7280;
  --pebble-soft-ink: #b3b9c2;
  --signal: #5b8def;
  --signal-ink: #3f6fd0;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e8eaed;
  --line-strong: #dcdfe4;

  --font-sans: var(--font-sans-fallback), "Noto Sans KR", system-ui, sans-serif;
  --font-mono: var(--font-mono-fallback), "DM Mono", ui-monospace, monospace;

  --feed-width: 760px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans), "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------- persistent mini feed header ---------- */
.feed-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.feed-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.pebble-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.16);
  flex: none;
}

.feed-wordmark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.feed-stamp {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono), monospace;
  font-size: 11.5px;
  color: var(--muted);
}
.feed-stamp-key {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pebble);
}
.feed-stamp time {
  color: var(--pebble-mid);
  font-weight: 500;
}

/* ---------- home: feed main ---------- */
.feed-main {
  max-width: var(--feed-width);
  margin: 0 auto;
  padding: 26px 22px 72px;
}

/* slim lead band (NOT a hero) with subtle pebble texture / lead image */
.feed-lead {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 26px;
  background-color: #eef0f3;
  background-image:
    linear-gradient(118deg, rgba(238, 240, 243, 0.93), rgba(223, 227, 233, 0.84)),
    url("/images/pebblesignal-lead.jpg");
  background-size: cover;
  background-position: center;
}
.feed-lead-line {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.feed-lead-sub {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* feed stream */
.feed-stream-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line-strong);
}
.feed-h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.feed-count {
  font-family: var(--font-mono), monospace;
  font-size: 11.5px;
  color: var(--muted);
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-row {
  display: grid;
  grid-template-columns: 46px 12px auto 1fr auto;
  align-items: baseline;
  column-gap: 11px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}
.feed-row:hover {
  background: rgba(91, 141, 239, 0.035);
}

.feed-date {
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--pebble-mid);
  font-variant-numeric: tabular-nums;
}

.feed-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  align-self: center;
  flex: none;
}

.feed-cat {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.feed-line {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.55;
}
.feed-line-link {
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}
.feed-line-link:hover {
  border-bottom-color: var(--signal);
  color: var(--signal-ink);
}

.feed-confirm {
  font-family: var(--font-mono), monospace;
  font-size: 11.5px;
  color: var(--signal-ink);
  text-decoration: none;
  white-space: nowrap;
}
.feed-confirm:hover {
  text-decoration: underline;
}
.feed-confirm-mute {
  color: var(--pebble-soft-ink);
}

/* principles block (about substitute) */
.feed-principles {
  margin-top: 34px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.feed-principles-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.feed-principles ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}
.feed-principles li {
  font-size: 13.5px;
  color: var(--ink);
}
.feed-foot {
  margin: 16px 0 0;
  font-family: var(--font-mono), monospace;
  font-size: 11px;
  color: var(--pebble);
}

/* ---------- article: micro-brief ---------- */
.brief-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 22px 80px;
}

.brief-back {
  display: inline-block;
  font-family: var(--font-mono), monospace;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 18px;
}
.brief-back:hover {
  color: var(--signal-ink);
}

.brief {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 34px 36px;
}

.brief-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.brief-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.brief-cat {
  font-size: 12px;
  color: var(--muted);
}
.brief-stamp {
  margin-left: auto;
  font-family: var(--font-mono), monospace;
  font-size: 11.5px;
  color: var(--pebble-mid);
  font-variant-numeric: tabular-nums;
}

.brief-title {
  margin: 0 0 12px;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.014em;
  color: var(--ink);
}

.brief-lead {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
  color: #3a3f46;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

/* dated change log timeline */
.changelog {
  margin: 0 0 22px;
}
.changelog-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.changelog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.changelog-list::before {
  content: "";
  position: absolute;
  left: 71px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}
.changelog-item {
  display: grid;
  grid-template-columns: 64px 16px 1fr;
  align-items: baseline;
  column-gap: 12px;
  padding: 5px 0;
}
.changelog-date {
  font-family: var(--font-mono), monospace;
  font-size: 11.5px;
  color: var(--pebble-mid);
  font-variant-numeric: tabular-nums;
}
.changelog-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-strong);
  align-self: center;
  justify-self: center;
}
.changelog-label {
  font-size: 13.5px;
  color: var(--ink);
}

/* checkpoints list */
.checkpoints {
  margin: 0 0 26px;
  padding: 16px 18px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.checkpoints-title {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.checkpoints-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
.checkpoints-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  color: var(--ink);
}
.checkpoints-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
}

/* injected article body */
.article-content {
  font-size: 15.5px;
  line-height: 1.78;
  color: #2a2f36;
}
.article-content > *:first-child {
  margin-top: 0;
}
.article-content h2 {
  margin: 30px 0 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-top: 6px;
}
.article-content h3 {
  margin: 22px 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}
.article-content p {
  margin: 0 0 14px;
}
.article-content a {
  color: var(--signal-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content ul,
.article-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}
.article-content li {
  margin: 4px 0;
}
.article-content blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--signal);
  background: rgba(91, 141, 239, 0.05);
  border-radius: 0 8px 8px 0;
  color: #353b43;
  font-size: 15px;
}
.article-content blockquote p {
  margin: 0;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
}
.article-content thead th {
  text-align: left;
  background: #f4f5f7;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.01em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.article-content tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink);
}
.article-content tbody tr:last-child td {
  border-bottom: none;
}

/* faq */
.brief-faq {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.brief-faq h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.brief-faq details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.brief-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 26px 9px 0;
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.brief-faq summary::-webkit-details-marker {
  display: none;
}
.brief-faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 8px;
  font-family: var(--font-mono), monospace;
  color: var(--pebble);
}
.brief-faq details[open] summary::after {
  content: "−";
  color: var(--signal-ink);
}
.brief-faq details p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
}

/* sources */
.brief-sources {
  margin-top: 26px;
  padding: 16px 18px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.brief-sources h2 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.brief-sources p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

/* foot */
.brief-foot {
  margin-top: 26px;
}
.brief-foot-link {
  font-family: var(--font-mono), monospace;
  font-size: 12.5px;
  color: var(--signal-ink);
  text-decoration: none;
}
.brief-foot-link:hover {
  text-decoration: underline;
}

/* ---------- narrow widths ---------- */
@media (max-width: 640px) {
  .feed-row {
    grid-template-columns: 42px 10px 1fr;
    grid-template-areas:
      "date dot line"
      "date cat confirm";
    row-gap: 2px;
  }
  .feed-date {
    grid-area: date;
  }
  .feed-cat-dot {
    grid-area: dot;
  }
  .feed-cat {
    grid-area: cat;
  }
  .feed-line {
    grid-area: line;
  }
  .feed-confirm {
    grid-area: confirm;
    justify-self: start;
  }
  .brief {
    padding: 24px 20px 30px;
  }
  .brief-title {
    font-size: 23px;
  }
  .changelog-list::before {
    left: 71px;
  }
}
