:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  color: #18272e;
  background: #f4f6f5;
  --sidebar: #121e25;
  --sidebar-text: #d4dfe2;
  --surface: #fff;
  --text-soft: #4c5d64;
  --accent: #176256;
  --accent-pale: #eaf3ef;
  --line: #d8e1df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid #047e69;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: 12px;
  translate: 0 -180%;
  padding: 10px 14px;
  color: #12262a;
  background: #fff;
}

.skip-link:focus {
  translate: 0;
}

.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 38px 23px;
  background: var(--sidebar);
  color: var(--sidebar-text);
}

.sidebar a:focus-visible {
  outline-color: #8fdfc9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: 0 0 18px;
  height: 18px;
  border: 2px solid #8fdfc9;
  border-radius: 3px;
  background: linear-gradient(#8fdfc9, #8fdfc9) center / 5px 5px no-repeat;
}

.navigation {
  display: grid;
  gap: 5px;
  margin-top: 42px;
}

.navigation a {
  display: block;
  padding: 10px 11px;
  border-radius: 5px;
  font-size: 0.91rem;
  line-height: 1.35;
  text-decoration: none;
}

.navigation a:hover,
.navigation a:focus-visible {
  background: #21333c;
  color: #fff;
}

main {
  width: min(100%, 1240px);
  min-width: 0;
  padding: 47px clamp(28px, 4vw, 64px) 62px;
}

main:focus {
  outline: none;
}

section {
  scroll-margin-top: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-bottom: 25px;
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.044em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 174px;
  padding: 20px 18px 16px;
  border: 1px solid var(--line);
  border-top: 2px solid #6b9e93;
  border-radius: 8px;
  background: var(--surface);
}

.project-card h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
  line-height: 1.24;
  letter-spacing: -0.015em;
}

.project-card p,
.tool-copy > span {
  color: var(--text-soft);
  font-size: 0.89rem;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 11px;
  margin-top: auto;
  padding-top: 15px;
}

.action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
}

.action {
  padding: 7px 9px;
  border-radius: 5px;
  background: var(--accent-pale);
}

.action:hover {
  background: #dbece5;
}

.secondary-action:hover {
  text-decoration: underline;
}

.tool-section {
  margin-top: 35px;
}

.tool-section h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.tool-list {
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  list-style: none;
  background: var(--surface);
}

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

.tool-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  min-height: 69px;
  padding: 12px 17px;
  text-decoration: none;
}

.tool-link:hover,
.tool-link:focus-visible {
  background: var(--accent-pale);
}

.tool-link:focus-visible {
  outline-offset: -4px;
}

.tool-copy {
  display: grid;
  gap: 4px;
  line-height: 1.25;
}

.tool-copy strong {
  font-weight: 650;
}

.archive-shell {
  max-width: 1070px;
  margin-inline: auto;
}

.archive-header h1 {
  margin-top: 20px;
}

.archive-back {
  display: inline-block;
  padding: 6px 0;
  color: var(--accent);
  font-weight: 650;
  text-underline-offset: 4px;
}

.archive-meta {
  margin-bottom: 16px;
  color: var(--text-soft);
  line-height: 1.5;
}

.archive-list {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  list-style: none;
}

.archive-card + .archive-card {
  border-top: 1px solid var(--line);
}

.archive-card > a {
  display: block;
  padding: 14px 18px;
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.archive-card > a:hover,
.archive-card > a:focus-visible {
  background: var(--accent-pale);
  text-decoration: underline;
}

.archive-card > a:focus-visible {
  outline-offset: -4px;
}

.archive-article {
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.archive-prose {
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.archive-prose :is(p, ul, ol, pre, blockquote, .archive-table) {
  margin: 12px 0;
}

.archive-prose :is(h2, h3, h4):not(:first-child) {
  margin-top: 1.4em;
}

.archive-prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.archive-prose pre,
.archive-table {
  overflow-x: auto;
}

.archive-prose pre {
  padding: 12px;
  border-radius: 5px;
  background: #f3f6f5;
}

.archive-prose blockquote {
  padding-inline-start: 12px;
  border-inline-start: 3px solid #6b9e93;
  color: var(--text-soft);
}

.archive-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.archive-table :is(th, td) {
  min-width: 100px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.archive-table th {
  background: var(--accent-pale);
}

@media (max-width: 1070px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px 16px 12px;
  }

  .navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 13px;
  }

  .navigation a {
    padding: 8px 7px;
  }

  main {
    padding: 31px 16px 40px;
  }
}

@media (max-width: 470px) {
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-card {
    min-height: 0;
  }
}
