:root {
  color-scheme: light;
  --bg: #fdfdfb;
  --surface: #ffffff;
  --surface-2: #f0f3f1;
  --surface-3: #f7f8f6;
  --text: #202623;
  --muted: #607069;
  --line: #dfe5df;
  --accent: #315f4d;
  --accent-dark: #244c3e;
  --accent-soft: #eef5f1;
  --blue: #415d72;
  --footer: #172521;
  --footer-line: rgba(255, 255, 255, .16);
  --danger: #a33b31;
  --page-pad: clamp(26px, 3.2vw, 52px);
  --content-max: 1080px;
}

* { box-sizing: border-box; }

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

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}

a:hover,
a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

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

.site-header {
  min-height: 96px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 32px;
  padding: 22px var(--page-pad) 18px;
  background: var(--bg);
}

.brand {
  color: var(--text);
  font-size: clamp(23px, 2.5vw, 30px);
  font-weight: 520;
  line-height: 1.1;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 36px);
  padding-top: 10px;
  color: var(--text);
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 520;
}

.home-hero,
.page-heading,
.section,
.article-shell {
  width: 100%;
  margin: 0;
}

.home-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  padding: 52px var(--page-pad) 86px;
  background: var(--bg);
}

.hero-copy {
  width: min(760px, 100%);
}

.home-hero h1,
.page-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(36px, 4.6vw, 58px);
  font-weight: 560;
  line-height: 1.22;
  letter-spacing: 0;
}

.lead {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--text);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 30px;
}

.compact-hero {
  min-height: 220px;
  padding-top: 36px;
  padding-bottom: 52px;
}

.compact-hero h1 {
  font-size: clamp(42px, 5vw, 64px);
}

.compact-hero .lead {
  margin-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 520;
  letter-spacing: 0;
}

.section {
  padding: 44px var(--page-pad) 50px;
  background: var(--bg);
}

.section-muted,
.focus-section {
  background: var(--surface-2);
}

.section-head,
.project-grid,
.post-list,
.focus-grid,
.empty,
.filters {
  max-width: var(--content-max);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 42px;
  margin-bottom: 18px;
}

.split-head {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1fr);
  align-items: start;
}

.section-head h2,
.page-heading h1 {
  margin: 0;
}

.section-head h2 {
  color: var(--text);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 540;
  line-height: 1.18;
}

.section-head p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.text-link,
.back-link,
button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 620;
  text-decoration: none;
}

.text-link:hover,
.back-link:hover,
.button-link:hover {
  text-decoration: none;
}

.button-link {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button-link:hover,
.button-link:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}


.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}

.project-card,
.post-row {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e7ebe6;
}

.project-card > div {
  padding: 15px;
}

.project-card h2,
.project-card h3,
.post-row h2,
.post-row h3 {
  margin: 7px 0 5px;
  color: var(--text);
  line-height: 1.35;
  font-weight: 600;
}

/* compact blog tuning */
.project-card h2,
.project-card h3 {
  font-size: 18px;
}

.post-row h2 {
  font-size: 19px;
}

.post-row h3 {
  font-size: 17px;
}

.project-card p,
.post-row p {
  font-size: 13.5px;
  line-height: 1.65;
}

.project-card p,
.post-row p,
.article-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #c9d8cf;
  border-radius: 2px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 650;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-list.compact {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 280px));
  justify-content: start;
  align-items: start;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 136px) 1fr;
  gap: 12px;
  padding: 12px;
}

