/* ───────────────────────────────────────────────
   Les Haïku — élégance et poésie
   Papier washi · encre sumi · rouge cinabre
   ─────────────────────────────────────────────── */

:root {
  --paper: #f7f2e7;
  --paper-2: #efe7d6;
  --card: #fbf8f0;
  --ink: #1e1b18;
  --ink-2: #4f4a43;
  --muted: #7d766a;
  --line: #ddd2bb;
  --accent: #b3301e;
  --accent-ink: #fff;
  --indigo: #2c3a5c;
  --shadow: 0 1px 2px rgba(60, 40, 10, .08), 0 8px 24px -10px rgba(60, 40, 10, .22);
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif JP", serif;
  --display: "Cormorant Garamond", "EB Garamond", "Iowan Old Style", Georgia, "Noto Serif JP", serif;
  --ja: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "MS Mincho", serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --measure: 40rem;
  --side: 20rem;
  --top: 3.6rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14130f; --paper-2: #1c1a15; --card: #1a1813; --ink: #ece6d9; --ink-2: #bdb5a5;
    --muted: #8d8576; --line: #34302a; --accent: #ee7a62; --accent-ink: #1a0b07; --indigo: #9db0dc;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14130f; --paper-2: #1c1a15; --card: #1a1813; --ink: #ece6d9; --ink-2: #bdb5a5;
  --muted: #8d8576; --line: #34302a; --accent: #ee7a62; --accent-ink: #1a0b07; --indigo: #9db0dc;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: clamp(1.12rem, 1.04rem + .35vw, 1.3rem); line-height: 1.68;
  font-feature-settings: "liga", "kern", "onum"; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::before {          /* léger grain de papier */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: radial-gradient(rgba(120, 90, 40, .05) 1px, transparent 1.2px);
  background-size: 5px 5px; mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::before { opacity: .15; mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: .15; mix-blend-mode: screen; } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: .06em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
[lang="ja"] { font-family: var(--ja); font-weight: 400; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ───────── barre du haut ───────── */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  display: flex; align-items: center; gap: .5rem; padding: 0 clamp(.75rem, 2vw, 1.5rem);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); font-family: var(--ui); font-size: .875rem;
}
.grow { flex: 1; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.seal {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .35rem;
  background: var(--accent); color: var(--accent-ink); font-size: 1.15rem; line-height: 1; font-family: var(--ja); font-weight: 600;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-ink) 35%, transparent);
  transform: rotate(-3deg);
}
.bt { display: flex; flex-direction: column; line-height: 1.05; }
.bt b { font-family: var(--display); font-size: 1.2rem; font-weight: 700; letter-spacing: .01em; }
.bt i { font-family: var(--display); font-size: .82rem; color: var(--muted); font-style: italic; }
.iconbtn, .searchbtn {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
  border-radius: .6rem; display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; font: inherit;
}
.iconbtn:hover, .searchbtn:hover { background: var(--paper-2); color: var(--ink); }
.searchbtn { display: inline-flex; gap: .55rem; align-items: center; padding: 0 .75rem; border-color: var(--line); background: var(--card); }
.searchbtn kbd { font: 600 .72rem var(--ui); border: 1px solid var(--line); border-radius: .3rem; padding: .05rem .38rem; color: var(--muted); background: var(--paper); }
.menubtn { display: none; }
.themebtn .i-sun { display: none; }
:root[data-theme="dark"] .themebtn .i-sun { display: block; }
:root[data-theme="dark"] .themebtn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themebtn .i-sun { display: block; }
  :root:not([data-theme="light"]) .themebtn .i-moon { display: none; }
}
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.topnav { display: flex; gap: 1.25rem; margin-right: .75rem; }
.topnav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.topnav a:hover { color: var(--accent); }

