/* Prépa Cafetier — secondary pages (mentions légales, confidentialité, 404).
   Every rule is scoped under main.doc and every class is prefixed .doc-. Tokens from base.css only. */

/* ------------------------------------------------------------------ reading progress (CSS scroll timeline, progressive) */
.doc .doc-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .doc .doc-progress { display: block; position: fixed; z-index: 101; top: 0; left: 0; right: 0; height: 2px; pointer-events: none;
    background: linear-gradient(90deg, var(--brass-deco), var(--wine)); transform-origin: 0 50%; transform: scaleX(0);
    animation: doc-progress linear both; animation-timeline: scroll(root); }
}
@keyframes doc-progress { to { transform: scaleX(1); } }

/* ------------------------------------------------------------------ page head */
.doc .doc-head { position: relative; padding: calc(76px + clamp(48px, 9vw, 120px)) 0 clamp(48px, 7vw, 96px); background: var(--paper); overflow: hidden; }
.doc .doc-head::before { /* faint brass arcs, like the rim of a plate seen from above */
  content: ""; position: absolute; right: -180px; top: -140px; width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(201, 164, 92, .35), 0 0 0 36px var(--paper), 0 0 0 37px rgba(201, 164, 92, .22), 0 0 0 96px var(--paper), 0 0 0 97px rgba(201, 164, 92, .12); }
.doc .doc-head .container { position: relative; z-index: 1; }
.doc .doc-crumbs { margin: 0 0 clamp(28px, 4vw, 44px); font-size: 14.5px; color: var(--muted); }
.doc .doc-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.doc .doc-crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.doc .doc-crumbs li + li::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--brass-deco); transform: rotate(45deg); }
.doc .doc-crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.doc .doc-crumbs a:hover { text-decoration-color: var(--wine); }
.doc .doc-title { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7.4vw, 96px); line-height: 1; letter-spacing: -.035em; margin: 0 0 clamp(20px, 3vw, 30px); max-width: 14ch; font-optical-sizing: auto; }
.doc .doc-title em { font-style: italic; color: var(--wine); }
.doc .doc-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: clamp(26px, 4vw, 40px) 0 0; padding: 0; list-style: none; }
.doc .doc-meta .pill { font-weight: 550; color: var(--muted); }
.doc .doc-meta .pill b { color: var(--ink); font-weight: 650; }
.doc .doc-meta svg { width: 16px; height: 16px; color: var(--brass); }

/* ------------------------------------------------------------------ body: sommaire + article */
.doc .doc-body { position: relative; background: var(--paper-2); border-top: 1px solid var(--line); padding: clamp(48px, 8vw, 112px) 0 clamp(80px, 11vw, 150px); }
.doc .doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 6vw, 88px); }
@media (min-width: 1000px) {
  .doc .doc-layout { grid-template-columns: 250px minmax(0, 70ch); justify-content: center; align-items: start; }
  .doc .doc-toc { position: sticky; top: 110px; }
}

.doc .doc-toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px 14px; }
@media (min-width: 1000px) { .doc .doc-toc { background: transparent; border: 0; padding: 0; } }
.doc .doc-toc-t { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--brass); display: flex; align-items: center; gap: 12px; }
.doc .doc-toc-t::before { content: ""; width: 28px; height: 1px; background: var(--brass-deco); }
.doc .doc-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: doc-toc; }
.doc .doc-toc li { counter-increment: doc-toc; border-top: 1px solid var(--line); }
.doc .doc-toc li:first-child { border-top: 0; }
.doc .doc-toc a { position: relative; display: flex; align-items: baseline; gap: 14px; min-height: 48px; padding: 12px 0; color: var(--ink); text-decoration: none; font-size: 15.5px; line-height: 1.35; }
.doc .doc-toc a::before { content: counter(doc-toc, decimal-leading-zero); flex: none; width: 22px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--brass); font-variant-numeric: lining-nums tabular-nums; }
.doc .doc-toc a span { background: linear-gradient(var(--wine), var(--wine)) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease-out), color .2s; padding-bottom: 2px; }
.doc .doc-toc a:hover span, .doc .doc-toc a:focus-visible span { background-size: 100% 1px; color: var(--wine); }

