/* Les trois présentations de la carte. Une seule est montée à la fois (#carte.carte-a, -b ou -c). */
.carte { position: relative; }
.c-meta, .a-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.c-meta span, .a-meta span { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 13px; border-radius: 999px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; border: 1px solid rgba(246, 239, 228, .34); background: rgba(20, 7, 4, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.c-meta span:first-child, .a-meta span:first-child { background: var(--cream); color: var(--mid); border-color: var(--cream); }

/* ---------- A · Plein cadre ---------- */
.carte-a { background: var(--night); }
.a-head { min-height: 74dvh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 20px 64px; }
.a-head h2 { font-size: clamp(3.2rem, 15vw, 7rem); line-height: .96; margin-top: 10px; }
.a-head > p:not(.g-kick) { margin-top: 14px; color: var(--dim); font-size: 17px; }
.a-swipe { width: 28px; height: 46px; border: 1.5px solid rgba(246, 239, 228, .5); border-radius: 99px; margin-top: 28px; position: relative; }
.a-swipe i { position: absolute; left: 50%; top: 26px; width: 4px; height: 9px; margin-left: -2px; border-radius: 2px; background: var(--crema); animation: a-swipe 1.8s var(--expo) infinite; }
@keyframes a-swipe { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-18px); opacity: 0; } }
.a-stack { position: relative; }
.a-slide { --q: 0; --e: 0; position: sticky; top: 0; height: 100dvh; overflow: hidden; }
.a-in { position: absolute; inset: 0; overflow: hidden; transform-origin: 50% 0; transform: scale(calc(1 - var(--q) * .1)); border-radius: calc(var(--q) * 36px); will-change: transform; }
.a-in::after { content: ""; position: absolute; inset: 0; z-index: 3; background: #050100; opacity: calc(var(--q) * .7); pointer-events: none; }
.a-item .a-in { background: var(--coffee); }
.a-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.02 + var(--e) * .24)); will-change: transform; }
.a-item .a-in::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(12, 4, 3, .55), transparent 22%, transparent 40%, rgba(12, 4, 3, .94) 88%); pointer-events: none; }
.a-copy { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: calc(96px + env(safe-area-inset-bottom)); }
.a-k { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--crema); font-variant-numeric: tabular-nums; }
.a-copy h3 { font-size: clamp(3rem, 15vw, 6.6rem); line-height: .95; margin-top: 8px; overflow: hidden; padding-bottom: .06em; }
.a-copy h3 span { display: inline-block; }
.a-d { margin-top: 10px; font-size: 16.5px; max-width: 34ch; }
.a-act { display: flex; gap: 8px; margin-top: 18px; }
.a-add { min-width: 150px; }
.a-add.has { background: var(--cream); }
/* Le texte entre quand l'écran est arrivé */
.a-copy > * { opacity: 0; transform: translateY(26px); transition: opacity .6s, transform .9s var(--expo); }
.a-copy h3 span { transform: translateY(105%); transition: transform 1s var(--expo); }
.a-slide.on .a-copy > * { opacity: 1; transform: none; }
.a-slide.on .a-copy h3 span { transform: none; }
.a-slide.on .a-copy > :nth-child(2) { transition-delay: .05s; } .a-slide.on .a-copy > :nth-child(3) { transition-delay: .12s; }
.a-slide.on .a-copy > :nth-child(4) { transition-delay: .18s; } .a-slide.on .a-copy > :nth-child(5) { transition-delay: .24s; }
/* L'écran crème qui annonce une catégorie */
.a-cat .a-in { background: var(--cream); color: var(--mid); display: flex; flex-direction: column; justify-content: center; padding: 90px 22px calc(110px + env(safe-area-inset-bottom)); }
.a-cat .a-in::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='16'%3E%3Cpath d='M0 0h28L21 16 14 0 7 16z' fill='%233B1209'/%3E%3C/svg%3E") repeat-x; }
.a-num { position: absolute; right: -8px; top: 70px; font: 400 44vw/.8 var(--disp); color: transparent; -webkit-text-stroke: 1.5px var(--mid); opacity: .16; pointer-events: none; }
.a-cat h3 { font-size: clamp(3.4rem, 16vw, 7.4rem); line-height: .94; position: relative; }
.a-cat .a-in > p { margin-top: 12px; font-size: 17.5px; position: relative; }
.a-dots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; position: relative; }
.a-dots button { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--cream), 0 12px 22px -10px rgba(59, 18, 9, .8); opacity: 0; transform: translateY(24px) scale(.7); transition: opacity .5s, transform .9s var(--expo); }
.a-dots button:nth-child(2) { transition-delay: .06s; } .a-dots button:nth-child(3) { transition-delay: .12s; } .a-dots button:nth-child(4) { transition-delay: .18s; }
.a-dots button:nth-child(5) { transition-delay: .24s; } .a-dots button:nth-child(6) { transition-delay: .3s; }
.a-dots img { width: 100%; height: 100%; object-fit: cover; }
.a-cat.on .a-dots button { opacity: 1; transform: none; }
.a-count { position: relative; font-weight: 600; margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.a-count::after { content: ""; width: 10px; height: 10px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); animation: hint-pulse 1.6s ease-in-out infinite; }
/* Le petit index des catégories, à droite */
.a-index { position: fixed; z-index: 25; right: 8px; top: calc(max(12px, env(safe-area-inset-top)) + 96px); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; opacity: 0; transform: translateX(14px); pointer-events: none; transition: opacity .35s, transform .5s var(--expo); }
.a-index.show { opacity: 1; transform: none; pointer-events: auto; }
.a-index button { display: flex; align-items: center; gap: 8px; min-height: 34px; padding-left: 8px; font-size: 12.5px; font-weight: 600; }
.a-index span { padding: 5px 10px; border-radius: 99px; background: rgba(20, 7, 4, .78); color: var(--cream); opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .5s var(--expo); }
.a-index button.on span { opacity: 1; transform: none; }
.a-index i { width: 4px; height: 16px; border-radius: 4px; background: rgba(246, 239, 228, .45); box-shadow: 0 0 0 1px rgba(20, 7, 4, .25); transition: height .5s var(--expo), background .3s; }
.a-index button.on i { height: 30px; background: var(--crema); }

