/* ============================================================
   Studio CEVINO GLASS — catalogue interactif
   ============================================================ */

:root {
  --navy:        #0d1326;
  --navy-deep:   #070b16;
  --navy-soft:   #18203a;
  --cream:       #fff8f5;
  --cream-dim:   #f2e8e3;
  --gold:        #c3a86b;
  --gold-bright: #dcc48d;
  --ink:         #0a0a0a;

  --page-ratio: 0.74044;      /* 1181 / 1595 */
  --ui:  "Manrope", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shell-pad: 26px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--navy-deep);
  color: var(--cream);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Décor de fond ------------------------------------ */

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, #1d2744 0%, transparent 60%),
    radial-gradient(90% 70% at 50% 120%, #15182c 0%, transparent 65%),
    var(--navy-deep);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- Écran de chargement ------------------------------ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  gap: 26px;
  justify-items: center;
  background: var(--navy-deep);
  transition: opacity .7s var(--ease), visibility .7s;
}
.boot.gone { opacity: 0; visibility: hidden; }
.boot__mark { font-size: 34px; letter-spacing: .01em; font-weight: 300; }
.boot__mark b { font-weight: 600; }
.boot__sub { font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.boot__bar { width: 190px; height: 1px; background: rgba(255,248,245,.16); overflow: hidden; }
.boot__bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s linear; }

/* ---------- Chrome ------------------------------------------- */

.shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar, .bottombar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--shell-pad);
  position: relative;
  z-index: 20;
}
.topbar { justify-content: space-between; }
.bottombar { flex-direction: column; gap: 8px; }

.brand { display: flex; align-items: baseline; gap: 10px; user-select: none; }
.brand__name { font-size: 19px; font-weight: 300; letter-spacing: .005em; white-space: nowrap; }
.brand__name b { font-weight: 600; }
.brand__tag {
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); padding-left: 10px; border-left: 1px solid rgba(195,168,107,.35);
}

.tools { display: flex; align-items: center; gap: 4px; }

.tool {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px; letter-spacing: .02em;
  color: rgba(255,248,245,.72);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.tool:hover, .tool:focus-visible { background: rgba(255,248,245,.09); color: var(--cream); outline: none; }
.tool[aria-pressed="true"] { background: rgba(195,168,107,.16); color: var(--gold-bright); }
.tool svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tool--icon { padding: 0; width: 36px; justify-content: center; }
.tool--label { display: inline; }

/* ---------- Scène ------------------------------------------- */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 clamp(8px, 4vw, 70px);
  perspective: 2600px;
  perspective-origin: 50% 46%;
}

.book {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .62s var(--ease);
  will-change: transform;
}
.book.is-closed-front { transform: translateX(-25%); }   /* couverture : feuillet de droite, on recentre vers la gauche */
.book.is-closed-back  { transform: translateX(25%); }    /* dos : feuillet de gauche */
.book.single.is-closed-front,
.book.single.is-closed-back { transform: none; }

.leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--cream);
  background-size: cover;
  backface-visibility: hidden;
  overflow: hidden;
}
.leaf img { display: block; width: 100%; height: 100%; object-fit: cover; }

.leaf--left  { left: 0;  box-shadow: -18px 22px 46px rgba(0,0,0,.55); }
.leaf--right { left: 50%; box-shadow: 18px 22px 46px rgba(0,0,0,.55); }

/* pli central */
.leaf--left::after, .leaf--right::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 44px;
  pointer-events: none;
}
.leaf--left::after  { right: 0; background: linear-gradient(to right, transparent, rgba(0,0,0,.20)); }
.leaf--right::after { left: 0;  background: linear-gradient(to left,  transparent, rgba(0,0,0,.20)); }

.book.single .leaf { width: 100%; }
.book.single .leaf--left  { left: 0; }
.book.single .leaf--right { left: 0; }
.book.single .leaf::after { display: none; }

/* feuille en rotation */
.flipper {
  position: absolute;
  top: 0; left: 50%;
  width: 50%; height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  z-index: 8;
  will-change: transform;
  pointer-events: none;
}
.flipper.back { left: 0; transform-origin: right center; }
.book.single .flipper { left: 0; width: 100%; }