.doc .doc-article { max-width: 70ch; min-width: 0; }
.doc .doc-article p, .doc .doc-article li { line-height: 1.7; }
.doc .doc-article p { margin: 0 0 1.05em; }
.doc .doc-article a { color: var(--wine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc .doc-article a:hover { text-decoration-thickness: 2px; }
.doc .doc-article strong { font-weight: 650; }
.doc .doc-article ul { margin: 0 0 1.1em; padding: 0; list-style: none; display: grid; gap: 10px; }
.doc .doc-article ul li { position: relative; padding-left: 26px; }
.doc .doc-article ul li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 6px; height: 6px; border: 1px solid var(--brass-deco); transform: rotate(45deg); }

/* sections + brass ornament divider */
.doc .doc-sec { position: relative; scroll-margin-top: 100px; }
.doc .doc-sec + .doc-sec { margin-top: clamp(48px, 6vw, 72px); padding-top: clamp(48px, 6vw, 72px); }
.doc .doc-sec + .doc-sec::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; height: 1px; background: linear-gradient(90deg, var(--brass-deco), rgba(201, 164, 92, 0)); opacity: .7; }
.doc .doc-sec + .doc-sec::after { content: ""; position: absolute; top: -4px; left: 0; width: 8px; height: 8px; border: 1px solid var(--brass-deco); transform: rotate(45deg); background: var(--paper-2); }
.doc .doc-h { display: flex; align-items: baseline; gap: 16px; font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 22px; }
.doc .doc-h em { font-style: italic; color: var(--wine); }
.doc .doc-n { flex: none; font-style: italic; font-size: .5em; color: var(--brass); letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums; transform: translateY(-.5em); transition: color .3s; }
.doc .doc-h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; letter-spacing: -.01em; margin: 30px 0 10px; }
/* the section you jumped to gets a quiet bordeaux marker */
.doc .doc-sec:target .doc-n { color: var(--wine); }
.doc .doc-sec:target > .doc-h::before { content: ""; position: absolute; left: -22px; width: 3px; height: 1.1em; border-radius: 3px; background: var(--wine); transform-origin: 50% 0; animation: doc-mark .7s var(--ease-out) both; }
.doc .doc-sec > .doc-h { position: relative; }
@keyframes doc-mark { from { transform: scaleY(0); } to { transform: none; } }
@media (max-width: 1099px) { .doc .doc-sec:target > .doc-h::before { left: -14px; } }

