:root {
  color-scheme: light;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --link: #2563eb;
  --code-bg: #f6f8fa;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 2;
  padding: 8px 12px;
  color: #fff;
  background: var(--link);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(860px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 24px;
}

.site-name {
  color: var(--text);
  font-weight: 600;
}

.project-header {
  padding: 64px 0 40px;
}

h1,
h2,
h3 {
  color: #111827;
  line-height: 1.25;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.5rem;
}

h3 {
  margin: 28px 0 10px;
  font-size: 1.05rem;
}

p,
ul,
ol {
  margin-top: 0;
}

.lead {
  max-width: 720px;
  margin-bottom: 16px;
  color: #374151;
  font-size: 1.2rem;
  line-height: 1.6;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 0;
}

.project-links span {
  color: #9ca3af;
}

.project-image {
  margin: 0 0 56px;
}

.project-image img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

section p,
section ul,
section ol {
  max-width: 760px;
}

ul,
ol {
  padding-left: 24px;
}

li + li {
  margin-top: 5px;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

code {
  padding: 0.15em 0.35em;
  border-radius: 3px;
  background: var(--code-bg);
}

pre {
  overflow-x: auto;
  margin: 14px 0 24px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  line-height: 1.6;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 12px 14px;
  border: 1px solid var(--border);
}

th {
  background: var(--code-bg);
  font-weight: 600;
}

.note {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 3px solid #9ca3af;
  background: var(--code-bg);
}

.site-footer {
  margin-top: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 32px, 860px);
  }

  .header-inner {
    min-height: 56px;
  }

  .project-header {
    padding: 48px 0 32px;
  }

  .project-image {
    margin-bottom: 40px;
  }

  section {
    padding: 32px 0;
  }

  th,
  td {
    min-width: 120px;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
