* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial, sans-serif;
  color: #0f172a;
  background: #ffffff;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container{
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
}

.content{
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas: "toc article";
  gap: 40px;
  align-items: start;
  padding-top: 20px;

  transform: translateX(-15px);
}

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eef2f7;
}

.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo{
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo__img{
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0);
}

.logo__text{
  font-family: "Qwitcher Grypen", cursive;
  font-size: 34px;
  letter-spacing: 0.2px;
}

.nav{
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: #334155;
}

.nav-link{
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}

.nav-link:hover{
  color: #0f172a;
}

.nav-link--active{
  color: #2563eb;
  font-weight: 600;
}

/* ====== HERO ====== */
.post{ padding-bottom: 56px; }

.info{
  padding-top: 34px;
  padding-bottom: 28px;
  text-align: center;
}

.breadcrumb{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.02em;
  margin: 4px 0 22px;
}

.breadcrumb a:hover{ color: #64748b; }
.breadcrumb-current{ color: #64748b; }

.post-title{
  margin: 0 auto;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 920px;
}

.post-subtitle{
  margin: 18px auto 0;
  max-width: 760px;
  font-size: 18px;
  color: #64748b;
}

.post-meta{
  margin-top: 18px;
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-divider {
  border: none;
  height: 1px;
  background: #e2e8f0;
  margin: 2px auto;
  max-width: 1072px;
}

.post-divider {
  border: 0;
  border-top: 1px solid #C9CED6;
  margin: 0 0 15px 0;
}

/* ===== table of contents ===== */

.toc {
  grid-area: toc;
  position: sticky;
  top: 135px;
  margin: 40px 100px 0px 0px;
  width: 300px;
  transform: translateX(-120px);

  opacity: 0;
  animation: fadeUpToc 0.55s ease forwards;
  animation-delay: 0.05s;
}

.toc-title {
  font-size: 13px;
  color: #94a3b8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.toc-link {
  display: block;
  padding: 10px 12px;
  margin: 2px 0;
  color: #94a3b8;
  border-left: 2px solid #e2e8f0;
  font-weight: 600;
}

.toc-link:hover {
  color: #64748b;
  border-left-color: #cbd5e1;
}

.toc-link--active {
  color: #0f172a;
  border-left-color: #2563eb;
}

/* ===== article ===== */

h2[id] {
  scroll-margin-top: 90px;
}

.article {
  grid-area: article;
  max-width: none;
  width: 100%;
  margin: 0;

  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.7s ease forwards;
  animation-delay: 0.12s;
}

.article p {
  font-size: 18px;
  color: #0f172a;
  margin: 0 0 8px;
}

.article .study-image {
  margin: 40px auto;
  max-width: 300px;
  height: auto;
}

.article .solution-title {
  font-size: 21px;
  margin: 0 0 4px;
}

.article h2 {
  margin: 30px 0 10px;
  font-size: 26px;
  letter-spacing: -0.01em;
}

.article pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 13px 0px 13px 25px;
  border-radius: 14px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.5;
}

.article ul {
  margin: 0;
  padding-left: 22px;
}

.article li {
  margin-bottom: 12px;
  line-height: 1.7;
  font-size: 18px;
}

.inline-code {
  font-family: Consolas, Monaco, monospace;
  font-size: 15px;
  margin: 0px 3px 0px 0px;
}

/* ===== article table ===== */

.article table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 20px 0;
  font-size: 16px;
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  overflow: hidden;
}

.article th,
.article td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid #e3e3e3;
  border-right: 1px solid #e3e3e3;
}

.article th:last-child,
.article td:last-child {
  border-right: 0;
}

.article th {
  background: #f2f2f2;
  color: #565658;
  font-weight: 600;
}

.article td {
  color: #0f172a;
}

.article tbody tr:last-child td {
  border-bottom: 0;
}

.article tbody tr:nth-child(even) {
  background: #fafafa;
}

/* ===== information cards ===== */

.infocard {
  border: 1px solid #d9d9d9;
  border-radius: 14px;
  background: #fafafa;
  overflow: hidden;
  margin: 20px 0;
}

.infocard-header {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  background: #f2f2f2;
  border-bottom: 1px solid #e3e3e3;
}

.infocard-header-img {
  font-size: 20px;
}

.infocard-header-title {
  font-size: 21px;
  margin: 0px 0px 2px 5px;
  color: #565658;

}

.infocard-body {
  padding: 18px 22px;
  background: #ffffff;
  font-size: 18px;
}

.infocard-body li:last-child {
  margin-bottom: 0;
}

.text-link {
  color: #1a73e8;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

p.img-description {
  margin: 0px 0px 15px 0px;
  color: #505050;
  font-size: 15px;
  text-align: center;
}

.site-footer {
  border-top: 1px solid #eef2f7;
  padding: 22px 0;
  color: #94a3b8;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: center;
}

/* ====== RESPONSIVE ====== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
 }

@keyframes fadeUpToc {
  from {
    opacity: 0;
    transform: translateX(-120px) translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateX(-120px) translateY(0);
  }
}

@media (max-width: 768px) {
  .toc {
    display: none;
    animation: none;
  }

  .content {
    display: block;
    transform: none;
  }

  .container {
    width: 100%;
    padding: 0 16px;
  }

  .article pre {
    padding: 12px;
    font-size: 13px;
  }

  .article p, .article li {
    word-break: keep-all;
  }
}

@media (max-width: 560px) {
  .nav{ gap: 14px; }
  .article p{ font-size: 16px; }
}