.face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  background: var(--cream);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.face--back { transform: rotateY(180deg); }

/* ombrage dynamique de la feuille */
.face__shade {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
}
.face--front .face__shade { background: linear-gradient(to left, rgba(0,0,0,.55), rgba(0,0,0,0) 60%); }
.face--back  .face__shade { background: linear-gradient(to right, rgba(0,0,0,.55), rgba(0,0,0,0) 60%); }

/* zones cliquables de tourne-page */
.turn {
  position: absolute; top: 0; bottom: 0; width: 17%;
  z-index: 9;
  cursor: pointer;
  background: transparent;
  transition: background .25s;
}
.turn--prev { left: 0; }
.turn--next { right: 0; }
.turn:focus { outline: none; }
@media (hover: hover) {
  .turn:hover { background: linear-gradient(to var(--dir, left), rgba(255,255,255,.09), transparent); }
}
.turn--prev { --dir: right; }
.turn--next { --dir: left; }
.turn[hidden] { display: none; }

/* flèches flottantes */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,248,245,.07);
  backdrop-filter: blur(8px);
  color: rgba(255,248,245,.8);
  z-index: 30;
  transition: background .2s, color .2s, opacity .2s;
}
.nav-arrow:hover { background: rgba(195,168,107,.22); color: var(--gold-bright); }
.nav-arrow[disabled] { opacity: .2; pointer-events: none; }
.nav-arrow--prev { left: clamp(6px, 2vw, 26px); }
.nav-arrow--next { right: clamp(6px, 2vw, 26px); }
.nav-arrow svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Zones cliquables du sommaire imprimé -------------- */

.hot {
  position: absolute;
  z-index: 10;                     /* au-dessus des bords de tourne-page */
  padding: 0;
  border-radius: 3px;
  background: transparent;
  transition: background .16s, box-shadow .16s;
}
.hot::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
@media (hover: hover) {
  .hot:hover { background: rgba(195,168,107,.22); }
  .hot:hover::after { transform: scaleX(1); }
}
.hot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hot:active { background: rgba(195,168,107,.34); }

/* ---------- Lecture verticale (mobile) ----------------------- */

.reel {
  position: relative;               /* repère des offsetTop des pages */
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.reel[hidden] { display: none; }
.reel::-webkit-scrollbar { width: 0; }

.reel__page {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: var(--page-ratio);
  margin: 0;
  flex: none;
  background: #e9ded8;
  box-shadow: 0 14px 34px rgba(0,0,0,.5);
  scroll-snap-align: center;
  overflow: hidden;
}
.reel__page img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reel__no {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(13,19,38,.6);
  backdrop-filter: blur(6px);
  font-size: 10px; letter-spacing: .08em;
  color: rgba(255,248,245,.75);
  pointer-events: none;
}

.stage.is-reel {
  display: block;
  padding: 0 12px;
  perspective: none;
}
.stage.is-reel .book,
.stage.is-reel .nav-arrow { display: none; }

/* ---------- Barre basse -------------------------------------- */

.scrub-row { display: flex; align-items: center; gap: 18px; width: 100%; justify-content: center; }

.scrub {
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.scrub input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 22px; background: none; cursor: pointer;
}
.scrub input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(to right, var(--gold) var(--fill, 0%), rgba(255,248,245,.18) var(--fill, 0%));
}
.scrub input[type="range"]::-moz-range-track { height: 2px; border-radius: 2px; background: rgba(255,248,245,.18); }
.scrub input[type="range"]::-moz-range-progress { height: 2px; border-radius: 2px; background: var(--gold); }
.scrub input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin-top: -4.5px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px rgba(195,168,107,.18);
  transition: box-shadow .2s;
}
.scrub input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 7px rgba(195,168,107,.24); }
.scrub input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--gold); }

.counter {
  font-size: 12px; letter-spacing: .06em;
  color: rgba(255,248,245,.6);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 108px;
}
.counter b { color: var(--cream); font-weight: 500; }

/* ---------- Panneaux ----------------------------------------- */

