/* ==========================================================================
   CESURNES — components
   Reusable pieces: buttons, header, menu, language switch, cards.
   ========================================================================== */

/* ==================================================================== btn */
/* Figma: h 32 · padding 8 / 30 · 1px border · uppercase · centred label. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 30px;
  border: 1px solid transparent;
  font-size: var(--fs-btn);
  line-height: 16px;
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .25s var(--ease),
              color .25s var(--ease),
              border-color .25s var(--ease);
}

/* -- variants -------------------------------------------------------- */
.btn--light {
  background: var(--c-white);
  border-color: var(--c-black);
  color: var(--c-ink);
}

.btn--terracota {
  background: var(--c-terracota);
  border-color: #fff;
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: #fff;
  color: #fff;
}

/* -- hover ------------------------------------------------------------ */
/* Surfaces trade places: anything not already terracotta fills with it,
   and terracotta empties back to the light surface. */
.btn--light:hover,
.btn--ghost:hover {
  background: var(--c-terracota);
  border-color: #fff;
  color: #fff;
}

.btn--terracota:hover {
  background: var(--c-white);
  border-color: var(--c-black);
  color: var(--c-ink);
}

/* =================================================================== lang */
.lang {
  display: flex;
  gap: 9px;
  font-size: var(--fs-link);
  line-height: 1;
  text-transform: uppercase;
  color: var(--c-white);
}

.lang__item { color: var(--c-dim); }

.lang__item.is-active {
  color: var(--c-white);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ================================================================= header */
/* The header never paints a backdrop. It stays transparent the whole way
   down and only flips its ink: white over the dark bands, black once a
   light-backed section (marked data-nav="light") sits behind it. */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  background: none;
  transition: transform .4s var(--ease);
}

/* Desktop tucks the bar away on the way down — see header.js. */
.header.is-hidden { transform: translateY(-100%); }

@media (prefers-reduced-motion: reduce) {
  .header { transition: none; }
}

.header__links a,
.header__contact,
.lang__item,
.burger__bar,
.header__brand img,
.header__cta {
  transition: color .3s var(--ease),
              background-color .3s var(--ease),
              border-color .3s var(--ease),
              filter .3s var(--ease);
}

.header.is-light .header__links,
.header.is-light .header__contact,
.header.is-light .lang__item.is-active {
  color: var(--c-black);
}

.header.is-light .lang__item { color: rgba(9, 8, 7, .45); }

.header.is-light .burger__bar { background: var(--c-black); }

/* The monogram ships white; inverting it is cheaper than a second request. */
.header.is-light .header__brand img { filter: invert(1); }

/* The white border would vanish on a light ground. */
.header.is-light .header__cta { border-color: var(--c-terracota); }

.header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 10px var(--gutter);
}

/* Every slot is pinned to row 1 — without an explicit row, sparse auto-placement
   pushes the items declared after the centred brand onto a second row. */
.header__brand {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.header__brand img {
  width: 22px;
  height: 23px;
}

.header__nav { display: none; }

.header__aside {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 30px;
}

.header__contact,
.header__cta { display: none; }

/* -- burger ---------------------------------------------------------- */
.burger {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 0;
}

.burger__bar {
  display: block;
  height: 1px;
  background: var(--c-white);
  transition: width .25s var(--ease);
}

.burger__bar:nth-child(1) { width: 22px; }
.burger__bar:nth-child(2) { width: 14px; }

.burger:hover .burger__bar:nth-child(2) { width: 22px; }

/* =================================================================== menu */
/* Slides in from the right. Kept in the flow (not display:none) so the
   transform can animate; visibility keeps it out of the a11y tree and the
   tab order while closed. */
.menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  /* No artwork of its own — this is a translucent scrim and the hero
     banner already on the page shows through it (Figma: rgba(9,8,7,.72)
     to #090807 at 58%). */
  background: linear-gradient(180deg, rgba(9, 8, 7, .72) 0%, var(--c-black) 58%);
  visibility: hidden;
  transform: translateX(100%);
  transition: transform .5s var(--ease), visibility 0s linear .5s;
}

