:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-elevated: #fffcf7;
  --text: #1c1b18;
  --muted: #5f5c55;
  --accent: #0c6b56;
  --accent-hover: #095445;
  --border: #e2ddd3;
  --shadow: 0 10px 30px rgba(28, 27, 24, 0.05);
  --header-bg: rgba(246, 244, 239, 0.86);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #141513;
  --bg-elevated: #1c1d1a;
  --text: #f2f0ea;
  --muted: #b0ada4;
  --accent: #6ad4b0;
  --accent-hover: #8be0c2;
  --border: #2f2f2a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(20, 21, 19, 0.82);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141513;
  --bg-elevated: #1c1d1a;
  --text: #f2f0ea;
  --muted: #b0ada4;
  --accent: #6ad4b0;
  --accent-hover: #8be0c2;
  --border: #2f2f2a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --header-bg: rgba(20, 21, 19, 0.82);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Noto Sans", sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.4rem 0.7rem;
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 0.4rem;
  z-index: 20;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header,
.site-footer,
.wrap {
  width: min(860px, calc(100% - 2.4rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0 0.85rem;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.site-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  height: 1px;
  transform: translateX(-50%);
  background: var(--border);
}

.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.2rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a[aria-current="page"] {
  font-weight: 600;
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: var(--accent);
}

.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun { display: block; }
  :root:not([data-theme="light"]) .moon { display: none; }
}
html[data-theme="dark"] .sun { display: block; }
html[data-theme="dark"] .moon { display: none; }
html[data-theme="light"] .sun { display: none; }
html[data-theme="light"] .moon { display: block; }

main {
  flex: 1;
  padding: 2.6rem 0 4.5rem;
}

.hero {
  padding: 3.2rem 0 1.2rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.tagline {
  margin: 0 0 1.6rem;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  color: var(--text);
  font-weight: 520;
}

.lede,
.prose p,
.prose li {
  color: var(--muted);
}

.lede {
  max-width: 40rem;
  margin: 0 0 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #f7fffb;
}

html[data-theme="dark"] .btn-primary {
  color: #10231c;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #f7fffb;
}

html[data-theme="dark"] .btn-primary:hover {
  color: #10231c;
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
}

.page-title {
  margin: 0.4rem 0 0.35rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.meta {
  color: var(--muted);
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.lang-switch button {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--text);
  font-weight: 600;
}

.prose h2 {
  margin: 2rem 0 0.7rem;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.05rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.lang-panel[hidden] {
  display: none;
}

.site-footer {
  padding: 1.4rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

.notice {
  margin: 2.4rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--bg-elevated);
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero { padding-top: 1.8rem; }
  main { padding-top: 1.4rem; }
}
