/* Reset, body text, links, focus ring. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: 700; letter-spacing: .04em; }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 700; }
small, .text-small { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--muted); }
.text-muted { color: var(--muted); }
.prose { line-height: var(--lh-prose); white-space: pre-wrap; overflow-wrap: anywhere; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: var(--r-pill); }
.skip-link:focus-visible { top: 12px; }

/* Page shell: centred column, 20px gutters, room for the floating nav. */
.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--nav-clearance);
}
.section { margin-top: var(--section-gap); }
.section > * + * { margin-top: var(--sp-3); }
.stack > * + * { margin-top: var(--sp-3); }

.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