.menu.is-open {
  visibility: visible;
  transform: translateX(0);
  transition: transform .5s var(--ease), visibility 0s;
}

/* The panel's contents trail the panel slightly. */
.menu__panel > * {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

.menu.is-open .menu__panel > * {
  opacity: 1;
  transform: none;
  transition-delay: .18s;
}

@media (prefers-reduced-motion: reduce) {
  .menu,
  .menu__panel > * { transition: none; }
}

.menu__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px var(--gutter) 10px;
}

/* -- top row --------------------------------------------------------- */
.menu__top {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

/* Sits exactly where the header mark was, so it reads as one logo arriving
   with the panel rather than a second one appearing. */
.menu__brand {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.menu__brand img {
  width: 22px;
  height: 23px;
}

/* -- close ----------------------------------------------------------- */
.menu__close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--c-rule-light);
  border-radius: 50%;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}

.menu__close::before,
.menu__close::after {
  content: "";
  grid-area: 1 / 1;
  width: 10px;
  height: 1px;
  background: var(--c-white);
}

.menu__close::before { transform: rotate(45deg); }
.menu__close::after  { transform: rotate(-45deg); }

.menu__close:hover {
  border-color: var(--c-white);
  transform: rotate(90deg);
}

/* -- links ----------------------------------------------------------- */
.menu__nav { margin-top: 33px; }

.menu__links { border-bottom: 1px solid var(--c-rule-light); }

.menu__links li { border-top: 1px solid var(--c-rule-light); }

.menu__links a {
  display: block;
  padding-block: 18px;
  font-size: var(--fs-nav);
  line-height: var(--lh-nav);
  font-weight: 200;
  text-transform: uppercase;
  color: var(--c-white);
  transition: color .25s var(--ease), padding-left .25s var(--ease);
}

.menu__links a:hover {
  color: var(--c-cream);
  padding-left: 8px;
}

/* -- foot ------------------------------------------------------------ */
.menu__foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 12px;
}

.menu__mail {
  font-size: var(--fs-body);
  line-height: 16px;
  font-weight: 300;
  color: var(--c-dim-soft);
}

.menu__mail:hover { color: var(--c-white); }

/* Figma sets the drawer switch a step below the header one (14 vs 15). */
.menu__lang {
  justify-self: end;
  font-size: 14px;
}

.menu__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

.menu__actions .btn { padding-inline: 12px; }
.menu__actions .btn:nth-child(1) { flex: 176; }
.menu__actions .btn:nth-child(2) { flex: 119; }

/* ================================================= header/menu · desktop */
@media (min-width: 1200px) {
  .header__inner { padding-block: 25px; }

  .header__brand img {
    width: 61px;
    height: 65px;
  }

  .header__nav {
    display: block;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .header__links {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 16px;
    line-height: 16px;
    font-weight: 300;
    text-transform: uppercase;
    color: #fff;
  }

  .header__links a {
    position: relative;
    padding-block: 2px;
  }

  .header__links a:hover { font-weight: 500; }

  /* Reserves the bold width up front. Without it the weight change on hover
     re-measures the link and shunts every item after it along the row. */
  .header__links a::before {
    content: attr(data-label);
    display: block;
    height: 0;
    overflow: hidden;
    font-weight: 500;
    visibility: hidden;
  }

  .header__links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--ease);
  }

  .header__links a:hover::after { transform: scaleX(1); }

  .header__aside {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .header__contact {
    display: inline-flex;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    color: var(--c-white);
  }

  .header__cta {
    display: inline-flex;
    min-width: 149px;
  }

  .burger { display: none; }

  /* The drawer is mobile/tablet only. */
  .menu { display: none !important; }
}

