:root {
  --paper: #f1ead9;
  --paper-deep: #e4dac4;
  --paper-light: #faf6ea;
  --ink: #20252a;
  --navy: #18264a;
  --navy-soft: #334267;
  --vermilion: #ad382c;
  --rule: #b8ad97;
  --muted: #6e6a60;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--navy);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(24, 38, 74, .025) 1px, transparent 1px) 0 0 / 100% 32px,
    var(--paper);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button,
input,
select { font: inherit; }

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  color: white;
  background: var(--vermilion);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

:focus-visible {
  outline: 3px solid var(--vermilion);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  color: var(--paper-light);
  background: var(--navy);
  border-bottom: 3px solid var(--vermilion);
  box-shadow: 0 5px 18px rgba(22, 26, 36, .14);
}

.header-main {
  width: var(--shell);
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: white;
  border: 1px solid rgba(255, 255, 255, .72);
  background: var(--vermilion);
  font-family: var(--serif);
  font-size: 21px;
}

.brand b {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .11em;
  line-height: 1.25;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #cbc5b6;
  font-size: 9px;
  letter-spacing: .22em;
  line-height: 1;
}

.header-meta {
  display: flex;
  gap: 8px;
  color: #dbd3c4;
  font-size: 11px;
  letter-spacing: .08em;
}

.header-meta span {
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, .22);
}

.month-nav {
  width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr repeat(12, 1fr);
  border-top: 1px solid rgba(255, 255, 255, .13);
}

.month-nav a {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: #d9d4c8;
  border-right: 1px solid rgba(255, 255, 255, .11);
  font-family: var(--serif);
  font-size: 12px;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}

.month-nav a:first-child { border-left: 1px solid rgba(255, 255, 255, .11); }
.month-nav a:hover { color: white; background: rgba(255, 255, 255, .08); }
.month-nav a[aria-current="page"] { color: white; background: var(--vermilion); }
.month-nav small { margin-left: 1px; font-size: 9px; }

main {
  width: var(--shell);
  margin: 0 auto;
}

.kicker {
  margin: 0 0 12px;
  color: var(--vermilion);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
}

.front-matter {
  min-height: 255px;
  padding: 44px 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 48px;
  align-items: end;
  border-bottom: 1px solid var(--navy);
}

.front-title h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.34;
}

.front-title > p:last-child {
  max-width: 720px;
  margin: 18px 0 0;
  color: #4e4b45;
  font-family: var(--serif);
  font-size: 15px;
}

.today-panel {
  padding: 18px 20px 16px;
  color: var(--paper-light);
  background: var(--navy);
  border-left: 7px solid var(--vermilion);
}

.today-panel > span {
  display: block;
  color: #c8c0b0;
  font-size: 10px;
  letter-spacing: .16em;
}

.today-panel time {
  display: block;
  margin: 4px 0 6px;
  font-family: var(--serif);
  font-size: 24px;
}

.today-panel a {
  display: inline-block;
  color: white;
  font-size: 12px;
  text-underline-offset: 4px;
}

.finder {
  margin-top: 24px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr);
  gap: 22px;
  color: var(--paper-light);
  background: var(--navy);
  border-top: 5px solid var(--vermilion);
}

.finder-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finder-heading > span {
  color: #d2c9b5;
  font-family: var(--serif);
  font-size: 28px;
}

.finder-heading h2,
.finder-heading p { margin: 0; }

.finder-heading h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.finder-heading p {
  color: #c8c0b0;
  font-size: 11px;
}

.finder-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 120px 110px;
  gap: 8px;
  align-items: end;
}

.finder-fields label > span {
  display: block;
  margin-bottom: 4px;
  color: #d0c7b6;
  font-size: 10px;
  letter-spacing: .08em;
}

.finder-fields input,
.finder-fields select,
.finder-fields button {
  width: 100%;
  height: 42px;
  border: 1px solid #918a7e;
  border-radius: 0;
}

.finder-fields input,
.finder-fields select {
  padding: 0 11px;
  color: var(--ink);
  background: var(--paper-light);
}

.finder-fields button {
  color: white;
  background: transparent;
  cursor: pointer;
}

.finder-fields button:hover { background: var(--vermilion); border-color: var(--vermilion); }

.month-directory,
.master-index,
.month-analysis,
.spotlight,
.month-entries { margin-top: 48px; }

