:root { color-scheme: dark; --paper: #07080f; --surface: #0e101b; --ink: #ece4d2; --muted: #8f8b9c; --accent: #d9b779; --line: #262738; --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; line-height: 1.9; }
a { color: inherit; text-underline-offset: .3em; overflow-wrap: anywhere; }
button, input, select { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.skip { position: absolute; top: -5rem; z-index: 10; padding: .5rem 1rem; background: var(--surface); }
.skip:focus { top: .5rem; }
.masthead { display: flex; justify-content: space-between; align-items: center; padding: 1.3rem 4vw; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .85rem; font-size: 1.2rem; text-decoration: none; }
.brand-mark { color: var(--accent); font: 1.9rem var(--serif); border: 1px solid var(--line); width: 2.6rem; text-align: center; }
.brand-caption { font-size: .75rem; color: var(--muted); margin-left: .5rem; }
.edition, .eyebrow { color: var(--accent); font-size: .68rem; letter-spacing: .18em; font-weight: 500; }
.masthead-actions { display: flex; align-items: center; gap: 1.5rem; font-size: .8rem; }
.masthead-actions a { text-decoration: none; }
.era-doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-top: 1.5rem; }
.era-door { display: flex; flex-direction: column; align-items: start; gap: .7rem; padding: 1.3rem; border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.era-door > span { font-size: .75rem; color: var(--muted); }
.era-door strong { font: 1rem/1.7 var(--serif); }
.era-door:hover { border-color: var(--accent); }
.atlas-page.atlas-ready .public-eras { display: block; padding-top: 2.5rem; }
.chronicle-events { list-style: none; padding: 0; }
.chronicle-events > li { border-bottom: 1px solid var(--line); padding: 1.2rem 0 1.7rem; scroll-margin-top: 2rem; }
.chronicle-events > li:target { border-left: 3px solid var(--accent); padding-left: 1.2rem; background: var(--surface); }
.reader .chronicle-date { color: var(--accent); font: 1.3rem/1.5 var(--serif); margin-bottom: .6rem; }
.chronicle-places { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; }
.chronicle-places a { color: var(--accent); text-decoration: none; }
.chronicle-places a:hover { text-decoration: underline; }
.reader .chronicle-events h3 { font: 1.15rem/1.8 var(--serif); font-weight: 400; margin: 0 0 .4rem; }
.reader .timeline-intro { color: var(--muted); }
/* 年表の絵。本文の脇に静かに置き、押すと同じ画面で大きく見える。 */
.chronicle-events figure { margin: 1.2rem 0 0; max-width: 560px; }
.picture-open { display: block; width: 100%; height: auto; padding: 0; border: 1px solid var(--line); background: #000; cursor: zoom-in; overflow: hidden; }
.picture-open img { display: block; width: 100%; filter: saturate(.85); transition: transform .8s ease, filter .4s; }
.picture-open:hover img, .picture-open:focus-visible img { filter: none; transform: scale(1.02); }
.chronicle-events figcaption { margin-top: .5rem; font-size: .78rem; line-height: 1.7; color: var(--muted); }
.picture-lightbox { width: min(1200px, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--accent); background: #000; color: var(--ink); }
.picture-lightbox::backdrop { background: #03040ad9; backdrop-filter: blur(8px); }
.picture-lightbox img { display: block; width: 100%; max-height: calc(100dvh - 6rem); object-fit: contain; }
.picture-lightbox p { margin: 0; padding: .8rem 1rem; font: .85rem/1.7 var(--serif); color: #d8d0bf; }
.picture-lightbox button { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 1px solid var(--accent); border-radius: 50%; background: #0a0b15cc; color: var(--ink); font-size: 18px; line-height: 1; }
@media (max-width: 700px) { .era-doors { grid-template-columns: 1fr; }.masthead-actions { gap: 1rem; }.brand { font-size: 1rem; } }
.home, .footer { max-width: 1440px; margin: auto; padding-inline: 4vw; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 3rem; padding: 5rem 0 4rem; min-height: 540px; }
.hero h1 { font: clamp(2.5rem, 4.5vw, 4.7rem)/1.6 var(--serif); letter-spacing: .035em; margin: 1.5rem 0; }
.hero-description { color: var(--muted); font-size: .95rem; }
.button { display: inline-flex; gap: 3rem; align-items: center; padding: .85rem 1.6rem; background: var(--accent); color: #14120c; text-decoration: none; margin-top: 1.3rem; }
.button:hover { background: #ead08f; }
.hero-date { display: flex; flex-direction: column; align-items: center; padding: 4rem 0; background: radial-gradient(ellipse at center, #2a2440aa, transparent 70%); border-block: 1px solid var(--line); }
.horizon { font: clamp(5rem, 12vw, 11rem)/1.5 var(--serif); color: var(--accent); letter-spacing: -.04em; }
.date-caption { font-size: .75rem; color: var(--muted); letter-spacing: .15em; }
.archive-stats { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-block: 1px solid var(--line); padding: 1rem 0; color: var(--muted); font-size: .75rem; letter-spacing: .1em; }
.archive-stats strong { font-size: 1.4rem; font-weight: 400; color: var(--ink); margin-right: .8rem; }
.era-explorer, .library { padding-top: 5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.section-heading h2 { font: clamp(1.6rem, 3vw, 2.2rem)/1.6 var(--serif); margin: .6rem 0 0; }
.section-description, .count { color: var(--muted); font-size: .85rem; }
.text-link { color: var(--accent); font-size: .8rem; }
.era-controls { display: flex; gap: 1rem; align-items: center; margin: 2rem 0; padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.era-controls label { font-size: .8rem; color: var(--muted); }
select, input { border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--surface); padding: .8rem 1rem; min-width: 0; }
select { flex: 1; max-width: 600px; width: 100%; font-size: .85rem; }
.era-arrows { margin-left: auto; display: flex; gap: .4rem; }
button { width: 3rem; height: 3rem; border: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; }
button:disabled { opacity: .3; cursor: default; }
.era-panel { display: grid; grid-template-columns: 1fr 1.6fr; gap: 3rem; padding: 1rem 0 2rem; animation: emerge .35s ease-out; }
.era-number { font: 4.8rem/1.2 var(--serif); color: var(--accent); }
.era-label h3 { font-size: .95rem; font-weight: 400; margin: 1rem 0 1.5rem; }
.event-list { margin: 0; padding: 0; list-style: none; counter-reset: event; }
.event-list li { counter-increment: event; position: relative; padding: 1rem 0 1rem 2.5rem; border-bottom: 1px solid var(--line); font-size: .85rem; color: #d8d0bf; }
.event-list li::before { content: counter(event, decimal-leading-zero); position: absolute; left: 0; color: var(--accent); font-size: .7rem; }
.search { margin: 2rem 0; display: flex; align-items: center; gap: 1rem; }
.search label { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.search input { width: 100%; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.card { display: flex; flex-direction: column; padding: 1.7rem; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-3px); }
.card-index { color: var(--accent); font-size: .65rem; letter-spacing: .12em; }
.card h3 { font: 1.3rem/1.7 var(--serif); margin: 1.5rem 0 .7rem; }
.card h3 a { text-decoration: none; }
.card-summary { color: var(--muted); font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2rem; }
.card-bottom { margin-top: auto; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1rem; font-size: .75rem; color: var(--muted); }
.card-bottom a { color: var(--accent); }
.empty-state { padding: 3rem; border: 1px solid var(--line); text-align: center; }
.footer { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-block: 2rem; margin-top: 5rem; font-size: .75rem; color: var(--muted); }
.footer a { text-decoration: none; }
.reader-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 4vw; max-width: 1440px; padding: 3rem 4vw; margin: auto; }
.reader-sidebar { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow: auto; font-size: .8rem; padding-right: 1rem; }
.back-link { color: var(--accent); font-size: .8rem; text-decoration: none; }
.document-menu, .contents { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
summary { cursor: pointer; color: var(--muted); }
.document-menu nav a { display: block; padding: .45rem .5rem; text-decoration: none; margin-block: .2rem; }
.document-menu a[aria-current] { color: var(--accent); background: var(--surface); border-left: 2px solid var(--accent); }
.contents ul { padding-left: 1rem; }
.contents a { text-decoration: none; }
.contents a[aria-current] { color: var(--accent); text-decoration: underline; }
.reader { min-width: 0; max-width: 920px; }
.reader h1 { font: clamp(1.9rem, 4vw, 3rem)/1.6 var(--serif); margin-top: 1.2rem; }
.reader h2 { font: 1.6rem/1.7 var(--serif); margin-top: 3.5rem; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.reader h3 { font-size: 1.15rem; margin-top: 2rem; }
.reader p, .reader li { color: #d8d0bf; }
.reader article a { color: var(--accent); }
.glossary-term { display: inline; width: auto; height: auto; padding: 0; border: 0; border-bottom: 1px dotted color-mix(in srgb, var(--accent) 75%, transparent); color: inherit; background: transparent; line-height: inherit; text-align: inherit; cursor: help; }
.glossary-term:hover, .glossary-term[aria-expanded="true"] { color: var(--accent); border-bottom-style: solid; }
.glossary-tooltip { position: fixed; z-index: 20; width: min(22rem, calc(100vw - 24px)); padding: 1rem 1.1rem; border: 1px solid var(--accent); background: #0f1120f5; color: var(--ink); box-shadow: 0 12px 35px #0008; backdrop-filter: blur(12px); line-height: 1.7; }
.glossary-tooltip-label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .62rem; letter-spacing: .06em; }
.glossary-tooltip strong { display: block; color: var(--accent); font: 1.05rem/1.5 var(--serif); }
.glossary-tooltip p { margin: .4rem 0 0; color: #d8d0bf; font-size: .78rem; }
h1, h2, h3, p, li { overflow-wrap: anywhere; }
h2, h3 { scroll-margin-top: 2rem; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; font-size: .82rem; }
th, td { padding: .8rem; border: 1px solid var(--line); min-width: 7rem; vertical-align: top; }
th { background: #161829; text-align: left; color: var(--accent); }
tr:nth-child(even) { background: var(--surface); }
pre { padding: 1rem; overflow: auto; background: var(--surface); }
img, video { max-width: 100%; height: auto; }
blockquote { margin-left: 0; padding-left: 1rem; border-left: 2px solid var(--accent); }
.reader-end { display: block; margin-top: 4rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.reading-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 5; }
.reading-progress span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes emerge { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .reader-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 2rem; } }
@media (max-width: 700px) {
  .edition, .brand-caption { display: none; }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2rem; }
  .hero-date { padding: 1.5rem 0; }
  .horizon { font-size: 6rem; }
  .archive-stats { flex-wrap: wrap; }
  .era-explorer, .library { padding-top: 3rem; }
  .section-heading { flex-wrap: wrap; }
  .era-controls { flex-wrap: wrap; gap: .5rem; }
  .era-controls label { width: 100%; }
  .era-panel { grid-template-columns: 1fr; gap: 1rem; }
  .era-number { font-size: 3.5rem; }
  .era-arrows button { width: 2.5rem; }
  .cards { grid-template-columns: 1fr; }
  .search { flex-wrap: wrap; }
  .reader-layout { grid-template-columns: 1fr; padding-top: 1rem; }
  .reader-sidebar { position: static; max-height: none; padding: 0; }
  .contents, .document-menu { margin-top: 1rem; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { :root { --ink: #111; --muted: #444; --paper: white; --surface: white; --accent: #222; --line: #ccc; color-scheme: light; } .masthead, .reader-sidebar, .reading-progress, .footer, .skip, .reader-end, .glossary-tooltip { display: none; } .reader-layout { display: block; padding: 0; } .reader p, .reader li { color: #111; } .glossary-term { border: 0; color: inherit; } table { display: table; font-size: 8pt; } }
