/* legal.oga.ninja — readable long-form legal text. No external fonts or scripts. */
:root {
  --bg: #ffffff;
  --fg: #1f2328;        /* 15.8:1 on --bg */
  --muted: #57606a;     /* 6.4:1 on --bg */
  --link: #0a58ca;      /* 6.4:1 on --bg, 6.0:1 on --surface */
  --line: #d0d7de;
  --surface: #f6f8fa;
  --focus: #0a58ca;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;      /* 16.0:1 on --bg */
    --muted: #9da7b3;   /* 7.8:1 on --bg */
    --link: #79b8ff;    /* 9.1:1 on --bg, 8.3:1 on --surface */
    --line: #30363d;
    --surface: #161b22;
    --focus: #79b8ff;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 1.0625rem;  /* 17px */
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 42rem;       /* about 40 Japanese characters per line */
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: 0.5rem; top: -3rem;
  background: var(--bg); color: var(--link);
  padding: 0.5rem 0.75rem; z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--line); padding-block: 0.75rem; }
.site-name { margin: 0; font-weight: 700; }
.site-name a { color: var(--fg); text-decoration: none; }
.site-name a:hover { text-decoration: underline; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.25rem; }
.nav-label { margin: 0; color: var(--muted); font-size: 0.9rem; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; min-height: 44px; line-height: 44px;   /* touch target */
}
.site-nav a[aria-current="page"] { color: var(--fg); font-weight: 700; text-decoration-thickness: 2px; }

/* Main content */
main { padding-block: 1.5rem 3rem; }
h1 { font-size: 1.75rem; line-height: 1.4; margin: 0.5rem 0 1rem; }
h2 {
  font-size: 1.3rem; line-height: 1.5; margin: 2.5rem 0 0.75rem;
  padding-top: 1rem; border-top: 1px solid var(--line);
}
h3 { font-size: 1.1rem; line-height: 1.5; margin: 1.75rem 0 0.5rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5em; }
li + li { margin-top: 0.3rem; }
strong { font-weight: 700; }
code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.92em;
  background: var(--surface); padding: 0.1em 0.3em; border-radius: 4px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.doc > p:first-of-type, .doc .meta { color: var(--muted); }

/* Table of contents */
.toc-box {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 0.5rem 1rem; margin-bottom: 1.5rem;
}
.toc-box summary { cursor: pointer; font-weight: 700; min-height: 44px; line-height: 44px; }
.toc-box ul { margin: 0.25rem 0 0.75rem; }

/* Tables scroll inside their box, never the page */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; min-width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--surface); }

/* Index lists */
.doc-list { list-style: none; padding: 0; }
.doc-list li { border: 1px solid var(--line); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.doc-list a { font-weight: 700; font-size: 1.1rem; }
.doc-list p { margin: 0.25rem 0 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; padding-block: 1rem 2rem; }
.site-footer p { margin: 0; }

@media print {
  .site-nav, .skip-link, .toc-box { display: none; }
  a { color: inherit; }
}
