:root {
  --bibo-header-ink: #fff;
  --bibo-logo-filter: brightness(0) invert(1);
  /* Burgundy logo for light backgrounds (mega dropdown + fullscreen menu),
     so it isn't white-on-cream. */
  --bibo-logo-red-filter: brightness(0) saturate(1) invert(11%) sepia(63%) saturate(2540%) hue-rotate(332deg) brightness(81%) contrast(98%);
}

body.is-menu-open {
  overflow: hidden;
}

.site-head {
  position: fixed;
  inset: clamp(14px, 1.35vw, 24px) clamp(16px, 1.6vw, 30px) auto clamp(16px, 1.6vw, 30px);
  z-index: 240;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0;
  color: var(--bibo-header-ink);
  background: transparent;
  font-family: "Doner", "Doner Text", Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  transform: translate3d(0, 0, 0);
  transition:
    transform 220ms var(--bibo-header-ease),
    opacity 160ms ease;
}

/* Let the loader's own fade reveal the header together with the page. */
.preloader ~ .site-head {
  z-index: 200;
}

.site-head .brand {
  display: block;
  width: clamp(54px, 4.8vw, 72px);
  justify-self: start;
}

.site-head .brand img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: var(--bibo-logo-filter);
}

.desktop-nav,
.head-actions {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.1vw, 36px);
}

.desktop-nav {
  transform: translateY(-2px);
}

.desktop-nav--left {
  justify-self: center;
}

.desktop-nav--right,
.head-actions {
  justify-self: end;
}

.desktop-nav--right {
  gap: 10px;
}

.desktop-nav--right a:first-child::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  margin: 0 0 0 10px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.62;
}

.desktop-nav a,
.head-actions a,
.site-menu a {
  color: inherit;
  text-decoration: none;
}

.desktop-nav a {
  opacity: 1;
  transition: opacity 240ms ease;
}

.desktop-nav a[aria-current],
.desktop-nav a:hover {
  opacity: 1;
}

.projects-mega {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 235;
  width: auto;
  min-height: 360px;
  color: #17120f;
  pointer-events: none;
  background: rgba(246, 244, 239, 0.985);
  /* Vertical "curtain" reveal: drops down from the top edge. */
  clip-path: inset(0 0 100% 0);
  transition: clip-path 460ms var(--bibo-header-ease);
}

body.is-projects-mega-open .projects-mega {
  pointer-events: auto;
  clip-path: inset(0 0 0 0);
}

.projects-mega__inner {
  min-height: inherit;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  align-items: stretch;
  width: 100%;
  padding: 84px clamp(16px, 3vw, 40px) 36px;
}

.projects-mega__top,
.projects-mega__media {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 260ms ease,
    transform 440ms var(--bibo-header-ease);
}

body.is-projects-mega-open .projects-mega__top,
body.is-projects-mega-open .projects-mega__media {
  opacity: 1;
  transform: translateY(0);
}

.projects-mega__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
  width: 100%;
  margin: 0 auto;
}

.projects-mega__top span {
  color: rgba(23, 18, 15, 0.56);
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
}

.projects-mega__top a {
  color: #690d1b;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.projects-mega__top a:hover,
.projects-mega__top a:focus-visible {
  color: #17120f;
}

.projects-mega__media {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 0.75vw, 14px);
  max-width: none;
  width: 100%;
  margin: 0 auto;
  transition-delay: 45ms;
}

.projects-mega__card {
  display: grid;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  text-transform: none;
  transition: opacity 320ms ease;
}

.projects-mega__thumb {
  overflow: hidden;
  aspect-ratio: 1.28;
  background: rgba(23, 18, 15, 0.08);
}

.projects-mega__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 620ms var(--bibo-header-ease);
}

/* Hover: the image zooms, sibling cards dim, the active title takes the red. */
.projects-mega__card:hover .projects-mega__thumb img {
  transform: scale(1.05);
}

.projects-mega__media:hover .projects-mega__card {
  opacity: 0.5;
}

.projects-mega__media:hover .projects-mega__card:hover {
  opacity: 1;
}

.projects-mega__card span:not(.projects-mega__thumb) {
  display: grid;
  gap: 5px;
}

.projects-mega__card strong {
  font-size: 15px;
  line-height: 1;
  text-transform: uppercase;
  transition: color 220ms ease;
}

.projects-mega__card:hover strong {
  color: var(--bibo-header-red);
}

