:root {
  color-scheme: light;
  --paper: #f8f4ed;
  --surface: #fffdf9;
  --ink: #20201d;
  --muted: #6d6a62;
  --line: #ded8cd;
  --accent: #bf4f35;
  --accent-soft: #f3ded5;
  --shadow: 0 18px 50px rgba(47, 40, 30, 0.09);
  --display: "DM Serif Display", Georgia, serif;
  --serif: "Noto Serif KR", "Noto Sans KR", serif;
  --sans: "Noto Sans KR", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171714;
  --surface: #211f1b;
  --ink: #f2eee6;
  --muted: #aaa399;
  --line: #3b3731;
  --accent: #ef8a6e;
  --accent-soft: #472d27;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  letter-spacing: -0.012em;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { color: inherit; }
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.skip-link:focus { position: fixed; z-index: 1000; inset: 12px auto auto 12px; padding: 8px 12px; background: var(--surface); }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 34px; }
.brand { font: 1.9rem/1 var(--display); letter-spacing: -0.03em; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 24px; margin-left: auto; font-size: 0.95rem; font-weight: 500; }
nav a:hover { color: var(--accent); }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; }

.hero { padding: 108px 0 88px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.hero h1 { max-width: 820px; margin: 0; font: 700 clamp(3rem, 5.75vw, 4.6rem)/1.22 var(--serif); letter-spacing: -0.055em; word-break: keep-all; }
.hero-line { display: block; white-space: nowrap; }
.hero h1 em { color: var(--accent); font-style: italic; font-weight: 600; }
.hero > p:last-child { max-width: 570px; margin: 26px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.8; }

.content-section { padding-bottom: 110px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.section-heading h2 { margin: 0; font: 700 2.2rem/1.35 var(--serif); letter-spacing: -0.045em; }
.search-field input { width: min(280px, 70vw); border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); padding: 11px 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.filter-chip { border: 1px solid var(--line); border-radius: 99px; background: transparent; padding: 8px 16px; cursor: pointer; }
.filter-chip.is-active, .filter-chip:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.post-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 28px; }
.post-card { grid-column: span 4; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: inherit; box-shadow: 0 1px 0 rgba(0,0,0,.02); transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.post-card[hidden] { display: none; }
.card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card-image--empty { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 2.2rem var(--serif); }
.post-card:hover .card-image img { transform: scale(1.025); }
.card-body { padding: 24px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .75rem; }
.card-meta span { color: var(--accent); font-weight: 700; }
.card-body h3 { min-height: 4.5em; margin: 14px 0 10px; display: -webkit-box; overflow: hidden; font: 700 1.22rem/1.5 var(--serif); letter-spacing: -0.035em; word-break: keep-all; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-body p { margin: 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: .95rem; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.read-more { display: inline-block; margin-top: 20px; color: var(--accent); font-size: .86rem; font-weight: 700; }
.empty-state { padding: 50px 0; color: var(--muted); text-align: center; }

.article-shell { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 82px 0 110px; }
.article-header { margin-bottom: 50px; text-align: center; }
.article-header h1 { margin: 12px auto 22px; font: 700 clamp(2.25rem, 4.3vw, 3.25rem)/1.32 var(--serif); letter-spacing: -.055em; word-break: keep-all; }
.article-meta { display: flex; justify-content: center; gap: 10px; color: var(--muted); font-size: .87rem; }
.article-content { font-size: 1.08rem; line-height: 1.95; letter-spacing: -0.006em; }
.article-content h2, .article-content h3 { margin: 2.2em 0 .7em; line-height: 1.35; }
.article-content h2 { font: 700 1.55rem/1.5 var(--serif); letter-spacing: -0.035em; }
.article-content h3 { font: 700 1.25rem/1.55 var(--serif); letter-spacing: -0.03em; }
.article-content p { margin: 1.15em 0; }
.article-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-content img { margin: 2rem auto; border-radius: 14px; box-shadow: var(--shadow); }
.article-content blockquote { margin: 2rem 0; border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 16px 22px; }
.article-content table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.article-content th, .article-content td { border: 1px solid var(--line); padding: 10px; text-align: left; }
.article-content pre { overflow-x: auto; border-radius: 12px; background: #141412; color: #f7f1e8; padding: 18px; }
.article-content hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }
.comments { margin-top: 70px; border-top: 1px solid var(--line); padding-top: 36px; }
.comments h2 { font: 2rem var(--serif); }
:root[data-theme="dark"] #lv-container { border-radius: 12px; background: #f7f7f7; filter: invert(.88) hue-rotate(180deg); padding: 10px; }

.ad-slot { min-height: 112px; display: grid; place-items: center; margin: 40px 0; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.ad-placeholder { font-size: .7rem; letter-spacing: .2em; opacity: .55; }
.ad-label { align-self: start; padding-top: 6px; font-size: .65rem; }

.site-footer { border-top: 1px solid var(--line); padding: 54px 0 24px; background: var(--surface); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }
.footer-grid p { color: var(--muted); }
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links button { border: 0; background: transparent; cursor: pointer; }
.footer-links button:hover { color: var(--accent); }
.copyright { margin: 42px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }

.site-dialog { width: min(560px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); padding: 36px; box-shadow: var(--shadow); }
.site-dialog::backdrop { background: rgba(20, 17, 14, .68); backdrop-filter: blur(3px); }
.site-dialog h2 { margin: 0 0 18px; font: 2.2rem var(--serif); }
.dialog-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 1.8rem; cursor: pointer; }
.contact-form { display: grid; gap: 16px; margin-top: 22px; }
.contact-form label { display: grid; gap: 7px; font-size: .85rem; font-weight: 700; }
.contact-form input, .contact-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); padding: 11px; }
.primary-button { border: 0; border-radius: 9px; background: var(--accent); color: white; padding: 12px 18px; font-weight: 700; cursor: pointer; }

@media (max-width: 900px) {
  nav { display: none; }
  .icon-button { margin-left: auto; }
  .post-card { grid-column: span 6; }
}

@media (max-width: 620px) {
  .container, .article-shell { width: min(100% - 28px, 1160px); }
  .header-inner { min-height: 64px; }
  .hero { padding: 72px 0 58px; }
  .hero h1 { font-size: clamp(2.25rem, 9vw, 3.45rem); line-height: 1.3; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .post-card { grid-column: 1 / -1; }
  .article-shell { padding-top: 56px; }
  .article-header h1 { font-size: 2rem; line-height: 1.4; }
  .article-content { font-size: 1.02rem; line-height: 1.9; }
  .footer-grid, .footer-links { align-items: flex-start; flex-direction: column; }
  .ad-slot { min-height: 88px; }
}
