/* 糸灯の夜の工房。紙色・藍・灯の琥珀。日本語の見出しは明朝。 */
@font-face {
  font-family: "Itobi Serif";
  src: local("Noto Serif CJK JP"), local("Noto Serif JP"), local("Source Han Serif JP"), local("Yu Mincho"), local("Hiragino Mincho ProN");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Itobi Sans";
  src: local("Noto Sans CJK JP"), local("Noto Sans JP"), local("Source Han Sans JP"), local("Hiragino Sans"), local("Yu Gothic");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3ece0;
  --ink: #2a2420;
  --ink-soft: #5c534a;
  --muted: #7a7066;
  --navy: #243044;
  --apron: #2d3a55;
  --amber: #c4a26a;
  --lamp: #e6c98a;
  --line: #d2c4b0;
  --night: #1c1a1f;
  --footer: #2b2622;
  --serif: "Itobi Serif", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", "Noto Serif JP", serif;
  --sans: "Itobi Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--night); }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(ellipse 70% 28% at 50% 0%, rgba(230, 201, 138, 0.28), transparent 62%),
    radial-gradient(ellipse 40% 22% at 88% 8%, rgba(36, 48, 68, 0.10), transparent 55%),
    linear-gradient(180deg, #e6d8c4 0%, #f3ece0 220px, #f3ece0 100%);
  overflow: clip;
}

.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("paper-grain.png");
  background-size: 360px 360px;
  opacity: 0.18;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.page > *:not(.sample-badge) { position: relative; z-index: 1; }

.sample-badge {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 5;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  background: rgba(243, 236, 224, 0.92);
  border: 1px solid var(--line);
  padding: 4px 8px;
}

.page > .skip {
  position: absolute;
  left: 8px;
  top: 8px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 6;
}

.page > .skip:focus { transform: none; }

.inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: 72px 0 48px;
}

.site-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.42em;
  color: var(--apron);
  margin-bottom: 28px;
}

.site-name a { text-decoration: none; }

.icon-wrap {
  width: 168px;
  height: 168px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 3px #f3ece0,
    0 0 0 5px var(--amber),
    0 16px 36px rgba(42, 36, 32, 0.22);
  background: #d8cfc3;
}

.icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}

.hero h1,
.mast h1 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: var(--ink);
}

.hero h1 {
  font-size: 38px;
  margin-bottom: 14px;
}

.ai-note {
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.ai-note::before,
.ai-note::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--amber);
  vertical-align: middle;
  margin: 0 12px;
  opacity: 0.85;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-top: 22px;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.subnav a {
  color: var(--apron);
  text-decoration: none;
}

.subnav a[aria-current="page"] { border-bottom: 1px solid var(--amber); }

.subnav a:hover,
.pager a:hover,
footer a:hover,
.prose a:hover { text-decoration: underline; }

section { padding: 4px 0 36px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.section-head h2,
.prose h2,
.entry h3,
.today-words h3,
footer h3 {
  font-family: var(--serif);
  font-weight: 400;
}

.section-head h2 {
  font-size: 22px;
  letter-spacing: 0.22em;
  color: var(--navy);
}

.lamp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f0e0b8, var(--amber) 55%, #8a6a3a);
  box-shadow: 0 0 8px rgba(230, 201, 138, 0.7);
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

.section-head .en,
.mast-en,
footer .en {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.mast-en { margin: 0 0 8px; }

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.today-art {
  background: #faf6ef;
  border: 1px solid var(--line);
  padding: 18px 18px 16px;
  box-shadow: 0 10px 28px rgba(42, 36, 32, 0.06);
  min-width: 0;
}

.today-art img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f4efe6;
}

.today-art figcaption {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  min-width: 0;
}

.art-title {
  font-family: var(--serif);
  color: var(--ink);
  letter-spacing: 0.14em;
  text-decoration: none;
  text-align: right;
  min-width: 0;
}

.today-words { min-width: 0; }

.today-words h3 {
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--navy);
  margin-bottom: 16px;
}

.today-words p,
.prose p,
.lead {
  font-size: 15px;
  line-height: 2.05;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.today-words p { text-align: justify; }

.disclosure {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-align: left;
}

.code-view { margin-top: 28px; min-width: 0; }

.code-view summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  padding: 8px 18px;
  border: 1px solid #8a7a66;
  color: var(--apron);
  font-size: 13px;
  letter-spacing: 0.16em;
  background: transparent;
}

.code-view summary::-webkit-details-marker { display: none; }

.code-view pre {
  margin-top: 16px;
  max-width: 100%;
  max-height: 320px;
  overflow: auto;
  background: var(--night);
  color: #e8dcc8;
  padding: 16px;
  font-size: 12px;
  line-height: 1.6;
  tab-size: 2;
}

.past-grid,
.future-grid {
  display: grid;
  gap: 16px 14px;
}

.past-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.future-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.archive-more {
  margin: 14px 0 0;
  font-size: 13px;
  letter-spacing: 0.1em;
}

.archive-more a { color: var(--apron); }

.month-list {
  display: grid;
  gap: 10px;
}

.month-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #faf6ef;
  text-decoration: none;
  color: inherit;
}

.month-link:hover { border-color: var(--amber); }

.month-name {
  font-family: var(--serif);
  letter-spacing: 0.12em;
}