.projects-mega__card small {
  color: rgba(23, 18, 15, 0.52);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

/* Mega open: the header stays exactly put (no reposition / resize) — only its
   ink goes dark and it picks up the cream fill so it's readable. The dropdown
   curtain reveals below it. */
body.is-projects-mega-open .site-head {
  color: #17120f;
  background: rgba(246, 244, 239, 0.985);
  transform: translate3d(0, 0, 0) !important;
  opacity: 1;
  pointer-events: auto;
}

body.is-projects-mega-open .site-head .brand img {
  filter: var(--bibo-logo-red-filter);
}

.site-head .is-over-media {
  color: #fff;
  opacity: 1;
}

body.is-projects-mega-open .site-head .brand img,
body.is-projects-mega-open .site-head:not(.is-over-light):not(.site-head--layer) .brand img,
body.is-projects-mega-open .site-head .brand.is-over-media img {
  filter: var(--bibo-logo-red-filter);
}

.head-actions {
  display: none;
}

.menu-button,
.menu-close {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-button i,
.menu-button i::before,
.menu-button i::after {
  display: block;
  width: 28px;
  height: 1px;
  background: currentColor;
}

.menu-button i {
  position: relative;
}

.menu-button i::before,
.menu-button i::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-button i::before {
  top: -7px;
}

.menu-button i::after {
  top: 7px;
}

.site-menu {
  font-family: "Doner", "Doner Text", Arial, sans-serif;
  overflow-y: auto;
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 34px;
  color: var(--bibo-header-red);
  background: var(--bibo-header-menu-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 520ms ease,
    visibility 520ms ease;
}

body.is-menu-open .site-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.is-menu-open .site-head {
  opacity: 0;
  pointer-events: none;
}

.site-menu__head,
.site-menu__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.site-menu .brand {
  display: block;
  width: 59px;
}

.site-menu .brand img {
  display: block;
  width: 100%;
  height: auto;
  filter: var(--bibo-logo-red-filter);
}

.site-menu__body {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 24vw, 360px);
  gap: clamp(42px, 7vw, 110px);
  align-items: center;
}

.site-menu__nav {
  display: grid;
  font-size: clamp(46px, 7.2vw, 108px);
  font-weight: 500;
  line-height: 0.94;
  text-transform: uppercase;
}

.site-menu__nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
  width: 100%;
  max-width: 980px;
  padding: 0.13em 0;
  border-bottom: 1px solid rgba(105, 13, 27, 0.22);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 360ms ease,
    transform 560ms var(--bibo-header-ease),
    color 360ms ease,
    border-color 360ms ease;
}

.site-menu__nav a:first-child {
  border-top: 1px solid rgba(105, 13, 27, 0.22);
}

body.is-menu-open .site-menu__nav a {
  opacity: 1;
  transform: translateY(0);
}

body.is-menu-open .site-menu__nav a:nth-child(2) { transition-delay: 45ms; }
body.is-menu-open .site-menu__nav a:nth-child(3) { transition-delay: 90ms; }
body.is-menu-open .site-menu__nav a:nth-child(4) { transition-delay: 135ms; }
body.is-menu-open .site-menu__nav a:nth-child(5) { transition-delay: 180ms; }

.site-menu__nav a::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  min-width: 44px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.18);
  transform-origin: left center;
  transition:
    opacity 360ms ease,
    transform 560ms var(--bibo-header-ease);
}

.site-menu__nav:hover a {
  opacity: 0.44;
}

.site-menu__nav a:hover {
  opacity: 1;
  color: var(--bibo-header-red);
  border-color: rgba(105, 13, 27, 0.5);
  transform: translateX(clamp(8px, 1.1vw, 18px));
}

.site-menu__nav a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-menu__preview {
  position: relative;
  margin: 0;
  height: clamp(320px, 46vh, 520px);
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(23, 18, 15, 0.12), rgba(23, 18, 15, 0.12)),
    url("assets/img/wearebibo/projects/02-rare-wagyu-boutique-santiago/01-opt.jpg") center / cover;
  box-shadow: 0 34px 90px rgba(23, 18, 15, 0.16);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease 140ms,
    transform 680ms var(--bibo-header-ease) 140ms,
    background-image 220ms ease;
}

body.is-menu-open .site-menu__preview {
  opacity: 1;
  transform: translateY(0);
}

.site-menu__preview span {
  position: absolute;
  left: 22px;
  bottom: 20px;
  color: rgba(237, 229, 213, 0.82);
  font-size: clamp(36px, 5vw, 76px);
  line-height: 0.8;
  text-transform: uppercase;
}

.site-menu__foot {
  color: rgba(105, 13, 27, 0.68);
}

@media (max-width: 820px) {
  .projects-mega {
    display: none;
  }

  .site-head {
    inset: 22px 20px auto 20px;
    z-index: 240;
    grid-template-columns: auto 1fr;
    gap: 18px;
    font-size: 10px;
  }

  .desktop-nav {
    display: none;
  }

  .site-head .brand,
  .site-menu .brand {
    width: 54px;
  }

  .head-actions {
    display: flex;
    gap: 0;
  }

  .menu-button {
    gap: 10px;
    font-size: 10px;
  }

  .menu-button i,
  .menu-button i::before,
  .menu-button i::after {
    width: 24px;
  }

  .menu-button i::before {
    top: -6px;
  }

  .menu-button i::after {
    top: 6px;
  }

  .site-menu {
    padding: 22px 20px 24px;
  }

  .site-menu__head {
    align-items: flex-start;
  }

  .site-menu__nav {
    font-size: clamp(30px, 10vw, 38px);
    line-height: 0.96;
  }

  .site-menu__nav a {
    display: block;
    max-width: 100%;
    padding: 0.2em 0;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }

  .site-menu__body {
    display: block;
    align-self: center;
  }

  .site-menu__preview {
    display: none;
  }

  .site-menu__nav:hover a {
    opacity: 1;
  }

  .site-menu__nav a:hover {
    transform: translateX(0);
  }

  .site-menu__nav a::after {
    display: none;
  }

  .site-menu__foot {
    display: grid;
    gap: 8px;
  }
}
