@import url("https://cdn.jsdelivr.net/gh/sunn-us/SUIT/fonts/static/woff2/SUIT.css");

:root {
  --bg: #fbfbf8;
  --surface: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --line: #e8e8e3;
  --line-strong: #d9d9d2;
  --accent: #111111;
  --chip: #f3f3ee;
  --chip-active: #111111;
  --chip-active-text: #ffffff;
  --content-width: 760px;
  --list-width: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "SUIT", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner,
.site-footer__inner,
.list-shell,
.archive-wrap,
.post-layout {
  width: min(calc(100% - 32px), var(--list-width));
  margin: 0 auto;
}

.site-header__inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.site-brand {
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-main {
  padding: 28px 0 72px;
}

.list-shell {
  display: grid;
  gap: 18px;
}

.list-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.list-title,
.archive-title,
.post-title {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.22;
}

.list-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.list-context {
  padding-top: 2px;
}

.list-context .list-title {
  font-size: 1rem;
  line-height: 1.4;
}

.list-description,
.archive-description,
.post-meta,
.post-kicker,
.post-endcap,
.archive-date,
.empty-state,
.site-footer {
  color: var(--muted);
}

.list-description,
.archive-description {
  margin: 0;
  max-width: 62ch;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  align-items: center;
}

.list-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.lang-chip.is-active {
  background: var(--chip-active);
  border-color: var(--chip-active);
  color: var(--chip-active-text);
}

.lang-chip.is-disabled {
  color: #a4a4a4;
  border-color: var(--line);
}

.utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  cursor: pointer;
}

.utility-link--danger {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.24);
}

.utility-link--danger:hover {
  background: rgba(180, 35, 24, 0.06);
}

.search-box input {
  width: min(100%, 240px);
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: #a8a8a0;
}

.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.category-chip.is-active {
  background: var(--chip-active);
  color: var(--chip-active-text);
}

.post-list {
  border-top: 1px solid var(--line);
}

.list-search-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.post-row {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--line);
}

.post-row__meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.post-row__title {
  margin: 6px 0 8px;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.post-row__title a {
  text-decoration: none;
}

.post-row__excerpt {
  margin: 0;
  color: var(--muted);
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.token {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 0.84rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.pager-link.is-current {
  background: var(--chip-active);
  border-color: var(--chip-active);
  color: var(--chip-active-text);
}

.pager-link.is-disabled {
  color: #a4a4a4;
  border-color: var(--line);
}

.pager-status {
  font-size: 0.9rem;
  color: var(--muted);
}

.empty-state {
  margin: 0;
  padding-top: 4px;
}

.archive-panel,
.post-shell {
  width: min(100%, var(--content-width));
}

.archive-panel {
  display: grid;
  gap: 16px;
}

.archive-toolbar {
  display: flex;
  justify-content: flex-end;
}

.archive-group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.archive-group h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  padding: 7px 0;
}

.archive-item a {
  text-decoration: none;
}

.post-layout {
  display: flex;
  justify-content: center;
}

.post-shell {
  width: min(100%, var(--content-width));
}

.post-backbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.post-kicker {
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.post-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.92rem;
  margin-bottom: 22px;
}

.post-cover {
  margin: 0 0 26px;
}

.post-cover img {
  width: 100%;
  border: 1px solid var(--line);
}

.post-content {
  font-size: 1.02rem;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2em 0 0.75em;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content pre,
.post-content blockquote,
.post-content figure {
  margin: 1em 0;
}

.post-content a {
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.post-content pre {
  overflow-x: auto;
  padding: 18px;
  background: #121212;
  color: #f5f5f5;
}

.post-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.post-content :not(pre) > code {
  padding: 0.08em 0.3em;
  background: #f1f1ec;
}

.post-content blockquote {
  margin-inline: 0;
  padding-left: 16px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
}

.post-content iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

.post-embed {
  margin: 1.2em 0;
}

.post-embed__frame {
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.post-content figcaption {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-endcap {
  padding-top: 22px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

.site-footer__inner p {
  margin: 0;
}

@media (max-width: 720px) {
  .site-main {
    padding-top: 22px;
  }

  .site-header__inner,
  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .list-toolbar {
    align-items: stretch;
  }

  .search-box input {
    width: 100%;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