.scrim {
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;                 /* la transition de visibilité dure 350 ms : sans ça, le voile avale le clic suivant */
  background: rgba(5,8,16,.72);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.scrim.open { opacity: 1; visibility: visible; pointer-events: auto; }

.panel {
  position: fixed; top: 0; bottom: 0; right: 0;
  z-index: 100;
  width: min(480px, 100%);
  display: flex; flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  transform: translateX(100%);
  transition: transform .45s var(--ease);
  box-shadow: -30px 0 70px rgba(0,0,0,.45);
}
.panel { pointer-events: none; }
.panel.open { transform: none; pointer-events: auto; }
.panel--wide { width: min(940px, 100%); }

.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(10,10,10,.1);
}
.panel__title { margin: 0; font-size: 13px; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; }
.panel__close {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(10,10,10,.55);
  transition: background .2s, color .2s;
}
.panel__close:hover { background: rgba(10,10,10,.07); color: var(--ink); }
.panel__close svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; }
.panel__body { flex: 1; overflow-y: auto; padding: 8px 26px 40px; overscroll-behavior: contain; }

/* --- sommaire --- */

.chapter { border-bottom: 1px solid rgba(10,10,10,.08); padding: 20px 0 18px; }
.chapter:last-child { border-bottom: 0; }

.chapter__head {
  display: flex; align-items: baseline; gap: 12px;
  width: 100%; text-align: left;
  padding: 0; margin: 0 0 4px;
}
.chapter__head h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; transition: color .2s; }
.chapter__head:hover h3 { color: var(--gold); }
.chapter__sub { margin: 0 0 12px; font-size: 13px; font-style: italic; color: #a08a55; line-height: 1.45; }

.entry {
  display: flex; align-items: baseline; gap: 10px;
  width: 100%; text-align: left;
  padding: 7px 10px 7px 12px;
  margin-left: -12px;
  border-radius: 7px;
  transition: background .18s;
}
.entry:hover { background: rgba(195,168,107,.16); }
.entry.current { background: rgba(195,168,107,.26); }
.entry__label { font-size: 13.5px; font-weight: 500; }
.entry__dots { flex: 1; height: 1px; border-bottom: 1px dotted rgba(10,10,10,.28); transform: translateY(-3px); }
.entry__page { font-size: 12px; font-style: italic; color: rgba(10,10,10,.55); font-variant-numeric: tabular-nums; }

/* --- grille de miniatures --- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 16px 14px;
}
.thumb { display: block; width: 100%; text-align: center; }
.thumb__frame {
  position: relative;
  aspect-ratio: var(--page-ratio);
  background: #e9ded8;
  border: 1px solid rgba(10,10,10,.1);
  overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover .thumb__frame { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.18); border-color: rgba(195,168,107,.8); }
.thumb.current .thumb__frame { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.thumb__no { display: block; margin-top: 7px; font-size: 11px; color: rgba(10,10,10,.5); font-variant-numeric: tabular-nums; }
.thumb.current .thumb__no { color: #8a7233; font-weight: 600; }

/* --- recherche --- */

.search__field {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 6px;
  padding: 12px 15px;
  border: 1px solid rgba(10,10,10,.16);
  border-radius: 10px;
  transition: border-color .2s;
}
.search__field:focus-within { border-color: var(--gold); }
.search__field svg { width: 17px; height: 17px; stroke: rgba(10,10,10,.45); fill: none; stroke-width: 1.6; }
.search__field input {
  flex: 1; border: 0; outline: none; background: none;
  font: inherit; font-size: 15px; color: var(--ink);
}
.search__count { font-size: 12px; color: rgba(10,10,10,.5); padding: 10px 0 4px; }

.result {
  display: flex; gap: 14px; align-items: flex-start;
  width: 100%; text-align: left;
  padding: 12px; margin: 0 -12px;
  border-radius: 9px;
  transition: background .18s;
}
.result:hover { background: rgba(195,168,107,.15); }
.result__no {
  flex: none; width: 46px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(10,10,10,.45); padding-top: 2px;
}
.result__snip { font-size: 13.5px; line-height: 1.55; color: rgba(10,10,10,.8); }
.result__snip mark { background: rgba(195,168,107,.45); color: var(--ink); padding: 0 1px; border-radius: 2px; }

.empty { padding: 40px 0; text-align: center; font-size: 13.5px; color: rgba(10,10,10,.45); font-style: italic; }

/* ---------- Contact ------------------------------------------ */

.card { padding: 22px 0 10px; }
.card__role { margin: 0 0 18px; font-size: 12px; font-style: italic; color: #a08a55; }
.card__name { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.card__co { margin: 2px 0 26px; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: rgba(10,10,10,.5); }

.card__link {
  display: flex; align-items: center; gap: 15px;
  padding: 14px 14px 14px 12px; margin: 0 -12px;
  border-radius: 11px;
  color: inherit; text-decoration: none;
  transition: background .18s;
}
.card__link:hover { background: rgba(195,168,107,.16); }
.card__ico {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--navy); color: var(--gold);
}
.card__ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card__link b { display: block; font-size: 15px; font-weight: 600; }
.card__link i { display: block; font-size: 12px; font-style: normal; color: rgba(10,10,10,.5); margin-top: 2px; }

.card__cta {
  display: block; margin-top: 26px;
  padding: 15px; border-radius: 999px;
  background: var(--navy); color: var(--cream);
  text-align: center; text-decoration: none;
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500;
  transition: background .2s, color .2s;
}
.card__cta:hover { background: var(--gold); color: var(--navy); }

/* ---------- Zoom --------------------------------------------- */

.zoom {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4,6,12,.94);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
  overflow: hidden;
  touch-action: none;
  pointer-events: none;
}
.zoom.open { opacity: 1; visibility: visible; pointer-events: auto; }
.zoom__img {
  max-width: 94vw; max-height: 92vh;
  transform-origin: center center;
  cursor: grab;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  will-change: transform;
}
.zoom__img.dragging { cursor: grabbing; }
.zoom__bar {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255,248,245,.09);
  backdrop-filter: blur(10px);
}
.zoom__bar button {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: rgba(255,248,245,.8);
  transition: background .2s, color .2s;
}
.zoom__bar button:hover { background: rgba(195,168,107,.25); color: var(--gold-bright); }
.zoom__bar svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.zoom__level { font-size: 12px; color: rgba(255,248,245,.6); min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.zoom__close { position: absolute; top: 20px; right: 22px; }

/* ---------- Aide --------------------------------------------- */

.hint {
  display: flex; align-items: center; gap: 16px;
  margin: 0 auto 2px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255,248,245,.08);
  backdrop-filter: blur(10px);
  font-size: 11.5px; letter-spacing: .04em;
  color: rgba(255,248,245,.62);
  white-space: nowrap;
  transition: opacity .5s;
}
.hint.gone { opacity: 0; height: 0; margin: 0; padding: 0; overflow: hidden; pointer-events: none;
             transition: opacity .4s, height .4s .4s, margin .4s .4s, padding .4s .4s; }
