:root {
  --ink: #0f1419;
  --muted: #5c6b73;
  --line: #d7dee0;
  --paper: #ffffff;
  --wash: #eef3f2;
  --brand: #0a8f7a;
  --brand-deep: #067a68;
  --accent: #1ad4b3;
  --soft: #e6f5f2;
  --max: 42rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(26, 212, 179, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(10, 143, 122, 0.12), transparent 50%),
    linear-gradient(180deg, var(--wash) 0%, #f7f9f9 40%, #f2f4f5 100%);
  font-family: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", "Noto Sans JP", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(100% - 2.5rem, calc(var(--max) + 8rem));
  margin: 0 auto;
  padding: 2.5rem 0 4.5rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.sibling-link {
  font-size: 0.875rem;
  color: var(--brand-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(10, 143, 122, 0.35);
}
.sibling-link:hover { border-bottom-color: var(--brand); }

.lang-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}
.lang-switch button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

header.hero {
  position: relative;
  padding: 0.5rem 0 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.signal {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 28px;
  margin-bottom: 1.25rem;
}
.signal span {
  display: block;
  width: 7px;
  border-radius: 2px;
  background: var(--brand);
  transform-origin: bottom;
  animation: rise 0.7s ease both;
}
.signal span:nth-child(1) { height: 8px; opacity: 0.35; animation-delay: 0.05s; }
.signal span:nth-child(2) { height: 14px; opacity: 0.55; animation-delay: 0.12s; }
.signal span:nth-child(3) { height: 20px; opacity: 0.75; animation-delay: 0.18s; }
.signal span:nth-child(4) {
  height: 28px;
  opacity: 1;
  animation-delay: 0.24s;
  background: linear-gradient(180deg, var(--accent), var(--brand));
}

@keyframes rise {
  from { transform: scaleY(0.2); opacity: 0; }
  to { transform: scaleY(1); }
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin: 0 0 0.75rem;
}

h1 {
  font-family: "Syne", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-weight: 800;
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
}

.lede {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 1.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.meta strong {
  color: var(--ink);
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 920px) {
  .layout {
    grid-template-columns: 13rem minmax(0, var(--max));
    gap: 2.5rem;
    align-items: start;
  }
}

nav.toc {
  position: sticky;
  top: 1rem;
  padding: 1rem 0;
}
nav.toc .toc-title {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
nav.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
nav.toc a {
  display: block;
  padding: 0.35rem 0 0.35rem 0.9rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.4;
  transition: color 0.15s ease, border-color 0.15s ease;
}
nav.toc a:hover,
nav.toc a:focus-visible {
  color: var(--brand-deep);
  border-left-color: var(--brand);
  outline: none;
}

@media (max-width: 919px) {
  nav.toc { display: none; }
}

article.content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.35rem, 3vw, 2.25rem);
  box-shadow: 0 18px 40px rgba(15, 20, 25, 0.04);
  animation: fade-up 0.55s ease both;
  animation-delay: 0.12s;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

article.content h2 {
  font-family: "Syne", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.75rem;
  padding-top: 0.35rem;
  scroll-margin-top: 1.25rem;
}
article.content h2:first-of-type { margin-top: 0; }
article.content h2::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.55rem;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  vertical-align: 0.12em;
}

article.content p { margin: 0 0 0.9rem; }
article.content ul,
article.content ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
article.content li { margin-bottom: 0.4rem; }
article.content li::marker { color: var(--brand); }

.callout {
  margin: 1.25rem 0;
  padding: 0.95rem 1.05rem;
  background: var(--soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.note {
  font-size: 0.9rem;
  color: var(--muted);
}

footer.page-foot {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
footer.page-foot a {
  color: var(--brand-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(10, 143, 122, 0.35);
}
footer.page-foot a:hover { border-bottom-color: var(--brand); }