.post-row[data-card-href] {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.post-row[data-card-href]:hover,
.post-row[data-card-href]:focus-visible {
  border-color: #b9cac1;
  box-shadow: 0 10px 26px rgba(28, 39, 34, .08);
}

.post-row[data-card-href]:focus-visible {
  outline: 3px solid rgba(49, 95, 77, .22);
  outline-offset: 3px;
}

.post-list.compact .post-row {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  width: 100%;
}

.post-list.compact .post-row > img {
  width: 100%;
  height: 118px;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.post-list.compact .post-row > div {
  padding: 13px 14px 7px;
}

.post-list.compact .post-row > time {
  padding: 0 14px 13px;
  color: var(--muted);
  font-size: 12px;
}

.post-row > img {
  width: 100%;
  height: 100%;
  min-height: 96px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  background: #e7ebe6;
}

.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.tag-row a {
  color: var(--blue);
  font-weight: 650;
}

.page-heading {
  padding: 42px var(--page-pad) 22px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(140px, .8fr)) auto;
  gap: 10px;
  margin-bottom: 22px;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

button {
  padding: 0 16px;
  cursor: pointer;
  font-weight: 620;
}

.article-shell {
  padding: 34px var(--page-pad) 54px;
}

.article-head {
  display: grid;
  gap: 8px;
  max-width: 720px;
  margin-bottom: 16px;
}

.article-head h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.cover {
  width: min(100%, 780px);
  max-height: 320px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 22px;
}

.article-body {
  max-width: 720px;
  font-size: 15.5px;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.7em 0 .55em;
  color: var(--text);
  line-height: 1.28;
}

.article-body h2 {
  padding-bottom: .34em;
  border-bottom: 2px solid var(--accent);
  font-size: clamp(23px, 2.5vw, 30px);
  font-weight: 760;
}

.article-body h3 {
  padding-left: 14px;
  border-left: 5px solid var(--accent);
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 740;
}

.article-body h4 {
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 740;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body figure,
.article-body table,
.article-body .link-card,
.article-body .callout,
.comments-placeholder {
  margin: 0 0 1.05em;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body .button-link,
.article-body .button-link:visited {
  color: #fff;
  text-decoration: none;
}

.article-body .button-link:hover,
.article-body .button-link:focus-visible {
  color: #fff;
  text-decoration: none;
}

.article-body blockquote {
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
}

.article-body pre {
  position: relative;
  overflow: auto;
  padding: 42px 14px 14px;
  border: 1px solid #2d4039;
  border-radius: 4px;
  background: #111c18;
  color: #f7faf7;
  line-height: 1.58;
}

.article-body pre code {
  display: block;
  min-width: max-content;
}

.article-body pre code.hljs {
  padding: 0;
  background: transparent;
}

.copy-code-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 4px;
  background: #edf5f0;
  color: #183127;
  font-size: 12px;
  font-weight: 740;
  line-height: 1;
  opacity: 1;
}

.copy-code-button:hover,
.copy-code-button:focus-visible {
  background: #ffffff;
  color: #183127;
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article-body figure img {
  border-radius: 4px;
}

.article-body figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--surface-2);
}

.link-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  text-decoration: none !important;
}

.link-card span {
  color: var(--muted);
}

.callout {
  padding: 11px 13px;
  border-left: 4px solid var(--blue);
  border-radius: 4px;
  background: #eef3f3;
}

.callout-warning {
  border-left-color: #8b6c3f;
  background: #f7f2e8;
}

.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
}

.embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.project-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px;
}

.project-pages {
  position: sticky;
  top: 32px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.project-pages a {
  color: var(--muted);
  font-weight: 650;
}

.comments-placeholder,
.empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}

.site-footer {
  margin-top: 0;
  background: var(--footer);
  color: #f4f7f4;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  max-width: var(--content-max);
  padding: 58px var(--page-pad) 48px;
}

.site-footer h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
}

.site-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.footer-copy {
  margin: 0;
  padding: 16px var(--page-pad);
  border-top: 1px solid var(--footer-line);
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}


@media (max-width: 760px) {
  :root {
    --page-pad: 22px;
  }

  .site-header {
    min-height: auto;
    align-items: start;
    flex-direction: column;
    padding-block: 24px;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    padding-top: 0;
    font-size: 14px;
  }

  .home-hero {
    min-height: auto;
    padding-block: 44px 58px;
  }

  .section {
    padding-block: 52px;
  }

  .split-head,
  .filters,
  .post-row,
  .project-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
    gap: 16px;
  }

  .project-pages {
    position: static;
  }
}

/* compact article tuning */
.article-body {
  line-height: 1.78;
}

.article-body blockquote {
  font-size: 14.5px;
}

.article-body pre {
  font-size: 13px;
}

.comments-placeholder {
  max-width: 720px;
  padding: 14px 16px;
}

.comments-placeholder h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.comments-placeholder p {
  margin: 0;
  font-size: 14px;
}


/* account pages */
.account-page {
  background: var(--surface-2);
}

.account-header {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.account-main {
  min-height: calc(100vh - 78px);
  padding: 34px var(--page-pad) 64px;
}

.account-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.account-shell.narrow {
  width: min(460px, 100%);
}

.account-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(28, 39, 34, .06);
}

.account-card-wide h1,
.account-card h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.18;
}

.account-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.account-muted {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-form hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.account-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.account-actions form {
  margin: 0;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.account-list span {
  color: var(--muted);
  font-size: 13px;
}

.account-flashes {
  width: min(960px, 100%);
  margin: 0 auto 14px;
}

.account-flashes p {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #c9d8cf;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 650;
}

@media (max-width: 760px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}
