/* L'Heure Bleue : la DA commune, pensée d'abord pour le téléphone. Du papier
   découpé, une lumière de bougie, son rouge d'abord et son bleu ensuite. */

@font-face { font-family: 'Fraunces'; src: url('polices/fraunces-latin-full-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('polices/fraunces-latin-full-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('polices/literata-latin-opsz-normal.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('polices/literata-latin-opsz-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Marck Script'; src: url('polices/marck-script-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  /* Son rouge */
  --rouge: #D3123A;
  --rouge-vif: #F02A50;
  --carmin: #9C0C2C;
  --lie: #560A1E;
  /* Son bleu */
  --nuit: #0C1236;
  --encre: #131B4C;
  --crepuscule: #1E2D78;
  --bleu: #2F4FD0;
  --pervenche: #93A6F5;
  --brume: #D3DAFB;
  /* Le cappuccino */
  --mousse: #FDF4E7;
  --lait: #F4E4CE;
  --caramel: #C98D56;
  --cafe: #6B4128;
  --moka: #3A2218;
  /* La flamme et l'orchidée */
  --flamme: #FFC873;
  --or: #E9B84F;
  --orchidee: #EE8FC6;
  --orchidee-vive: #C92F9C;
  /* Les six raretés se lisent sur la tranche */
  --r0: #B7AB9D;
  --r1: #3DAE7C;
  --r2: #2F7BEF;
  --r3: #B23BD6;
  --r4: #F0B323;
  --r5: #F01D46;
  --titre: 'Fraunces', Georgia, serif;
  --texte: 'Literata', Georgia, serif;
  --main: 'Marck Script', 'Segoe Script', cursive;
  --ombre-papier: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 8px 18px rgba(6, 8, 34, .4), 0 2px 4px rgba(6, 8, 34, .35);
  --nav: 64px;
  --bas: env(safe-area-inset-bottom, 0px);
  --haut: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--nuit); -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100dvh; color: var(--mousse); font-family: var(--texte); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--titre); font-weight: 600; line-height: 1.05; margin: 0; font-variation-settings: 'SOFT' 100, 'WONK' 1; }
:focus-visible { outline: 3px solid var(--flamme); outline-offset: 3px; border-radius: 4px; }

