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

/* ============================================================
   헤이즐테이블 · 비교 원장 (ledger / spreadsheet architecture)
   paper + thin gridlines + ink + single hazel accent
   ============================================================ */

:root {
  --paper: #faf8f3;
  --paper-2: #f4f1e8;
  --grid: #e0dccf;
  --grid-strong: #cdc7b5;
  --ink: #2a2a26;
  --ink-soft: #6a675d;
  --ink-faint: #908c80;
  --hazel: #9a6b45;
  --hazel-deep: #7c5435;
  --hazel-tint: #f1e7dd;
  --zebra: #f4f1e8;
  --hover: #f0e6da;
  --font-sans: "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --maxw: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.003em;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}

a {
  color: var(--hazel-deep);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 50;
  text-decoration: none;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------------- Ledger header (wordmark + column-key legend) ---------------- */

.ledger-head {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.ledger-head__brand {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 32px 14px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.wordmark__mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--hazel);
  color: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  border-radius: 3px;
}

.wordmark__text {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.wordmark__name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.wordmark__tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--hazel);
}

.ledger-head__id {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.legend-strip {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--grid);
}

.legend-cell {
  display: flex;
  gap: 8px;
  padding: 9px 14px 9px 0;
  border-right: 1px solid var(--grid);
  align-items: flex-start;
}
.legend-cell:first-child {
  padding-left: 0;
}
.legend-cell:last-child {
  border-right: 0;
}

.legend-key {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.legend-meaning {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.legend-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.legend-hint {
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------------- Home: lead cover plate ---------------- */

.ledger-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px 64px;
}

.ledger-lead {
  margin: 28px 0 26px;
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--hazel);
  background-image: linear-gradient(
      125deg,
      rgba(42, 42, 38, 0.86) 0%,
      rgba(124, 84, 53, 0.7) 58%,
      rgba(154, 107, 69, 0.62) 100%
    ),
    url("/images/hazeltable-lead.jpg");
  background-size: cover;
  background-position: center;
  color: var(--paper);
}

.ledger-lead__inner {
  padding: 40px 40px 38px;
  max-width: 720px;
}

.ledger-lead__eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0ddcb;
}

.ledger-lead h1 {
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ledger-lead__sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #f3ece2;
  max-width: 56ch;
}

/* ---------------- Home: comparison ledger ---------------- */

.ledger-block {
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  background: var(--paper);
}

.ledger-block__bar {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}
.ledger-block__bar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ledger-block__caption {
  margin: 0;
  flex: 1 1 240px;
  font-size: 13px;
  color: var(--ink-soft);
}
.ledger-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--hazel-deep);
  background: var(--hazel-tint);
  padding: 3px 9px;
  border-radius: 3px;
}

.ledger-scroll {
  overflow: visible;
}

table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.ledger thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper-2);
  border-bottom: 2px solid var(--ink);
  border-right: 1px solid var(--grid);
  text-align: left;
  vertical-align: bottom;
  padding: 11px 16px;
  white-space: nowrap;
}
table.ledger thead th:last-child {
  border-right: 0;
}
.col-key {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 8px;
}
.col-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

table.ledger tbody td,
table.ledger tbody th {
  border-bottom: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  padding: 14px 16px;
  vertical-align: top;
  text-align: left;
}
table.ledger tbody td:last-child,
table.ledger tbody th:last-child {
  border-right: 0;
}

table.ledger tbody tr:nth-child(even) th,
table.ledger tbody tr:nth-child(even) td {
  background: var(--zebra);
}
table.ledger tbody tr:hover th,
table.ledger tbody tr:hover td {
  background: var(--hover);
}

.cell-topic {
  font-weight: 700;
  min-width: 280px;
  border-left: 3px solid transparent;
}
table.ledger tbody tr:hover .cell-topic {
  border-left-color: var(--hazel);
}
.cell-topic a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
.cell-topic a:hover {
  color: var(--hazel-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cell-topic__meta {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-faint);
  line-height: 1.45;
}

.cell-field {
  color: var(--ink-soft);
  white-space: nowrap;
}
.cell-criterion {
  color: var(--ink);
}
.cell-num,
.cell-date {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.cell-num {
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}

.ledger-block__foot {
  margin: 0;
  padding: 13px 20px;
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--grid);
}

/* ---------------- Article: row detail / ledger entry ---------------- */

.entry-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 30px 32px 64px;
}

.entry {
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  background: var(--paper);
}

.entry-head {
  padding: 30px 34px 26px;
  border-bottom: 2px solid var(--ink);
}
.entry-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hazel-deep);
}
.entry-head h1 {
  margin: 0 0 14px;
  font-size: 31px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.018em;
}
.entry-lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* shared section bar */
.entry-criteria__bar,
.entry-memo__bar,
.entry-faq__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 34px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--grid);
}
.entry-criteria__bar h2,
.entry-memo__bar h2,
.entry-faq__bar h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.entry-criteria__hint,
.entry-memo__cellref,
.entry-faq__count {
  font-size: 12px;
  color: var(--ink-faint);
}

/* criteria ledger (the row expanded) */
.entry-criteria {
  border-bottom: 1px solid var(--grid);
}
table.entry-ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.entry-ledger thead th {
  text-align: left;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  border-right: 1px solid var(--grid);
  padding: 10px 16px 10px 34px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
}
table.entry-ledger thead th:last-child {
  border-right: 0;
  padding-left: 16px;
}
table.entry-ledger tbody th {
  text-align: left;
  width: 38%;
  padding: 12px 16px 12px 34px;
  border-bottom: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-2);
}
table.entry-ledger tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--grid);
  color: var(--ink);
}
table.entry-ledger tbody tr:last-child th,
table.entry-ledger tbody tr:last-child td {
  border-bottom: 0;
}

