/* Deux plumes, une lignée — feuille de style
   Polices : Fraunces & Inter (identiques à letract-upr, licences OFL dans fonts/). */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(fonts/fraunces-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url(fonts/fraunces-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Palette : vélin, encre, sang-de-bœuf, or ---------- */
:root {
  --papier: #f5efe2;
  --papier-2: #ece3cf;
  --encre: #2a2320;
  --encre-douce: #5e534b;
  --filet: #cdbfa3;
  --accent: #7a2e2a;        /* sang-de-bœuf */
  --or: #a8823b;
  --rene: #8a5a2b;          /* terre de Sienne, Pyrénées */
  --urbain: #6b2a46;        /* lie-de-vin, Aude */
  --ombre: rgba(60, 40, 20, .14);
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mesure: 34rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papier: #1b1816;
    --papier-2: #24201d;
    --encre: #eae1cf;
    --encre-douce: #b3a792;
    --filet: #4a4038;
    --accent: #d9897c;
    --or: #cfa95e;
    --rene: #d4a06a;
    --urbain: #d48aa8;
    --ombre: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papier: #1b1816; --papier-2: #24201d; --encre: #eae1cf; --encre-douce: #b3a792;
  --filet: #4a4038; --accent: #d9897c; --or: #cfa95e; --rene: #d4a06a; --urbain: #d48aa8;
  --ombre: rgba(0, 0, 0, .5); color-scheme: dark;
}

/* ---------- Socle ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--papier);
  /* grain de papier : turbulence SVG très légère + vignettage */
  background-image:
    radial-gradient(ellipse at 50% 0%, transparent 55%, var(--ombre) 140%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  color: var(--encre);
  font: 500 1.125rem/1.7 var(--serif);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures discretionary-ligatures;
  font-feature-settings: "kern", "liga", "dlig", "onum";
  text-rendering: optimizeLegibility;
}
main { flex: 1; width: 100%; padding: 0 16px; }
a { color: inherit; text-decoration-color: var(--filet); text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--or) 35%, transparent); }
em { font-style: normal; color: var(--accent); }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 16px; top: 8px; z-index: 50; background: var(--papier); padding: .3rem .6rem; }

.fleuron { color: var(--or); font-size: 1.5rem; text-align: center; margin: .5rem 0; line-height: 1; }
.surtitre {
  font: 600 .72rem/1.4 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin: 0 0 .6rem;
}
.surtitre a { text-decoration: none; }

/* ---------- Bandeau ---------- */
.bandeau {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 16px;
  background: color-mix(in srgb, var(--papier) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--filet);
}
.marque {
  font: 600 1.05rem/1 var(--serif);
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.marque .fleuron { font-size: 1.1rem; margin: 0; }
.bandeau nav { margin-left: auto; display: flex; gap: 1.2rem; }
.bandeau nav a {
  font: 600 .75rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; color: var(--encre-douce);
}
.bandeau nav a:hover { color: var(--accent); }

.burger {
  flex: none; width: 2.5rem; height: 2.5rem; padding: .6rem .5rem;
  display: grid; align-content: space-between;
  background: none; border: 1px solid var(--filet); border-radius: 50%;
  cursor: pointer; color: var(--encre);
}
.burger span { display: block; height: 1.5px; background: currentColor; border-radius: 1px; transition: width .3s; }
.burger span:nth-child(2) { width: 70%; justify-self: center; }
.burger:hover { color: var(--accent); border-color: currentColor; }
.burger:hover span:nth-child(2) { width: 100%; }

/* ---------- Tiroir biographique ---------- */
.tiroir {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: min(26rem, 92vw);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 3.5rem 1.75rem 2.5rem;
  background: var(--papier-2);
  border-right: 1px solid var(--filet);
  box-shadow: 0 0 40px var(--ombre);
  transform: translateX(-102%);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.tiroir-ouvert .tiroir { transform: none; }
.tiroir-ouvert { overflow: hidden; }
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(20, 14, 10, .45); }
.fermer {
  position: absolute; top: .8rem; right: 1rem;
  background: none; border: 0; cursor: pointer;
  font: 400 2rem/1 var(--serif); color: var(--encre-douce);
}
.fermer:hover { color: var(--accent); }
.bio { padding: 1.5rem 0 2rem; border-top: 1px solid var(--filet); font-size: 1rem; line-height: 1.65; }
.bio + .bio { margin-top: .5rem; }
.bio h2 { font: 700 1.7rem/1.1 var(--serif); margin: 1rem 0 .2rem; color: var(--teinte); }
.bio .vie { font: 500 .78rem/1.4 var(--sans); letter-spacing: .08em; color: var(--encre-douce); margin: 0 0 1rem; }
.bio p { margin: 0 0 .8rem; hyphens: auto; text-align: justify; }
.bio .lire { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--teinte); text-decoration: none; }
.portrait {
  position: relative; margin: 0 auto;
  width: 9.5rem; aspect-ratio: 4 / 5;
  display: grid; place-items: center;
  border-radius: 50% / 42%;
  background: radial-gradient(circle at 50% 35%, var(--papier), var(--papier-2));
  box-shadow: 0 0 0 1px var(--filet), 0 0 0 6px var(--papier-2), 0 0 0 7px var(--or), 0 10px 30px var(--ombre);
  overflow: hidden;
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: sepia(.25) contrast(1.02); z-index: 1; }
.monogramme { font: 800 4.5rem/1 var(--serif); color: var(--teinte); opacity: .55; }
.auteur-rene { --teinte: var(--rene); }
.auteur-urbain { --teinte: var(--urbain); }

