:root {
  --bg: #fffdfa;
  --text: #2e2a25;
  --heading: #171512;
  --muted: #686058;
  --faint: #8d857c;
  --link: #5f6f7d;
  --link-hover: #263f55;
  --border: #e4ded5;
  --soft: #f6f2eb;
  --code-bg: #f0ebe3;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #171614;
  --text: #e7e0d6;
  --heading: #fbf6ec;
  --muted: #b7ada1;
  --faint: #948a80;
  --link: #9eb4c5;
  --link-hover: #c7d8e4;
  --border: #34302b;
  --soft: #201e1b;
  --code-bg: #26231f;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

p {
  margin: 0 0 1.05rem;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: 1.9rem;
}

h2 {
  margin: 2rem 0 0.55rem;
  font-size: 1.25rem;
}

h3 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.05rem;
}

img {
  max-width: 100%;
  height: auto;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1120px;
  min-height: 58px;
  margin: 0 auto;
  padding: 0 2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.site-nav-left {
  justify-content: flex-start;
}

.site-nav-right {
  justify-content: flex-end;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--heading);
}

.home-link {
  display: inline-flex;
  align-items: center;
}

.home-link svg,
.profile-links svg,
.theme-toggle svg {
  width: 1em;
  height: 1em;
  stroke-width: 1.9;
}

.clone-nav-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--link);
  border-radius: 3px;
  color: var(--link) !important;
  padding: 0.34rem 0.62rem;
  line-height: 1.1;
}

.clone-nav-button:hover,
.clone-nav-button:focus {
  border-color: var(--link-hover);
  color: var(--link-hover) !important;
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--heading);
  outline: none;
}

.theme-toggle:focus-visible .theme-toggle-track {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 2.35rem;
  height: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
}

.theme-toggle-thumb {
  position: absolute;
  left: 0.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.92rem;
  height: 0.92rem;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

:root[data-theme="dark"] .theme-toggle-thumb {
  left: auto;
  right: 0.15rem;
  color: var(--heading);
}

.page-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 680px);
  column-gap: 4.4rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.2rem 2rem 2rem;
}

.page-wrap.no-profile {
  display: block;
  max-width: 760px;
}

.profile {
  position: sticky;
  top: 5.2rem;
  align-self: start;
  max-height: calc(100vh - 6.4rem);
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-image {
  display: block;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  margin-bottom: 1.15rem;
  object-fit: cover;
  object-position: 70% 62%;
}

.profile h2 {
  margin: 0 0 0.35rem;
  font-size: 1.22rem;
}

.profile-title {
  color: var(--muted);
  margin-bottom: 1rem;
}

.profile-meta,
.profile-links {
  font-size: 0.82rem;
  line-height: 1.55;
}

.profile-links {
  display: grid;
  gap: 0.28rem;
}

.profile-links a,
.profile-location {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.profile-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
}

.profile-location {
  color: var(--muted);
}

.main-content {
  max-width: 680px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.home .connect {
  margin-top: 1.65rem;
}

.listing h1 {
  margin-bottom: 1.8rem;
}

.list-item {
  margin: 0 0 2.45rem;
}

.list-item h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.18rem;
}

.list-item p {
  margin-bottom: 0.45rem;
}

.item-links,
.read-more,
.post-date,
.back-link {
  color: var(--faint);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
}

.item-links {
  display: flex;
  gap: 0.42rem;
  align-items: center;
}

.article {
  max-width: 720px;
  margin: 0 auto;
}

.article .back-link {
  margin-bottom: 1.2rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.back-link svg {
  width: 1em;
  height: 1em;
  stroke-width: 1.9;
}

.article .post-date {
  margin-bottom: 1.8rem;
}

.article-body h2 {
  margin-top: 2.1rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35rem;
}

.article-body li {
  margin-bottom: 0.35rem;
}

.article-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.45rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
}

blockquote {
  margin: 1.35rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

code {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.08rem 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  line-height: 1.5;
}

pre code {
  background: transparent;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.65rem 0.5rem 0;
  text-align: left;
}

.chat {
  margin-top: 1.8rem;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}

.conversation {
  min-height: 220px;
  margin-bottom: 1rem;
}

.message {
  max-width: 88%;
  margin-bottom: 0.85rem;
}

.message p {
  display: inline-block;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--soft);
}

.message-user {
  margin-left: auto;
  text-align: right;
}

.message-user p {
  background: transparent;
}

.message-thinking p {
  color: var(--muted);
}

.thinking-dots {
  display: inline-block;
  min-width: 1.05em;
  animation: thinking-pulse 1.1s steps(4, end) infinite;
  overflow: hidden;
  vertical-align: bottom;
}

@keyframes thinking-pulse {
  0% {
    width: 0;
  }

  100% {
    width: 1.05em;
  }
}

.chat-form {
  display: flex;
  gap: 0.5rem;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 0.55rem 0.65rem;
}

.chat-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--link);
  border-radius: 3px;
  background: transparent;
  color: var(--link);
  font: inherit;
  line-height: 1.1;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.chat-form button svg {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-form button:hover,
.chat-form button:focus {
  border-color: var(--link-hover);
  color: var(--link-hover);
}

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

.site-footer {
  max-width: 1120px;
  margin: 1.6rem auto 0;
  padding: 1.2rem 2rem 2rem;
  color: var(--faint);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.76rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 0.85rem;
  }

  .site-nav-right {
    margin-left: 0;
  }

  .page-wrap {
    display: block;
    padding-top: 2rem;
  }

  .profile {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 2.2rem;
  }

  .profile-image {
    width: 128px;
    height: 128px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15.5px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .header-inner,
  .page-wrap,
  .site-footer {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .site-nav {
    font-size: 0.95rem;
  }

  .chat-form {
    flex-direction: column;
  }

  .chat-form button {
    align-self: flex-start;
  }
}
