@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  color-scheme: light dark;
  --accent-hue: 28;
  --bg: #ffffff;
  --surface: #f7f7f7;
  --surface-2: #efefef;
  --hair: #e6e6e6;
  --line: #cfcfcf;
  --text: #161616;
  --text-muted: #5c5c5c;
  --text-meta: #737373;
  --accent: oklch(50% 0.14 var(--accent-hue));
  --accent-soft: oklch(50% 0.14 var(--accent-hue) / 0.12);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --col: 680px;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --surface: #1c1c1c;
    --surface-2: #242424;
    --hair: #2a2a2a;
    --line: #3a3a3a;
    --text: #ececec;
    --text-muted: #a3a3a3;
    --text-meta: #878787;
    --accent: oklch(72% 0.12 var(--accent-hue));
    --accent-soft: oklch(72% 0.12 var(--accent-hue) / 0.16);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

:lang(ko) {
  word-break: keep-all;
}

::selection {
  background: var(--accent-soft);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 140ms ease, color 140ms ease;
}

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

.wrap {
  width: 100%;
  max-width: calc(var(--col) + 40px);
  margin: 0 auto;
  padding-inline: 20px;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-meta);
}

.site-links a {
  text-decoration: none;
}

.site-links a:hover {
  color: var(--text);
}

main {
  flex: 1;
  padding-block: 56px 64px;
}

/* Article page */
.article-header {
  margin-bottom: 32px;
}

.article-header h1 {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 13px;
  color: var(--text-meta);
  font-variant-numeric: tabular-nums;
}

.article-meta a {
  color: var(--text-meta);
  text-decoration: none;
}

.article-meta a:hover {
  color: var(--text);
  text-decoration: underline;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 36px 0 12px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.prose h3 {
  margin: 28px 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.prose p {
  margin: 0 0 18px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

.prose blockquote {
  margin: 24px 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--line);
  color: var(--text-muted);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 32px 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 5px;
  padding: 1px 5px;
}

.prose pre {
  margin: 22px 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hair);
}

.prose figure {
  margin: 26px 0;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-meta);
  line-height: 1.5;
}

.prose svg {
  max-width: 100%;
  height: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.prose th,
.prose td {
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--hair);
}

.prose th {
  font-weight: 600;
  color: var(--text-muted);
  border-bottom-color: var(--line);
}

.chart-frame {
  margin: 26px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow-x: auto;
}

.site-footer {
  border-top: 1px solid var(--hair);
  padding: 20px 0 36px;
  font-size: 13px;
  color: var(--text-meta);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

@media (max-width: 560px) {
  .article-header h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

@media print {
  .site-footer,
  .article-meta .pdf-link,
  .article-meta :has(+ .pdf-link) {
    display: none;
  }
}