/* ---------- Frontispices ---------- */
.frontispice {
  position: relative;
  max-width: 44rem; margin: 0 auto;
  padding: 5rem 0 3rem;
  text-align: center;
}
.frontispice h1 {
  font: 800 clamp(2.6rem, 9vw, 5rem)/1 var(--serif);
  letter-spacing: -.02em;
  margin: 0 0 1.2rem;
  color: var(--teinte, var(--encre));
}
.frontispice h1 em { font-weight: 500; }
.frontispice .chapeau {
  font-size: 1.2rem; color: var(--encre-douce);
  max-width: 32rem; margin: 0 auto;
}
.compte { font: 600 .72rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--or); margin-top: 1.6rem; }
.lettrine-geante {
  position: absolute; left: 50%; top: 50%; z-index: -1;
  transform: translate(-50%, -54%);
  font: 900 clamp(14rem, 45vw, 24rem)/1 var(--serif);
  color: var(--teinte, var(--or)); opacity: .07;
  pointer-events: none; user-select: none;
}
.epigraphe {
  max-width: 26rem; margin: 2rem auto 0;
  font-size: 1.15rem; color: var(--encre-douce);
}
.epigraphe small { display: block; margin-top: .4rem; font: 500 .8rem/1.4 var(--sans); letter-spacing: .06em; }
.accueil::after, .page-sommaire .frontispice::after {
  content: "❦"; display: block; margin-top: 2.5rem; color: var(--or); font-size: 1.6rem;
}

/* ---------- Accueil : photographie encadrée ---------- */
.photographie {
  max-width: 22rem; margin: 0 auto 4rem;
  padding: .9rem .9rem 0;
  background: #fbf8f1;
  box-shadow: 0 1px 2px var(--ombre), 0 18px 40px var(--ombre);
  transform: rotate(-1.2deg);
}
.photographie img { display: block; width: 100%; height: auto; filter: sepia(.18) saturate(.9); }
.photographie figcaption {
  padding: .7rem 0 .9rem; text-align: center;
  font: 500 .95rem/1.4 var(--serif); color: #5e534b;
}

/* ---------- Accueil : deux cartes ---------- */
.cartes {
  max-width: 60rem; margin: 0 auto 5rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2rem;
}
.carte {
  position: relative; overflow: hidden; isolation: isolate;
  display: block; padding: 2.5rem 2rem 2rem;
  text-decoration: none;
  background: color-mix(in srgb, var(--papier-2) 70%, transparent);
  border: 1px solid var(--filet);
  outline: 1px solid var(--filet); outline-offset: -8px;
  transition: transform .3s, box-shadow .3s;
}
.carte:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 14px 34px var(--ombre); }
.carte h2 { font: 800 2.2rem/1.05 var(--serif); margin: 0 0 .3rem; color: var(--teinte); }
.carte .vie { font: 500 .78rem/1.4 var(--sans); letter-spacing: .08em; color: var(--encre-douce); }
.carte .lettrine-geante { left: auto; right: -1rem; top: auto; bottom: -5rem; transform: none; font-size: 16rem; opacity: .09; }

