:root {
  --hako-bg: #ffffff;
  --hako-surface: #ffffff;
  --hako-text: #17211d;
  --hako-body: #2a322e;
  --hako-muted: #586860;
  --hako-faint: #8b968f;
  --hako-border: #e9ece9;
  --hako-border-strong: #dce1dd;
  --hako-soft: #f3f6f4;
  --hako-accent: #128a6b;
  --hako-accent-strong: #0b6149;
  --hako-accent-soft: #e9f3ee;
  --hako-code-bg: #f5f8f6;
  --hako-code-text: #232c27;
  --hako-code-inline: #0b6149;
  --hako-sidebar-width: 248px;
  --hako-content-width: 720px;
  --hako-page-max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--hako-bg);
  color: var(--hako-text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
}

::selection {
  background: var(--hako-accent-soft);
  color: var(--hako-accent-strong);
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--hako-accent) 38%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--hako-accent-strong);
  text-decoration-color: currentColor;
}

a:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--hako-accent);
  outline-offset: 3px;
}

.hako-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--hako-surface);
  border-bottom: 1px solid var(--hako-border);
}

.hako-site-header__inner {
  align-items: center;
  display: flex;
  gap: 16px;
  margin: 0 auto;
  max-width: var(--hako-page-max);
  padding: 15px 32px;
}

.hako-site-header__brand {
  align-items: center;
  color: var(--hako-text);
  display: inline-flex;
  font-size: 1.02rem;
  font-weight: 700;
  gap: 9px;
  line-height: 1.2;
  text-decoration: none;
}

.hako-site-header__brand::before {
  background: var(--hako-accent);
  border-radius: 3px;
  box-shadow: 0 0 0 3px var(--hako-accent-soft);
  content: "";
  height: 9px;
  width: 9px;
}

.hako-site-header__brand:hover {
  color: var(--hako-text);
}

.hako-shell {
  align-items: start;
  display: grid;
  gap: clamp(40px, 6vw, 88px);
  grid-template-columns: var(--hako-sidebar-width) minmax(0, var(--hako-content-width));
  margin: 0 auto;
  max-width: var(--hako-page-max);
  padding: 56px 32px 96px;
}

.hako-sidebar {
  align-self: start;
  border-right: 1px solid var(--hako-border);
  padding-right: 28px;
  position: sticky;
  top: 88px;
}