/* ---------- B · La loupe ---------- */
.carte-b { background: var(--cream); color: var(--mid); }
.b-view { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 12px; padding: 34px 16px 12px 20px; background: linear-gradient(180deg, var(--cream) 82%, rgba(246, 239, 228, 0)); }
.b-lens { position: relative; flex: none; width: 152px; height: 152px; }
.b-shot { position: absolute; inset: 16px; border-radius: 50%; overflow: hidden; background: var(--coffee); box-shadow: 0 20px 30px -14px rgba(59, 18, 9, .8); }
.b-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.b-ring { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
.b-ring text { font: 700 10.5px var(--body); letter-spacing: .24em; fill: var(--mid); }
.b-now { min-width: 0; }
.b-k { font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8A4B22; }
.b-name { font: 400 clamp(1.6rem, 7.4vw, 2.2rem)/1.02 var(--disp); margin-top: 4px; }
.b-meta { font-weight: 600; font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.b-list { padding: 0 20px 90px; }
.b-head { padding: 30px 0 4px; }
.b-head h2 { font-size: clamp(2.3rem, 10vw, 4.2rem); line-height: 1.02; }
.b-cat { padding-top: 40px; }
.b-cat h3 { font-size: clamp(2.6rem, 12vw, 4.8rem); line-height: 1; display: flex; align-items: flex-start; gap: 6px; }
.b-cat h3 sup { font: 600 13px/1 var(--body); margin-top: 10px; color: #8A4B22; }
.b-cat > p { color: #6F5348; margin: 8px 0 12px; }
.b-row { display: grid; grid-template-columns: 26px 1fr auto 44px; gap: 10px; align-items: center; padding: 16px 0; border-top: 1px solid rgba(59, 18, 9, .16); opacity: .46; transition: opacity .45s; }
.b-row.on { opacity: 1; }
.b-n { align-self: start; padding-top: 7px; font: 600 12px/1 var(--body); color: #8A4B22; font-variant-numeric: tabular-nums; }
.b-main { text-align: left; min-width: 0; }
.b-main b { display: block; font: 400 1.55rem/1.08 var(--disp); }
.b-main small { display: block; font-size: 13.5px; line-height: 1.38; color: #6F5348; margin-top: 4px; }
.b-p { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.b-add { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--mid); font-size: 19px; font-weight: 600; transition: background .25s, color .25s, transform .3s var(--expo); }
.b-add:active { transform: scale(.88); }
.b-add.has { background: var(--mid); color: var(--cream); font-size: 15px; }
.b-foot { margin-top: 28px; font-size: 13.5px; color: #6F5348; }

/* ---------- C · Le jeu de cartes ---------- */
.carte-c { overflow: hidden; background: #0E0503; }
.c-amb { position: absolute; inset: 0; overflow: hidden; }
.c-amb img { position: absolute; inset: -80px; width: calc(100% + 160px); height: calc(100% + 160px); object-fit: cover; filter: blur(42px) brightness(.42) saturate(1.35); opacity: 0; transition: opacity 1.1s; }
.c-amb img.on { opacity: 1; }
.c-in { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(70px + env(safe-area-inset-top)) 20px calc(96px + env(safe-area-inset-bottom)); }
.c-head h2 { font-size: clamp(2.2rem, 10vw, 4.6rem); line-height: 1; margin-top: 6px; }
.c-cats { display: flex; gap: 6px; overflow-x: auto; margin: 16px -20px 0; padding: 2px 20px; scrollbar-width: none; }
.c-cats::-webkit-scrollbar { display: none; }
.c-cats button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 15px 0 5px; border-radius: 999px; background: rgba(246, 239, 228, .08); border: 1px solid rgba(246, 239, 228, .2); font-weight: 600; font-size: 14px; transition: background .3s, color .3s; }
.c-cats img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.c-cats .on { background: var(--cream); color: var(--mid); border-color: var(--cream); }
.c-deck { position: relative; height: clamp(330px, calc(100dvh - 400px), 560px); margin-top: 16px; }
.c-card { --k: 0; --keep: 0; --pass: 0; position: absolute; inset: 0; margin: 0 auto; max-width: 400px; border-radius: 26px; overflow: hidden; background: var(--coffee); box-shadow: 0 30px 60px -24px #000; touch-action: pan-y; -webkit-user-select: none; user-select: none; cursor: grab; transform: translateY(calc(var(--k) * 18px)) scale(calc(1 - var(--k) * .06)); filter: brightness(calc(1 - var(--k) * .28)); transition: transform .55s var(--expo), filter .55s; }
.c-card:active { cursor: grabbing; }
.c-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.c-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(12, 4, 3, .95)); pointer-events: none; }
.c-cap { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 18px; }
.c-cap h3 { font-size: clamp(2.3rem, 11vw, 3.2rem); line-height: 1; }
.c-cap p { margin-top: 8px; font-size: 15px; }
.c-meta .c-q { background: var(--crema); color: var(--coffee); border-color: var(--crema); }
.stamp { position: absolute; z-index: 2; top: 24px; padding: 6px 14px 4px; border: 3px solid; border-radius: 10px; font: 400 1.9rem/1 var(--disp); text-transform: uppercase; letter-spacing: .04em; pointer-events: none; }
.stamp.keep { left: 18px; color: var(--crema); transform: rotate(-12deg); opacity: var(--keep); }
.stamp.pass { right: 18px; color: var(--cream); transform: rotate(12deg); opacity: var(--pass); }
.c-card.show-keep { --keep: 1; } .c-card.show-pass { --pass: 1; }
.c-ctrl { position: relative; z-index: 5; display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: -36px; }
.c-btn { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); background: rgba(20, 7, 4, .55) !important; }
.c-btn.keep { background: var(--crema) !important; }
.c-btn { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: rgba(246, 239, 228, .1); border: 1px solid rgba(246, 239, 228, .3); font-size: 28px; font-weight: 500; transition: transform .3s var(--expo), background .25s; }
.c-btn:active { transform: scale(.88); }
.c-btn.small { width: 46px; height: 46px; }
.c-btn.keep { width: 72px; height: 72px; background: var(--crema); color: var(--coffee); border-color: var(--crema); font-size: 32px; box-shadow: 0 14px 30px -12px rgba(226, 164, 92, .7); }
.c-count { display: flex; justify-content: space-between; align-items: center; max-width: 400px; width: 100%; margin: 10px auto 0; font-size: 13.5px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; min-height: 24px; }
.c-count b { color: var(--cream); font-weight: 600; }
.c-cap { bottom: 50px; }
.c-end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; animation: rise .8s var(--expo) both; }
.c-end img { width: 124px; height: 124px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--cream); }
.c-end p { font: 400 2.2rem/1.1 var(--disp); }

@media (min-width: 900px) {
  .a-head { padding-inline: 6vw; }
  .a-copy { left: 6vw; right: 40vw; bottom: 64px; }
  .a-cat .a-in { padding-inline: 6vw; }
  .a-num { font-size: 30vw; right: 4vw; top: 50%; transform: translateY(-50%); }
  .a-dots button { width: 84px; height: 84px; }
  .b-wrap { display: grid; grid-template-columns: 1.15fr .85fr; }
  .b-list { grid-row: 1; padding: 30px 4vw 140px 6vw; }
  .b-view { grid-row: 1; grid-column: 2; position: sticky; top: 0; height: 100dvh; flex-direction: column; justify-content: center; text-align: center; background: none; padding: 60px 3vw 40px; }
  .b-lens { width: min(32vw, 460px); height: min(32vw, 460px); }
  .b-shot { inset: 34px; }
  .b-ring text { font-size: 9px; }
  .b-name { font-size: clamp(2rem, 3vw, 3rem); }
  .c-in { padding-inline: 6vw; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: .9fr 1.1fr; grid-template-rows: auto auto 1fr auto auto; column-gap: 5vw; }
  .c-head, .c-cats { grid-column: 1; }
  .c-cats { margin: 18px 0 0; padding: 2px 0; flex-wrap: wrap; align-content: start; }
  .c-deck, .c-ctrl, .c-count { grid-column: 2; }
  .c-deck { grid-row: 1 / 4; height: 600px; margin-top: 0; }
  .c-ctrl { grid-row: 4; } .c-count { grid-row: 5; }
}
@media (prefers-reduced-motion: reduce) {
  .a-copy > *, .a-copy h3 span, .a-dots button { opacity: 1 !important; transform: none !important; }
}