.hint kbd {
  display: inline-block; padding: 1px 6px; margin: 0 1px;
  border: 1px solid rgba(255,248,245,.28); border-radius: 4px;
  font: inherit; font-size: 10.5px;
}

/* ---------- Responsive --------------------------------------- */

@media (max-width: 900px) {
  :root { --shell-pad: 14px; }
  .tool--label { display: none; }
  .tool { padding: 0; width: 36px; justify-content: center; }
  .brand__tag { display: none; }
  .brand__name { font-size: 15px; }
  .hint__keys { display: none; }
  .book::after { bottom: -16px; }
  .nav-arrow { width: 40px; height: 40px; }
  .counter { min-width: 0; font-size: 11px; }
  .panel__body { padding: 8px 18px 40px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px 10px; }
}

@media (max-width: 520px) {
  :root { --shell-pad: 10px; }
  .topbar { gap: 4px; }
  .tools { gap: 1px; }
  .tool { width: 32px; height: 32px; }
  .tool svg { width: 15px; height: 15px; }
  .brand__name { font-size: 11.5px; letter-spacing: 0; }
  .nav-arrow { width: 34px; height: 34px; background: rgba(255,248,245,.05); }
  .nav-arrow--prev { left: 2px; }
  .nav-arrow--next { right: 2px; }
  .counter { font-size: 10.5px; }
  .bottombar { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .book, .flipper, .panel, .scrim, .zoom { transition-duration: .01ms !important; }
}
