:root {
  --blue: #27316c;
  --blue-strong: #1f285d;
  --blue-soft: #eef1fa;
  --sky: #5865a6;
  --green: #00a881;
  --ink: #191f28;
  --text: #333d4b;
  --muted: #6b7684;
  --line: #e5e8eb;
  --surface: #f8fafc;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(25, 31, 40, 0.08);
  --radius: 8px;
  --page: min(1120px, calc(100vw - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(229, 232, 235, 0.84);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(210px, 300px);
  align-items: center;
  gap: 22px;
  width: var(--page);
  min-height: 72px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 300;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  width: 42px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-name {
  color: #111111;
  font-family: "Helvetica Neue", "Avenir Next", "Noto Sans KR", Arial, sans-serif;
  font-size: 17px;
  font-weight: 300;
}

.topic-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-nav::-webkit-scrollbar {
  display: none;
}

.topic-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.topic-link:hover,
.topic-link.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-55%);
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.search-box input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
  padding: 0 14px 0 40px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.search-box input:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 100, 255, 0.12);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  width: min(440px, calc(100vw - 40px));
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-results.is-open {
  display: block;
}

.result-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.result-item:last-child {
  border-bottom: 0;
}

.result-item img {
  width: 64px;
  height: 44px;
  border-radius: 6px;
  object-fit: contain;
}

.result-item strong,
.result-item small {
  display: block;
}

.result-item strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.result-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.empty-result {
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 48px;
  align-items: center;
  width: var(--page);
  min-height: min(620px, calc(100vh - 72px));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.hero-copy {
  max-width: 560px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.hero-copy h1,
.page-title h1,
.post-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow),
.page-title p,
.post-header p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--blue);
  font-weight: 800;
}

.text-link::after {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  content: ">";
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.hero-media {
  overflow: hidden;
  border-radius: var(--radius);
  background: #f4f6f8;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.28s ease;
}

.hero-media:hover img {
  transform: none;
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  width: var(--page);
  margin: 0 auto;
  padding: 46px 0 96px;
  border-top: 1px solid var(--line);
}

.article-section.standalone,
.related-section {
  width: var(--page);
  margin: 0 auto;
  padding: 36px 0 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading h2,
.side-rail h2,
.related-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.25;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 24px;
}

.article-card {
  min-width: 0;
}

.article-card .thumb {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
}

.article-card .thumb img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: contain;
  transition: transform 0.24s ease;
}

.article-card:hover .thumb img {
  transform: none;
}

.card-body {
  padding-top: 16px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.article-meta a {
  color: var(--blue);
}

.article-meta span {
  position: relative;
}

.article-meta span::before {
  margin-right: 10px;
  color: #c1c8d0;
  content: "·";
}

.article-card h3 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.34;
}

.article-card p {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-author {
  margin-top: 12px;
  color: #8b95a1;
  font-size: 14px;
  font-weight: 700;
}

.side-rail {
  display: grid;
  align-content: start;
  gap: 34px;
}

.side-rail section {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.rank-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.rank-link {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
}

.rank-link span {
  color: var(--blue);
  font-weight: 900;
}

.rank-link strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.rank-link small {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  padding: 0 12px;
}

.page-title {
  width: var(--page);
  margin: 0 auto;
  padding: 72px 0 34px;
}

.page-title h1 {
  font-size: clamp(42px, 8vw, 82px);
}

.post-shell {
  width: min(860px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 72px 0 68px;
}

.post-header {
  text-align: left;
}

.post-header .article-meta {
  margin-bottom: 18px;
}

.post-header h1 {
  font-size: clamp(38px, 7vw, 68px);
}

.post-author {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.post-cover {
  overflow: hidden;
  margin: 42px 0 52px;
  border-radius: var(--radius);
  background: var(--white);
}

.post-cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.post-content {
  color: var(--text);
  font-size: 18px;
}

.post-content > *:first-child {
  margin-top: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--ink);
  line-height: 1.32;
  scroll-margin-top: 96px;
}

.post-content h2 {
  margin: 52px 0 16px;
  font-size: 32px;
}

.post-content h3 {
  margin: 36px 0 12px;
  font-size: 24px;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content table,
.post-content pre {
  margin: 18px 0;
}

.post-content a {
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.post-content ul,
.post-content ol {
  padding-left: 1.35em;
}

.post-content li + li {
  margin-top: 8px;
}

.post-content blockquote {
  border-left: 4px solid var(--blue);
  margin-left: 0;
  padding: 4px 0 4px 18px;
  color: var(--muted);
}

.post-content img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 32px rgba(25, 31, 40, 0.06);
}

.post-content p:has(img) {
  margin: 34px 0;
}

.post-content pre {
  overflow-x: auto;
  border-radius: var(--radius);
  background: #14171f;
  color: #edf4ff;
  padding: 18px;
  font-size: 15px;
  line-height: 1.65;
}

.post-content code {
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-strong);
  font-size: 0.92em;
  padding: 2px 6px;
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}

.post-content th,
.post-content td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
}

.post-content th {
  background: var(--surface);
  color: var(--ink);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 42px;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-nav a {
  display: grid;
  gap: 6px;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.post-nav a:last-child {
  text-align: right;
}

.post-nav span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.post-nav strong {
  color: var(--ink);
  line-height: 1.42;
}

.article-card.compact h3 {
  font-size: 18px;
}

.article-card.compact p {
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  width: var(--page);
  margin: 0 auto;
  padding: 40px 0 46px;
  color: var(--muted);
}

.footer-brand {
  display: inline-block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 8px;
}

.footer-inner p {
  margin: 0;
}

.footer-about {
  max-width: 720px;
  margin-top: 14px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
}

.footer-support {
  margin-top: 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.not-found {
  min-height: 52vh;
}

@media (max-width: 900px) {
  :root {
    --page: min(100vw - 28px, 720px);
  }

  .header-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 0;
  }

  .brand {
    justify-self: start;
  }

  .topic-nav {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .search-results {
    left: 0;
    right: auto;
    width: 100%;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
    padding: 42px 0 44px;
  }

  .hero-media {
    grid-row: 1;
  }

  .hero-copy h1,
  .page-title h1,
  .post-header h1 {
    font-size: 42px;
  }

  .content-shell {
    grid-template-columns: 1fr;
    gap: 42px;
    padding-bottom: 72px;
  }

  .side-rail {
    grid-template-columns: 1fr;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .post-shell {
    width: var(--page);
    padding-top: 46px;
  }

  .post-content {
    font-size: 17px;
  }
}

@media (max-width: 560px) {
  :root {
    --page: calc(100vw - 24px);
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-mark {
    width: 36px;
  }

  .topic-link {
    height: 34px;
    padding: 0 11px;
    font-size: 14px;
  }

  .hero-copy h1,
  .page-title h1,
  .post-header h1 {
    font-size: 34px;
  }

  .hero-copy p:not(.eyebrow),
  .page-title p,
  .post-header p {
    font-size: 17px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .content-shell,
  .article-section.standalone,
  .related-section {
    padding-bottom: 56px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav a:last-child {
    text-align: left;
  }
}