/* ================================================== card · collection */
.product {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.product__media {
  aspect-ratio: 1;
  overflow: hidden;
  /* Transparent: with object-fit contain the box letterboxes, and the page
     ground should show through rather than a panel colour. */
  background: transparent;
}

.product__media img {
  width: 100%;
  height: 100%;
  /* Each piece is shown whole — never cropped to fill the frame. */
  object-fit: contain;
  transition: transform .8s var(--ease);
}

.product:hover .product__media img { transform: scale(1.03); }

.product__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.product__name {
  font-size: var(--fs-prod-name);
  line-height: 1;
  font-weight: 400;
  text-transform: uppercase;
}

.product__price {
  font-size: var(--fs-prod-price);
  line-height: 1;
  font-weight: 300;
  text-transform: uppercase;
}

.product__desc {
  font-size: var(--fs-prod-desc);
  line-height: var(--lh-prod-desc);
  color: var(--c-muted);
}

/* Desktop reproduces the three distinct card heights from the Figma frame. */
@media (min-width: 1200px) {
  .product__media          { aspect-ratio: 440 / 628; }
  .product--feature .product__media { aspect-ratio: 440 / 584; }

  /* Short cards: the shot keeps its own width and is centred in the column. */
  .product--sm .product__media {
    aspect-ratio: 440 / 356;
    background: none;
  }

  .product--sm .product__media img {
    width: auto;
    margin-inline: auto;
    object-fit: contain;
  }
}

/* ====================================================== card · pièce unique */
.piece__media {
  aspect-ratio: 280 / 300;
  overflow: hidden;
  background: transparent;
}

.piece__media img {
  width: 100%;
  height: 100%;
  /* This rail fills its frame edge to edge rather than letterboxing — the
     collection cards below still contain, so nothing is cropped there. */
  object-fit: cover;
  transition: transform .8s var(--ease);
}

.piece:hover .piece__media img { transform: scale(1.03); }

.piece__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: #fff;
}

.piece__name {
  font-size: var(--fs-piece-name);
  line-height: 1;
  font-weight: 400;
  text-transform: uppercase;
}

.piece__price {
  font-size: var(--fs-piece-price);
  line-height: 1;
  font-weight: 300;
  text-transform: uppercase;
}

@media (min-width: 1200px) {
  .piece__media { aspect-ratio: 700 / 781; }
  .piece__row   { margin-top: 20px; }
}

/* ================================================================= teaser */
/* Figma's Component 4 has two states: a small marker, and the full card.
   The marker sits flush in the card's bottom-right corner in both, so the
   open animation is a clip-path inset anchored to that corner — the panel is
   always laid out at full size, so nothing reflows while it opens. */
.teaser {
  --card: 300px;
  --mark: 31px;

  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  height: var(--mark);
  /* Only the marker and the card itself take pointer events — the strip
     between them must not swallow clicks on the hero. */
  pointer-events: none;
}

/* On the card, not the reveal: the reveal is an invisible band the full
   width of the strip, whereas the card is clip-path'd — and clip-path governs
   hit-testing too, so when closed only the marker-sized corner is live. */
.teaser__toggle,
.teaser__card { pointer-events: auto; }

.teaser__reveal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Mobile: the card fills the strip, so it is as wide as the screen allows
   and its corner lands on the marker. */
.teaser__card {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--c-chip);
  color: var(--c-black);
  /* Square wipe: the clip starts as the marker-sized box in the card's
     bottom-right corner — which is exactly where the plus sits — and opens
     straight out from there. */
  clip-path: inset(calc(100% - var(--mark)) 0 0 calc(100% - var(--mark)));
  transition: clip-path .5s var(--ease);
}

.teaser.is-open .teaser__card { clip-path: inset(0 0 0 0); }

/* Contents settle in just behind the opening edge. */
.teaser__card > * {
  opacity: 0;
  transition: opacity .3s ease;
}

.teaser.is-open .teaser__card > * {
  opacity: 1;
  transition-delay: .18s;
}

.teaser__media {
  position: absolute;
  left: 0;
  top: 0;
  /* Figma: 175 of a 300 card (and 193 of 330) — the same ratio either way,
     so it scales with the card instead of pinning to one card size. */
  width: 58.33%;
  height: 100%;
  overflow: hidden;
}

