@charset "UTF-8";

* { box-sizing: border-box; }
html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
  margin: 0;
  padding: 36px 24px 72px;
  background: #fff;
  color: #111;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
}
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid #111; outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1.15em; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 2rem; font-weight: 600; line-height: 1.3; }
h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.5; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.6; }
ul { margin: 0; padding-left: 1.25em; }
li + li { margin-top: .6em; }

.site-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 720px);
  gap: 64px;
  width: min(100%, 952px);
  margin: 0 auto;
  line-height: 1.9;
}
.site-rail {
  position: sticky;
  top: 36px;
  align-self: start;
  min-width: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
.site-rail .site-name { display: inline-block; margin-bottom: 44px; font-size: 1rem; font-weight: 700; }
.chapter-nav { display: grid; border-top: 1px solid #111; }
.chapter-nav a {
  display: grid;
  grid-template-columns: 2.4em 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #bbb;
  font-size: .8rem;
  text-decoration: none;
}
.chapter-nav a:hover, .chapter-nav .current { background: #111; color: #fff; padding-left: 6px; padding-right: 6px; }
.chapter-nav span, .page-kicker, .catalog-meta, .note-entry > time, .note-branch, .site-footer, .breadcrumb {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
.chapter-nav span { font-variant-numeric: tabular-nums; }
.page { min-width: 0; }
.page-header { margin-bottom: 48px; padding-bottom: 28px; border-bottom: 1px solid #111; }
.page-header h1 { font-size: 3.4rem; }
.page-kicker { margin: 0 0 12px; font-size: .7rem; font-weight: 700; letter-spacing: 0; }
.page-description { max-width: 38em; margin: 16px 0 0; color: #444; font-size: .94rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: -26px 0 40px; color: #555; font-size: .75rem; }
.section { padding: 32px 0; border-top: 1px solid #bbb; }
.section:first-child { border-top-color: #111; }
.section > h2 { margin-bottom: 22px; }
.home-intro { max-width: 35em; margin: 0 0 48px; font-size: 1.12rem; line-height: 2; }

.chapter-index { margin: 0; padding: 0; list-style: none; }
.chapter-index li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid #ddd; }
.chapter-index li:first-child { border-top: 0; padding-top: 0; }
.chapter-index li + li { margin-top: 0; }
.chapter-index h3 { font-size: 1.2rem; }
.chapter-index p { margin: 5px 0 0; color: #444; }
.chapter-number { font-family: "Courier New", monospace; font-size: .82rem; }
.document-link { margin: 0 0 36px; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: .86rem; }
.work-catalog { border-top: 1px solid #111; }
.catalog-entry {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 180px;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid #bbb;
}
.catalog-meta { display: flex; flex-direction: column; gap: 5px; font-size: .7rem; line-height: 1.45; }
.catalog-meta time { font-weight: 700; font-variant-numeric: tabular-nums; }
.catalog-copy h2 { margin-bottom: 9px; }
.catalog-copy p { margin-bottom: .7em; font-size: .92rem; line-height: 1.75; }
.related-link { font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: .75rem !important; }
.catalog-image { align-self: start; }
.catalog-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.note-index { border-top: 1px solid #111; }
.note-entry { display: grid; grid-template-columns: 96px 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid #bbb; }
.note-entry > time { font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.note-entry h2 { margin-bottom: 8px; }
.note-entry p { margin: 0; color: #444; }
.note-branch { margin-top: 12px !important; font-size: .72rem; }
.note-entry-archive h2 { color: #444; }

.work-item + .work-item { margin-top: 32px; }
.work-item { padding: 28px 0; border-top: 1px solid #bbb; }
.section > .work-item:first-of-type { padding-top: 0; border-top: 0; }
.work-item h3 { margin-bottom: 8px; }
.work-thumbnail { width: min(100%, 300px); margin: 16px 0 24px; }
.full-width-image { width: 100%; margin: 20px 0 30px; }
.video-full { width: 100%; aspect-ratio: 16 / 9; margin: 20px 0 30px; }
.video-full iframe { display: block; width: 100%; height: 100%; border: 0; }
.example-list { margin: 24px 0; padding-left: 32px; }
.example-list p { margin-bottom: 10px; line-height: 1.6; }
.photo-grid { display: flex; flex-direction: column; gap: 16px; margin: 32px 0; }
.photo-row { display: flex; gap: 12px; }
.photo-row img { width: calc((100% - 24px) / 3); aspect-ratio: 1; object-fit: cover; }

.diary-search { padding: 0 0 28px; border-bottom: 1px solid #111; }
.search-label { display: block; margin-bottom: 8px; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: .82rem; font-weight: 700; }
.search-input { width: 100%; padding: 11px 12px; border: 1px solid #777; border-radius: 0; background: #fff; color: #111; font: inherit; }
.search-input:focus { outline: 2px solid #111; outline-offset: 2px; }
.search-status, .muted { color: #666; font-size: .85rem; }
.search-status { min-height: 1.6em; margin: 8px 0 0; }
.month-jump { display: inline-block; margin-top: 12px; }
.diary-section { padding: 36px 0 0; border: 0; }
.diary-month { margin-bottom: 28px; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: 1.35rem; }
.diary-item { width: 100%; margin: 0 0 42px; padding: 0 0 42px; border-bottom: 1px solid #bbb; }
.diary-date { margin-bottom: 18px; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; font-size: 1rem; font-variant-numeric: tabular-nums; }
.diary-entry-image, .diary-image { width: auto; max-height: calc(1.7rem * 15); }
.diary-entry-image { margin: 0 0 22px; }
.diary-image { margin: 16px 0 26px; }
.diary-content p:last-child { margin-bottom: 0; }
.diary-month-links { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 24px; border-top: 1px solid #111; }
.diary-scroll-buffer { height: 70vh; }
.post-nav { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 42px; padding-top: 18px; border-top: 1px solid #bbb; }

.site-footer { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 56px; padding-top: 18px; border-top: 1px solid #111; color: #555; font-size: .72rem; }
.site-footer span { margin-left: auto; }
.current { font-weight: inherit; }

/* Standalone experiment pages keep their own compact reading column. */
.container { max-width: 720px; margin: 0 auto; }
.global-nav { margin: 16px 0 36px; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; }
.global-nav a { margin-right: 16px; }
.site-header { margin-bottom: 40px; }
.site-description { color: #666; }

@media (max-width: 820px) {
  body { padding: 24px 16px 56px; }
  .site-shell { display: block; width: min(100%, 720px); }
  .site-rail { position: static; margin-bottom: 38px; }
  .site-rail .site-name { margin-bottom: 18px; }
  .chapter-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid #111; }
  .chapter-nav a { display: block; padding: 8px 4px; border: 0; font-size: .72rem; white-space: nowrap; }
  .chapter-nav a:hover, .chapter-nav .current { padding: 8px 4px; }
  .chapter-nav span { display: block; font-size: .62rem; }
  .page-header { margin-bottom: 36px; padding-bottom: 22px; }
  .catalog-entry { grid-template-columns: 70px minmax(0, 1fr) 120px; gap: 16px; }
  .note-entry { grid-template-columns: 70px 1fr; gap: 16px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .page-header h1 { font-size: 2.15rem; }
  .catalog-entry { grid-template-columns: 58px 1fr; }
  .catalog-image { grid-column: 2; width: min(100%, 220px); }
  .chapter-index li { grid-template-columns: 38px 1fr; gap: 10px; }
  .note-entry { grid-template-columns: 58px 1fr; }
  .site-footer span { width: 100%; margin-left: 0; }
}