/* ───────── structure ───────── */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 90rem; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top); align-self: start; height: calc(100dvh - var(--top)); overflow-y: auto;
  padding: 1.25rem 1rem 3rem 1.5rem; border-right: 1px solid var(--line);
  font-family: var(--ui); font-size: .86rem; line-height: 1.4; scrollbar-width: thin;
}
.sb-home { display: inline-block; margin-bottom: 1rem; color: var(--muted); text-decoration: none; font-weight: 500; }
.sb-home:hover { color: var(--accent); }
.navsec { margin: 0 0 .35rem; }
.navsec summary {
  list-style: none; cursor: pointer; display: flex; gap: .6rem; align-items: baseline; padding: .5rem .4rem; border-radius: .5rem;
  font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--ink); line-height: 1.2;
}
.navsec summary::-webkit-details-marker { display: none; }
.navsec summary:hover { background: var(--paper-2); }
.navsec summary::after { content: ""; margin-left: auto; width: .45rem; height: .45rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; align-self: center; }
.navsec[open] summary::after { transform: rotate(45deg); }
.navsec .sn { color: var(--accent); font-style: italic; min-width: 1rem; }
.navsec ul { list-style: none; margin: 0 0 .5rem .45rem; padding: 0 0 0 .6rem; border-left: 1px solid var(--line); }
.navsec li a { display: flex; gap: .55rem; padding: .32rem .5rem; border-radius: .4rem; color: var(--ink-2); text-decoration: none; }
.navsec li a:hover { background: var(--paper-2); color: var(--ink); }
.navsec li a.cur { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.navsec .pn { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2.2rem; flex: none; }
.navsec a.cur .pn { color: var(--accent); }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 45; }

main { min-width: 0; position: relative; z-index: 1; }
.art { padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 4vw, 3rem) 1rem; max-width: calc(var(--measure) + 6rem + 2 * clamp(1rem, 4vw, 3rem)); margin: 0 auto; }

/* ───────── en-tête de chapitre ───────── */
.chead { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); position: relative; }
.chead::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 4.5rem; height: 3px; background: var(--accent); }
.eyebrow { margin: 0 0 .6rem; font: 600 .78rem/1.2 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.eyebrow .en { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .4rem; border: 1.5px solid var(--accent); border-radius: 50%; font-size: .75rem; letter-spacing: 0; }
.chead h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); line-height: 1.06; letter-spacing: -.01em; text-wrap: balance; }
.sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.1rem; margin: .9rem 0 0; font: .85rem var(--ui); color: var(--muted); }
.sub .pnum { font: italic 600 1.4rem var(--display); color: var(--accent); }
.sub .kanji { font-size: 1.15rem; color: var(--ink-2); letter-spacing: .1em; }
.sub .read::before { content: "·"; margin-right: .9rem; }
.sub .pnum:empty + .kanji, .sub .pnum:empty { display: none; }

.toc { margin: 0 0 2.25rem; padding: 1rem 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: .75rem; font-family: var(--ui); font-size: .88rem; }
.toc-t { margin: 0 0 .5rem; font-weight: 700; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; columns: 2 17rem; column-gap: 2rem; }
.toc li { break-inside: avoid; padding: .18rem 0; line-height: 1.35; }
.toc li.l3 { padding-left: 1rem; font-size: .93em; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover, .toc a.on { color: var(--accent); }

/* ───────── texte ───────── */
.prose { font-size: 1em; hyphens: auto; -webkit-hyphens: auto; }
.prose p { margin: 0 0 1.1em; text-wrap: pretty; max-width: var(--measure); }
.prose > p:first-child { font-size: 1.12em; color: var(--ink); }
.prose > p:first-child::first-letter { font-family: var(--display); font-weight: 700; color: var(--accent); float: left; font-size: 3.7em; line-height: .82; padding: .08em .12em 0 0; }
.prose em { font-style: italic; }
.prose strong { font-weight: 600; }
.prose sup { font-size: .68em; line-height: 0; }
.prose h2, .prose h3, .prose h4 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 2.4em 0 .7em; position: relative; text-wrap: balance; }
.prose h2 { font-size: 2rem; padding-top: .9em; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.5rem; }
.prose h4 { font-size: 1.2rem; }
.prose .hnum { font: italic 600 .62em var(--display); color: var(--accent); margin-right: .35em; letter-spacing: .02em; }
.prose .anchor { position: absolute; left: -1.1em; top: 0; opacity: 0; color: var(--muted); text-decoration: none; font: 400 .7em var(--ui); padding: .2em; }
.prose h2 .anchor { top: .9em; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .anchor:focus { opacity: 1; }
.prose ul, .prose ol { max-width: var(--measure); padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.prose .attrib { font-variant: small-caps; letter-spacing: .04em; color: var(--ink-2); margin-left: 2rem; }
.xref, .bibref { font: 500 .82em var(--ui); text-decoration: none; padding: .08em .45em; border-radius: 99px; background: color-mix(in srgb, var(--accent) 11%, transparent); white-space: nowrap; }
.xref:hover, .bibref:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.prose img.inline { display: inline-block; vertical-align: middle; margin: 0 .3em; border-radius: 3px; }
.prose :target { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 24%, transparent); } to { background: transparent; } }