.month-count {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

a.card {
  display: block;
  background: #faf6ef;
  border: 1px solid var(--line);
  padding: 10px 10px 14px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

a.card:hover { border-color: var(--amber); }

.card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e9dfd1;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card .thumb,
.card .date,
.card .title { display: block; }

.card .date,
.shelf-date {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.card .title {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.5;
}

a.card.skipped { background: #efe8ee; border-color: #cfc4c8; }

a.card.skipped .title {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.entry {
  border: 1px solid var(--line);
  background: rgba(250, 246, 239, 0.7);
  padding: 12px 12px 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.entry .mark { width: 28px; height: 28px; margin-bottom: 8px; }

.entry h3 {
  font-size: 16px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.entry p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  flex: 1;
}

.badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 8px;
  align-self: flex-start;
}

.mast {
  text-align: center;
  padding: 48px 0 8px;
}

.mast h1 {
  font-size: 32px;
  margin: 18px 0 8px;
}

.shelf-date { margin: 0 0 18px; }

.lead { margin: 0 0 18px; }

.prose { max-width: 40rem; padding-bottom: 64px; }

.prose h2 {
  font-size: 22px;
  letter-spacing: 0.14em;
  color: var(--navy);
  margin: 36px 0 14px;
}

.prose a { color: var(--apron); text-underline-offset: 3px; }
.prose a:hover { color: var(--navy); }

.prose strong {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.prose-fig {
  margin: 36px 0 16px;
  text-align: center;
}

.prose-fig img {
  display: block;
  max-width: min(520px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(36, 48, 68, 0.10);
  border: 1px solid rgba(196, 162, 106, 0.28);
  background: var(--paper);
}

.prose-fig figcaption {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

.prose blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 2px solid var(--amber);
  background: rgba(250, 246, 239, 0.75);
}

.prose blockquote p { text-align: left; }

.facts {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  margin-top: 28px;
  font-size: 13px;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  letter-spacing: 0.12em;
}

.facts dd { letter-spacing: 0.04em; }

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 32px;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.pager a { color: var(--apron); text-decoration: none; }

.empty { color: var(--ink-soft); letter-spacing: 0.06em; }

footer {
  background: var(--footer);
  color: #e8dcc8;
  padding: 28px 0 20px;
  margin-top: 4px;
}

footer .inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
}

footer h3 {
  font-size: 13px;
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

footer h3 a { color: var(--lamp); text-decoration: none; }

footer p {
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: #d9cbb8;
}

footer .dummy { color: #b5a894; overflow-wrap: anywhere; }

footer .en { margin: -6px 0 10px; }

.footer-support {
  width: min(1080px, calc(100% - 32px));
  margin: 22px auto 2px;
  max-width: 100%;
}

.footer-support .support-lead {
  font-size: 13px;
  color: #c9bcab;
  margin: 0 0 10px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.footer-support .bmc-btn-container {
  display: block;
  max-width: 100%;
}

footer .footer-support .bmc-btn {
  height: 36px;
  min-width: 0;
  max-width: 100%;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: "Lato", var(--sans) !important;
  line-height: 1;
  letter-spacing: 0.01em;
}

footer .footer-support .bmc-btn svg {
  height: 18px !important;
  width: auto;
}

footer .footer-support .bmc-btn-text {
  width: auto;
  max-width: 100%;
  margin-left: 7px;
  font-size: 13px;
  font-family: "Lato", var(--sans) !important;
  line-height: 1;
  flex-shrink: 1;
}

.bmc-fallback {
  color: var(--lamp);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-underline-offset: 3px;
}

.footer-bottom {
  width: min(1080px, calc(100% - 32px));
  margin: 16px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(196, 162, 106, 0.28);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #9a8c7a;
}

/* 案内路（パンくず） */
.breadcrumb {
  padding: 16px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.bc-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 6px 8px;
  color: var(--muted);
}

.bc-item a {
  color: var(--apron);
  text-decoration: none;
}

.bc-item a:hover {
  text-decoration: underline;
}

.bc-sep {
  color: var(--line);
  font-size: 11px;
}

/* 前後の棚（サムネイル付きナビゲーション） */
.pager-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.pager-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #faf6ef;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.pager-step:hover {
  border-color: var(--amber);
}

.pager-thumb {
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  background: #e9dfd1;
  overflow: hidden;
}

.pager-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pager-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pager-dir {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--apron);
  font-weight: 700;
}

.pager-title {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 個別棚の足元の案内 */
.shelf-foot-nav {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.shelf-foot-nav a {
  color: var(--apron);
  text-decoration: none;
}

.shelf-foot-nav a:hover {
  text-decoration: underline;
}

/* コード写し取りボタン */
.code-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--apron);
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 3px;
}

.copy-btn:hover {
  border-color: var(--amber);
  color: var(--ink);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .past-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .future-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager-shelf { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  footer .inner { grid-template-columns: 1fr; gap: 16px; }
  .hero { padding: 40px 0 16px; }
  .site-name { letter-spacing: 0.28em; margin-bottom: 16px; }
  section { padding-bottom: 24px; }
}

@media (max-width: 520px) {
  .inner { width: min(1080px, calc(100% - 24px)); }
  .footer-support,
  .footer-bottom { width: min(1080px, calc(100% - 24px)); }
  .hero h1 { font-size: 26px; letter-spacing: 0.06em; margin-bottom: 8px; }
  .mast h1 { font-size: 24px; letter-spacing: 0.06em; }
  .section-head { gap: 10px; margin-bottom: 14px; }
  .section-head h2 { font-size: 18px; letter-spacing: 0.12em; }
  .icon-wrap { width: 112px; height: 112px; margin-bottom: 16px; }
  .ai-note { letter-spacing: 0.08em; }
  .ai-note::before,
  .ai-note::after { width: 16px; margin: 0 8px; }
  .today-words p,
  .prose p,
  .lead { font-size: 14.5px; line-height: 1.85; }
  .today-art figcaption { flex-wrap: wrap; }
  .art-title { text-align: left; }
  .subnav { margin-top: 12px; gap: 6px 12px; }
}