.qual-legend {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 34px 16px;
}
.qual-legend__title {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.qual-legend__row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.qual-legend__mark {
  font-size: 12px;
  font-weight: 700;
  color: var(--hazel-deep);
  background: var(--hazel-tint);
  padding: 2px 8px;
  border-radius: 2px;
}
.qual-legend__meaning {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

/* memo block: injected content */
.entry-memo__source {
  margin: 0;
  padding: 14px 34px 26px;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.ledger-memo {
  padding: 8px 34px 6px;
}
.ledger-memo > :first-child {
  margin-top: 12px;
}
.article-content p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.8;
}
.article-content h2 {
  margin: 32px 0 12px;
  padding-left: 12px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  border-left: 4px solid var(--hazel);
  letter-spacing: -0.01em;
}
.article-content h3 {
  margin: 24px 0 10px;
  font-size: 16px;
  font-weight: 700;
}
.article-content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--hazel-tint);
  border-left: 4px solid var(--hazel);
  border-radius: 0 3px 3px 0;
  color: var(--hazel-deep);
  font-size: 15px;
  line-height: 1.65;
}
.article-content blockquote p {
  margin: 0;
}
.article-content ul,
.article-content ol {
  margin: 0 0 18px;
  padding-left: 4px;
  list-style: none;
}
.article-content ul li,
.article-content ol li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
  font-size: 15px;
  line-height: 1.7;
}
.article-content ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  background: var(--hazel);
  border-radius: 1px;
}
.article-content ol {
  counter-reset: li;
}
.article-content ol li::before {
  counter-increment: li;
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--hazel-deep);
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
  border: 1px solid var(--grid-strong);
}
.article-content thead th {
  background: var(--paper-2);
  text-align: left;
  padding: 11px 14px;
  border-bottom: 2px solid var(--ink);
  border-right: 1px solid var(--grid);
  font-weight: 700;
}
.article-content thead th:last-child {
  border-right: 0;
}
.article-content tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  vertical-align: top;
}
.article-content tbody td:last-child {
  border-right: 0;
}
.article-content tbody tr:nth-child(even) td {
  background: var(--zebra);
}
.article-content tbody tr:hover td {
  background: var(--hover);
}
.article-content a {
  color: var(--hazel-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.article-content a:hover {
  color: var(--hazel);
}

/* faq */
.entry-faq details {
  border-bottom: 1px solid var(--grid);
  padding: 0 34px;
}
.entry-faq details:last-of-type {
  border-bottom: 0;
}
.entry-faq summary {
  cursor: pointer;
  padding: 15px 0;
  font-size: 15px;
  font-weight: 700;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.entry-faq summary::-webkit-details-marker {
  display: none;
}
.entry-faq summary::before {
  content: "Q";
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--paper);
  background: var(--hazel);
  padding: 1px 6px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.entry-faq details[open] summary {
  color: var(--hazel-deep);
}
.entry-faq details p {
  margin: 0 0 16px 26px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.entry-foot {
  padding: 22px 34px;
  border-top: 2px solid var(--ink);
}
.entry-foot__back {
  font-size: 14px;
  font-weight: 700;
  color: var(--hazel-deep);
  text-decoration: none;
}
.entry-foot__back::before {
  content: "<";
  font-family: var(--font-mono);
  margin-right: 7px;
  color: var(--hazel);
}
.entry-foot__back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------- Global footer ---------------- */

.ledger-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 32px 40px;
  border-top: 2px solid var(--ink);
}
.ledger-foot__rule {
  display: flex;
  gap: 18px;
  align-items: baseline;
  flex-wrap: wrap;
}
.ledger-foot__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: 0 0 auto;
}
.ledger-foot__rule ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-width: 760px;
}
.ledger-foot__rule li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.ledger-foot__rule li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--grid-strong);
  border-radius: 1px;
}
.ledger-foot__mark {
  margin: 18px 0 0;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-faint);
  border-top: 1px solid var(--grid);
  padding-top: 14px;
}
.ledger-foot__mark span:first-child {
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---------------- Responsive: collapse gracefully ---------------- */

@media (max-width: 860px) {
  .legend-strip {
    grid-template-columns: 1fr 1fr;
  }
  .legend-cell:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 720px) {
  .ledger-head__brand,
  .legend-strip,
  .ledger-page,
  .ledger-foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .legend-strip {
    grid-template-columns: 1fr;
  }
  .legend-cell {
    border-right: 0;
    border-bottom: 1px solid var(--grid);
  }
  .legend-cell:last-child {
    border-bottom: 0;
  }
  .ledger-lead__inner {
    padding: 28px 22px;
  }
  .ledger-lead h1 {
    font-size: 28px;
  }
  .ledger-scroll {
    overflow-x: auto;
  }
  table.ledger {
    min-width: 640px;
  }
  .entry-page {
    padding: 20px 18px 48px;
  }
  .entry-head,
  .entry-criteria__bar,
  .entry-memo__bar,
  .entry-faq__bar,
  .ledger-memo,
  .entry-memo__source,
  .qual-legend,
  .entry-faq details,
  .entry-foot {
    padding-left: 20px;
    padding-right: 20px;
  }
  table.entry-ledger thead th,
  table.entry-ledger tbody th {
    padding-left: 20px;
  }
  .article-content table {
    display: block;
    overflow-x: auto;
  }
}