/* références de notes */
.fn a { font: 600 .74rem/1 var(--ui); text-decoration: none; padding: .12em .34em; margin-left: .1em; border-radius: .3em; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); vertical-align: baseline; position: relative; top: -.3em; }
.fn a:hover, .fn a:focus-visible { background: var(--accent); color: var(--accent-ink); }

/* ───────── haïku (vers) ───────── */
.verse { margin: 1.6rem 0; padding: .35rem 0 .35rem 1.4rem; border-left: 2px solid var(--accent); max-width: var(--measure); position: relative; }
.verse p { margin: 0; font-size: 1.12em; font-style: italic; line-height: 1.5; color: var(--ink); max-width: none; }
.verse p::first-letter { all: unset; }
.verse .vl { display: block; }
.verse footer { margin-top: .55rem; font: 500 .78rem/1.3 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.verse footer::before { content: "— "; }
.verse footer a { color: inherit; text-decoration: none; }
.verse footer a:hover { color: var(--accent); }
.verse footer .fn a { text-transform: none; letter-spacing: 0; }

/* ───────── images ───────── */
figure { margin: 2rem 0; }
.prose > figure { text-align: center; }
figure img { margin: 0 auto; border-radius: 4px; box-shadow: var(--shadow); cursor: zoom-in; background: var(--paper-2); }
figcaption { margin: .75rem auto 0; max-width: 34rem; font: .8rem/1.45 var(--ui); color: var(--muted); text-align: center; }
figcaption .fnum { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .72rem; color: var(--accent); margin-right: .3em; }
figure.wide img { width: 100%; }
@media (min-width: 62rem) {
  .prose > figure.wide { margin-inline: -4rem; }
}

/* ───────── mises en page tabulaires d'origine (lignes) ───────── */
.row { display: flex; flex-wrap: wrap; gap: 1.25rem 1.75rem; margin: 2rem 0; align-items: flex-start; }
.row > .cell { flex: 1 1 calc(var(--w, 50) * 1% - 1.75rem); min-width: min(100%, 11.5rem); }
.row > .cell > :first-child { margin-top: 0; }
.row > .cell > :last-child { margin-bottom: 0; }
.cell p { max-width: none; }
.cell.is-fig { flex: 0 1 auto; max-width: 100%; align-self: center; }
.cell.is-fig figure { margin: 0; }
.row.n2 > .cell.is-fig { flex: 0 1 min(100%, 17rem); }
.cell.is-fig + .cell, .cell + .cell.is-fig { flex: 1 1 16rem; }
.row .verse { margin: 0; }
/* carte haïku */
.cell.is-verse { min-width: min(100%, 17rem); background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: 1.1rem 1.3rem; box-shadow: 0 1px 0 var(--line); align-self: stretch; }
.cell.is-verse .verse { border-left: 0; padding: 0; }
.cell.is-verse .verse p { font-size: 1.1em; }
.cell.has-verse .verse { margin-bottom: .75rem; }
.row.n3 > .cell, .row.n4 > .cell, .row.n5 > .cell, .row.n6 > .cell { flex-basis: 14rem; }
.row.n3 > .cell.is-fig, .row.n4 > .cell.is-fig { flex: 1 1 11rem; }

/* ───────── notes de fin ───────── */
.endnotes { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .9em; color: var(--ink-2); }
.endnotes h2 { font-family: var(--display); font-size: 1.5rem; margin: 0 0 .8rem; }
.endnotes ol { margin: 0; padding-left: 2.2rem; }
.endnotes li { margin: .55em 0; padding-left: .3rem; max-width: var(--measure); }
.endnotes li::marker { color: var(--accent); font: 700 .85em var(--ui); }
.endnotes .back { text-decoration: none; margin-left: .3em; font-family: var(--ui); }
.fnpop {
  position: absolute; z-index: 70; width: min(22rem, calc(100vw - 1.5rem)); background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: .7rem; padding: .85rem 1rem; font: .95rem/1.5 var(--serif); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
.fnpop[hidden] { display: none; }
.fnpop b { font: 700 .7rem var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: .3rem; }

/* ───────── navigation précédent / suivant ───────── */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: calc(var(--measure) + 6rem); margin: 3rem auto 0; padding: 0 clamp(1rem, 4vw, 3rem); }
.pager a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); background: var(--card); border-radius: .8rem; text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s; }
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.pager .lab { font: 600 .72rem var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pager .tt { font-family: var(--display); font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }
.foot { max-width: calc(var(--measure) + 6rem); margin: 3rem auto 0; padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem; border-top: 1px solid var(--line); font: .85rem/1.5 var(--ui); color: var(--muted); text-align: center; }
.foot a { color: var(--ink-2); }
.foot .small { max-width: 34rem; margin: .5rem auto 0; }

/* ───────── recherche ───────── */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(20, 15, 5, .5); backdrop-filter: blur(3px); }
.searchdlg { width: min(42rem, calc(100vw - 1.5rem)); max-height: min(34rem, 80dvh); margin: 8dvh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.searchdlg[open] { display: flex; flex-direction: column; }
.sform { display: flex; align-items: center; gap: .6rem; padding: .35rem .75rem .35rem 1.1rem; border-bottom: 1px solid var(--line); margin: 0; color: var(--muted); }
.sform input { flex: 1; border: 0; background: transparent; font: 1.15rem var(--serif); color: var(--ink); padding: .8rem 0; outline: none; min-width: 0; }
.sres { overflow-y: auto; padding: .4rem; font-family: var(--ui); }
.sres .hint { padding: 1.2rem; color: var(--muted); font-size: .9rem; }
.sres a { display: block; padding: .65rem .85rem; border-radius: .6rem; text-decoration: none; color: var(--ink); }
.sres a:hover, .sres a.sel { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.sres .rt { font: 600 .72rem var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.sres .rh { font: 700 1.05rem var(--display); }
.sres .rs { font: .88rem/1.45 var(--serif); color: var(--ink-2); display: block; margin-top: .15rem; }
.sres mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: .15em; padding: 0 .08em; }

/* ───────── lightbox ───────── */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 1rem; background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(10, 8, 4, .92); }
.lightbox figure { margin: 0; text-align: center; color: #eee; max-width: 100%; }
.lightbox img { max-width: min(96vw, 1400px); max-height: 82dvh; width: auto; height: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); cursor: zoom-out; margin: 0 auto; }
.lightbox figcaption { color: #cfc8b8; margin-top: 1rem; max-width: 40rem; }
.lightbox .close { position: fixed; right: 1rem; top: 1rem; color: #fff; background: rgba(255, 255, 255, .1); font-size: 1.1rem; }

/* ───────── ACCUEIL ───────── */
.home { --top: 3.6rem; }
.home main { z-index: 1; overflow-x: clip; }
.hero { position: relative; max-width: 78rem; margin: 0 auto; padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem); display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.sun { position: absolute; z-index: -1; right: -8rem; top: -6rem; width: 38rem; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent) 78%, #fff 0%), var(--accent) 60%, color-mix(in srgb, var(--accent) 85%, #000)); opacity: .9; filter: saturate(.9); mask-image: radial-gradient(circle, #000 55%, transparent 71%); -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%); }
:root[data-theme="dark"] .sun { opacity: .5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sun { opacity: .5; } }
.hero h1 { margin: .2rem 0 1rem; font-family: var(--display); font-weight: 700; font-size: clamp(3.6rem, 2rem + 8vw, 8rem); line-height: .92; letter-spacing: -.02em; }
.hero h1 em { color: var(--accent); font-style: italic; font-weight: 600; }
.hero h1 span { display: block; margin-top: .25em; font-size: .3em; font-weight: 500; font-style: italic; letter-spacing: .02em; color: var(--ink-2); }
.lede { font-size: 1.3em; max-width: 30rem; color: var(--ink-2); margin: 0 0 2rem; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; font-family: var(--ui); }
.btn { display: inline-flex; align-items: center; padding: .8rem 1.4rem; border-radius: 99px; border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; transition: .15s; background: transparent; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); background: var(--accent); color: var(--accent-ink); }
.hero-art { display: flex; justify-content: center; align-items: flex-start; gap: 1.5rem; }
.vertical { writing-mode: vertical-rl; display: flex; gap: .5rem; font-size: clamp(1.4rem, 1rem + 1.5vw, 2.1rem); letter-spacing: .25em; line-height: 1.3; color: var(--ink); padding-top: .5rem; text-orientation: upright; }
.vertical span { border-right: 1px solid var(--line); padding: 0 .6rem; }
.vertical span:first-child { border-right: 0; }
.print { margin: 0; padding: .7rem; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transform: rotate(1.5deg); }
.print img { width: min(15rem, 52vw); height: auto; box-shadow: none; cursor: default; border-radius: 0; }

.quotes { max-width: 78rem; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 3rem) 3rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; }
.verse.big { margin: 0; padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: .25rem .9rem .9rem .25rem; background: var(--card); max-width: none; }
.verse.big p { font-size: 1.3rem; }

.sechead { margin-bottom: 1.5rem; }
.sechead h2 { margin: 0; font: 700 clamp(1.9rem, 1.4rem + 2vw, 2.8rem)/1.1 var(--display); text-wrap: balance; }
.chapters, .author { max-width: 78rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 3rem); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem 1.5rem 1rem; display: flex; flex-direction: column; transition: border-color .2s, box-shadow .2s, transform .2s; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-main { text-decoration: none; color: inherit; display: block; flex: 1; }
.cn { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 1.3rem var(--display); margin-bottom: .8rem; }
.card h3 { margin: 0 0 .4rem; font: 700 1.55rem/1.15 var(--display); }
.card p { margin: 0 0 1rem; font-size: .95em; color: var(--ink-2); line-height: 1.5; }
.card details { border-top: 1px solid var(--line); font: .85rem var(--ui); }
.card summary { cursor: pointer; padding: .7rem 0; color: var(--muted); font-weight: 600; }
.card summary:hover { color: var(--accent); }
.card ul { list-style: none; margin: 0; padding: 0 0 .5rem; }
.card li a { display: flex; gap: .6rem; padding: .28rem 0; color: var(--ink-2); text-decoration: none; }
.card li a:hover { color: var(--accent); }
.card .pn { color: var(--muted); min-width: 2.2rem; font-variant-numeric: tabular-nums; }

.sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); gap: 1rem; }
.sites a { display: flex; flex-direction: column; gap: .4rem; padding: .8rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--card); text-decoration: none; color: var(--ink); transition: .15s; }
.sites a:hover { border-color: var(--accent); transform: translateY(-2px); }
.sites img { width: 100%; height: 7.5rem; object-fit: cover; border-radius: .4rem; background: #fff; }
.sites b { font: 700 1.15rem var(--display); }
.sites span { font: .78rem/1.4 var(--ui); color: var(--muted); }
.partner { margin-top: 2.5rem; padding: 1.4rem 1.6rem; border-radius: 1rem; background: var(--paper-2); max-width: 44rem; }
.partner h3 { margin: 0 0 .4rem; font: 700 1.6rem var(--display); }
.partner p:last-child { margin: 0; color: var(--ink-2); font-size: .95em; }
.home-foot { max-width: none; margin-top: 2rem; }

/* ───────── responsive ───────── */
@media (max-width: 62rem) {
  .menubtn { display: inline-grid; }
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(22rem, 88vw); background: var(--paper); transform: translateX(-102%); transition: transform .25s ease; padding-top: 1rem; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .searchbtn .lab, .searchbtn kbd { display: none; }
  .searchbtn { padding: 0; min-width: 2.4rem; justify-content: center; border-color: transparent; background: transparent; }
  .topnav { display: none; }
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .hero-art { justify-content: flex-start; }
  .sun { right: -14rem; top: -10rem; opacity: .55; }
}
@media (max-width: 34rem) {
  .bt i { display: none; }
  .prose .attrib { margin-left: 1rem; }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
  .prose h2 { font-size: 1.7rem; }
  .prose > p:first-child::first-letter { font-size: 3.2em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ───────── impression ───────── */
@media print {
  body::before, .topbar, .sidebar, .progress, .pager, .scrim, .foot .totop, .anchor { display: none !important; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .shell { display: block; }
  .art { max-width: none; padding: 0; }
  figure { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .fn a { background: none; color: #000; }
}
.sform input[type="search"]::-webkit-search-cancel-button { display: none; }

.sudoku { margin: 1rem 0 0; font: .9rem var(--ui); color: var(--muted); }
.sites a:not(:has(img)) { justify-content: center; min-height: 6rem; }

/* code couleur des écritures japonaises : kanji rouge, hiragana bleu, katakana vert */
.c-red { color: #c4161c; } .c-blue { color: #1e4fc4; } .c-green { color: #1b7a3a; }
:root[data-theme="dark"] .c-red { color: #ff7b72; } :root[data-theme="dark"] .c-blue { color: #79a6ff; } :root[data-theme="dark"] .c-green { color: #56d17a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-red { color: #ff7b72; } :root:not([data-theme="light"]) .c-blue { color: #79a6ff; } :root:not([data-theme="light"]) .c-green { color: #56d17a; }
}
.prose .indent { margin-left: 1.25rem; padding-left: 1rem; border-left: 2px solid var(--line); font-style: italic; color: var(--ink-2); }
.tablewrap { overflow-x: auto; margin: 1.5rem 0; max-width: 100%; }
table.data { border-collapse: collapse; width: 100%; max-width: 44rem; font-size: .95em; background: var(--card); border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }
table.data th, table.data td { padding: .55rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data thead th { background: var(--paper-2); font: 600 .78rem var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-style: normal; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data [lang="ja"] { font-size: 1.15em; }
.prose .indent [lang="ja"] { font-style: normal; }
.row.n3 > .cell, .row.n4 > .cell { min-width: min(100%, 12rem); }
.row.n3 > .cell.is-verse, .row.n4 > .cell.is-verse { min-width: min(100%, 12rem); padding: 1rem; }

/* texte justifié (corps de texte et notes), poèmes et légendes restent alignés à gauche / centrés */
.prose p, .endnotes li { text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }
.prose .verse p, .prose .attrib, .cell.is-verse p, figcaption, .prose .tablewrap p { text-align: left; hyphens: manual; }
.cell p { hyphens: auto; }
@media (max-width: 34rem) { .prose p, .endnotes li { text-align: left; } }

/* citations et dialogues */
.prose .indent.indent2 { margin-left: 3.2rem; }
.prose blockquote.quote { margin: 1.2rem 0 1.2rem 1.25rem; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink-2); max-width: var(--measure); }
.prose blockquote.quote p { margin: 0; }

.prose h3.season { text-align: center; font-weight: 700; margin: 2.6rem 0 1.2rem; }

.prose blockquote.verse.dlg { margin: .4rem 0 1.1rem 3.2rem; }

a.listen { display: inline-block; margin-top: .4rem; font: 500 .85rem/1.3 var(--ui); color: var(--accent); text-decoration: none; }
a.listen:hover { text-decoration: underline; }

.vtag { display: block; margin-bottom: .45rem; font: 600 .66rem/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-style: normal; }
.endnotes[hidden] { display: none; }

.prose blockquote.quote.center { text-align: center; border-left: 0; padding-left: 0; margin-left: auto; margin-right: auto; }
.prose blockquote.quote.center p { text-align: center; }
.prose blockquote.quote .verse { margin-left: 0; }
.row.n1 > .cell.is-verse { flex: 0 1 calc(50% - .9rem); }
.prose blockquote.quote p + p { margin-top: .8rem; }

/* haïku : une seule présentation (carte) */
.prose > .verse:not(.big):not(.dlg) { background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: 1.1rem 1.3rem; box-shadow: 0 1px 0 var(--line); max-width: 24rem; }
.prose > .verse:not(.big):not(.dlg) p { font-size: 1.1em; }
.verse[lang="en"] p { font-style: normal; }
.fn a:focus-visible, a.bibref:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sites img.top { object-position: top; }
.btn small { opacity: .75; font-weight: 400; }
.btn small { margin-left: .4rem; }
.sites img.contain { object-fit: contain; }
