:root {
  color-scheme: light dark;
  --paper: #f5efe4;
  --ink: #292824;
  --muted: #77766f;
  --accent: #6f897a;
  --line: #d9d1c4;
  --surface: rgba(255, 255, 255, .38);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 ui-serif, Georgia, "Noto Serif CJK SC", serif;
}

main {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 36px;
}

header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.mark {
  display: grid;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 18px;
  background: var(--accent);
  color: #fff;
  font: 700 28px/1 ui-sans-serif, system-ui, sans-serif;
}

h1, h2, h3 { line-height: 1.2; }
h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.5rem); }
h2 { margin-top: 0; }
h3 { margin: 1.7rem 0 .5rem; }
.lead { margin: 4px 0 0; color: var(--muted); }

.page-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 38px;
}

.language-switcher {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.language-switcher button {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.language-switcher button:hover { color: var(--ink); }

.language-switcher button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(41, 40, 36, .12);
}

.language-switcher button:focus-visible,
.page-link:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}

.page-link {
  color: #496f5c;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

a { color: #496f5c; }

[data-lang-section][hidden] { display: none; }

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

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.contact {
  margin-top: 8px;
  padding-left: 20px;
  border-left: 5px solid var(--accent);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: .9rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d2426;
    --ink: #ece8df;
    --muted: #aaa9a3;
    --accent: #718c7e;
    --line: #394244;
    --surface: rgba(255, 255, 255, .04);
  }
  a, .page-link { color: #a9c9b8; }
}

@media (max-width: 600px) {
  main { width: min(100% - 28px, 760px); padding-top: 32px; }
  .page-controls { align-items: flex-start; flex-direction: column; }
  .language-switcher { width: 100%; }
  .language-switcher button { flex: 1; padding-inline: 8px; }
  footer { flex-direction: column; }
}