.section-rule {
  min-height: 42px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 54px auto 1fr;
  align-items: baseline;
  gap: 13px;
  border-bottom: 2px solid var(--navy);
}

.section-rule > span {
  color: var(--vermilion);
  font-family: var(--serif);
  font-size: 24px;
}

.section-rule h2 {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .05em;
}

.section-rule p {
  justify-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.month-index-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--navy);
  border-left: 1px solid var(--navy);
}

.month-index {
  min-height: 116px;
  padding: 13px;
  display: grid;
  grid-template-columns: 43px 1fr;
  align-content: start;
  color: var(--ink);
  border-right: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
  background: rgba(250, 246, 234, .45);
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}

.month-index:hover,
.month-index.is-current {
  color: white;
  background: var(--navy);
}

.month-index-no {
  grid-row: span 3;
  color: var(--vermilion);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.2;
}

.month-index-name b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.month-index-name small {
  margin-left: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .12em;
}

.month-index:hover .month-index-name small,
.month-index.is-current .month-index-name small { color: #d5cdbd; }

.month-index-count,
.month-index-work {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.4;
}

.month-index-work { color: var(--muted); }
.month-index:hover .month-index-work,
.month-index.is-current .month-index-work { color: #d5cdbd; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--navy);
  background: rgba(250, 246, 234, .62);
}

.birthday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.birthday-table th {
  position: sticky;
  z-index: 2;
  top: 108px;
  padding: 9px 12px;
  color: white;
  background: var(--navy);
  border-right: 1px solid rgba(255, 255, 255, .18);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-align: left;
}

.birthday-table td {
  padding: 8px 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

.birthday-table tbody tr:nth-child(even) { background: rgba(228, 218, 196, .42); }
.birthday-table tbody tr:hover { background: #fffaf0; }
.birthday-table tr[hidden] { display: none; }

.birthday-table th:nth-child(1),
.birthday-table td:nth-child(1) { width: 112px; }
.birthday-table th:nth-child(2),
.birthday-table td:nth-child(2) { width: 25%; }
.birthday-table th:nth-child(3),
.birthday-table td:nth-child(3) { width: 24%; }
.birthday-table th:nth-child(5),
.birthday-table td:nth-child(5) { width: 66px; }

.date-cell time { display: flex; align-items: baseline; gap: 7px; }
.date-cell b { color: var(--vermilion); font-family: var(--serif); font-size: 17px; }
.date-cell span { color: var(--muted); font-size: 9px; }
.name-cell strong { color: var(--navy); font-family: var(--serif); font-size: 15px; font-weight: 600; }
.reading-cell { color: var(--muted); font-size: 11px; }
.work-cell { font-weight: 600; }

.source-link,
.spotlight-note a {
  color: var(--vermilion);
  font-size: 11px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.no-results {
  margin: 0;
  padding: 30px;
  text-align: center;
}

.breadcrumb {
  padding: 16px 0 7px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.breadcrumb a { color: var(--vermilion); text-underline-offset: 3px; }

.month-lead {
  min-height: 330px;
  padding: 32px 0 42px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 52px;
  align-items: center;
  border-bottom: 2px solid var(--navy);
}

.month-number {
  position: relative;
  min-height: 230px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background: var(--navy);
  border-right: 9px solid var(--vermilion);
}

.month-number::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: 46px;
  left: 22px;
  border-top: 1px solid rgba(255, 255, 255, .35);
}

.month-number > span {
  color: #d4ccbc;
  font-size: 11px;
  letter-spacing: .28em;
}

.month-number b {
  align-self: center;
  font-family: var(--serif);
  font-size: 100px;
  font-weight: 400;
  line-height: 1;
}

.month-number small {
  align-self: flex-end;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .2em;
}

.month-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(31px, 4.2vw, 52px);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.35;
}

.month-copy > p:not(.kicker) {
  max-width: 780px;
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 15px;
}

.month-jump-links {
  margin-top: 25px;
  display: flex;
  gap: 8px;
}

.month-jump-links a {
  padding: 5px 12px;
  color: var(--navy);
  border: 1px solid var(--navy);
  font-size: 10px;
  text-decoration: none;
}

.month-jump-links a:hover { color: white; background: var(--navy); }

.analysis-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  border-top: 1px solid var(--navy);
  border-left: 1px solid var(--navy);
}

.analysis-grid article {
  min-height: 225px;
  padding: 22px;
  border-right: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
  background: rgba(250, 246, 234, .55);
}

.analysis-label {
  color: var(--vermilion);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.analysis-grid h3 {
  margin: 5px 0 11px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.analysis-grid p {
  margin: 0;
  color: #4f4c45;
  font-size: 12px;
}

.analysis-grid .work-rank {
  margin-bottom: 9px;
  color: var(--navy);
  font-weight: 700;
}

.distribution {
  height: 9px;
  margin: 13px 0;
  display: flex;
  gap: 2px;
}

.distribution i {
  flex: var(--share);
  background: var(--navy);
}

.distribution i:nth-child(2) { background: var(--vermilion); }
.distribution i:nth-child(3) { background: #847b69; }

.spotlight-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(360px, .93fr);
  gap: 28px;
  align-items: start;
}

.quoted-figure { margin: 0; }

.quoted-figure img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border: 1px solid var(--navy);
  background: var(--paper-deep);
}

.quoted-figure figcaption {
  padding: 7px 9px;
  color: var(--muted);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  font-size: 10px;
}

.quoted-figure figcaption a {
  color: var(--vermilion);
  text-underline-offset: 3px;
}

.spotlight-notes {
  border-top: 2px solid var(--navy);
}

.spotlight-note {
  padding: 16px 2px 17px;
  border-bottom: 1px solid var(--rule);
}

.spotlight-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.spotlight-meta span {
  color: var(--vermilion);
  font-family: var(--serif);
  font-size: 18px;
}

.spotlight-meta small { color: var(--muted); font-size: 9px; }

.spotlight-note h3 {
  margin: 2px 0 4px;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.spotlight-note p {
  margin: 0 0 5px;
  font-size: 12px;
  line-height: 1.8;
}

.day-entry-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 20px;
}

.day-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  border-top: 1px solid var(--navy);
  border-right: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
  background: rgba(250, 246, 234, .54);
}

.day-entry > header {
  padding: 13px;
  color: white;
  background: var(--navy);
  border-left: 5px solid var(--vermilion);
}

.day-entry > header span {
  color: #d1c9ba;
  font-family: var(--serif);
  font-size: 11px;
}

.day-entry > header h3 {
  margin: 4px 0 1px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.day-entry > header small { color: #d1c9ba; font-size: 9px; }

.day-entry-list article {
  min-height: 82px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, .8fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

.day-entry-list article:last-child { border-bottom: 0; }
.day-entry-list h4 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: 15px; font-weight: 600; }
.day-entry-list article > div p { margin: 0; color: var(--muted); font-size: 9px; }
.entry-work { margin: 0; font-size: 11px; font-weight: 700; line-height: 1.45; }

.chapter-nav {
  margin: 50px 0 58px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--navy);
  border-left: 1px solid var(--navy);
}

.chapter-nav a {
  padding: 15px 18px;
  border-right: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
  text-decoration: none;
}

.chapter-nav a:nth-child(2) { text-align: center; }
.chapter-nav a:last-child { text-align: right; }
.chapter-nav a:hover { color: white; background: var(--navy); }
.chapter-nav small { display: block; color: var(--muted); font-size: 9px; }
.chapter-nav a:hover small { color: #d2c9b8; }
.chapter-nav b { font-family: var(--serif); font-size: 15px; }

.site-footer {
  padding: 30px max(20px, calc((100% - 1180px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 35px;
  color: #d6cebe;
  background: var(--navy);
  border-top: 5px solid var(--vermilion);
}

.site-footer div b { display: block; color: white; font-family: var(--serif); font-size: 14px; }
.site-footer div span { display: block; color: #aaa395; font-size: 9px; }
.site-footer p { max-width: 560px; margin: 0; font-size: 10px; text-align: right; }
.site-footer a { color: white; text-underline-offset: 3px; }

@media (max-width: 980px) {
  :root { --shell: min(100% - 28px, 900px); }
  .header-meta { display: none; }
  .month-nav { overflow-x: auto; grid-template-columns: 90px repeat(12, 48px); }
  .front-matter { grid-template-columns: 1fr 250px; gap: 28px; }
  .finder { grid-template-columns: 1fr; }
  .finder-fields { grid-template-columns: minmax(190px, 1fr) 110px 110px 100px; }
  .month-index-grid { grid-template-columns: repeat(4, 1fr); }
  .birthday-table th { top: 108px; }
  .month-lead { grid-template-columns: 190px 1fr; gap: 32px; }
  .month-number { min-height: 210px; }
  .month-number b { font-size: 82px; }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .analysis-grid article:first-child { grid-row: span 2; }
  .spotlight-layout { grid-template-columns: 1fr; }
  .spotlight-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .day-entry-stack { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --shell: calc(100% - 22px); }
  body { background-size: 100% 28px; }
  .site-header { position: relative; }
  .header-main { min-height: 64px; }
  .brand b { font-size: 14px; }
  .brand-seal { width: 34px; height: 34px; font-size: 18px; }
  .front-matter { min-height: 0; padding: 30px 0 22px; grid-template-columns: 1fr; gap: 22px; }
  .front-title h1 { font-size: 33px; }
  .front-title > p:last-child { font-size: 13px; }
  .today-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .today-panel > span { grid-column: 1 / -1; }
  .today-panel time { font-size: 20px; }
  .finder { margin-top: 16px; padding: 15px; gap: 12px; }
  .finder-heading { justify-content: space-between; }
  .finder-fields { grid-template-columns: 1fr 1fr; }
  .keyword-field { grid-column: 1 / -1; }
  .month-directory, .master-index, .month-analysis, .spotlight, .month-entries { margin-top: 36px; }
  .section-rule { grid-template-columns: 38px 1fr; gap: 8px; }
  .section-rule > span { font-size: 20px; }
  .section-rule h2 { font-size: 19px; }
  .section-rule p { display: none; }
  .month-index-grid { grid-template-columns: repeat(2, 1fr); }
  .month-index { min-height: 104px; padding: 11px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  .birthday-table, .birthday-table tbody { display: block; }
  .birthday-table thead { display: none; }
  .birthday-table tr {
    margin-bottom: 8px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 78px 1fr auto;
    background: rgba(250, 246, 234, .7);
    border: 1px solid var(--navy);
  }
  .birthday-table tbody tr:nth-child(even) { background: rgba(228, 218, 196, .55); }
  .birthday-table td { width: auto !important; padding: 1px 7px; border: 0; }
  .birthday-table .date-cell { grid-row: 1 / span 2; grid-column: 1; padding: 0; }
  .date-cell time { display: block; }
  .date-cell b { display: block; font-size: 19px; }
  .name-cell { grid-column: 2; }
  .reading-cell { grid-column: 2; }
  .work-cell { grid-column: 1 / span 2; margin-top: 7px; padding-top: 7px !important; border-top: 1px solid var(--rule) !important; }
  .source-cell { grid-column: 3; grid-row: 1 / span 3; align-self: center; }
  .breadcrumb { padding-top: 11px; }
  .month-lead { min-height: 0; padding: 18px 0 30px; grid-template-columns: 1fr; gap: 24px; }
  .month-number { min-height: 120px; display: grid; grid-template-columns: 1fr auto; align-items: start; }
  .month-number b { grid-row: 1 / span 2; grid-column: 2; font-size: 76px; }
  .month-number small { align-self: end; justify-self: start; }
  .month-number::after { right: 100px; bottom: 46px; }
  .month-copy h1 { font-size: 32px; }
  .month-copy > p:not(.kicker) { font-size: 13px; }
  .month-jump-links { flex-wrap: wrap; }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-grid article:first-child { grid-row: auto; }
  .analysis-grid article { min-height: 0; padding: 18px; }
  .spotlight-notes { grid-template-columns: 1fr; gap: 0; }
  .spotlight-note { padding-right: 0; padding-left: 0; }
  .day-entry { grid-template-columns: 86px 1fr; }
  .day-entry-list article { min-height: 78px; grid-template-columns: 1fr auto; gap: 7px; }
  .entry-work { grid-column: 1; }
  .day-entry-list .source-link { grid-column: 2; grid-row: 1 / span 2; }
  .chapter-nav a { padding: 12px 9px; }
  .chapter-nav b { font-size: 12px; }
  .site-footer { padding: 25px 18px; display: block; }
  .site-footer p { margin-top: 12px; text-align: left; }
}

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