:root {
  color-scheme: light;
  --paper: #f8f3e7;
  --paper-deep: #eee4d1;
  --ink: #17202a;
  --muted: #5f6872;
  --rail: #17649a;
  --rail-dark: #0c3f65;
  --accent: #cb6245;
  --line: rgba(23, 32, 42, 0.14);
  --card: rgba(255, 253, 247, 0.9);
  --shadow: 0 18px 60px rgba(46, 55, 61, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 3%, rgba(203, 98, 69, 0.12), transparent 28rem),
    linear-gradient(180deg, var(--paper) 0%, #f4efe4 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rail-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

.shell { width: min(100% - 32px, 820px); margin-inline: auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rail);
  color: white;
  font-size: 15px;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,0.18);
}

.languages { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.83rem; }
.languages a { color: var(--muted); text-decoration: none; }
.languages a[aria-current="page"] { color: var(--rail-dark); font-weight: 700; }

main { padding: 70px 0 80px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--rail);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: ui-serif, "New York", "Hiragino Mincho ProN", serif; }
h1 { max-width: 720px; margin: 0; font-size: clamp(2.6rem, 9vw, 5.3rem); font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; }
.document h1 { font-size: clamp(2.25rem, 8vw, 4.4rem); }
.lede { max-width: 650px; margin: 24px 0 0; color: var(--muted); font-size: clamp(1rem, 3vw, 1.18rem); }

.rail-line { position: relative; height: 44px; margin: 42px 0 34px; }
.rail-line::before { content: ""; position: absolute; top: 20px; left: 0; right: 0; height: 3px; border-radius: 9px; background: var(--rail); }
.rail-line::after { content: ""; position: absolute; top: 12px; left: 13%; width: 18px; height: 18px; border: 4px solid var(--rail); border-radius: 50%; background: var(--paper); box-shadow: 230px 0 0 -4px var(--paper), 230px 0 0 0 var(--rail), 470px 0 0 -4px var(--paper), 470px 0 0 0 var(--rail); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 36px; }
.card {
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(23,100,154,0.42); }
.card .code { color: var(--accent); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; }
.card h2 { margin: 26px 0 8px; color: var(--ink); font-size: 1.5rem; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.doc-meta { display: flex; gap: 12px 22px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 0.85rem; }
.content { margin-top: 46px; padding: clamp(24px, 6vw, 52px); border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
.content h2 { margin: 2.4em 0 0.65em; font-size: 1.55rem; line-height: 1.25; }
.content h2:first-child { margin-top: 0; }
.content h3 { margin: 1.8em 0 0.5em; font-size: 1.12rem; }
.content p, .content ul, .content ol { margin: 0.7em 0; }
.content li + li { margin-top: 0.4em; }
.notice { margin: 28px 0 0; padding: 18px 20px; border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; background: rgba(203,98,69,0.08); }
.contact { display: inline-block; margin-top: 8px; padding: 11px 16px; border-radius: 999px; background: var(--rail-dark); color: white; font-weight: 700; text-decoration: none; }
.contact:hover { background: var(--accent); color: white; }

footer { padding: 26px 0 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  main { padding-top: 46px; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card h2 { margin-top: 12px; }
  .rail-line::after { left: 8%; box-shadow: 120px 0 0 -4px var(--paper), 120px 0 0 0 var(--rail), 240px 0 0 -4px var(--paper), 240px 0 0 0 var(--rail); }
}

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