:root {
  color-scheme: light;
  --bg: #f7f4ec;
  --surface: #fffdf8;
  --surface-soft: #eee8db;
  --text: #18201d;
  --muted: #66716c;
  --faint: #8c9690;
  --line: rgba(24, 32, 29, .14);
  --accent: #9f5136;
  --accent-2: #286f7b;
  --code-bg: #101a17;
  --code-text: #eef5ee;
  --shadow: 0 18px 60px rgba(24, 32, 29, .12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121715;
  --surface: #19211e;
  --surface-soft: #202a26;
  --text: #edf2ed;
  --muted: #b7c1bb;
  --faint: #7f8d86;
  --line: rgba(237, 242, 237, .14);
  --accent: #e2a071;
  --accent-2: #7fc7d4;
  --code-bg: #0c1110;
  --code-text: #edf2ed;
  --shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 780;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
}

.nav a {
  transition: color .2s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
}

.theme-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, .62fr);
  gap: clamp(34px, 6vw, 84px);
  align-items: center;
  padding: clamp(58px, 8vw, 104px) 0 clamp(52px, 7vw, 86px);
}

.home-copy {
  animation: riseIn .65s ease both;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .98;
  font-weight: 820;
  letter-spacing: 0;
}

.home-copy p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.78;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 760;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.ghost {
  background: transparent;
  color: var(--text);
}

.home-visual {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}

.home-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(260px, 1fr);
  gap: clamp(34px, 6vw, 86px);
  align-items: start;
  padding-bottom: clamp(80px, 10vw, 128px);
}

.section-head {
  margin-bottom: 26px;
}

.section-head h2,
.side-section h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
}

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

.post-item {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.post-cover {
  display: block;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  aspect-ratio: 16 / 9;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}

.post-cover:hover img {
  transform: scale(1.025);
}

.post-item.pinned {
  position: relative;
}

.post-item.pinned::before {
  content: "Pinned";
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 720;
}

.post-item h3 {
  margin-bottom: 12px;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1.16;
}

.post-item h3 a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: color .2s ease, background-size .2s ease;
}

.post-item h3 a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

.post-item p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row a,
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

.tag-row a:hover,
.tag-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--text);
}

.side-column {
  position: sticky;
  top: 104px;
}

.side-section {
  padding: 0 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.side-section h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.side-section p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}

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

.topic-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.topic-list a:hover {
  color: var(--text);
}

.archive-hero,
.article-hero,
.tag-hero {
  padding: clamp(54px, 8vw, 92px) 0 clamp(36px, 6vw, 66px);
  border-bottom: 1px solid var(--line);
}

.archive-hero h1,
.article-hero h1,
.tag-hero h1 {
  max-width: 900px;
  font-size: clamp(38px, 6vw, 66px);
}

.archive-hero p,
.article-hero p,
.tag-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
}

.archive-list {
  width: min(860px, 100%);
  padding: clamp(44px, 7vw, 78px) 0 clamp(80px, 10vw, 128px);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  color: var(--faint);
  font-size: 14px;
  font-weight: 720;
}

.article-cover {
  margin: 32px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 260px;
  gap: clamp(34px, 6vw, 86px);
  align-items: start;
  padding: clamp(44px, 7vw, 82px) 0 clamp(80px, 10vw, 128px);
}

.article-body {
  font-size: 18px;
  line-height: 1.86;
}

.article-body h2 {
  margin: 54px 0 16px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.article-body h3 {
  margin: 34px 0 12px;
  font-size: 24px;
}

.article-body p,
.article-body li {
  color: var(--muted);
}

.article-body a {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 10px;
}

.article-body pre {
  overflow-x: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  line-height: 1.6;
}

.article-body code {
  font-size: .92em;
}

.toc {
  position: sticky;
  top: 104px;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.toc strong {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.toc a:hover {
  color: var(--text);
}

.back-link {
  display: inline-flex;
  margin-top: 46px;
  color: var(--accent-2);
  font-weight: 760;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 760px;
  padding: clamp(44px, 7vw, 78px) 0 24px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .site-header {
    min-height: 64px;
    padding-inline: 20px;
  }

  .nav {
    gap: 12px;
  }

  .nav a:nth-child(4) {
    display: none;
  }

  main,
  .footer {
    width: min(100% - 40px, 720px);
  }

  .home-intro,
  .page-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .home-intro {
    padding-top: 44px;
  }

  .home-visual {
    aspect-ratio: 16 / 9;
  }

  .side-column,
  .toc {
    position: static;
  }

  .toc {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    display: none;
  }

  .nav a:nth-child(3) {
    display: none;
  }

  .home-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
