:root {
  color-scheme: light;
  --canvas: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #162033;
  --ink-soft: #445268;
  --muted: #718096;
  --line: #dbe3ee;
  --line-strong: #c5d0df;
  --accent: #315f9f;
  --accent-dark: #214673;
  --accent-soft: #e7effa;
  --candidate-bg: #fff3cf;
  --candidate-ink: #805b00;
  --complete-bg: #e5f5ec;
  --complete-ink: #17663d;
  --waiting-bg: #e7effa;
  --waiting-ink: #315f9f;
  --archived-bg: #edf0f4;
  --archived-ink: #5f6b7a;
  --code-bg: #172235;
  --code-ink: #e8eef7;
  --shadow-sm: 0 2px 10px rgba(32, 51, 78, 0.05);
  --shadow-md: 0 16px 40px rgba(32, 51, 78, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

a:focus-visible {
  outline: 3px solid rgba(49, 95, 159, 0.3);
  outline-offset: 3px;
  border-radius: 5px;
}

.site-shell {
  width: min(100% - 40px, 1120px);
  margin: 0 auto;
}

.site-header {
  padding: 28px 0 34px;
}

.topbar,
.title-row,
.index-actions,
.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 42px;
}

.back-link,
.brand-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.back-link:hover,
.brand-link:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--accent-dark);
}

.eyebrow,
.section-kicker,
.card-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.title-row {
  align-items: flex-start;
}

.title-block {
  min-width: 0;
}

h1 {
  max-width: 850px;
  margin: 10px 0 12px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 790;
  letter-spacing: -0.045em;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.lede {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
  text-wrap: pretty;
}

.status-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.status-experiment-candidate {
  background: var(--candidate-bg);
  color: var(--candidate-ink);
}

.status-research-complete {
  background: var(--complete-bg);
  color: var(--complete-ink);
}

.status-awaiting-test {
  background: var(--waiting-bg);
  color: var(--waiting-ink);
}

.status-archived {
  background: var(--archived-bg);
  color: var(--archived-ink);
}

.note-layout {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding-bottom: 54px;
}

.meta-card,
.note-content {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.meta-card {
  position: sticky;
  top: 24px;
  overflow: hidden;
  border-radius: 16px;
}

.meta-card::before {
  display: block;
  height: 4px;
  background: var(--accent);
  content: "";
}

.meta-card-inner {
  padding: 22px 20px 20px;
}

.card-kicker {
  margin-bottom: 17px;
  color: var(--muted);
}

.meta-list {
  margin: 0;
}

.meta-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.meta-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.meta-item dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.meta-item dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.scope-note {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid #f0d788;
  border-radius: 10px;
  background: #fffaf0;
  color: #6c5414;
  font-size: 13px;
  line-height: 1.6;
}

.scope-note strong {
  display: block;
  margin-bottom: 3px;
  color: var(--candidate-ink);
  font-size: 12px;
}

.note-content {
  min-width: 0;
  border-radius: 18px;
  padding: clamp(24px, 5vw, 52px);
}

.content-intro {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.content-intro p:last-child {
  margin-bottom: 0;
}

.note-content h2 {
  margin: 42px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 780;
  letter-spacing: -0.03em;
  line-height: 1.3;
  text-wrap: balance;
}

.note-content .content-intro + h2,
.note-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.note-content h3 {
  margin: 28px 0 9px;
  color: var(--accent-dark);
  font-size: clamp(17px, 2.3vw, 21px);
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.note-content p {
  margin: 0 0 17px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.note-content ul,
.note-content ol {
  margin: 0 0 20px;
  padding-left: 1.35em;
  color: var(--ink-soft);
}

.note-content li {
  margin: 5px 0;
  padding-left: 4px;
}

.note-content li::marker {
  color: var(--accent);
  font-weight: 700;
}

.note-content blockquote {
  margin: 24px 0;
  padding: 15px 19px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.note-content blockquote p {
  color: inherit;
}

.note-content code {
  padding: 2px 5px;
  border: 1px solid #d9e2ef;
  border-radius: 5px;
  background: #f1f5fa;
  color: #244d80;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.note-content pre {
  overflow-x: auto;
  margin: 20px 0 24px;
  padding: 17px 19px;
  border: 1px solid #293b55;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

.note-content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.note-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 20px 0 24px;
  border-collapse: collapse;
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}

.note-content th,
.note-content td {
  min-width: 110px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.note-content th {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 750;
  white-space: nowrap;
}

.note-content hr {
  height: 1px;
  margin: 32px 0;
  border: 0;
  background: var(--line);
}

.note-content a {
  font-weight: 600;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.index-page {
  padding-bottom: 48px;
}

.index-page .site-header {
  padding-bottom: 24px;
}

.index-actions {
  align-items: flex-start;
  margin: 22px 0 28px;
}

.index-intro {
  max-width: 700px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.stats-line {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.note-card:hover {
  border-color: #a9bdd8;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.note-card-top {
  align-items: flex-start;
  margin-bottom: 15px;
}

.note-category {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note-card-title {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.note-card-title:hover {
  color: var(--accent);
}

.note-card-summary {
  min-height: 3.5em;
  margin: 0 0 15px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.read-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 28px, 680px);
  }

  .topbar {
    margin-bottom: 30px;
  }

  .title-row {
    display: block;
  }

  .title-row .status-chip {
    margin-top: 16px;
  }

  .note-layout {
    display: block;
  }

  .meta-card {
    position: static;
    margin-bottom: 16px;
  }

  .meta-card-inner {
    padding: 18px;
  }

  .note-content {
    padding: 26px 20px 32px;
  }

  .index-actions {
    display: block;
  }

  .stats-line {
    display: block;
    margin-top: 10px;
  }

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

@media (max-width: 460px) {
  .site-shell {
    width: min(100% - 20px, 680px);
  }

  .site-header {
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    gap: 8px;
  }

  .back-link,
  .brand-link {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 12px;
  }

  h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .lede {
    font-size: 16px;
  }

  .note-content {
    border-radius: 14px;
    padding: 22px 16px 28px;
  }

  .note-content h2 {
    margin-top: 34px;
    padding-top: 22px;
  }

  .note-card {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .note-card {
    transition: none;
  }
}

@media print {
  html,
  body {
    background: #fff;
  }

  .site-shell {
    width: 100%;
  }

  .meta-card,
  .note-content {
    box-shadow: none;
  }

  .meta-card {
    position: static;
  }

  .back-link,
  .brand-link {
    border: 0;
    padding: 0;
    box-shadow: none;
  }
}