/* ---------- Sommaire ---------- */
.table {
  max-width: 64rem; margin: 0 auto 5rem;
  columns: 2 22rem; column-gap: 4rem; column-rule: 1px solid var(--filet);
}
.lettre { break-inside: avoid; margin-bottom: 1.6rem; }
.lettre h2 {
  font: 800 2.4rem/1 var(--serif); color: var(--or);
  margin: 0 0 .4rem; padding-bottom: .3rem; border-bottom: 1px solid var(--filet);
}
.lettre ul { list-style: none; margin: 0; padding: 0; }
.lettre li a {
  display: block; padding: .45rem 0 .5rem; text-decoration: none;
  border-bottom: 1px dotted var(--filet);
}
.lettre li a .t { display: block; font-weight: 600; font-size: 1.08rem; line-height: 1.3; transition: color .2s, padding .3s; }
.lettre li a .incipit {
  display: block; font-size: .85rem; color: var(--encre-douce); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lettre li a:hover .t { color: var(--teinte, var(--accent)); padding-left: .4rem; }
.page-sommaire .frontispice ~ .table { --teinte: inherit; }

/* ---------- Poème ---------- */
.poeme {
  max-width: var(--mesure); margin: 0 auto; padding: 4.5rem 0 2rem;
}
.poeme .surtitre { text-align: center; }
.poeme h1 {
  font: 800 clamp(2rem, 6.5vw, 3.1rem)/1.08 var(--serif);
  letter-spacing: -.015em;
  text-align: center; text-wrap: balance;
  margin: .2rem 0 .4rem;
}
.poeme > .fleuron { margin-bottom: 2.6rem; }
.strophe { margin: 0 0 1.6em; }
.vers {
  display: block;
  padding-left: 1.6em; text-indent: -1.6em;   /* retrait suspendu pour les vers longs */
  transition: color .25s;
}
.strophe:hover .vers { color: var(--encre-douce); }
.strophe .vers:hover { color: var(--encre); }
.strophe.premiere .vers:nth-child(-n+2) { padding-left: 0; text-indent: 0; }
.strophe.premiere .vers:first-child::first-letter {
  float: left;
  font-size: 3.4em; line-height: .8; font-weight: 800;
  margin: .08em .08em 0 0;
  color: var(--accent);
}
.prose .vers { padding-left: 0; text-indent: 1.5em; text-align: justify; hyphens: auto; margin-bottom: .6em; }
.date { text-align: right; font-size: .95rem; color: var(--encre-douce); margin: 2rem 0 0; }
.signature {
  text-align: right; margin: .4rem 0 0;
  font: 600 .78rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--or);
}

.feuillets {
  max-width: 44rem; margin: 2rem auto 5rem;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  padding-top: 1.5rem; border-top: 1px solid var(--filet);
}
.feuillets a { text-decoration: none; font-size: 1rem; line-height: 1.3; }
.feuillets small {
  display: block; margin-bottom: .2rem;
  font: 600 .66rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--encre-douce);
}
.feuillets .prec small::before { content: "← "; }
.feuillets .suiv { text-align: right; }
.feuillets .suiv small::after { content: " →"; }
.feuillets .sommaire {
  font: 600 .72rem/1 var(--sans); letter-spacing: .12em; color: var(--or);
  border: 1px solid var(--filet); border-radius: 2rem; padding: .55rem .9rem;
  white-space: nowrap;
}

/* ---------- Mentions légales ---------- */
.legale { max-width: 40rem; margin: 0 auto; padding: 4.5rem 0 3rem; font-size: 1.02rem; }
.legale > .surtitre, .legale h1 { text-align: center; }
.legale h1 { font: 800 clamp(2rem, 6.5vw, 3.1rem)/1.08 var(--serif); margin: .2rem 0 .4rem; }
.legale > .fleuron { margin-bottom: 2.4rem; text-align: center; }
.legale section { margin-bottom: 2.2rem; }
.legale h2 {
  font: 700 1.35rem/1.25 var(--serif); color: var(--accent);
  margin: 0 0 .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--filet);
}
.legale p { margin: 0 0 .8rem; text-align: justify; hyphens: auto; }

/* ---------- Pied ---------- */
.pied {
  padding: 2rem 16px 3rem; text-align: center;
  font: 500 .78rem/1.5 var(--sans); color: var(--encre-douce);
}
.pied p { margin: .3rem 0; }

/* ---------- Petits écrans ---------- */
@media (max-width: 40rem) {
  body { font-size: 1.05rem; }
  .bandeau nav { display: none; }
  .frontispice { padding-top: 3.5rem; }
  .poeme { padding-top: 3rem; }
  .feuillets { grid-template-columns: 1fr 1fr; }
  .feuillets .sommaire { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .table { column-rule: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  .bandeau, .tiroir, .voile, .feuillets, .pied { display: none; }
  body { background: #fff; color: #000; }
  .poeme { padding-top: 0; }
}