/* Figma renders the shot larger than its frame and pushes it left, so the
   piece bleeds past the edge rather than sitting whole inside it:
   140% wide at -40%, 103.18% tall at -0.1%. All percentages, so the same
   crop holds at every breakpoint. */
.teaser__media img {
  position: absolute;
  left: -40%;
  top: -0.1%;
  width: 140%;
  height: 103.18%;
  max-width: none;
  object-fit: cover;
}

.teaser__badge {
  position: absolute;
  right: 11px;
  top: 11px;
  padding: 4px;
  background: #000;
  color: #fff;
  font-size: 12px;
  line-height: 14px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

.teaser__name,
.teaser__desc {
  position: absolute;
  right: 11px;
  width: 156px;
  text-align: right;
}

.teaser__name {
  top: 120px;
  font-size: 16px;
  line-height: 14px;
  font-weight: 500;
  text-transform: uppercase;
}

.teaser__desc {
  top: 148px;
  font-size: 16px;
  line-height: 16px;
  font-weight: 300;
}

.teaser__cta {
  position: absolute;
  right: 11px;
  bottom: 12px;
  width: 156px;
  padding-inline: 8px;
  background: transparent;
  border-color: var(--c-black);
  color: var(--c-ink);
}

.teaser__cta:hover {
  background: var(--c-terracota);
  border-color: #fff;
  color: #fff;
}

/* The collapsed marker (Figma Variant2): a #f3f3f3 chip carrying the star.
   It owns its own surface, because the card clips away to nothing. */
.teaser__toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--mark);
  height: var(--mark);
  background: var(--c-chip);
}

.teaser__toggle {
  transition: opacity .25s var(--ease), visibility 0s linear .25s;
}

.teaser.is-open .teaser__toggle { transition: opacity .2s var(--ease), visibility 0s; }

.teaser__toggle svg {
  width: 21px;
  height: 21px;
  fill: #000;
}

.teaser.is-open .teaser__toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (min-width: 768px) {
  .teaser {
    --card: 330px;
    --mark: 43px;
    bottom: 14px;
  }

  /* From tablet up the card takes its Figma size and sits against the marker,
     so it opens out of the plus rather than from the middle of the strip. */
  .teaser__card {
    width: var(--card);
    margin-left: auto;
  }

  .teaser__badge,
  .teaser__name,
  .teaser__desc,
  .teaser__cta { right: 10px; }

  .teaser__cta { bottom: 11px; }
}

@media (min-width: 1200px) {
  /* The card is pinned to the hero, not to the flow, so it takes the shell
     edge directly — otherwise it would drift out to the screen edge on a wide
     display while the copy beside it stayed centred. */
  .teaser {
    left: var(--shell-edge);
    right: var(--shell-edge);
    bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .teaser__reveal,
  .teaser__card,
  .teaser__card > *,
  .teaser__toggle svg { transition: none; }
}

/* ------------------------------------------------- hero · menu-open state */
/* Figma 703:587 shows the banner while the drawer is open: every element is
   set to opacity 0 except the centred monogram, and the gradient starts its
   fade earlier. Everything below mirrors that frame. */
.hero__body,
.hero__sub,
.teaser,
.header__nav,
.header__aside,
.burger {
  transition: opacity .3s var(--ease);
}

.menu-open .hero__body,
.menu-open .hero__sub,
.menu-open .teaser,
.menu-open .header__nav,
.menu-open .header__aside,
.menu-open .burger {
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s linear .3s;
}

.menu-open .hero__media::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 53.257%, var(--c-black) 88.556%);
}

/* The banner keeps its monogram while the drawer is open (Figma 703:587 is
   the one hero element left at full opacity). The drawer carries its own copy
   that slides in with the panel and, being above the header, lands right on
   top of it — so the mark reads as holding still while everything else moves. */

/* -- "Commander", hidden for now -----------------------------------------
   The header's and the drawer's button stay in the markup and in "Réglages du
   site" (En-tête → Bouton « Commander »): delete this rule to show them again. */
.header .header__cta,
.menu .menu__cta { display: none; }