/* "carte de visite" for the publisher / host: card with brass corner ticks */
.doc .doc-vcard { position: relative; margin: 6px 0 26px; padding: clamp(22px, 4vw, 34px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.doc .doc-vcard::before, .doc .doc-vcard::after { content: ""; position: absolute; width: 18px; height: 18px; border: 0 solid var(--brass-deco); pointer-events: none; }
.doc .doc-vcard::before { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; border-top-left-radius: 8px; }
.doc .doc-vcard::after { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; border-bottom-right-radius: 8px; }
.doc .doc-vcard-name { margin: 0 0 18px; font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -.02em; }
.doc .doc-vcard dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.doc .doc-vcard dl > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (min-width: 560px) { .doc .doc-vcard dl > div { grid-template-columns: 9.5em minmax(0, 1fr); gap: 16px; } }
.doc .doc-vcard dt { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; color: var(--muted); padding-top: 3px; }
.doc .doc-vcard dd { margin: 0; overflow-wrap: anywhere; }
.doc .doc-todo { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--wine-soft); color: var(--wine-deep); font-style: italic; }

/* notice block (independence) */
.doc .doc-note { position: relative; margin: 6px 0 24px; padding: 20px 22px 20px 24px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--wine); }
.doc .doc-note p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ "L’addition": what this site collects */
.doc .doc-bill-wrap { margin: 0 0 clamp(40px, 6vw, 64px); filter: drop-shadow(0 1px 1px rgba(60, 30, 20, .07)) drop-shadow(0 22px 28px rgba(60, 30, 20, .11)); }
.doc .doc-bill { position: relative; padding: clamp(26px, 4vw, 38px) clamp(22px, 4vw, 38px) clamp(36px, 5vw, 48px); background: var(--card); border-radius: var(--r-sm) var(--r-sm) 0 0;
  -webkit-mask: radial-gradient(9px at 50% 100%, transparent 98%, #000) 50% 100% / 18px 100% repeat-x;
          mask: radial-gradient(9px at 50% 100%, transparent 98%, #000) 50% 100% / 18px 100% repeat-x; }
.doc .doc-bill-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px dashed var(--line-strong); }
.doc .doc-bill-k { margin: 0; font-family: var(--serif); font-style: italic; font-size: clamp(28px, 3.6vw, 38px); line-height: 1; letter-spacing: -.02em; color: var(--wine); }
.doc .doc-bill-sub { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.doc .doc-bill svg { flex: none; width: 46px; height: 46px; color: var(--brass-deco); }
.doc .doc-bill table { width: 100%; border-collapse: collapse; margin: 8px 0 0; font-size: 16px; }
.doc .doc-bill th, .doc .doc-bill td { padding: 11px 0; text-align: left; font-weight: 400; vertical-align: baseline; }
.doc .doc-bill tbody tr + tr th, .doc .doc-bill tbody tr + tr td { border-top: 1px dotted var(--line-strong); }
.doc .doc-bill td { text-align: right; padding-left: 16px; font-family: var(--serif); font-size: 19px; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.doc .doc-bill tfoot th, .doc .doc-bill tfoot td { border-top: 1.5px solid var(--ink); padding-top: 16px; }
.doc .doc-bill tfoot th { font-family: var(--serif); font-size: 20px; }
.doc .doc-bill tfoot td { font-size: clamp(34px, 4vw, 44px); line-height: 1; color: var(--wine); }
.doc .doc-bill-foot { margin: 16px 0 0 !important; font-size: 14px; color: var(--muted); line-height: 1.55 !important; }
.doc .doc-bill-stamp { position: absolute; right: clamp(18px, 4vw, 34px); bottom: clamp(46px, 6vw, 60px); padding: 6px 12px; border: 1.5px solid var(--ok); border-radius: 8px; color: var(--ok); font-size: 12.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-8deg); opacity: .9; background: var(--card); }
@media (max-width: 479px) { .doc .doc-bill-stamp { position: static; display: inline-block; margin-top: 14px; transform: rotate(-3deg); } }
/* the bill slides out of the printer when revealed */
.doc .doc-bill-wrap[data-reveal] { transform: translateY(-18px); clip-path: inset(0 -60px 100% -60px); transition: opacity .6s var(--ease-out), transform 1.2s var(--ease-out), clip-path 1.5s var(--ease-out); }
.doc .doc-bill-wrap[data-reveal].in { transform: none; clip-path: inset(-60px -60px -60px -60px); }
html.no-js .doc .doc-bill-wrap[data-reveal] { clip-path: none; transform: none; }

/* app facts: four small tiles */
.doc .doc-facts { list-style: none; margin: 8px 0 26px !important; padding: 0; display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 12px !important; }
@media (min-width: 560px) { .doc .doc-facts { grid-template-columns: 1fr 1fr; } }
.doc .doc-facts li { padding: 18px 18px 18px 18px !important; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); display: flex; gap: 14px; align-items: flex-start; line-height: 1.45 !important; }
.doc .doc-facts li::before { display: none; }
.doc .doc-facts svg { flex: none; width: 26px; height: 26px; color: var(--wine); margin-top: 1px; }
.doc .doc-facts b { display: block; font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: -.01em; margin-bottom: 2px; }
.doc .doc-facts span { font-size: 15px; color: var(--muted); }

/* end ornament + back link */
.doc .doc-end { display: flex; align-items: center; gap: 18px; margin-top: clamp(56px, 7vw, 88px); color: var(--brass-deco); }
.doc .doc-end::before, .doc .doc-end::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55; }
.doc .doc-end svg { width: 40px; height: 32px; }
.doc .doc-back { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* ------------------------------------------------------------------ 404: the empty table */
.doc.doc-404 { position: relative; min-height: 100vh; min-height: 100svh; display: grid; align-items: center; padding: calc(76px + clamp(32px, 6vw, 72px)) 0 clamp(64px, 9vw, 120px); background: var(--paper); overflow: hidden; }
.doc-404 .doc-404-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 940px) { .doc-404 .doc-404-in { grid-template-columns: 1.05fr 1fr; } }
.doc-404 .doc-404-art { width: 100%; max-width: 560px; margin: 0 auto; color: var(--brass-deco); }
@media (min-width: 940px) { .doc-404 .doc-404-art { order: 2; } }
.doc-404 .doc-404-art svg { width: 100%; height: auto; overflow: visible; }
.doc-404 .doc-404-lid { transform-box: view-box; transform-origin: 342px 236px; animation: doc-lid 6s var(--ease) infinite; transition: transform .8s var(--ease-out); }
.doc-404 .doc-404-shadow { transform-box: fill-box; transform-origin: 50% 50%; animation: doc-shadow 6s var(--ease) infinite; }
@keyframes doc-lid { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(-9deg) translateY(-8px); } }
@keyframes doc-shadow { 0%, 100% { transform: scaleX(1); opacity: .55; } 50% { transform: scaleX(.9); opacity: .4; } }
/* hovering or focusing an exit lifts the lid a little more: "we’re clearing the table for you" */
.doc-404:has(.doc-404-acts a:hover, .doc-404-acts a:focus-visible) .doc-404-lid { animation-play-state: paused; transform: rotate(-14deg) translateY(-22px); }
.doc-404 .doc-404-plate-in { stroke-dasharray: 2 7; }
.doc-404 .doc-404-card-k { font-family: var(--serif); font-style: italic; font-size: 13px; fill: var(--brass); }
.doc-404 .doc-404-card-n { font-family: var(--serif); font-size: 30px; letter-spacing: -1px; fill: var(--wine); }
.doc-404 .doc-404-text .eyebrow { margin-bottom: 22px; }
.doc-404 .doc-title { max-width: 12ch; }
.doc-404 .lead { margin-bottom: clamp(28px, 4vw, 40px); }
.doc-404 .doc-404-acts { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 420px) { .doc-404 .doc-404-acts .btn { width: 100%; } }
.doc-404 .doc-404-links { margin: clamp(28px, 4vw, 40px) 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); list-style: none; display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; }
.doc-404 .doc-404-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.doc-404 .doc-404-links a:hover { text-decoration-color: var(--wine); color: var(--wine); }

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .doc .doc-progress { display: none; }
  .doc-404 .doc-404-lid { animation: none; transform: rotate(-7deg); transition: none; }
  .doc-404 .doc-404-shadow { animation: none; }
  .doc-404:has(.doc-404-acts a:hover, .doc-404-acts a:focus-visible) .doc-404-lid { transform: rotate(-7deg); }
  .doc .doc-bill-wrap[data-reveal] { clip-path: none; transform: none; }
  .doc .doc-toc a span { transition: none; }
}