/* Le grain du papier : sans fusion, pour ne rien recalculer à chaque image. */
.grain { position: fixed; inset: 0; z-index: 54; pointer-events: none; opacity: .06;
  background-image: 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='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .88 0 0 0 1.100 -.1'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* Tout le site est un livre : sa toile rouge et le bord de ses pages tiennent l'écran. */
.reliure { position: fixed; inset: 0; z-index: 55; pointer-events: none; box-shadow: inset 0 0 0 3px #8E0B29, inset 0 0 0 4px var(--or), inset 0 0 0 5px #F7ECD9, inset 0 0 0 6px #C9B394; }

/* La poussière d'or, au-dessus du décor et sous les boutons. */
.magie { position: fixed; inset: 0; z-index: 30; width: 100%; height: 100%; pointer-events: none; }

/* La Lueur, et la seule phrase qu'on ait à lire. */
.lueur-guide { position: fixed; z-index: 47; left: 0; top: 0; width: 0; height: 0; pointer-events: none; will-change: transform; opacity: 0; transition: opacity .3s ease; }
.lueur-guide.vue { opacity: 1; }
.lueur-guide i { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle, #fff 0 5%, #FFEFC4 9%, rgba(255, 196, 96, .6) 21%, rgba(255, 170, 70, .17) 43%, transparent 68%); animation: lueur-vit 2.800s ease-in-out infinite; }
@keyframes lueur-vit { 0%, 100% { transform: translate(0, 0) scale(1); } 25% { transform: translate(6px, -5px) scale(1.120); } 50% { transform: translate(0, -9px) scale(.94); } 75% { transform: translate(-6px, -4px) scale(1.080); } }
.parole { position: fixed; z-index: 58; left: 50%; top: calc(var(--haut) + 108px); width: max-content; max-width: calc(100vw - 32px); padding: 8px 18px 10px; background: var(--mousse); color: var(--lie); font-family: var(--main); font-size: 24px; line-height: 1.15; text-align: center; font-kerning: none; border-radius: 4px; box-shadow: var(--ombre-papier); opacity: 0; transform: translate(-50%, -8px) rotate(-.8deg); transition: opacity .22s ease, transform .28s cubic-bezier(.2, 1.300, .4, 1); pointer-events: none; }
.parole.vue { opacity: 1; transform: translate(-50%, 0) rotate(-.8deg); }

/* La page qui tourne d'un écran à l'autre. */
.feuillet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; transform-origin: 0 50%; backface-visibility: hidden; will-change: transform; color: var(--carmin); font-family: var(--titre); font-style: italic; font-size: clamp(36px, 7vw, 70px); font-variation-settings: 'SOFT' 100, 'WONK' 1;
  background: linear-gradient(90deg, rgba(58, 34, 24, .34), rgba(58, 34, 24, 0) 11%), repeating-linear-gradient(0deg, transparent 0 33px, rgba(107, 65, 40, .09) 33px 34px), var(--mousse); box-shadow: 14px 0 30px rgba(6, 8, 34, .5); }
html.tourne body::after { content: ''; position: fixed; inset: 0; z-index: 89; background: var(--mousse); }

/* L'enseigne : le logo, la bourse. Le menu est sous le pouce. */
.enseigne { position: fixed; z-index: 56; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; height: calc(58px + var(--haut)); padding: calc(var(--haut) + 6px) 12px 0; pointer-events: none; }
.enseigne > * { pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; filter: drop-shadow(0 2px 5px rgba(6, 8, 34, .6)); }
.logo svg { width: 36px; height: 36px; flex: none; }
.logo span { font-family: var(--titre); font-style: italic; font-weight: 500; font-size: 20px; letter-spacing: -.01em; white-space: nowrap; color: var(--mousse); font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 60; }
.bourse { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pilous { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; background: var(--mousse); color: var(--lie); border-radius: 999px; font-family: var(--titre); font-weight: 650; font-size: 16px; box-shadow: var(--ombre-papier); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pilous svg { width: 22px; height: 22px; }
.bouton-son { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--encre); color: var(--mousse); box-shadow: 0 0 0 1px rgba(211, 218, 251, .25), var(--ombre-papier); }
.bouton-son svg { width: 18px; height: 18px; }
.bouton-son[aria-pressed='false'] { opacity: .6; }

.ruban-ombre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 57; filter: drop-shadow(0 -3px 8px rgba(6, 8, 34, .45)); }
.concentre .ruban-ombre { display: none; }
.rubans { display: flex; background: var(--mousse); padding-bottom: var(--bas); }
.ruban { position: relative; flex: 1 1 0; min-width: 0; height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 7px 2px 8px; text-decoration: none; color: var(--cafe); font-family: var(--texte); font-size: 14px; font-weight: 500; line-height: 1; }
.ruban .icone { display: block; width: 26px; height: 26px; }
.ruban[aria-current='page'] { color: var(--rouge); font-weight: 700; }
.ruban[aria-current='page']::before { content: ''; position: absolute; top: 0; width: 24px; height: 7px; background: var(--rouge); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 55%, 0 100%); }

/* Le bouton de l'heure : un ruban de cire rouge. */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 24px; border-radius: 999px; background: linear-gradient(180deg, var(--rouge-vif), var(--rouge) 45%, var(--carmin)); color: var(--mousse); font-family: var(--titre); font-weight: 650; font-size: 19px; line-height: 1.1; text-decoration: none; box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 -3px 0 rgba(86, 10, 30, .55) inset, 0 10px 22px rgba(86, 10, 30, .55); transition: transform .12s ease; font-variation-settings: 'SOFT' 100, 'WONK' 0; }
.bouton:active { transform: translateY(2px) scale(.985); }
.bouton.grand { min-height: 60px; padding: 12px 30px; font-size: 22px; }
.bouton.or { background: linear-gradient(180deg, #FFE9A8, var(--or) 50%, #B47A1E); color: var(--lie); box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 -3px 0 rgba(120, 72, 10, .5) inset, 0 10px 22px rgba(120, 72, 10, .45); }
.bouton.discret { background: var(--mousse); color: var(--lie); box-shadow: var(--ombre-papier); }
.bouton[disabled] { background: rgba(253, 244, 231, .14); color: var(--lait); box-shadow: inset 0 0 0 1.500px rgba(253, 244, 231, .3); cursor: default; }

/* Un livre en volume : la couverture, le dos, et la tranche à la couleur de sa rareté. */
.livre { --l: 200px; --h: calc(var(--l) * 1.5); --e: calc(var(--l) * .17); --tranche: var(--r0); position: relative; width: var(--l); height: var(--h); transform-style: preserve-3d; }
.livre .face { position: absolute; backface-visibility: hidden; }
.livre .devant { inset: 0; border-radius: 2px 5px 5px 2px; overflow: hidden; background: var(--couleur, var(--carmin)); transform: translateZ(calc(var(--e) / 2)); box-shadow: inset 7px 0 8px -5px rgba(0, 0, 0, .4), inset -1px 0 0 rgba(255, 255, 255, .2); }
.livre .devant img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.livre .devant::after { content: ''; position: absolute; z-index: 2; inset: 0; background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .13) 46%, rgba(255, 255, 255, 0) 60%); }
.livre .derriere { inset: 0; border-radius: 5px 2px 2px 5px; background: var(--couleur, var(--carmin)); transform: rotateY(180deg) translateZ(calc(var(--e) / 2)); }
.livre .pages { top: 3px; bottom: 3px; left: calc(50% - var(--e) / 2); width: var(--e); background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--tranche) 92%, white), color-mix(in srgb, var(--tranche) 92%, white) 1px, color-mix(in srgb, var(--tranche) 76%, black) 1px, color-mix(in srgb, var(--tranche) 76%, black) 2px); transform: rotateY(90deg) translateZ(calc(var(--l) / 2 - 3px)); }
.livre .dos { top: 0; bottom: 0; left: calc(50% - var(--e) / 2); width: var(--e); border-radius: 3px; background: var(--couleur, var(--carmin)); box-shadow: inset 0 0 12px rgba(0, 0, 0, .35); transform: rotateY(-90deg) translateZ(calc(var(--l) / 2)); }
.livre .haut { left: 3px; right: 3px; top: calc(50% - var(--e) / 2); height: var(--e); background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--tranche) 92%, white), color-mix(in srgb, var(--tranche) 92%, white) 1px, color-mix(in srgb, var(--tranche) 76%, black) 1px, color-mix(in srgb, var(--tranche) 76%, black) 2px); transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
.couverture-dessinee { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 12% 10%; color: var(--mousse); font-family: var(--titre); font-size: calc(var(--l) * .1); line-height: 1.1; }
.couverture-dessinee small { font-family: var(--texte); font-size: .62em; opacity: .85; }