.hako-sidebar__handle {
  align-items: center;
  color: var(--hako-accent-strong);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.hako-sidebar__handle:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.hako-sidebar__description {
  color: var(--hako-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 10px 0 26px;
}

.hako-sidebar__section {
  border-top: 1px solid var(--hako-border);
  padding-top: 20px;
}

.hako-sidebar__section + .hako-sidebar__section {
  margin-top: 20px;
}

.hako-sidebar__section-title {
  color: var(--hako-faint);
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hako-sidebar__list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hako-sidebar__list a {
  align-items: center;
  border-radius: 8px;
  color: var(--hako-text);
  display: flex;
  font-size: 0.92rem;
  gap: 10px;
  justify-content: space-between;
  margin: 0 -10px;
  padding: 7px 10px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.hako-sidebar__list a:hover {
  background: var(--hako-soft);
  color: var(--hako-accent-strong);
}

.hako-sidebar__count {
  color: var(--hako-faint);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.hako-sidebar__list a:hover .hako-sidebar__count {
  color: var(--hako-accent);
}

.hako-main {
  min-width: 0;
}

.hako-list-page > header,
.hako-article > header {
  border-bottom: 1px solid var(--hako-border);
  margin-bottom: 36px;
  padding-bottom: 28px;
}

.hako-article > header {
  margin-bottom: 40px;
}

.hako-list-page__eyebrow,
.hako-article__category,
.hako-post-list__category {
  color: var(--hako-accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.hako-article__category a,
.hako-post-list__category a {
  text-decoration: none;
}

.hako-article__category:empty,
.hako-post-list__category:empty {
  display: none;
}

.hako-article__category a:hover,
.hako-post-list__category a:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

h1,
h2,
h3 {
  color: var(--hako-text);
  line-height: 1.25;
  margin: 0;
  overflow-wrap: break-word;
}

h1 {
  font-size: 2.45rem;
  font-weight: 700;
}

.hako-list-page__description,
.hako-article__description {
  color: var(--hako-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 16px 0 0;
  max-width: 38rem;
}

.hako-post-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hako-post-list__item {
  border-bottom: 1px solid var(--hako-border);
  padding: 32px 0;
}

.hako-post-list__item:first-child {
  padding-top: 0;
}

.hako-post-list__item:last-child {
  border-bottom: 0;
}

.hako-post-list__category {
  font-size: 0.78rem;
  margin: 0 0 10px;
}

.hako-post-list h2 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
}

.hako-post-list h2 a {
  text-decoration: none;
}

.hako-post-list h2 a:hover {
  color: var(--hako-accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.hako-post-list__description {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--hako-muted);
  display: -webkit-box;
  font-size: 1rem;
  line-height: 1.6;
  margin: 10px 0 0;
  overflow: hidden;
}

.hako-post-list__meta,
.hako-article__meta {
  color: var(--hako-faint);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 0;
}

.hako-post-list__empty {
  color: var(--hako-muted);
  margin: 24px 0 0;
}

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

.hako-article__body {
  color: var(--hako-body);
  font-size: 1.06rem;
  line-height: 1.82;
  overflow-wrap: break-word;
}

.hako-article__body > * + * {
  margin-top: 1.15em;
}

.hako-article__body h1,
.hako-article__body h2,
.hako-article__body h3 {
  line-height: 1.3;
  margin-top: 2em;
}

.hako-article__body h1 {
  font-size: 1.7rem;
}

.hako-article__body h2 {
  border-bottom: 1px solid var(--hako-border);
  font-size: 1.4rem;
  padding-bottom: 0.3em;
}

.hako-article__body h3 {
  font-size: 1.16rem;
}

.hako-article__body p {
  margin-bottom: 0;
}

.hako-article__body ul,
.hako-article__body ol {
  padding-left: 1.4em;
}

.hako-article__body li + li {
  margin-top: 0.4em;
}

.hako-article__body img {
  border-radius: 8px;
  height: auto;
  max-width: 100%;
}

.hako-article__body hr {
  border: 0;
  border-top: 1px solid var(--hako-border);
  margin: 2.4em 0;
}

.hako-article__body blockquote {
  border-left: 3px solid var(--hako-accent);
  color: var(--hako-muted);
  margin: 1.6em 0;
  padding: 2px 0 2px 20px;
}

.hako-article__body blockquote p {
  margin: 0;
}

.hako-article__body code {
  background: var(--hako-code-bg);
  border: 1px solid var(--hako-border);
  border-radius: 5px;
  color: var(--hako-code-inline);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.36em;
}

.hako-article__body pre {
  background: var(--hako-code-bg);
  border: 1px solid var(--hako-border-strong);
  border-radius: 10px;
  color: var(--hako-code-text);
  font-size: 0.9rem;
  line-height: 1.7;
  overflow-x: auto;
  padding: 18px 20px;
}

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

@media (max-width: 860px) {
  .hako-site-header__inner {
    padding: 14px 20px;
  }

  .hako-shell {
    display: block;
    padding: 32px 20px 64px;
  }

  .hako-sidebar {
    border-bottom: 1px solid var(--hako-border);
    border-right: 0;
    margin-bottom: 36px;
    padding-bottom: 24px;
    padding-right: 0;
    position: static;
  }

  .hako-sidebar__description {
    margin-bottom: 20px;
  }

  .hako-sidebar__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hako-sidebar__list a {
    background: var(--hako-surface);
    border: 1px solid var(--hako-border);
    border-radius: 999px;
    gap: 7px;
    margin: 0;
    padding: 6px 13px;
  }

  .hako-sidebar__list a:hover {
    background: var(--hako-soft);
    border-color: var(--hako-border-strong);
  }
}

@media (max-width: 520px) {
  .hako-shell {
    padding: 24px 16px 56px;
  }

  h1 {
    font-size: 2rem;
  }

  .hako-post-list h2 {
    font-size: 1.35rem;
  }

  .hako-article__body {
    font-size: 1.02rem;
  }

  .hako-article__body pre {
    border-radius: 8px;
    padding: 14px 16px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