.r0 { --tranche: var(--r0); } .r1 { --tranche: var(--r1); } .r2 { --tranche: var(--r2); }
.r3 { --tranche: var(--r3); } .r4 { --tranche: var(--r4); } .r5 { --tranche: var(--r5); }

.flammes { display: inline-flex; gap: 3px; }
.flammes svg { width: 13px; height: 18px; fill: rgba(211, 218, 251, .22); }
.flammes .allumee { fill: var(--tranche); }

/* Le marque-page qui dit la rareté. */
.signet { --c: var(--tranche); display: inline-flex; align-items: center; gap: 8px; padding: 3px 20px 3px 12px; background: var(--c); color: #fff; font-family: var(--titre); font-weight: 650; font-size: 15px; line-height: 1.25; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%); text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.r0 .signet, .signet.r0 { color: var(--moka); text-shadow: none; }
.r4 .signet, .signet.r4 { color: var(--lie); text-shadow: none; }

/* La feuille qui monte du bas de l'écran. */
.voile-feuille { position: fixed; inset: 0; z-index: 60; background: rgba(6, 8, 34, .6); opacity: 0; transition: opacity .18s ease; }
.voile-feuille.vu { opacity: 1; }
.feuille-bas { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow-y: auto; padding: 20px 18px calc(18px + var(--bas)); background: var(--mousse); color: var(--moka); border-radius: 16px 16px 0 0; box-shadow: 0 -14px 30px rgba(6, 8, 34, .5); transform: translateY(102%); transition: transform .24s cubic-bezier(.2, .9, .3, 1); }
.feuille-bas.vu { transform: none; }
.feuille-bas h2 { font-size: 26px; font-style: italic; font-weight: 500; color: var(--carmin); }
.feuille-bas .sous { margin: 3px 0 12px; color: var(--cafe); }
.fermer-feuille { position: absolute; top: 10px; right: 10px; width: 42px; height: 42px; border-radius: 50%; background: var(--lait); color: var(--lie); font-size: 24px; line-height: 1; }

@media (min-width: 900px) {
  :root { --nav: 0px; }
  body { font-size: 17px; }
  .reliure { box-shadow: inset 0 0 0 6px #8E0B29, inset 0 0 0 7px var(--or), inset 0 0 0 9px #F7ECD9, inset 0 0 0 10px #C9B394, inset 0 0 0 12px #F7ECD9, inset 0 0 0 13px #C9B394; }
  .enseigne { height: auto; align-items: flex-start; gap: 26px; padding: 22px 28px 0; }
  .logo svg { width: 44px; height: 44px; }
  .logo span { font-size: 24px; }
  .pilous { font-size: 18px; padding: 6px 14px 6px 8px; }
  .pilous svg { width: 26px; height: 26px; }
  .bouton-son { width: 42px; height: 42px; }
  /* Sur grand écran, les marque-pages pendent du haut du livre. */
  .ruban-ombre { position: fixed; left: 330px; right: auto; top: 0; bottom: auto; filter: drop-shadow(0 5px 7px rgba(6, 8, 34, .5)); }
  .rubans { gap: 10px; background: none; padding: 0; }
  .ruban { --fond: var(--rouge); flex: none; min-width: 118px; height: 70px; flex-direction: row; align-items: flex-end; padding: 0 16px 23px; background: var(--fond); color: var(--mousse); font-family: var(--titre); font-weight: 600; font-size: 17.500px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 13px), 0 100%); transition: height .22s cubic-bezier(.3, 1.500, .5, 1); }
  .ruban .icone { display: none; }
  .ruban:hover { height: 80px; }
  .ruban[aria-current='page'] { height: 96px; color: var(--mousse); font-weight: 600; }
  .ruban[aria-current='page']::before { display: none; }
  .ruban.bleu { --fond: var(--bleu); }
  .ruban.creme { --fond: var(--lait); color: var(--lie); }
  .ruban.creme[aria-current='page'] { color: var(--lie); }
  .parole { top: auto; bottom: 28px; font-size: 28px; }
  .feuille-bas { left: 50%; right: auto; width: 520px; margin-left: -260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
